Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a function bisectionmethod that inputs a function f, two numbers a and b, an error tolerance tol, and a maximum number of iterations

image text in transcribed

1. Write a function bisectionmethod that inputs a function f, two numbers a and b, an error tolerance tol, and a maximum number of iterations N, and approximates a root c of f in [a, b using the bisection method. Your function should compute a bound err on the absolute error and halt when err N, whichever happens first. The function signature should be as follows: function [e, n, err] * bisection sethod(f, a, b, tol, N) U se your code to solve fir)- 0, f:(2x3 + 31-1)cosz-z, fr zel-1,11, with tol = 10-5 (a) What number n of iterations were needed? (b) What is the error bound upon termination? (c) What is the expected rate of convergence? (d) Plot the function f and the r-axis (y 0) on the same graph. (e) Solve f(x) 0 on the same interval using MATLAB's rootfinder fzero, and compare with your solution

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

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

Define people analytics.

Answered: 1 week ago

Question

8. Do the organizations fringe benefits reflect diversity?

Answered: 1 week ago