Skip to content

Warning: Initialization system is overdetermined on remake cases where it might (might) be redundant #3538

@TorkelE

Description

@TorkelE

Simple question. The first initialisatio nwarning makes sense. However, does the second one? I.e. here it might be straightforward to just update k1's already assigned value, and the observables equation just tracks that? Very possibly this is working as intended, and if so feel happy to close @AayushSabharwal . However, it also felt like a corner case that someone might not have thought about, so figured I should mention it.

using OrdinaryDiffEqDefault, ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D

# Create model.
@variables X(t) Y(t)
@parameters p d k1 k2 = 0.5
eqs = [
    D(X) ~ p - d*X,
    k1 + Y ~ k2*X
]
@mtkbuild osys = ODESystem(eqs, t)

# Create `ODEProblem`.
u0 = [X => 2.0, Y => 0.5]
pvals = [p => 1.0, d => 0.1, k1 => 0.5]
oprob = ODEProblem(osys, u0, (0.0, 10.0), pvals)

# Try to `remake`.
remake(oprob; p = [k1 => 1.0]) # Warning: Initialization system is overdetermined

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions