Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please show all matlab codes for written/modified functions and scripts and given outputs for: -method of false position that computes approximations to x coordinates by

please show all matlab codes for written/modified functions and scripts and given outputs for:

-method of false position that computes approximations to x coordinates by writing a new script/modifying bisect.m

-determine the initial bracket for each intersection

-a separate ffalpos.m function file to compute an appropriate function whose roots will need to be approximated for the x coordinates of the intersections

thanks!

image text in transcribed

note: copy and paste bisect.m code below into matlab

BISECT.M code to be modified

%find root of f(x) = 0

%using Bisection Method

format long e

%chosen error tolerance (TOL)

TOL = .000001;

%choose max number of iterations

MAXIT = 50;

%initial bracket

a = ;

b = ;

%keep track of number of iterations

count = 0;

%record iterates - a col vector of MAXIT length

cits = zeros(MAXIT,1);

%evaluate func. at a and b

fa = fbisect(a);

fb = fbisect(b);

%stop if not appropriate interval

if sign(fa)*sign(fb) >= 0

return

end

%stop loop when error less than TOL or MAXIT reached

while abs(b-a)/2 >= TOL & count

%get midpoint(root estimate)

c = (a + b)/2;

%eval. func at midpoint

fc = fbisect(c);

%stop if f(c)=0

if fc == 0

break

end

%update count

count = count + 1;

%add to list of iterates

cits(count) = c;

%if sign change between a and c make c the new right endpt

if sign(fa)*sign(fc)

b = c;

%if sign chg betw c and b make c the new left endpt

else

a = c;

end

end

%update count

count = count + 1;

%get final midpoint(root estimate)

c = (a+b)/2;

%add to vector of iterates

cits(count) = c;

%display error estimate

error = abs(b-a)/2

%display vector of iterates

cits

%display number of iterates

count

1) Modify the code bisect m (provided in eLearning) to write a new script, falpos.m, that performs the Method of False Position You will only need to add/modify a few lines of code. Run your senipt to compute approximations to the x coordinates of any intersections of the ellipse (x-2) (-1)1-1 and the parabola y- (-2)1 +1. For each intersection, you will need to 4 determine an initial bracket to use in your script (a sketch of the graphs would be helpful here) Also, write a separate function m-fle, ffalpos.m, to compute an appropriate function whose roots you will need to approximate for the x coordinates of the intersections

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions