Skip to content

Feature request: symbolic_solve with absolute values #1378

@1-Bart-1

Description

@1-Bart-1

Absolute values are very common in symbolic equations. I would like to be able to solve equations containing absolutes using symbolics.
For example:

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

julia> lhs = norm([x, y])
sqrt(abs2(y) + abs2(x))

julia> symbolic_solve(lhs, x)
┌ Warning: Var not present in given expression
└ @ Symbolics ~/.julia/packages/Symbolics/YbNrd/src/solver/ia_main.jl:283

Right now this causes a warning related to issue #1377.

Running with lhs = abs(x) gives a different warning:

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

julia> lhs = abs(x)
abs(x)

julia> symbolic_solve(lhs, x)
┌ Warning: This expression cannot be solved with the methods available to ia_solve. Try a numerical method instead.
└ @ Symbolics ~/.julia/packages/Symbolics/YbNrd/src/solver/ia_main.jl:47

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions