-
Notifications
You must be signed in to change notification settings - Fork 156
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
Handling ssqrt
and scbrt
returned from symbolic_solve
#1354
Comments
I think you are correct. Note that this simplification already happens as postprocessing in symbolic_solve (but it is not a part of Symbolics.jl/src/solver/postprocess.jl Line 91 in 195c95d
I agree; yes.
Hm. If I am not mistaken the option |
Thanks for the reply! I dug into what is going on a bit more and it does not appear to be @variables A[1:3, 1:3], λ
expr = det(Num.(collect(A-λ*one(A))))
sol = symbolic_solve(expr, λ);
simp = expand(*((λ .- sol)...) - expr) shows no floating points. (2*λ^2)^(1//4) which outputs Is there some way to symplify powers of the output of |
If I'm understanding the situation with respect to symbolic representations of purely numeric coefficients which may be irrational, it seems like perhaps landing the PR in JuliaSymbolics/SymbolicUtils.jl#617 might help the situation for |
I was playing around with the exciting developments landed in #1192 and noticed some peculiarities.
First cosider this example:
which gives me
As I understand (although would be good to put somewhere in the docs), the
ssqrt
function was introduced to handle negative arguments without raising errors. Thus I would expectsqrt(x)^2 = x
would be a valid rule to have applied by simplify? If I add a rule to rewritessqrt
to be a power instead I get the expected simplification so the following gives zero as expected.I then went to try this strategy of checking
symbolic_solve
with a generic third order characteristic polynomial and it seemed to fail to simplifyThe output is far to long to paste here, but it looks like there are floating point coefficients introduced at some point which might be why it fails to simplify to zero?
I was hoping to use the new
symbolic_solve
to find the eigenvalues of small symbolic matrices so this was my first test to make sure I was understanding how to work with the output ofsymbolic_solve
.The text was updated successfully, but these errors were encountered: