Question: Matlab - Write a function with the header [s] = myNR3(f1, f2, f3, x, eps) which solves a system of three non-linear equations (given by
Matlab - Write a function with the header [s] = myNR3(f1, f2, f3, x, eps) which solves a system of three non-linear equations (given by function handles f1, f2, and f3) given an initial guess vector x, and returns the root vector s. f1, f2 and f3 should be handles to functions of x (and x will be a column vector in R3). Use a convergence criterion on the incrementor (delX) such that the algorithm keeps going as long as abs(delX) > eps. CHECK YOUR ALGORITHM FOR INFINITE LOOPS! Hints: 1) In your function, define variables j11, j12, j13, j21, j22, j23, j31, j32, j33 as anonymous functions which get the output of a call to your myPartialDeriv function from Problem 2. (I will use my own copy of myPartialDeriv when I grade it.) 2) eps can be used for both the convergence criteria and as the last input argument to myPartialDeriv. 3) Define the Jacobian J as an anonymous function which creates a matrix of the above function handles (j11, j12, etc., etc.) in the correct locations. 4) Define a Function F as an anonymous function which creates a column vector of input function handles f1, f2, and f3. 5) Calculate delX as J(x)\F(x); 6) Keep updating x with delX per the Newtons Method update equation for nonlinear systems.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
