Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For Questions show the code solution for this question1.a),i) and ii) and for false method and bisection method please include comments explaining the code and

For Questions show the code solution for this question1.a),i) and ii) and for false method and 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 false method and bisection method. this must be in a matlab code

image text in transcribed

image text in transcribed

image text in transcribedimage text in transcribed

For this problem you are required to build a 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 your bisection function to take as input a real-valued function " fp", 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 bisection algorithm should iterate until the absolute error cnr of the final root approximation cn is less than the input error bound err I - Design your false position function to take as input a real-valued function " f", initial lower and upper bounds for the root " a" and " b", a desired number "p" of significant figures to which the root approximation has converged, and a maximum number of iterations "nmax". Your false position algorithm should iterate until either the approximation cn has converged to p significant figures (meaning that the first p significant figures of cn1 and cn are the same) or the number of iterations has exceeded nmax. Also design your false position code to print out (or simply display) the length of the final interval [an,bn] that produced the output root approximation cn!2 b) For this sub-problem, adjust 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)=05 and to display two values at each iteration of the main loop (using i to denote the iteration index): 1. An approximation for the relative error of the (i1)st root approximation given by (cici1)/ci. 2. The true value of the relative error of the (i1)st root approximation given by (rci1)/r. Consider the function f(x)=x101. What is the the unique positive root r of this function? First, solve for the true value of r analytically (i.e. solve for r by hand), and then proceed to questions (i) and (ii) below. (i) Approximate r using your adjusted bisection method code with a=0 and b=1.3 and with an input absolute error bound of err=102. Analyzing the output from your code, did (cici1)/ci provide a decent approximation (or at least provide an upper bound) on the true relative error (rci1)/r at each iteration of the bisection method?l ii) Approximate r using your adjusted false position method code with a=0 and b=1.3 and with an input of p=2 to produce an approximation cn which has converged to 2 significant figures. Would you say that this approximation is correct to 2 significant figures? Furthermore, analyzing the output from your code, did (cici1)/ci provide a decent approximation (or at least provide an upper bound) on the true relative error (rci1)/r at each iteration of the false position method

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

Students also viewed these Databases questions

Question

Write a program about converting inches to meters using C++

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago