Use an iterative numerical technique to calculate a value
Note: This assignment must be submitted in Colab (Jupyter format). You can cut/paste code and report from other tools into Colab or do the entire assignment directly in Colab. Colab has a share notebook link that you can copy and paste as your submission.
https://colab.research.google.com/
The Mannings Equation finds the Flow Q (cubic feet per second or cfs) in an open channel. The equation is
Q = 1.49/n * A * R^2/3 * S^1/2
Where
Q = Flowrate in cfs
A = Cross Sectional Area of Flow (square feet)
R = Hydraulic Radius (A/ Wetted Perimeter )
S = Downward Slope of the Channel (fraction)
The Wetted Perimeter and the Cross-Section of Flow are both dependent on the channel's geometry. For this assignment, we will use a Trapezoidal Channel.

If you work out the Flow Area, you will find it is
A = b*y + y*(z*y) = by + z*y^2
The Wetted Perimeter is a little trickier, but a little geometry will show it to be
W = b + 2y(1 + z^2)^1/2
where b = base width (ft); z = Side slope (horizontal to vertical =1); y = depth.
Putting it all together gives a Hydraulic Radius of
R = (b*y + z*y^2)/(b + 2y*(1+z^2))^1/2
All this goes into the Mannings Equations
Q = 1/49/n * (b*y + z*y^2) * ((b*y + z*y^2)/(b + 2y(1+z^2))^1/2)^2/3 * S^1/2
Luckily, I will give you the code for this equation in Python. You are free to use this code. Please note that using iterative techniques, YOU will solve for y (depth in this function).
def TrapezoidalQ(n,b,y,z,s): # n is Manning's n - table at # https://www.engineeringtoolbox.com/mannings-roughness-d_799.html # b = Bottom width of channel (ft) # y = Depth of channel (ft) # z = Side slope of channel (horizontal) # s = Directional slope of channel - direction of flow A = b*y + z*y*y W = b + 2*y*math.sqrt(1 + z*z) R = A/W Q = 1.49/n * A * math.pow(R, 2.0/3.0) * math.sqrt(s) return Q |
As an engineer, you are designing a warning system that must trigger when the flow is 50 cfs, but your measuring system measures depth. What will be the depth at which you trigger the alarm?
Values to Use:
Manning’s n for "Earth Channel – Clean" (you need to look this up - you can use https://www.engineeringtoolbox.com/mannings-roughness-d_799.html )
b = 3 foot bottom
z = 2 Horiz : 1 Vert Side Slope
s = 1 foot drop for every 100 feet
(hint: A depth of 1 foot will give you Q = 25.1 cfs)
Write the program code and create a document that demonstrates you can use the code to solve this problem using iterative techniques.
You should call your function CalculateDepth(Q, n, w, z, s). Inputs should be flowrate (variable Q) , Manning’s roughness coefficient (n), Bottom Width (b), Side Slope (z), and Longitudinal Slope (s). Your code should demonstrate an iterative method to converge on a solution with 0.01 foot accuracy or use existing functions from Python libraries to do this iteration.
As always, this will be done as an engineering report. Python includes libraries to work on iterative solutions to equations. You must either learn these libraries OR write your own code. You need to (1) figure out the algorithm for iterative solutions, (2) translate that into code, (3) use the code to solve this problem, (4) write a report of using this to solve the problem. You should also include a plot of Flow (Q) vs. Depth
Report
The methodology of your report should include the methods you used to solve for the depth. You must also report the depth for the specified flow rate. A plot of flow rate (Q) vs. depth with the solution labeled on the plot is required in the report.
Report Format (Details at Submission Guidelines (Engineering Reports) )
Cover - Name/Date/Class/Assignment #
Problem Statement - Copy/Paste and then modify to state problem
Methodology - The approach to the problem, not code, equations and explanation here
Results -Be sure to answer the problem asked in the problem statement
Conclusion - This can be short, any additional notes you want to make here
Appendices - Code or any additional information here