Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Below is the correct code for the false - position method. Using the image provided modify this code to create a script for the modified
Below is the correct code for the falseposition method. Using the image provided modify this code to create a script for the modified falseposition method. Focus on highlighted partsThe limitation of the Falseposition method is its onesidedness. If the root is close to
either upper or lower bound, one of the bracketing points is keep fixed. To overcome this
issue, the modified falseposition method was developed. The pseudo code for the
modified falseposition method is shown down below.
Fill the right column in the table below with your script
clc; clear all; close all;
Parameters
xl ; lower bound
xu ; upper bound
es e; tolerance
imax ; max iteration
Initialization of the plot
figure;
xlabelIteration;
ylabelApproximate Relative Error ;
titleError vs Iterations';
hold on;
xlim;
setgca 'YScale', 'log';
grid on;
Find root
xx iter FalsePositionxl xu es imax
function xx iter FalsePositionxl xu es imax
Initialization
iter ;
xr xl;
ea ;
Graph shows iterations for iter :
for iter :
Step : update root
xrold xr;
xr xu fxuxl xufxl fxu;
Step : error
if xr ~ && iter
ea absxr xrold xr;
end
Plot relative error
semilogyiter earo;
Step : Update Boundary
test fxl fxr;
if test
xu xr;
elseif test
xl xr;
else
ea ;
end
Break if tolerance is reached
if ea es
break;
end
end
xx xr;
end
Function Evaluation
function fc fx
g ;
m ;
t ;
fc g m x expx m t;
end
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