HiI have a dynamic model of ordinary differential equation that I want to integrate over an interval I = [0,T].
In the dynamic model I have a constant which depends on the value of time:
example I = t1<t2<…<T and my constant takes a different value according to ti (I can interpolate my constant between ti and ti+1).
my question is the following:
how can I model it in CasADi?
I manage to define my model with the constant but I don’t know how at each ti my constant takes this value during the integration.
Thank you for your reply. I agree with you in principle but if I use the casadi integrator
integrator = integrator(‘integrator’, ‘cvodes’, dae, {‘grid’:ts, ‘output_t0’:True})
I don’t know how to assign the value of this parameter at each iteration or at each time t of the grid during integration.
Since this is a pure CasADi question, it is offtopic in this forum.
You should probably consult the doumentation https://web.casadi.org/python-api/#integrator and the table on "Input scheme: casadi::IntegratorInput "