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

is Hal- ley\'s method. The solution process starts by choosing a value x, as a f

ID: 2291170 • Letter: I

Question

is Hal- ley's method. The solution process starts by choosing a value x, as a first mate of the solution. Using this value, a second, more accurate calculated with x2 =x1(x3 + 2P) / (2x3 + P) , which is then used for calculating a third, still more accurate value x3, and so on. The general equation for calculat- ing the value of xi +1 from the value of x, is xm-x(?+2P) / (2e+p). Write a MATLAB program that calculates the cubic root of a number. In the program use x P for the first estimate of the solution. Then, by using the general equation in a loop, calculate new, more accurate values. Stop the looping 32. One numerical method for calculating the cubic root of a number. value , is when the estimated relative error E defined by Eis smaller than 0.00001. Use the program to calculate: (a) 800 (b) /59071 (c) V-31.55

Explanation / Answer

Matlab Script:

P = input('Enter P');

xi = P;
while true
xi1 = xi*((xi^3)+(2*P))/((2*(xi^3))+(P));
E = abs((xi1-xi)/xi);
if E<1e-5
break;
else
xi = xi1;
end
end
disp(xi);

output: