Three nonlinear equation with initial guess

조회 수: 10 (최근 30일)
Nihal Yilmaz
Nihal Yilmaz 2022년 6월 6일
댓글: MOSLI KARIM 2022년 8월 12일
How can I solve this question? Please help me, Thank you.
equations are
-0.06*(x^2)-1.06*(z^2)+3.18*x+3.18*z+1.59*y-2.06*x*y-3.12*x*z-2.385-1.06*y*z=0
2.63*(x^2)-1.63*(y^2)-2.63*(z^2)-3.945*x+3.945*y+3.945*z-4.76*y*z=0
z-7.5*y+5x*y+5*y*z=0
initial guess x=y=z=0
x=?
y=?
z=?
  댓글 수: 1
MOSLI KARIM
MOSLI KARIM 2022년 8월 12일
function bvp_prb14
tspan=[0; 15];
y0=[0;0;0];
[t,x]=ode45(@fct,tspan,y0)
X=x(:,1) %%% x solution
Y=x(:,2) %%% YOUR Y
Z=x(:,3) %%%YOUR Z
table(X,Y,Z)
function yp=fct(t,x)
yp=[-0.06*(x(1)^2)-1.06*(x(3)^2)+3.18*x(1)+3.18*x(3)+1.59*x(2)-2.06*x(1)*x(2)-3.12*x(1)*x(3)-2.385-1.06*x(2)*x(3);
2.63*(x(1)^2)-1.63*(x(2)^2)-2.63*(x(3)^2)-3.945*x(1)+3.945*x(2)+3.945*x(3)-4.76*x(2)*x(3);
x(3)-7.5*x(2)+5*x(1)*x(2)+5*x(2)*x(3)];
end
end

댓글을 달려면 로그인하십시오.

답변 (3개)

Torsten
Torsten 2022년 6월 6일
fun = @(x,y,z)[-0.06*(x^2)-1.06*(z^2)+3.18*x+3.18*z+1.59*y-2.06*x*y-3.12*x*z-2.385-1.06*y*z;2.63*(x^2)-1.63*(y^2)-2.63*(z^2)-3.945*x+3.945*y+3.945*z-4.76*y*z;z-7.5*y+5*x*y+5*y*z];
u0=[0; 0; 0];
[sol,fval]=fsolve(@(u)fun(u(1),u(2),u(3)),u0)
Equation solved. fsolve completed because the vector of function values is near zero as measured by the value of the function tolerance, and the problem appears regular as measured by the gradient.
sol = 3×1
0.7079 0.1909 0.3868
fval = 3×1
1.0e-10 * -0.0873 0.4509 0.4931

Bjorn Gustavsson
Bjorn Gustavsson 2022년 6월 6일
Have a look at the help and documentation of fsolve. That should be the function for this task
HTH

Walter Roberson
Walter Roberson 2022년 6월 6일
with the symbolic toolbox you can find 8 solutions including a complex conjugate pair. The real solutions are approximately
0.7079 0.1909 0.3868
0.0375 0.5366 1.0654
0.9235 -0.3927 1.1749
0.6229 -0.5919 1.3247
-0.4412 -3.4575 2.0604
0.0323 -0.6798 2.0795
As you start from 0,0,0 the implication is that negative components are valid

카테고리

Help CenterFile Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by