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

Unexpected behaviour of rules #426

Open
xtalax opened this issue Jan 19, 2022 · 2 comments
Open

Unexpected behaviour of rules #426

xtalax opened this issue Jan 19, 2022 · 2 comments

Comments

@xtalax
Copy link

xtalax commented Jan 19, 2022

using ModelingToolkit, SymbolicUtils, Test

@parameters x, t
@variables u(..)

r = @rule u(t, 0) => 0

@test r(u(t, 0)) !== nothing

@test r(u(t, 0.0)) !== nothing
@shashi
Copy link
Member

shashi commented Jan 20, 2022

You need to Symbolics.unwrap the expression before running rules.

try:

r(Symbolics.unwrap(u(t, 0)))

Should be documented for sure.

@xtalax
Copy link
Author

xtalax commented Jan 20, 2022

using ModelingToolkit, SymbolicUtils, Test

@parameters x, t
@variables u(..)

r = @rule u(t, 0) => 0

@test r(Symbolics.unwrap(u(t, 0))) !== nothing

@test r(Symbolics.unwrap(u(t, 0.0))) !== nothing

Still fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants