Results 1 to 9 of 9

Math Help - help needed understanding basics of solving non linear equations using newtons method

  1. #1
    Newbie
    Joined
    Dec 2009
    Posts
    4

    Red face help needed understanding basics of solving non linear equations using newtons method

    hi guys..
    I have problem in combustion kinetics which requires solving four non-linear equations with 7variables. I have reduced the number of variables to 4 but am not sure how to solve this using the newton raphson method... could someone help me by illustrating the method with a detailed example...

    i am trying to solve the equations in matlab.

    captain black had posted this:
    First find the Jacobian:



    Now Newton's method proceeds from a initial approximation of guess: to the next approximation using by solving:



    for , then the next estimate is:

    .

    Then the general itteration step is:

    solve:



    for , then the next estimate is:

    .

    In Matlab the equation J dP= P is solved using a statement of the form:

    dP=J\P

    if I recall correctly
    --------------------------------------------------------------------------
    my difficulty lies in understanding how the iteration process proceeds.... also
    could some one illustrate this with an example...



    my equations are
    F=[m*(0.0588-x(1,1))-(6.19*10^9*exp((-15098)./x(4,1)))*30*0.0021*(101325/(8314*x(4,1))).^1.75*x(1,1).^0.1*(0.233*x(2,1)).^1 .65;
    m*(0.9412-x(2,1))-(4.76/3.5)*(6.19*10^9*exp((-15098)/x(4,1)))*30*0.0021*(101325/(8314*x(4,1))).^1.75*x(1,1).^0.1*(0.233*x(2,1)).^1 .65;
    1-x(1,1)-x(2,1)-x(3,1);
    x(1,1)*(-84.667)+x(3,1)*(-241.845)-0.0588*(-84.667)-0.9412+32*(x(4,1)-298)
    ];

    here i need to find x(:,1) as m varies from 0 to 0.2 and plot a graph of m vs x


    thanks to anyone who is willing to go the way...
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member
    Joined
    Mar 2009
    Posts
    378
    It appears that a lot of your post is missing. The multivariate newton method is
     x_n = x_{n-1} - JF^{-1} F(x_{n-1}).
    So, you will want an initial guess x_0 then solve the system above for x_1. Procede in the same manner to find x_2,\dots,\x_n until it converges. You will determine convergence using a norm, maybe \frac{\|x_n - x_{n-1}\|_{\infty}}{\|x_{n-1}\|_{\infty}} \le tol would be your convergence criterion.

    I hope this answers your question.

    EDIT: Attached is a newton method I developed for a class.
    Attached Files Attached Files
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Dec 2009
    Posts
    4

    Smile one more help

    could you show the method with a simple example..i am not one of those easy grasping guys
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Senior Member
    Joined
    Mar 2009
    Posts
    378
    This should help, and it is cool.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Dec 2009
    Posts
    4

    doubt

    now when two variables are involved in a set of non linear equations say
    f1= x^2+y^2-2
    f2=x^2-y^2
    F=[f1;f2]
    jacobianf=[2x 2y;2x -2y]
    thus h= jacobianf^-1*(-F)
    ...

    this being the case how will x and y be incremented using h
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Senior Member
    Joined
    Mar 2009
    Posts
    378
    delete
    Last edited by lvleph; December 6th 2009 at 08:27 AM. Reason: fixed spelling mistake
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Senior Member
    Joined
    Mar 2009
    Posts
    378
    You will create a vector X = \begin{pmatrix}x \\ y\end{pmatrix} and a vector for your function F = \begin{pmatrix}f_1 \\ f_2\end{pmatrix}.
    The inverse of the Jacobian will be JF^{1}(X) = \frac{1}{4}\begin{pmatrix}\frac{1}{x} & \frac{1}{y} \\ \frac{1}{x} & -\frac{1}{y}\end{pmatrix}. Then will take an initial guess, say X_0 = \begin{pmatrix}x_0 \\ y_0\end{pmatrix} = \begin{pmatrix}0.5 \\ 0.5\end{pmatrix}. Now we perform the iteration
    X_1 = X_0 - JF^{-1}(X_0)\cdot F(X_0), so we have
     X_1 = \begin{pmatrix}x_1 \\ y_1\end{pmatrix} = \begin{pmatrix}0.5 \\ 0.5\end{pmatrix} - \frac{1}{4}\begin{pmatrix}2 & 2\\2 & -2\end{pmatrix} \cdot \begin{pmatrix} -1.5 \\ 0\end{pmatrix}.
    Thus, we have
     X_1 = \begin{pmatrix}0.5 \\ 0.5\end{pmatrix} - \begin{pmatrix}-0.75 \\ -0.75\end{pmatrix} = \begin{pmatrix}1.25 \\ 1.25\end{pmatrix}.
    Now repeat this for X_2 = X_1 - JF^{-1}(X_1)\cdot F(X_1).
     X_2 = \begin{pmatrix}1.25 \\ 1.25\end{pmatrix} - \frac{1}{4}\begin{pmatrix}0.8 & 0.8\\0.8 & -0.8\end{pmatrix} \cdot \begin{pmatrix} 1.125 \\ 0\end{pmatrix}.
     X_2 = \begin{pmatrix}1.25 \\ 1.25\end{pmatrix} - \begin{pmatrix}0.225 \\ 0.225\end{pmatrix} = \begin{pmatrix}1.025 \\ 1.025\end{pmatrix}.
    Continue like this until \frac{\|X_n - X_{n-1}\|_{\infty}}{\|X_{n-1}\|_{\infty}} \le tol
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Newbie
    Joined
    Dec 2009
    Posts
    4

    matlab help..

    how do you define a variable..

    my program is as shown:


    clc
    clear all
    F=[y^2+z^2-2;y^2-z^2];
    v=[y,z]
    R=jacobian(F,v)
    y=0.1;z=0.1;
    xo=[y;z]
    for j=1:30
    D=(inv(R))*(-F)
    xo=xo-D
    end


    i am getting an error saying that y and z are undefined variables
    however if i use syms y,z the guess value of y and z does not get passed on into the for loop...dono why...PLS HELP
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Senior Member
    Joined
    Mar 2009
    Posts
    378
    Matlab doesn't like anything but numbers. So, x and y would have had to be given to it. You can pass functions to matlab using @F. But F will need some numbers. Look at the Newton.m that I attached earlier and it should help.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. [SOLVED] Understanding method of characteristics for first order equations
    Posted in the Differential Equations Forum
    Replies: 5
    Last Post: August 4th 2010, 11:42 AM
  2. Matrix equations solving help needed?
    Posted in the Advanced Algebra Forum
    Replies: 6
    Last Post: January 20th 2010, 06:12 AM
  3. NEwtons Method
    Posted in the Calculus Forum
    Replies: 2
    Last Post: November 16th 2007, 05:56 PM
  4. Newtons Method
    Posted in the Calculus Forum
    Replies: 5
    Last Post: October 28th 2007, 12:17 AM
  5. Rings: Don't quite understanding the basics...
    Posted in the Advanced Algebra Forum
    Replies: 6
    Last Post: April 15th 2007, 09:36 AM

Search Tags


/mathhelpforum @mathhelpforum