Question

need the MATLAB code to solve for percentage error at the 5th iteration given the following Newton-Raphson codeUsing the MATLAB code finline(X13-x^2-18); dfeinline(3*x2-2#x); e?100 count=0; xi=0.5; while (ea>01); count = count 1 ; xil - xi - f(xi)/df(xi); ea = 100 * abs((xi 1-xi)/xi 1 ); disp([count xil.xi, ea]); xi=xi 1 ; If ea is the error defined in percentage, the value of the error (ea) at 5th iteration (i.e., count-5) is closest or equal to hoices 51% 54% | 100% 50% Submit | Attempts 1

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Refer the output below:

Command Window >> f=inline ( x^3-x2-18 ) ; df-inline (3*22*x) ea=100; count 0:xi.5; while (ea>0.01) count-count+1: xil=

0.0100 -0.0001-0.0020 1.4085 11.0000 56.3926 -0.1329 100.2357 12.0000 37.7094 56.3926 49.5451 13.0000 25.2570 37.7094 49.3027

It is seen from the output that at count=5, ea= 51.2994 %. close to 51%

Hence choice 1 is correct

Add a comment
Know the answer?
Add Answer to:
need the MATLAB code to solve for percentage error at the 5th iteration given the following...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 5.1.2 Open Methods - Newton-Raphson Method Xi+1= xi – FOTO Matlab Code Example:4 function mynewtraph (f,...

    5.1.2 Open Methods - Newton-Raphson Method Xi+1= xi – FOTO Matlab Code Example:4 function mynewtraph (f, f1,x0,n) Xx0; for ilin x = x - f(x)/f1(x); disp (li if f(x) <0.01 f(x))) break end end end Matlab Code from Chapra function [root, ea, iter)=newtraph (func,dfunc, xr, es,maxit,varargin) newtraph: Newton-Raphson root location zeroes 8 [root, ea, iter)-newtraph (func, dfunc, xr, es,maxit,pl,p2, ...): $uses Newton-Raphson method to find the root of fune input: func- name of function 8dfunc = name of derivative of...

  • 45-3. Modify the code used in Example 4 to find the root only at f(x)<0.01 using...

    45-3. Modify the code used in Example 4 to find the root only at f(x)<0.01 using Newton-Rephson Method without showing any iteration. Also find the root of equation, f(x) = x 9-3x -10, take initial guess, Xo=2 العقدة College of 9:05 mybb.qu.edu.ca Numerical Methods (Lab.) GENG 300 Summer 2020 5.1.2 Open Methods - Newton-Raphson Method f(x) *1+1 = x; - Matlab Code Example:4 function mynewtraph.t1.x0,-) XXO for ilin x - x - x)/1 x) disp 1 x) <0.01 break end...

  • Use the following pseudocode for the Newton-Raphson method to write MATLAB code to approximate the cube...

    Use the following pseudocode for the Newton-Raphson method to write MATLAB code to approximate the cube root (a)1/3 of a given number a with accuracy roughly within 10-8 using x0 = a/2. Use at most 100 iterations. Explain steps by commenting on them. Use f(x) = x3 − a. Choose a = 2 + w, where w = 3 Algorithm : Newton-Raphson Iteration Input: f(x)=x3−a, x0 =a/2, tolerance 10-8, maximum number of iterations100 Output: an approximation (a)1/3 within 10-8 or...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT