BYU-PRISM / GEKKO

GEKKO Python for Machine Learning and Dynamic Optimization
https://machinelearning.byu.edu
Other
580 stars 103 forks source link

Error when dividing variable by negative number #41

Closed abe-mart closed 5 years ago

abe-mart commented 5 years ago

Dividing a Gekko variable by a negative number in an intermediate definition causes a "Multiple operators" error. It looks like it needs another set of parenthesis.

from gekko import GEKKO

m = GEKKO()

a = m.Var()
b = -1

c = m.Intermediate(a/b)

m.solve()
*** Error in syntax of function string: Multiple operators