Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ignore the a.) b.) and c.) parts in question 5.16 and only do what is told in P3). Only use 5.16 for the equations and

Ignore the a.) b.) and c.) parts in question 5.16 and only do what is told in P3). Only use 5.16 for the equations and inputs. image text in transcribed
image text in transcribed
5.16 Water is flowing in a trapezoidal channel at a rate of Q-20 m3/s. The critical depth y for such a channel must satisfy the equation Page 143 Q2 where g-9.81 m/s2, Ae-the cross-sectional area (m2), and B- the width of the channel at the surface (m). For this case, the width and the cross-sectional area can be related to depth y by Solve for the critical depth using (a) the graphical method, (b) bisection, and (e) false position. For (b) and (c) use initial guesses oF4 0.5 and , 2.5, and iterate until the approximate error falls below 1% or the number of iterations exceeds 10. Discuss your results. P3) Obtain the solution to problem 5.16 on page 143 by writing a user-defined function that implements the Modified Secant method as defined below with x0-0.5, x=0.01, 5,-1% and maximum of 10 iterations. Carefully note the definition of myfunc. Submit program and screenshot of results in command window. function [xr, fxr,ea, numIter]-myModSec_username (myfunc, xo,es,maxIter) %Function file : myModSec-username . m %Purpose : % To determine root of function associated with myfunc using the 8 Modified Secant method %Record of revisions (Date | Programmer Change): 8 Date Name Original program %Main Variables: % INPUTS : 8 myfuncfunction handle for (fx]-myfunc (x) x0 - (1x2) initial estimate of root and delta x such that x0 (1) is the initial estimate of the root, x0 (2) is delta x. es - (1x1) specified error tolerance in % (i.e. es-5 implies error tolerance of 5%) % max 1 ter- (1x1) maximum number of iterations that can be performed %OUTPUTS : % xr- (1x1) 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 %88%8888888%%""%%%8888%88%88"%%88888888HH8..88

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

How does selection differ from recruitment ?

Answered: 1 week ago