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

substitute parsing error #480

Closed
augustinas1 opened this issue Dec 21, 2021 · 2 comments
Closed

substitute parsing error #480

augustinas1 opened this issue Dec 21, 2021 · 2 comments

Comments

@augustinas1
Copy link

Trying to substitute products of variables into symbolic expressions can sometimes fail:

julia> @variables x y z
3-element Vector{Num}:
 x
 y
 z

julia> substitute(x*y, x*y => z)
z

julia> substitute(2*x*y, x*y => z) # expect 2z
2x*y

Seems to be some sort of parsing error?

@YingboMa
Copy link
Member

substitute doesn't support matching on non-Sym Symbolic. You should use rules.

@erny123
Copy link

erny123 commented Sep 11, 2023

@YingboMa it doesn't work even when it's all symbolic variables and how would you do this with rules? Rules have the same problem.

here's an example:

@variables a, b, c, d, e, f
test = a*b*c/d
substitute(test, Dict(a*c=>e*f))

Substitute does nothing in this cases.

Using any Symbolics.jl variables with the SymbolicUtils.jl @rules is also a huge mess and not well documented.

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

3 participants