2.0

2.0 | 1 rating Rate this file 47 Downloads (last 30 days) File Size: 4.97 KB File ID: #27544
image thumbnail

Newton-Raphson Iterative Solver for Systems of Equations

by John Fuller

 

09 May 2010 (Updated 01 Dec 2011)

An N-R iterative root-finder for systems of N equations and N unknowns.

| Watch this File

File Information
Description

For those of us who like to provide our own partial derivative sensitivity matrix. Can be used for both linear and non-linear systems.

x = nrsolve( F, dFdx, xi, tol, max_iter, c1, c2.... )

Given a system of equations F = {F1;F2;...}, defined sensitivity matrix dFdx (matlab functions allowed), and initial guess vector xi, nrsolve provides a solution vector x. Optional input constants c1, c2, etc. allow for passing variables into functions within F and dFdx.

See testnrsolve for more details.

Comments and debugging are highly appreciated.

MATLAB release MATLAB 7.9 (2009b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
12 Oct 2011 Andrew Knyazev

Incomplete description. The function is hard-coded for no more than 8 equations. Quoting the code: "Holy crap! More than 8 equations to solve??"

20 Oct 2011 John Fuller

No humor with this one :)

Please login to add a comment or rating.
Updates
01 Dec 2011

Fixed bug with fprintf function upon maximum iterations reached.

Tag Activity for this File
Tag Applied By Date/Time
newton John Fuller 10 May 2010 13:06:35
raphson John Fuller 10 May 2010 13:06:35
iterative John Fuller 10 May 2010 13:06:35
solver John Fuller 10 May 2010 13:06:35
mathematics John Fuller 10 May 2010 13:06:35
root John Fuller 10 May 2010 13:06:35
systems of equations John Fuller 10 May 2010 13:06:35
linear John Fuller 19 May 2010 09:36:56
nonlinear John Fuller 19 May 2010 09:36:57

Contact us at files@mathworks.com