Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How to format program??

8 Ansichten (letzte 30 Tage)
Russell
Russell am 19 Sep. 2012
Geschlossen: Sabin am 24 Dez. 2025 um 9:51
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 Kommentare
Ken Atwell
Ken Atwell am 19 Sep. 2012
I take is this is a homework question?
John D'Errico
John D'Errico am 26 Feb. 2018
Bearbeitet: John D'Errico am 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.

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by