Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SUBJECT: MODIFIED FALSE POSITION METHOD. Please RESET: il and iu . it looks like I have an error under ELSE IF section (iu). % Modified

SUBJECT: MODIFIED FALSE POSITION METHOD. Please RESET: il and iu. it looks like I have an error under ELSE IF section (iu).

% Modified False Position

xl = 0; % xl = 1; xu = 5; % xu = 4; precision = 10^-5;% precision = 10^-5; f = @ (x) 3*(x^2)-5; % ea = approximate error

iteration_count = 0; fxl = f(xl); fxu = f(xu); xr = xu - (f(xu)*(xl-xu))/(fxl-f(xu)); ea = abs((xl-xu)/(xl+xu))*100; % ea = approximate error

il = 0; iu = 0;

while ea > precision xr = xu - (f(xu)*(xl-xu))/(fxl-f(xu)); ea = abs((xl-xu)/(xl+xu))*100; % ea = approximate error iteration_count = iteration_count + 1; if fxl * f(xr) < 0 xu = xr; iu = 0; il = il + 1; if il >= 2 fl = fl/2; il = 0; end elseif fxl * f(xr) > 0 xl = xr; il = 0; iu = iu + 1; if iu >= 2 fl = fl/2; iu = 0; end end end bisect = xr; fprintf(['Using the Modified False Position Method, the root is located at ' ... num2str(bisect) ' after ' num2str(iteration_count) ' iterations.']);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

978-0764535376

More Books

Students also viewed these Databases questions

Question

Explain the strength of acid and alkali solutions with examples

Answered: 1 week ago

Question

Introduce and define metals and nonmetals and explain with examples

Answered: 1 week ago