I get an error when running the following code:
from gekko import GEKKO
m= GEKKO()
sigma = m.Var()
m.Equation((0.5*1.225*(Vt**2)*s*b)*(pb*(beta-sigma) \
+ Cndr*((((Vw**2)*Ss*CDy)/((Vt**2)*s) \
- Cyb*(beta-sigma))/Cydr)) + Fw*dc*math.cos(sigma)==0)
m.solve(disp=False)
print(sigma.value)
In the above code, I want to find the value of the variable sigma. All other variables are constants that have been defined. While executing the above code, I got the following error.
m.Equation((0.5*1.225*(Vt**2)*s*b)*(x[10]*(beta-sigma)
+ Cndr*((((Vw**2)*Ss*CDy)/((Vt**2)*s)
- Cyb*(beta-sigma))/Cydr)) + Fw*dc*math.cos(sigma)==0)
TypeError: Must be a real number, not GKvariable
I think the issue is with math.cos(sigma), because when I removed it - it worked.
How do I solve this error?