Skip to content

reinit! now ignores given state (2nd argument) for an MTK-derived ODEIntegrator. #3451

Closed
SciML/OrdinaryDiffEq.jl
#2658
@Datseris

Description

@Datseris

Minimal Reproducible Example 👇

using ModelingToolkit, OrdinaryDiffEqDefault

@independent_variables t
D = Differential(t)
@mtkmodel Roessler begin
    @parameters begin
        a = 0.2
        b = 0.2
        c = 5.7
    end
    @variables begin
        x(t) = 1.0
        y(t) = 0.0
        z(t) = 0.0
        nlt(t) # nonlinear term
    end
    @equations begin
        D(x) ~ -y -z
        D(y) ~ x + a*y
        D(z) ~ b + nlt
        nlt ~ z*(x - c)
    end
end

@mtkbuild roessler_model = Roessler()

prob = ODEProblem(roessler_model)
integ = OrdinaryDiffEqDefault.init(prob)
reinit!(integ, SVector(5, 5, 0.0))
integ

julia> integ
t: 0.0
u: 3-element SVector{3, Float64} with indices SOneTo(3):
 1.0
 0.0
 0.0

There are no error messages. The reinit! function simply now ignores the second argument and does not re-initialize the integrator at the given state. This is breaking for DynamicalSystems.jl, so I hope there is an easy fix!

Disclaimer: I have not checked whether this problem persists even for normally created ODEProblems.

  • Output of using Pkg; Pkg.status()
 pkg> st -m ModelingToolkit OrdinaryDiffEqDefault
Status `C:\Users\datse\.julia\environments\NLD\Manifest.toml`
  [961ee093] ModelingToolkit v9.65.0
  [50262376] OrdinaryDiffEqDefault v1.3.0
  • Output of versioninfo()

1.10.8.

Add any other context about the problem here.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions