Re: Solving non linear equations



"Ashwini Deshpande" <vd.ashwini@xxxxxxxxxxxxx> wrote in message
<g0gi9l$gtu$1@xxxxxxxxxxxxxxxxxx>...
"Ashwini Deshpande" <vd.ashwini@xxxxxxxxxxxxx> wrote in
message <g0gg50$hb4$1@xxxxxxxxxxxxxxxxxx>...
I have 3 unknowns and 3 nonlinear equations, as follows:

x^3 - 3x = y;
y^3 - 3y = z;
z^3 - 3z = x;

How do i solve this using matlab.

Thanks !
Ashwini

I tried to solve these equations using 'fsolve' command, i
am getting confused with how to set the starting values for
x, y and z. The procedure which i tried to solve is as follows:
function F = myfun(x)
F = [x(1)^3 - 3*x(1) - x(2);
x(2)^3 - 3*x(2) - x(3);
x(3)^3 - 3*x(3) - x(1)];

then from command prompt:
x0 = [-1;-1;-1];
[x,fval] = fsolve(@myfun,x0)

The problem is for all value of x0, i am getting different
answers for x, y and.

And one more doubt is i am getting one root value for x, y
and z. But i suppose to get 3 values for each variable as it
is a 3rd order equation.

Is there anything wrong in my approach, plz suggest me the
correct one.

Thanks!
Ashwini
----------------
This is a problem for 'roots'. By substitution, you can obtain a 27th degree
polynomial equation and that will have 27 roots altogether. First substitute
x^3-3x in for y in the second equation getting:

(x^3-3x)^3-3(x^3-3x) = z

Then substitute the left hand expression in this equation for z in the third
equation:

((x^3-3x)^3-3(x^3-3x))^3-3((x^3-3x)^3-3(x^3-3x)) = x

This is a polynomial equation of the 27th degree in x. For each of the 27
roots for x, the values of y and z can be determined uniquely from the first
two equations, so that makes 27 possible triplets x, y, and z which can satisfy
the three equations simultaneously.

It is easy to see that there are three triplet solutions with x, y, and z all
equal: (0,0,0), (2,2,2), and (-2,-2,-2). I can only guess at the remaining 24
solutions, but because of the symmetry of the equations, very likely they
consist of four basically different solutions with six permutations among x, y,
and z possible for each one. I wouldn't be surprised if many of these were
complex-valued.

Finding all such multiple solutions is a task well beyond the capabilities of
'fsolve' unless you provide it with a very large quantity of initial guesses for
its 'x0' argument. The 'roots' function seems the only reasonable way to do
the problem.

Roger Stafford


.



Relevant Pages

  • Re: finding complex root from nonlinear equations
    ... On Jan 3, 5:49 pm, "Roger Stafford" ... I don't know how to find complex roots, ... For polynomial equations the matlab function 'roots' will find all ... advice in their 'fsolve' documentation is "fsolve only handles real ...
    (comp.soft-sys.matlab)
  • Re: fsolve problems
    ... The roots will not be complex or negative if they ... I may not help you with fsolve, which is in that toolbox, ... x is a column vextor, w1, w2 are big enough scalar ... weights or columns of vector weights. ...
    (comp.soft-sys.matlab)
  • Re: Location of root directory
    ... the location of roots $HOME is not ... or see the syscorepath command. ... - update_all failing to update an X11 package leaving ... some re/post install script was looking ...
    (comp.unix.aix)
  • Re: finding complex root from nonlinear equations
    ... I know fsolve can find the real roots from polynomial equations, ... I don't know how to find complex roots, ... As to finding all possible roots, 'fsolve' only promises to find one root. ... I can see that polynomial equations can be split ...
    (comp.soft-sys.matlab)
  • Re: fsolve problems
    ... force fsolve to only look for real roots. ... The roots will not be complex or negative if they ... While fsolve will not accept explicit constraints, ... use a transformation of variables. ...
    (comp.soft-sys.matlab)