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

solve_for didn't throw error in some nonlinear equation #961

Closed
songjhaha opened this issue Aug 28, 2023 · 0 comments
Closed

solve_for didn't throw error in some nonlinear equation #961

songjhaha opened this issue Aug 28, 2023 · 0 comments

Comments

@songjhaha
Copy link

Consider this simple equation:

using Symbolics
@variables x y
eqs = [x*y ~ 4, x+y~4]
Symbolics.solve_for(eqs, [x,y])

Which gives a result but solution is represented with variable y:

julia> Symbolics.solve_for(eqs, [x,y])
2-element Vector{SymbolicUtils.BasicSymbolic{Real}}:
 4 / y
 (4//1) + -4 / y

Symbolics.islinear gives false in this situation, while Symbolics.linear_expansion gives true:

julia> Symbolics.islinear(x*y, [x, y])
false

julia> Symbolics.linear_expansion([x*y~0], [x,y])
(Num[-y 0], Num[0], true)

Versions:
Julia: 1.7.3
Symbolics: v5.5.1

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