Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Dependent parameters disappear from system parameters #3507

Open
hersle opened this issue Mar 26, 2025 · 2 comments
Open

Dependent parameters disappear from system parameters #3507

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

Comments

@hersle
Copy link
Contributor

hersle commented Mar 26, 2025

using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
@variables x(t)
@parameters A B
@named M = ODESystem([D(x) ~ A + B], t; parameter_dependencies = [B ~ 2A])
parameters(M) # gives only A, but I expected A and B

Is this intended? I would like B to remain accessible from parameters(M).

@hersle hersle added the bug Something isn't working label Mar 26, 2025
@hersle
Copy link
Contributor Author

hersle commented Mar 27, 2025

Removing dependent variables seem intentional. Is the intention to "remove" them from the system because they are effectively "always" set?

I expected parameters(sys) to return all (independent and dependent parameters). My model construction is conditional on something like if B in parameters(sys) (and I do not care if B is dependent or independent).

Could parameters(sys) also return dependent parameters? Or is there a better way to check if a system has a given (independent or dependent) parameter?

@hersle
Copy link
Contributor Author

hersle commented Mar 27, 2025

Sorry, I just realized there is full_parameters. I will open a PR to document it a little better to "fix" this issue.

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

No branches or pull requests

1 participant