Question: Develop your own M-file function for the Newton- Raphson method for nonlinear systems of equations based on Fig. 12.4. Test it by solving Example 12.4
Develop your own M-file function for the Newton- Raphson method for nonlinear systems of equations based on Fig. 12.4. Test it by solving Example 12.4 and then use it to solve Prob. 12.8.
![function [x, f, ea, iter] =newtmult (func, xo, es, maxit, varargin) &](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1678/9/6/5/0366412f92c4645d1678965034421.jpg)
Example 12.4
![newtmult: Newton-Raphson root zeroes nonlinear systems [x, f, ea, iter] =newtmult (func,](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1678/9/6/5/1126412f978785641678965111918.jpg)
Data Form Problem 12.8
Determine the solution of the simultaneous nonlinear equations
y = −x2 + x + 0.5
y + 5xy = x2
Use the Newton-Raphson method and employ initial guesses of x = y = 1.2.
function [x, f, ea, iter] =newtmult (func, xo, es, maxit, varargin) & newtmult: Newton-Raphson root zeroes nonlinear systems [x, f, ea, iter] =newtmult (func, xo, es, maxit, p1, p2, ...): 8 8 uses the Newton-Raphson method to find the roots of a system of nonlinear equations 8 & input: 8 func = name of function that returns f and J 8 xo initial guess es = desired percent relative error (default = 0.0001%) maxit = maximum allowable iterations (default = 50) p1, p2,... = additional parameters used by function & output: & & 8 8 f 8 & x = vector of roots f = vector of functions evaluated at roots ea = approximate percent relative error (%) iter = number of iterations if nargin
Step by Step Solution
3.47 Rating (163 Votes )
There are 3 Steps involved in it
ANSWER Here is the implementation of the NewtonRaphson method for nonlinear systems of e... View full answer
Get step-by-step solutions from verified subject matter experts
