Well, from the docs, it seems that both should work and handle correctly what is to be handled. Maybe that is a bug
From: Integrator Interface · DifferentialEquations.jl
-
resize!(integrator,k)
: Resizes the DE to a sizek
. This chops off the end of the array, or adds blank values at the end, depending on whetherk>length(integrator.u)
. -
resize_non_user_cache!(integrator,k)
: Resizes the non-user facing caches to be compatible with a DE of sizek
. This includes resizing Jacobian caches. Note that in many cases,resize!
simple resizesuser_cache
variables and then calls this function. This finer control is required for someAbstractArray
operations. -
deleteat_non_user_cache!(integrator,idxs)
:deleteat!
s the non-user facing caches at indicesidxs
. This includes resizing Jacobian caches. Note that in many cases,deleteat!
simpledeleteat!
suser_cache
variables and then calls this function. This finer control is required for someAbstractArray
operations. -
addat_non_user_cache!(integrator,idxs)
:addat!
s the non-user facing caches at indicesidxs
. This includes resizing Jacobian caches. Note that in many cases,addat!
simpleaddat!
suser_cache
variables and then calls this function. This finer control is required for someAbstractArray
operations. -
deleteat!(integrator,idxs)
: Shrinks the ODE by deleting theidxs
components. -
addat!(integrator,idxs)
: Grows the ODE by adding theidxs
components. Must be contiguous indices.