Skip to content
New issue

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

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

Closed
TorkelE opened this issue Jan 9, 2025 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@TorkelE
Copy link
Member

TorkelE commented Jan 9, 2025

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.

@TorkelE TorkelE added the bug Something isn't working label Jan 9, 2025
@AayushSabharwal
Copy link
Member

This is effectively a duplicate of #3290. See SciML/Catalyst.jl#1088 (comment).

@ChrisRackauckas
Copy link
Member

Alright, just make sure this is captured in the test as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants