Skip to content

Wrong value for problems when guesses are provided for default values #3303

Closed
@TorkelE

Description

@TorkelE
using ModelingToolkit: t_nounits as t, D_nounits as D

@variables Y(t)
# give `p` a guess and a default, which tells initialization you want to
# solve for it
@parameters d p = Y [guess = 1.0]
eqs = [D(Y) ~ p - d*Y]
@mtkbuild osys = ODESystem(eqs, t)
u0 = [Y => 1.0]
p = [d => 0.2]
oprob = ODEProblem(osys, u0, (0.0, 1.0), p)

oprob[osys.Y] # correct
oprob.ps[osys.p] # should be 1.0

Already reported, but just for keeping track of it. A guess is provided for p. However, its values is entirely wrong. If no guess is provided the correct value is found.

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