Cannot find ALL solutions to simultaneous equation
Show older comments
Hi everyone, I would like to find ALL the solutions to this series of equations. Here is my code.
My problem is that it prompts me to use vpasolve, which doesn't give ALL the solutions. I tried "ReturnCondition", but to no avail.
My code is here:
clear all
syms x y z
eq1 = exp(x^2 + y^2 + z^2) == 9;
eq2 = x + x*y - z == 1;
eq3 = x + y + z == 1;
[solx,soly,solz] = solve([eq1,eq2,eq3],[x y z])
Accepted Answer
More Answers (1)
Walter Roberson
on 8 Jan 2020
0 votes
Ookkay... The 55 kilobyte solution is attached.
Now what are you going to do with it?
5 Comments
Xinzhe Chai
on 8 Jan 2020
Walter Roberson
on 8 Jan 2020
I used Maple,
[allvalues](solve([exp(x^2 + y^2 + z^2) = 9, x*y + x - z = 1, x + y + z = 1]))
and then a fair bit of hand-editing to get the values into a form that could be loaded into MATLAB.
Xinzhe Chai
on 8 Jan 2020
Walter Roberson
on 8 Jan 2020
solve eq2 for x (in terms of y and z) . Substitute that x into eq3 and solve for z. substitute for x and then z into eq1, and solve for y asking solve for MaxDegree 4. The result will be four exact roots for y. simplify(). Now do back substitution.
Xinzhe Chai
on 8 Jan 2020
Categories
Find more on Equation Solving 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!