Re: Solving non linear equations
- From: "Roger Stafford" <ellieandrogerxyzzy@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 15 May 2008 06:57:01 +0000 (UTC)
"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
.
- Follow-Ups:
- Re: Solving non linear equations
- From: Ashwini V
- Re: Solving non linear equations
- References:
- Solving non linear equations
- From: Ashwini Deshpande
- Re: Solving non linear equations
- From: Ashwini Deshpande
- Solving non linear equations
- Prev by Date: Re: Question about trapz int
- Next by Date: Re: Matrix operation?
- Previous by thread: Re: Solving non linear equations
- Next by thread: Re: Solving non linear equations
- Index(es):
Relevant Pages
|