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

Regression: Cannot deepcopy SteadyStateProblem #2837

Closed
TorkelE opened this issue Jul 2, 2024 · 0 comments · Fixed by #2840
Closed

Regression: Cannot deepcopy SteadyStateProblem #2837

TorkelE opened this issue Jul 2, 2024 · 0 comments · Fixed by #2840
Assignees
Labels
bug Something isn't working

Comments

@TorkelE
Copy link
Member

TorkelE commented Jul 2, 2024

MWE:

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

# Prepare equations.
@parameters p d
@variables X(t)
alg_eqs = [0 ~ p - d*X]
diff_eqs = [D(X) ~ p - d*X]

# Create systems
@mtkbuild osys = ODESystem(diff_eqs, t)
@mtkbuild nsys = NonlinearSystem(alg_eqs)

# Create problems.
u0 = [X => 1.0]
ps = [p => 1.0, d => 0.2]
oprob = ODEProblem(osys, u0, 1.0, ps)
nprob = NonlinearProblem(nsys, u0, ps)
ssprob = SteadyStateProblem(osys, u0, ps)

deepcopy(oprob) # Works
deepcopy(nprob) # Works
deepcopy(ssprob)  # ERROR: deepcopy of Modules not supported
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