We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
remake
u0
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Take the following...
using ModelingToolkit using ModelingToolkit: t_nounits as t, D_nounits as D using OrdinaryDiffEq using CairoMakie pars = @parameters begin k(t) end vars = @variables begin x(t) end eqs = [ D(x) ~ (k - x) ] @mtkbuild sys = ODESystem(eqs, t, vars, pars) prob = ODEProblem(sys, [x=>0], (0, Inf), [k => 0]) integrator = init(prob, Rodas5P()) dt=0.1 for i=1:100 integrator.ps[sys.k] = ((i-1)*dt)^2 step!(integrator, dt, true) end prob_copy = remake(prob; u0=integrator.u, p = integrator.p, tspan= (99*dt, Inf)) integrator_copy = init(prob_copy, Rodas5P(); initializealg=CheckInit()) for i=101:200 integrator.ps[sys.k] = ((i-1)*dt)^2 integrator_copy.ps[sys.k] = ((i-1)*dt)^2 step!(integrator, dt, true) step!(integrator_copy, dt, true) end time = 0:dt:199*dt time_copy = 10:dt:199*dt fig = Figure() ax = Axis(fig[1,1], xlabel="time [s]", ylabel="sys.x") lines!(ax, time, integrator.sol(time; idxs=sys.x).u; label="integrator") scatter!(ax, time_copy, integrator_copy.sol(time_copy; idxs=sys.x).u; color=:red, label="integrator_copy") axislegend(ax; position=:lt) fig
This gives the following...
If I transfer the state u0 and the parameters p from integrator to integrator_copy, why does integrator_copy start at 0 instead of 81?
p
integrator
integrator_copy
using ModelingToolkit v9.79.0
The text was updated successfully, but these errors were encountered:
AayushSabharwal
No branches or pull requests
Take the following...
This gives the following...
If I transfer the state
u0
and the parametersp
fromintegrator
tointegrator_copy
, why doesintegrator_copy
start at 0 instead of 81?using ModelingToolkit v9.79.0
The text was updated successfully, but these errors were encountered: