Thread: Newton's Method for Systems of Nonlinear Equations

  1. #1
    Registered User
    Join Date
    Mar 2010

    Newton's Method for Systems of Nonlinear Equations

    I have to compute a solution for a System of Nonlinear Equations using Newton's Method.

    Does anybody have an idea how the algorithm may look like?

  2. #2
    Registered User Swarvy's Avatar
    Join Date
    Apr 2008
    United Kingdom
    What code have you written so far? Do you know how the method works? Here is the basic technique in a nutshell (There is more than one method which borrows Newton's name, but I will assume you are talking about this one:
           temp_x = x - ( MathsFunction(x)/MathsFunctionGrad(x, dx) );
           accuracy = absf( temp_x - x);
           x = temp_x;
    } while( accuracy > threshold_accuracy );
    Obviously you would have to define all the terms used. The MathsFunction is just the function you want to approximate and the MathsFunctionGrad just returns the gradient of the MathsFunction. In the above example I've considered the MathsFunctionGrad function to calculate an approximate gradient from the MathsFunction, so if you set dx to zero, you will have problems. It may be a good idea to make dx vary as you get closer to the solution rather than just using a fixed value because this would impose a limitation on the accuracy.

    In your original post you used plurals (i.e. systems of equations), which leads me to think that you may have to generalise the code to more variables but using the Taylor series (the basis of Newton's method), this should not be too difficult but would require some more work than what is shown above.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Packet Container Class
    By ChaoticXSinZ in forum C++ Programming
    Replies: 2
    Last Post: 11-01-2010, 12:07 AM
  2. help: nonlinear secant method program
    By lady_lyssa in forum C++ Programming
    Replies: 5
    Last Post: 10-09-2009, 12:40 PM
  3. on method pointers and inheritance
    By BrownB in forum C++ Programming
    Replies: 2
    Last Post: 03-02-2009, 07:50 PM
  4. Cubic Root by Newton's Iterative Method
    By amirahasanen1 in forum C++ Programming
    Replies: 2
    Last Post: 03-15-2005, 02:05 PM
  5. Newton's method
    By Cmuppet in forum C Programming
    Replies: 5
    Last Post: 10-19-2004, 11:02 AM