|
|
|
| CE En 270 - Homework #16Circular Channel, Part 2 - Solve for YIn an earlier homework assignment (homework #14, part B), you wrote a program that solves for the flowrate, Q, in a circular channel given the pipe diameter and properties. When designing drainage systems it is more common to need to know what flow depth, Y, results from a given Q. In other words, you need to know how large to make the pipe to ensure that it will carry the design flow. For this assignment, you will modify your program so that it can also be used to calculate Y for a given Q. Recall that the following equations apply to the circular channel case:
Manning's equation cannot be conveniently solved for Y. We will use an iterative method to solve for Y. We will start with an initial guess for Y and compare the resulting value of Q with the given value of Q. We will then gradually alter Y until the difference between the resulting Q and the given Q is acceptably small. First of all, the user will input a guess for Y and a tolerance factor called epsilon. To perform the iteration (inside a loop), first solve for Q using the initial guess for Y. This will give you a new value of Q which we will call Qt. Then compute DiffQ = |Qt - Q|. If DiffQ < epsilon*Q, then exit the loop. Otherwise, compute a new guess for y as follows:
Use this y for your next guess and repeat the process. For the tolerance (epsilon), you may want to start with something relatively high like .01 and after you get it working make it lower (0.0001). Your spreadsheet should have two buttons. One to solve for Q and one to solve for Y. If the Q button is clicked, it read the Y value and compute and display the corresponding Q using Manning's equation. If the Y button is selected, it should read the Q value and the Y value. Using the Y value as an initial guess, it should then find the Q value using the iterative process described above. Your spreadsheet may look something like this:
Note that it is possible to put in a value for Q that is so large that it is impossible to solve for Y since it may not be possible to carry that much water even if the pipe is flowing completely full. If you put in a Q that is too large, you will get an run-time error message (divide by zero or something). You may want to add Data Validation to your spreadsheet so that the value entered for Y is less than or equal to the value entered for D. In order to compute the angle alpha, you will need to compute an inverse sine. Click here for instructions on how to find an inverse sine in VB. Submittal Instructions:Click here to upload your homework assignment. |