SymbolicUtils.jl icon indicating copy to clipboard operation
SymbolicUtils.jl copied to clipboard

Unexpected behaviour of rules

Open xtalax opened this issue 3 years ago • 2 comments

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

xtalax avatar Jan 19 '22 17:01 xtalax

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

try:

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

Should be documented for sure.

shashi avatar Jan 20 '22 04:01 shashi

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

xtalax avatar Jan 20 '22 17:01 xtalax