# Three nonlinear equation with initial guess

3 views (last 30 days)
Nihal Yilmaz on 6 Jun 2022
Answered: Walter Roberson on 6 Jun 2022
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=?

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

Torsten on 6 Jun 2022
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

Walter Roberson on 6 Jun 2022
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

R2022a

### Community Treasure Hunt

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

Start Hunting!