Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write an M-file that implements the bisection method. But, instead of using using the maximum iterations and relative error, it uses the absolute error as
Write an M-file that implements the bisection method. But, instead of using using the maximum iterations and relative error, it uses the absolute error as the stopping criterion. Indeed, it identifies the minimum number of iterations to reach the predefined desired approximate absolute error Ead. That is: The first line of the function should be function [ root, Ea,ea,n]= YourName_Q1_bisect (func, xl,xu, Ead, varargin) Note that Ea= the approximate absolute error and ea = the approximate percent relative error. Test your code for the function (the velocity of water, v, discharged from a cylindrical tank through a long pipe) v=2gHtanh(LgHt) with v=5m/s,g=9.81m/s2,L=4m (pipe length), and t=2.5s (elapsed time) to find the initial head H in the interval [0,4]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started