Closed espringe closed 1 year ago
The m.if3()
statement does not have an inequality or equality expression. Use tlX
instead of tlX <= 0
. Here is an example from the documentation:
import numpy as np
import matplotlib.pyplot as plt
from gekko import GEKKO
m = GEKKO(remote=False)
p = m.Param()
y = m.if3(p-4,p**2,p+1)
# solve with condition<0
p.value = 3
m.solve(disp=False)
print(y.value)
# solve with condition>=0
p.value = 5
m.solve(disp=False)
print(y.value)
Please post future application questions to StackOverflow: https://stackoverflow.com/questions/tagged/gekko
It is this line:
q = m.if3(tlX <= 0, 1, 0)
That causes an error:
reproduced in example