SymbolicUtils.jl
SymbolicUtils.jl copied to clipboard
Unexpected behaviour of rules
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
You need to Symbolics.unwrap
the expression before running rules.
try:
r(Symbolics.unwrap(u(t, 0)))
Should be documented for sure.
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