Cannot create 'F' since [opti12_x_1] are free.

44 views
Skip to first unread message

Prakitr Srisuma

unread,
Mar 16, 2023, 12:12:10 PM3/16/23
to CasADi
In MATLAB, I am trying to pass the decision variable into the ODE solver (see code below) to calculate the objective function. However, 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.


Does anyone know how  to resolve this?

Tb_opt = opti.variable(); % decision variable
x = MX.sym('x');
dae = struct('x',x,'ode',ODEfunc(x,Tb_opt));
F = integrator('F', 'cvodes', dae);
r = F('x0',0);
objfunc = r.xf;
Reply all
Reply to author
Forward
0 new messages