Open APMonitor opened 3 years ago
The option to ignore fixed / free specifications isn't communicated appropriately when using m.options.SPECS=0. Here is an example script that demonstrates the behavior.
m.options.SPECS=0
from gekko import GEKKO m = GEKKO(remote=False) # Variables x1 = m.Var() x2 = m.Var() # Equation FindX1 = 6 == x1*x2 m.Equation(FindX1) # Fix x1 to 2 m.fix(x1, val=2) # Solve X2 m.solve(disp=False) print("X1: %s and X2: %s" % (x1.VALUE, x2.VALUE)) # Fix x2 to 2 m.fix(x2, val=2) # Free x1 m.free(x1) m.options.SPECS = 0 # Solve X1 m.solve(disp=False) print("X1: %s and X2: %s" % (x1.VALUE, x2.VALUE))
The solution should be:
X1: [2.0] and X2: [3.0] X1: [3.0] and X2: [2.0]
but instead this is produced:
X1: [2.0] and X2: [3.0] X1: [2.0] and X2: [3.0]
See StackOverflow post for the original question.
The option to ignore fixed / free specifications isn't communicated appropriately when using
m.options.SPECS=0
. Here is an example script that demonstrates the behavior.The solution should be:
but instead this is produced:
See StackOverflow post for the original question.