Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Re: How to solve a non linear third oder algebraic equation
Replies: 3   Last Post: Apr 9, 2013 6:49 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Torsten

Posts: 1,477
Registered: 11/8/10
Re: How to solve a non linear third oder algebraic equation
Posted: Apr 9, 2013 2:49 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Hari Kishore " <harikishoreguptha@gmail.com> wrote in message <kk0752$n48$1@newscl01ah.mathworks.com>...
> "Hari Kishore " <harikishoreguptha@gmail.com> wrote in message <kjmb37$d3a$1@newscl01ah.mathworks.com>...
> > "Torsten" wrote in message <kjma72$aok$1@newscl01ah.mathworks.com>...
> > > "Torsten" wrote in message <kjlqo2$ji$1@newscl01ah.mathworks.com>...
> > > > "Hari Kishore " <harikishoreguptha@gmail.com> wrote in message <kjl9d3$ev6$1@newscl01ah.mathworks.com>...
> > > > > "Torsten" wrote in message <kjk38p$hc7$1@newscl01ah.mathworks.com>...
> > > > > > "hk " <harikishoreguptha@gmail.com> wrote in message <kjjv93$3nd$1@newscl01ah.mathworks.com>...
> > > > > > > "Torsten" wrote in message <kjjf5j$gsu$1@newscl01ah.mathworks.com>...
> > > > > > > > "hk " <harikishoreguptha@gmail.com> wrote in message <kjjaqr$5l7$1@newscl01ah.mathworks.com>...
> > > > > > > > > hi.. i want to solve a third order non linear algebraic equation. but the command "solve" is not useful for this equations( matlab showing "busy" for hours ).. and my equations are..
> > > > > > > > > syms q0 q1
> > > > > > > > > equation1=4.97*q0-.570e-16*q1-.660e-1*(.158*q0^2+.141*q1^2)*q0-.228e-2*(-.927e-14*q0^2+.257e-15*q1^2)*q1;
> > > > > > > > > equation2=.291e-15*q0+.484*q1-.978e-19*(.158*q0^2+.141*q1^2)*q0+.170e-19*(-.927e-14*q0^2+.257e-15*q1^2)*q1;
> > > > > > > > >
> > > > > > > > > you help is highly apprecitaed!!!

> > > > > > > >
> > > > > > > > q0=q1=0 looks fine to me :-).
> > > > > > > >
> > > > > > > > Best wishes
> > > > > > > > Torsten.

> > > > > > > mr.torsten,
> > > > > > > thanks for reply.
> > > > > > > But i want a solution other than q0=q1=0.& command or procedure to solve this equations

> > > > > >
> > > > > > Are you sure a non-trivial solution exists ?
> > > > > > When I try to solve your system of equations with MATLAB's "fsolve", I get the trivial solution for a lot of different initial guesses for the solution variables q0 and q1...
> > > > > >
> > > > > > Best wishes
> > > > > > Torsten.

> > > > > hi..Mr.torsten,
> > > > > Iwould be thankful if you post the code with watever initial guess you have considered!!!
> > > > > thanks..

> > > >
> > > > x0 = [-5; -5]; % Make a starting guess at the solution
> > > > options = optimoptions('fsolve','Display','iter'); % Option to display output
> > > > [x,fval] = fsolve(@myfun,x0,options) % Call solver
> > > >
> > > > function F = myfun(x)
> > > > q0=x(1);
> > > > q1=x(2);
> > > > F = [4.97*q0-.570e-16*q1-.660e-1*(.158*q0^2+.141*q1^2)*q0-.228e-2*(-.927e-14*q0^2+.257e-15*q1^2)*q1;
> > > > .291e-15*q0+.484*q1-.978e-19*(.158*q0^2+.141*q1^2)*q0+.170e-19*(-.927e-14*q0^2+.257e-15*q1^2)*q1];
> > > >
> > > > Maybe you will have to scale the solution variables because of the small coefficients in your functional equation.
> > > >
> > > > Best wishes
> > > > Torsten.

> > >
> > > This could be of interest for you:
> > > http://neos-guide.org/content/hompack
> > >
> > > Best wishes
> > > Torsten.

> > Mr.torsten
> > thank you very much..for your support!!!

> hii mr.torsten that program is not working on my system? i have access to licensed simulink version, but its not working !! do we require any additional tool box?


You will have to save this part of the code in a separate .m-file on your MATLAB path and call it e.g. myfun.m:

function F = myfun(x)
q0=x(1);
q1=x(2);
F = [4.97*q0-.570e-16*q1-.660e-1*(.158*q0^2+.141*q1^2)*q0-.228e-2*(-.927e-14*q0^2+.257e-15*q1^2)*q1;
.291e-15*q0+.484*q1-.978e-19*(.158*q0^2+.141*q1^2)*q0+.170e-19*(-.927e-14*q0^2+.257e-15*q1^2)*q1];

Then call fsolve as follows:
x0 = [-5; -5]; % Make a starting guess at the solution
options = optimoptions('fsolve','Display','iter'); % Option to display output
[x,fval] = fsolve(@myfun,x0,options) % Call solver

No extra toolbox license necessary.

If this does not work, look at the examples provided under
http://www.mathworks.de/de/help/optim/ug/fsolve.html

Best wishes
Torsten.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.