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

Can create NonlinearProblem with missing variables #3461

Closed
TorkelE opened this issue Mar 15, 2025 · 2 comments
Closed

Can create NonlinearProblem with missing variables #3461

TorkelE opened this issue Mar 15, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@TorkelE
Copy link
Member

TorkelE commented Mar 15, 2025

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

@parameters p d
@variables X(t)
eqs = [0 ~ p - d*X]
@mtkbuild sys = NonlinearSystem(eqs)

u0 = []
ps = [p => 1.0, d => 1.0] # Value for `d` is missing

prob = NonlinearProblem(sys, u0, ps) # This passes without problem.
prob[X] # Is 1.0
@TorkelE TorkelE added the bug Something isn't working label Mar 15, 2025
@ChrisRackauckas
Copy link
Member

I don't get it, aren't you setting d to 1.0 so it's not missing?

@TorkelE
Copy link
Member Author

TorkelE commented Mar 15, 2025

Actually, that might make sense. Previously you always had to provide guesses through u0 for everything, but now since structural_simplify does some solving before solve X gets eliminated and this behaviour makes sense.

@TorkelE TorkelE closed this as completed Mar 15, 2025
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

2 participants