What is z1 appearing when solving this nonlinear system for x y and z?
Show older comments
I'm trying to solve the following nonlinear system
g = 1;
b = 1;
a = b+1;
syms x y z
eqn1 = 0 == -x^2/g-2*a*x-y^2/g+2*b*y+1;
eqn2 = 0 == a*x-a*y-b*y+b*z-x*y/g-y*z/g;
eqn3 = 0 == -y^2/g+2*a*y-z^2/g-2*b*z+1;
[x,y,z] = solve([eqn1, eqn2, eqn3], [x, y, z])
When running the code I was expecting to get numeric solutions, but instead each one of them contain z1, which I think is linked to the variable z (maybe it has to do with real or complex parts?). If I write z1 in the command window and press Enter, the error "Unrecognized function or variable 'z1'." appears.
These are the solutions:
x =
(230*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 1)^2)/361 + (100*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 1)^3)/361 + (21*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 1))/361 - 101/361
(230*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 2)^2)/361 + (100*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 2)^3)/361 + (21*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 2))/361 - 101/361
(230*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 3)^2)/361 + (100*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 3)^3)/361 + (21*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 3))/361 - 101/361
(230*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 4)^2)/361 + (100*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 4)^3)/361 + (21*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 4))/361 - 101/361
y =
(42*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 1)^2)/19 + (10*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 1)^3)/19 + (4*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 1))/19 - 31/19
(42*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 2)^2)/19 + (10*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 2)^3)/19 + (4*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 2))/19 - 31/19
(42*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 3)^2)/19 + (10*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 3)^3)/19 + (4*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 3))/19 - 31/19
(42*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 4)^2)/19 + (10*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 4)^3)/19 + (4*root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 4))/19 - 31/19
z =
root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 1)
root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 2)
root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 3)
root(z1^4 + (32*z1^3)/5 + (241*z1^2)/25 - (103*z1)/25 - 739/100, z1, 4)
The code above corresponds to the following system:

Accepted Answer
More Answers (1)
Stijn Haenen
on 24 Mar 2020
3 votes
You can try to use the function vpasolve instead of solve
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!