Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For Questions show the code solution for just the bisection method for question 1.a) and for the bisection method please include comments explaining the code

For Questions show the code solution for just the bisection method for question 1.a) and for the bisection method please include comments explaining the code and providing detail to it that explains what is do what and what does this variable represents, etc. Please show the steps clearly for the Bisection method.

image text in transcribedimage text in transcribed

image text in transcribed

Question 1. Bracketing Methods For this problem you are required to build MATLAB functions for the bisection method and false position method to approximate a root r satisfying f(r)=0 for a given function f. Design these MATLAB functions to take as input a real-valued function " f", initial lower and upper bounds for the root " a" and " b ", and a desired upper bound "err" on the absolute error of the final root approximation. Your algorithms should iterate until the absolute error cnr of the final root approximation cn is less than the input error bound err.]1 b) For this sub-problem, modify your code for the bisection method and false position method to take an additional input parameter " r " which represents the true value of the root r(a,b) such that f(r)=0 and to display two values at each iteration of the main loop: 1. An approximation for the relative error of the (n1)st root approximation given by (cncn1)/cn. 2. The true value of the relative error of the (n1)st root approximation given by (rcn1)/r. Consider the function f(x)=x101. Implement your modified code with a=0 and b=1.3 and with an input absolute error bound of err =102. Based on the result, does (cncn1)/cn appear to be a decent approximation (or at least provide an upper bound) on the true relative error (rcn1)/r when using the bisection method? What about when using the false position method? 1 Although your bisection code does not need to solve for the number of iterations n required to achieve an absolute error less than err in advance of the main loop, perhaps the "slickest" approach does solve the problem this way, and it does this without ustng a loop to solve for n. You are encouraged to implement this strategy, but it is not strictly required. Furthermore, if you choose not to solve for n in advance of the main loop for the bisection method, you should still be cognizant of additional information available when bounding the absolute error in the bisection method compared to the false position method. 2 For those interested: cd is a proportionality constant relating the velocity in freefall to the upward force due to air resistance. 3 These are reasonable values! 4 To be clear, we don't typically know r when root flnding, but this modifled code will be used for algorithm analysis

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

How is Karen Slagles argument an example of confirmation bias?

Answered: 1 week ago