Hello,
I posted this question a few weeks ago but still no answer, and I am struggling with this. So, allow me to repost this again.
In MATLAB, I am trying to pass the decision variable into the ODE solver cvodes (see code below) to calculate the objective function, i.e., my objective function requires solving the system of ODEs. The code looks something like
T = opti.variable(); % decision variable
x = MX.sym('x');
dae = struct('x',x,'ode',ODEfunc(x,T));
F = integrator('F', 'cvodes', dae);
objfunc = r.xf;
Note: ODEfunc is a function that defines a system of ODEs of x and T.
This is the error message I got:
Error using casadi.integrator
.../casadi/core/integrator.cpp:58: Cannot create 'F' since [opti12_x_1] are free.
I would appreciate any suggestions.
Prakitr