Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Water enters into a cylindrical tank of radius r =20 cm from inlets 1 and 2 at f

ID: 1620917 • Letter: W

Question

Water enters into a cylindrical tank of radius r =20 cm from inlets 1 and 2 at flow rates of Q1=5 ml/s and Q2=12 ml/s, respectively, and leaves the tank at a flow rate of Q3=10 ml/s from port 3. Initially the height of water in the tank is h =50 cm. It can be shown from conservation of mass principle that change in the height of water, h, in the tank is given by the following equation. dh/dt = Q_1 + Q_2 - Q_3/pi r^2 Write a script to solve for h using the Euler's method and plot its variation with time within 1 hr. Make sure all units agree with each other.

Explanation / Answer

I am assumin that you are clear with the derivation of the equation of dh/dt.

dh/dt is the rate of change of height of liquid level in the cyliderical container. It is derived from the equation of mass conservation which says that rate of change of volume of liquid in cylider is equal to net inflow.

Moving on to Euler's method, lets say that the equation can be written as dh/dt = k.

where k is a constant which is equal to (Q1+Q2+Q3)/(pi*r^2)

Euler's method is used to solve ODEs.

When we know dy/dx as a function of x, we can calculate value of y at different x if an initial condition(value) is known.

Lets say that the streams start pouring in at t=0. The level in the cylinder is is zero at t=0. We have our intial condition known to us now i.e. at t=0, h=0.

now lets say we want to know what is the level at t = 1 sec.

Eulers method says that h (at t sec) = h (at t-1 sec) + dh/dt

h(t=1 sec) = h(t=0 sec) + dh/dt(at t= 0 sec) *

which can be written as h1 = h0 + dh/dt (at t = 0)

since dh/dt is constant = k, we do not have tp worry about dh/dt varying with time.

hence it is equal to h1 = h0 + k

similarly, h2 = h1 + k => h2 = (h0 +k) +k = h0 + 2*k

h3 = h2 + k => h3 = h0 +2*k + k = h0 + 3*k

...

h at n sec sec is given by h_n = h0 + n*k