Casadi constante dependent on time

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.

If anyone can enlighten me I would be grateful.


my constant takes a different value according to ti

I would not call this a constant, but rather a parameter.
You could simulate such a system with the acados integrators, see

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 and the table on "Input scheme: casadi::IntegratorInput "