Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use MATLAB Use Newton Raphson method What the program has to do: 1. Overall goal

ID: 3863804 • Letter: U

Question

Use MATLAB

Use Newton Raphson method

What the program has to do: 1. Overall goal .The program has to use the Newton-Raphson method to find the roots of the function listed below with a relative% error less than, or equal to 0.01%. f(x) = x^2 - 3x - 200 2. The program must first plot the graph from x = -20 to x = 20, and then prompt the user to look the plotted graph and pick two suitable initial starting points, one for each root (graphing notes are posted in Moodle) 3. The program will find the root nearest the first user input. 4. The program will then find the root nearest the second user input. 5. The program will then print to screen (in a user friendly format using the fprintf command) the roots of the equation and the associated relative % errors. For each root print only three digits after the decimal point. 6. The program must call, and use correctly, the Aerror function you wrote for HW7.

Explanation / Answer

Matlab code:

clc;clear all;
format long;
xx = -20:0.01:20;
y = xx.^2 - 3*xx - 200;
plot(xx,y)
xlabel('x')
ylabel('y')

x= input('Enter first Guess');
fprintf('For first guess ');
h = (x^2 - 3*x - 200)/ (2*x -3);
i = 1;  
while(abs(x^2 - 3*x - 200) >= 0.0001)
i;
h = (x^2 - 3*x - 200)/ (2*x -3);
x = x - h;
i=i+1;
end
x


x= input('Enter Second Guess');

fprintf('For second guess ');
h = (x^2 - 3*x - 200)/ (2*x -3);
i = 1;  
while(abs(x^2 - 3*x - 200) >= 0.0001)
i;
h = (x^2 - 3*x - 200)/ (2*x -3);
x = x - h;
i=i+1;
end
x

Sample Output:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote