Skip to content

Updating parameter/variable values does not update values of dependant defaults #2733

@TorkelE

Description

@TorkelE

I thought this one was reported, but didn't actually find it anywhere. This is both a silent error (not just a crash), and something that we have Catalyst users that report errors with, so would be good to have a fix asap so that we can finally transition Catalyst to the MTK v9.

using ModelingToolkit
@variables t X(t)
@parameters p d = X
D = Differential(t)

eqs = [D(X) ~ p - d*X]
@mtkbuild osys = ODESystem(eqs, t)

u0 = [X => 1.0,]
ps = [p => 1.0]
oprob = ODEProblem(osys, u0, 1.0, ps)

oprob.ps[:d] # 1.0
oprob[:X] # 1.0
oprob[:X] = 2.0
oprob.ps[:d] # 1.0, should be 2.0

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