Answered step by step
Verified Expert Solution
Question
1 Approved Answer
False-position method is a bracketing with bracket xl and xu where the new root is approximated as xr = xu - f(xu)(xu - xl)/(f(xu) -
False-position method is a bracketing with bracket xl and xu where the new root is approximated as xr = xu - f(xu)(xu - xl)/(f(xu) - f(xl)) (a) Matlab script with a bug to compute the root for f(x) = x^3 - 27; after the 7th iterations using xL=0; xU=10; is given by
xL = 0; xU = 10; fU = xU^3 - 27; fL=xL^3 - 27; xR = xU - (fU) * (xL-xU)/(fL-fU); n=7; for i=1:n fR = xR^3 - 27; fL = xL^3 -27; fU = xU^3 - 27; if(fR*fL < 0 ) xL = xR; else xU = xR; end xR = xU - (fU) * (xL-xU)*(fL-fU); disp([i xL xU xR]) end
Fix the bug and write the correct code. (b) What is the value (or closest value ) of the root at the 3rd iteration?
Choices
1.0355 | |
1.2733 | |
0.7881 | |
0.5327 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started