How to call GEKKO correctly from Matlab
Date: 2022-11-21 12:30:20
I found a function for calling python from Matlab. So, I tried to use this function for calling GEKKO package from Matlab for solving ODE. I have gotten an error for defining a gekko option (remote=true) as function or variable.
I opened Matlab with Anaconda Prompt.
m = py.gekko.GEKKO(remote==True);
m.time = py.numpy.linspace(0,20,100);
k = 10;
y = m.Var(5.0);
t = m.Param(m.time);
m.Equation(k*y.dt()==-t*y);
m.options.IMODE = 4;
m.solve(disp==True)
time = cellfun(@double,cell(m.time.tolist()));
y = cellfun(@double,cell(y.VALUE.value));
plot(time,y)
xlabel('Time')
ylabel('y')
error message Undefined function or variable 'remote'.
Error in ODE_gekko_matlab (line 5) m = py.gekko.GEKKO(remote==True); % Solve on local machine