Unknown variables appearing in solutions for symbolic equation solver

5 次查看(过去 30 天)
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.

采纳的回答

Torsten
Torsten 2024-6-18
编辑:Torsten 2024-6-18
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.

更多回答(1 个)

Aquatris
Aquatris 2024-6-18
编辑:Aquatris 2024-6-18
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 个评论
Tim
Tim 2024-6-18
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

产品


版本

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by