Non-typical system of nonlinear equations
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
Walter Roberson
2021년 12월 30일
편집: Walter Roberson
2021년 12월 30일
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)
추가 답변 (1개)
Yusuf Suer Erdem
2021년 12월 30일
편집: Walter Roberson
2021년 12월 30일
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)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!