Info
This question is closed. Reopen it to edit or answer.
How to format program??
8 views (last 30 days)
Show older comments
Hi there,
Here is my problem:
A concrete channel to bring water to Crystal Lake is being designed. It will have vertical walls and be 15 feet wide. It will be 10 feet deep, have a slope of 0.0015 feet/foot, and have a roughness coefficient of 0.014. How deep will the water be when 1000 cubic feet per second is flowing through the channel?
Use Manning's equation: Q=(1.486/N)*A*R^(2/3)*S^(1/2)
where Q is the flow of water (cubic feet per second), N is the roughness coefficient (unitless), A is the cross-sectional area of the water (square feet), S is the slope (feet/foot), and R is the hydraulic radius (feet). The hydraulic radius is the cross-sectional area divided by the wetted perimeter. For squared channels like the one in this example:
Hydraulic radius = depth * width / (2.0 * depth + width)
To solve this problem, I have to design a program that allows the me to guess a depth and then calculate the corresponding water flow. I have to guess repeatedly until the computed flow is within 0.1 percent of the target water flow desired, which is 1000 ft^3/s
I have to guess many times obviously and I am supposed to use a loop function to get my answer
3 Comments
John D'Errico
on 26 Feb 2018
Edited: John D'Errico
on 26 Feb 2018
Why not make an effort? Show what you would try. If not, then you are asking someone to provide an in-depth tutorial on how to do the entire problem, including apparently teaching you how to write a loop. You will learn much by trying, by reading the help for the tools involved, by looking at examples of loops in the documentation, etc. It is that investment of effort, on YOUR part, that your teacher is trying to extract.
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!