Question: this is a matlab question Q2 i) Write a MATLAB function file which determines where two functions intersect using a Generalized Newton-Raphson technique. Your function

this is a matlab question
 this is a matlab question Q2 i) Write a MATLAB function

Q2 i) Write a MATLAB function file which determines where two functions intersect using a Generalized Newton-Raphson technique. Your function file should have the following function header line: function [rootx, rooty, iter-NR2D(x0,yo,,g,dfax , dfdy, agdx, dgdy, tol) - - - where: the return values root_x, root_y is the intersection point found by the function and iter is the number of iterations the function took to find the root. The input parameters are the initial guess (xO,y0), the two functions (f/x,y),g(x,y)), the derivative functions of f and g with respect to x and y (dfdx, dfdy, dgdx,dgdy) and the toot-finding tolerance (tol). It is possible that a root does not exist, so implement some kind of error checking inside this function that prints a warning message if the function does not appear to be converging. ii) Test your function by finding at least one point where the following two functions intersect: y-sin(x) and y x'-3x2+2. Use an initial condition of (0,0) and a tolerance of 106. Write the intersection value to the screen with 6 decimal points and on a separate line write a statement on how many iterations the function took to reach the toleranc.. ii) How can you tell if the root you have found is correct? Print a few sentences to the command window describing how you can do this and demonstrate that you have found the root to the accuracy defined by iv) Print a short message to the screen that describes the convergence error checking you implemented when writing the function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!