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

New symbolic_solve strange missing variable error #1230

Closed
fgerick opened this issue Aug 23, 2024 · 1 comment · Fixed by #1232
Closed

New symbolic_solve strange missing variable error #1230

fgerick opened this issue Aug 23, 2024 · 1 comment · Fixed by #1232

Comments

@fgerick
Copy link

fgerick commented Aug 23, 2024

Solving $\log(ax)=b$ for $x$ does not work, but using Nemo and solving for $a$ does work.

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.4 (2024-06-04)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Symbolics

julia> @variables a b x
3-element Vector{Num}:
 a
 b
 x

julia> symbolic_solve(log(a*x)-b,x)
┌ Warning: Var not present in given expression
└ @ Symbolics ~/.julia/packages/Symbolics/gWAv7/src/solver/ia_main.jl:267
Any[]

julia> symbolic_solve(log(a*x)-b,a)
ERROR: "Nemo is required. Execute `using Nemo` to enable this functionality."
Stacktrace:
  [1] factor_use_nemo(poly::Num)
    @ Symbolics ~/.julia/packages/Symbolics/gWAv7/src/solver/nemo_stuff.jl:14
  [2] solve_univar(expression::Num, x::Num; dropmultiplicity::Bool)
    @ Symbolics ~/.julia/packages/Symbolics/gWAv7/src/solver/main.jl:255
  [3] solve_univar(expression::Num, x::Num)
    @ Symbolics ~/.julia/packages/Symbolics/gWAv7/src/solver/main.jl:234
  [4] isolate(lhs::Num, var::Num; warns::Bool, conditions::Vector{Any})
    @ Symbolics ~/.julia/packages/Symbolics/gWAv7/src/solver/ia_main.jl:16
  [5] isolate
    @ ~/.julia/packages/Symbolics/gWAv7/src/solver/ia_main.jl:3 [inlined]
  [6] ia_solve(lhs::Num, var::Num; warns::Bool)
    @ Symbolics ~/.julia/packages/Symbolics/gWAv7/src/solver/ia_main.jl:270
  [7] ia_solve
    @ ~/.julia/packages/Symbolics/gWAv7/src/solver/ia_main.jl:262 [inlined]
  [8] symbolic_solve(expr::Num, x::Num; dropmultiplicity::Bool, warns::Bool)
    @ Symbolics ~/.julia/packages/Symbolics/gWAv7/src/solver/main.jl:151
  [9] symbolic_solve(expr::Num, x::Num)
    @ Symbolics ~/.julia/packages/Symbolics/gWAv7/src/solver/main.jl:113
 [10] top-level scope
    @ REPL[3]:1

julia> using Nemo

Welcome to Nemo version 0.46.0

Nemo comes with absolutely no warranty whatsoever

julia> symbolic_solve(log(a*x)-b,a)
1-element Vector{SymbolicUtils.BasicSymbolic{Real}}:
 (ℯ^b) / x

(sym) pkg> st
Status `/private/tmp/sym/Project.toml`
  [2edaba10] Nemo v0.46.0
  [0c5d862f] Symbolics v6.3.0 `https://github.com/JuliaSymbolics/Symbolics.jl.git#master`
@n0rbed
Copy link
Member

n0rbed commented Aug 23, 2024

Let me know if anything else breaks for you!

@bowenszhu bowenszhu linked a pull request Aug 24, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants