Question: Figure 2 is shown above. Create a Matlab code to solve the differential equation using a forward finite difference. Also, plot the liquid height as

 Figure 2 is shown above. Create a Matlab code to solve

Figure 2 is shown above. Create a Matlab code to solve the differential equation using a forward finite difference. Also, plot the liquid height as a function of time and note approximately how long it would take for the tank to empty. All information given is shown above.

A spherical tank has a circular orfice in its bottom through which the liquid flows out (see Figure 2). The flow rate throught the hole can be estimated as Qout CA 2gh (1) where Qout is the outflow (m3/s), C is an empirically derived coefficient, A is the area of the orfi ce (m2), g is the gravitational constant (9.81 m/s and h is the depth of liquid in the tank. The balance equation describing the volume of liquid in the tanke is dV (2) Qout dt Additionally, the volume of liquid in the tank can be calculated as a function of of the liquid height and the tank radius as follows: Th (3r h) (3) Combining these three expressions leads to the following differential equation: dh -CA 2gh (4) dt 2Trh Th2 (You should try and derive this result for yourself, although you do not need to document it.) Solve this differential equation numerically using a forward finite difference. Note that the denominator of the right-hand-side will become zero when the tank is empty. To keep the solver "sane" you should check if h at each time point is less than or equal to zero. If it is, just set h 0, which captures what happens physically anyway A spherical tank has a circular orfice in its bottom through which the liquid flows out (see Figure 2). The flow rate throught the hole can be estimated as Qout CA 2gh (1) where Qout is the outflow (m3/s), C is an empirically derived coefficient, A is the area of the orfi ce (m2), g is the gravitational constant (9.81 m/s and h is the depth of liquid in the tank. The balance equation describing the volume of liquid in the tanke is dV (2) Qout dt Additionally, the volume of liquid in the tank can be calculated as a function of of the liquid height and the tank radius as follows: Th (3r h) (3) Combining these three expressions leads to the following differential equation: dh -CA 2gh (4) dt 2Trh Th2 (You should try and derive this result for yourself, although you do not need to document it.) Solve this differential equation numerically using a forward finite difference. Note that the denominator of the right-hand-side will become zero when the tank is empty. To keep the solver "sane" you should check if h at each time point is less than or equal to zero. If it is, just set h 0, which captures what happens physically anyway

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!