solving non linear third order algebaric expressions using newton rapson method or any other method!!!

3 views (last 30 days)
hii..the two equations mentioned below are non linear third order algebraic equations. i tried to solve using f solve but it didnt work!!i think this equations can be solved mathematically using newton raphson method!!but i am new to matlab.. plz help me out in solving this equations
syms q0 q1
f(1)= 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;
f(2)=.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;

Answers (1)

Kye Taylor
Kye Taylor on 30 Apr 2013
Edited: Kye Taylor on 30 Apr 2013
The fsolve function needs a function handle as input. So create a file with the command
edit yourFun.m
and paste this code in there
function f = yourFun(q)
q0 = q(1);
q1 = q(2);
f(1) = 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;
f(2) = .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;
The above code defines a function (hopefully you're familiar with that, if not create another post). The fsolve function dictates the form of the interface to the the function: one input, where each component represent a scalar variable in your system; and one vector output. You can see the documentation on fsolve for more detail by typing
doc fsolve
Then, from the command window type
fsolve(@yourFun,[1;2])
That said, I'm not sure you want to really trust the results.. what are you trying to do exactly? You're dealing with such small numbers defining coefficients of the nonlinear functions that I'd be skeptical of any conclusions.
  2 Comments
Hari Kishore
Hari Kishore on 30 Apr 2013
Mr.kye taylor,
thanks for your reply, i am trying to solve vonkaraman plate deflection equations.. where q0,q1 are coefficients and they are scalars. actually these equations are output of a program where equations changes with various parameters. so every time its difficult to write equations in user defined functions and executing the program.matlab is showing busy for hours together(may be it has been doing many iterations to get accurate value)if i gave a command [a,b]=solve(f(1),f(2)) suggest me any method such that i can do it automatically such that i need not to change the user defined function again and again.
cr
cr on 30 Apr 2013
You can tell the 'other program' to write the output eqns to a file which can be read by matlab as text strings. Then replace the last two statements from Kye's code with eval of those strings.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!