If I initialize a boolean variable as 0 I get an incorrect solution (0). If I initialize it as 1 I get the correct solution (1).
# Squaring doesn't work
#######################################################
m = GEKKO(remote=False)
b = m.Var(lb=0,ub=1,integer=True, value=0)
m.Maximize(b**2)
m.options.SOLVER = 1
m.solve(debug=0, disp=True)
Returns:
Successful solution
Objective: 0.
with b: [0]
This is a follow up to a previous question (Gekko returning incorrect successful solution) that concerns a model involving matrix multiplication of two gekko arrays with gekko integer variables. I believe I've traced that issue to this problem.