Closed TorkelE closed 3 months ago
In one case, using oint[X] works while setu(oint, X)(oint, 10.0) throws an error. Presumably, the first one should throw an error as well?
oint[X]
setu(oint, X)(oint, 10.0)
using ModelingToolkit, OrdinaryDiffEq using ModelingToolkit: t_nounits as t, D_nounits as D @parameters p @variables X(t) eq = D(X) ~ p - X @mtkbuild osys = ODESystem([eq], t) oprob = ODEProblem(osys, [X => 0.1], (0.0, 1.0), [p => 1.0]) oint = init(oprob, Tsit5()) oint[X] = 1.0 # Works. setu(oint, X)(oint, 10.0) # ERROR: Integrator state cannot be reset unless it is initialized with save_everystep=false oint = init(oprob, Tsit5(); save_everystep=false) oint[X] = 1.0 # Works. setu(oint, X)(oint, 10.0) # Works.
In one case, using
oint[X]
works whilesetu(oint, X)(oint, 10.0)
throws an error. Presumably, the first one should throw an error as well?