Question

For a tank draining problem with a constant feed rate, the governing equation is \frac{d h}{d t}=\frac{Q}{A_{t}}-\frac{A_{t}}{A_{h}} \sqrt{2 g h} Where Q is the flow rate in At is the tank area Ah is the hole area and h is the height in the tank. Lets say the hole diameter in 10 cm (watch your units) , the tank diameter is 1 m, Q is0.05 m3/sec, and g is 9.8066 m/s?. We will assume the initial height in the tank is 10 m and we can assume the tank is very tall (it wont overflow). Now don't get spooked by the problem.We want to use Euler's method to generate a table of h vs time. You will find this very similar to some examples I provided under "Euler". It should be easy to modify. a) OK so set this up using Eulers method. Try a step size of 50 sec and run it out long enough to see what happens. (at least 5000 seconds). b) At the point where the level becomes constant (it will) what is the flow rate out? (think .. this doesn't require a calculation.) Add another column to use modified Euler with the predictor /corrector step. Write a livescript program which asks the user for the flow rate in and the time duration., but has the other dimensions "built in" (that is just type dt=1, and dh =0.1, etc. Your livescript should generate an array of h vs t. Have the script plot h vs t. Just use straight Euler for this... not modified.

Question image 1Question image 2Question image 3Question image 4Question image 5Question image 6Question image 7