Non-typical system of nonlinear equations
1 view (last 30 days)
Show older comments
I tried to solve this system of equations, using fsolve and various newton-raphson functions, but to no avail:
x*y-z^2-1 = 0
x*y*z+y^2-x^2-2 = 0
e^x+z-e^y-3 = 0
How to bite this?
0 Comments
Accepted Answer
Walter Roberson
on 30 Dec 2021
Edited: Walter Roberson
on 30 Dec 2021
There two real-valued solutions and two complex-valued solutions.
syms x y z
eq1=x.*y-z.^2-1 == 0;
eq2=x.*y.*z+y.^2-x.^2-2 == 0;
eq3=exp(x)+z-exp(y)-3 == 0;
eqns = [eq1, eq2, eq3];
string(eqns)
solx = solve(eqns(1),x)
eqns2 = subs(eqns(2:end), x, solx)
soly = solve(eqns2(1), y, 'maxdegree', 4)
eqns3 = subs(eqns2(2:end), y, soly)
solz = arrayfun(@vpasolve, eqns3)
backz = solz
backy = simplify(arrayfun(@(Y,Z) subs(Y, z, Z), soly, backz))
backx = simplify(arrayfun(@(Y,Z) subs(solx, {y, z}, {Y, Z}), backy, backz))
X = double(backx(:));
Y = double(backy(:));
Z = double(backz(:));
sols = table(X, Y, Z)
More Answers (1)
Yusuf Suer Erdem
on 30 Dec 2021
Edited: Walter Roberson
on 30 Dec 2021
Try these codes below please;
syms x y z
eq1=x.*y-z.^2-1 == 0;
eq2=x.*y.*z+y.^2-x.^2-2 == 0;
eq3=exp(x)+z-exp(y)-3 == 0;
solve(eq1,eq2,eq3,x,y,z)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!