Need help for the following conditions to be implemented in GEKKO python.
For Matlab, i have the following conditions
if t<15
x1 = 1e-7;
else x1 = 0;
end
For python I have written the code as
m.time = np.linspace(0,60)
t = m.Var(0)
m.Equation(t.dt()==1)
x1 = m.if2(t-15,1e-7,0)
But that didn't work. Basically x1 is my input and I want that x1 to be available for 15min only, after that it is 0. Please let me know the solution to this.
2.effect=min((0.2x17+0.8x19)/APequil, 1) in Matlab
In python I have used the following effect=m.min2(((0.2x17+0.8x19)/APequil),1)
Please check if its okay? As removing min2 is not affecting my solution.
- In matlab, have used options=odeset('InitialStep',0.0001,'RelTol',1e-09),
how to use the same in GEKKO python? As I have successful solution in matlab, but the same output is not achieved in Python, i think it is due to this tolerance value or what?