Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem needs to be completed using MATLAB or a similar language. Thank you! Problem 2: The bisection method The purpose of this exercise is to

Problem needs to be completed using MATLAB or a similar language. Thank you! image text in transcribed
Problem 2: The bisection method The purpose of this exercise is to apply the bisection method and study its convergence. Write a function with name bisectionMethod with input a function f, a left end-point a, a right en and a tolerance level tol. Your function should do the following: . Check that a O. If not, it should print an error message and stop . Return the vector midPoints that contains all midpoints generated by the bisection method ap . Return the vector fMidPoints that contains the corresponding function values on all midpoints . Create a figure with the graph of f in [a, b] AND the first and last midpoints of the bisection with an initial interval [a, bl by the bisection method applied to f, with an initial interval a, b] marked with red marks on the x-axis. (You can use any marker style you prefer.) Print a message in the standard output, stating o the number of iterations needed to reach a solution to f(x) within a tolerance of tol. o the approximation to the solution of f(x) 0 calculated by the bisection method. In your prob20, call your bisectionMethod function to find the real roots of the following functions (a) cos x-x, starting with [0,1], with tol= 10-6 (b) xsinx, starting with three different intervals (one per run) and tol= 10-6. Each interval shoul length of /2 and contain a different root of x sin x. AND to find (c) v7 (Note: you are asked to use the bisection method to find this, do NOT use sqrt!)

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

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

Identify the universal properties of all languages.

Answered: 1 week ago

Question

Understand the different approaches to job design. page 167

Answered: 1 week ago