Question: 5 . 1 6 ( mod ) The 'critical depth' y for a trapezoidal channel carrying water must satisfy the equation 1 - Q 2

5.16(mod) The 'critical depth' y for a trapezoidal channel carrying water must satisfy the equation
1-Q2BgA3=0
where Q is the flow rate, B=3+y is the channel width, g=9.81ms2 is the acceleration due to gravity, and A=3y+y22 is the channel cross-sectional area. Determine the critical depth y for a flow rate of Q=20m3s by writing a user-defined MATLAB function that implements the Bisection method as defined below with xl=0.5,xu=2.5,s=1% and maximum of 10 iterations. Carefully note the definition of my func.
Submit printout of function and command window with results.
function [xr, fxr, ea, numIter]=myBisection_username (myfunc,x0, es, maxIter)
% Function file: myBisection_username.m
88
%urpose:
: To determine root of function associated with myfunc using the
B Bisection method
%Record of revisions (Date | Programmer | Change):
: Date I Name | Original program
%Main Variables:
%INPUTS:
myfunc
function handle for [fx]=myfunc(x)
x0-(1x2) initial bracket xL,xU
-(11) specified error toler
esror tolerance of5%
maxiter -(1x1) maximum number of iterations that can be performed
20
%OUTPUTS :
xr,-(11) estimate of the root
fxr -(1x1) value of function at xr
ea -(1x1) approx. percentage relative error at xr
numIter-(1x1) number of iterations required to obtain xr
%
 5.16(mod) The 'critical depth' y for a trapezoidal channel carrying water

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!