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

remake failing for several cases with vector variables #2660

Open
TorkelE opened this issue Apr 20, 2024 · 1 comment · Fixed by SciML/JumpProcesses.jl#469
Open

remake failing for several cases with vector variables #2660

TorkelE opened this issue Apr 20, 2024 · 1 comment · Fixed by SciML/JumpProcesses.jl#469
Assignees
Labels
bug Something isn't working

Comments

@TorkelE
Copy link
Member

TorkelE commented Apr 20, 2024

When you have vector variables, it seems like remake is not working for several cases:

using ModelingToolkit, OrdinaryDiffEq

@variables t (X(t))[1:2]
@parameters p[1:2]
D = Differential(t)
eqs = [
    D(X[1]) ~ p[1] - X[1],
    D(X[2]) ~ p[2] - X[2]
]
@mtkbuild osys = ODESystem(eqs, t)

u0 = [X[1] => 1.0, X[2] => 2.0]
tspan = (0.0, 1.0)
ps = [p[1] => 0.1, p[2] => 0.2]
oprob = ODEProblem(osys, u0, tspan, ps)

oprob_rmk = remake(oprob; u0 = [X => [10.0, 20.0]]) # Errors
oprob_rmk = remake(oprob; u0 = [X[1] => 10.0, X[2] => 20.0]) # Errors
oprob_rmk = remake(oprob; u0 = [osys.X => [10.0, 20.0]]) # Errors
oprob_rmk = remake(oprob; u0 = [osys.X[1] => 10.0, osys.X[2] => 20.0]) # Errors
oprob_rmk = remake(oprob; u0 = [:X => [10.0, 20.0]]) # Errors
oprob_rmk = remake(oprob; ps = [p => [10.0, 20.0]]) # Works
oprob_rmk = remake(oprob; ps = [p[1] => 10.0, p[2] => 20.0]) # Works
oprob_rmk = remake(oprob; ps = [osys.p => [10.0, 20.0]]) # Works
oprob_rmk = remake(oprob; ps = [osys.p[1] => 10.0, osys.p[2] => 20.0]) # Works
oprob_rmk = remake(oprob; ps = [:p => [10.0, 20.0]]) # Works

For parameters it seems fine though.

@AayushSabharwal
Copy link
Member

I linked the wrong issue 😅

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

Successfully merging a pull request may close this issue.

2 participants