Unknown variables appearing in solutions for symbolic equation solver

6 views (last 30 days)
Hello,
I am currently trying to solve a symbolic equation for a variable and the solution I am receiving has roots of 'z' which was not previously defined or used in any of my equations. Here is where/how it appears:
In another case I modified the simplifcation process to attempt get a usable solution and ended up with just the variable 'u' which was not previously used or defined either. Is there a known reason why these variables are appearing. I've read that equations of the fifth degree can be hard to solve symbolically, which may be the reason for the 'z' in the roots but I don't quite understand the 'u' solution.

Accepted Answer

Torsten
Torsten on 18 Jun 2024
Edited: Torsten on 18 Jun 2024
syms x
f = x^5+x^4+3*x^2-4;
solve(f==0)
ans = 
vpa(solve(f==0))
ans = 
double(solve(f==0))
ans =
0.9269 + 0.0000i -1.2264 + 0.0000i 0.4282 - 1.4411i 0.4282 + 1.4411i -1.5569 + 0.0000i
I have no explanation for the u that appears in your solution. Please include your code to reproduce the problem if it is not yet solved by the answer from above.

More Answers (1)

Aquatris
Aquatris on 18 Jun 2024
Edited: Aquatris on 18 Jun 2024
This is shown in the documentation of solve, under Solve Polynomial Equations of High Degree.
You should call the function with 'MaxDegree' argument to get an explicit solution. Here is the example from the documentation
syms x a
eqn = x^3 + x^2 + a == 0;
solve(eqn, x)
ans = 
S = solve(eqn, x, 'MaxDegree', 3)
S = 
  1 Comment
Tim
Tim on 18 Jun 2024
Thank you for your response!
The roots I posted previously are the result of setting the 'MaxDegree' parameter to 4.
I have also tried setting assumptions for all the equations and simplifying to hopefully help the solving process.

Sign in to comment.

Products


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!