Differentialequations.jl - Solving ODE with time dependent parameter allocation friendly

You can just use remake, or you can mutate it, i.e. prob_ode.u0 .= ....

Also, instead of a new solve every time, you can initialize the integrator once and just use reinit!.

Those allocations are because you’re saving. If you tell it to save at every 1.0, then it will allocate at every 1.0. If you change the time span and aren’t saving, the allocations should be unchanged.

2 Likes