Figure 1: Pipe with liquid connecting two pools.

The equations of motion for the surface is given by: $$ \begin{align} \frac{dv}{dt} = -\left[\frac{2\,g\,z}{L} + \frac{f}{2D}v \lvert v \rvert\right], \label{eq:motion} \end{align} $$
where, \( v \) [m/s] is the velocity of the surface, \( z \) [m] is the displacement with respect to the equilibrium, \( t \) [s] is time, \( D=0.5 \) [m] is the diameter of the pipe, \( f=0.05 \) [-] is a friction coefficient, \( L=392 \) is the total length of the water columns and \( g=9.8 \) [m/s^2]. The initial conditions (for the left surface) are given by: $$ \begin{align} z(0) = -6\,, \label{_auto1}\\ v(0) = 0\,. \label{eq:init} \end{align} $$
a) Calculate \( z \) and \( v = \frac{dz}{dt} \) after 3 \( s \) using Eulers method with a time-step of \( \Delta t = 1 s \).
solution: \( z = -5.105 m \), \( v = 0.863 m/s \).
Recall Euler's method: $$ \begin{align} y(n + 1) = y(n) + h\,f(n), \label{_auto2} \end{align} $$
Eq. \eqref{eq:motion} can be reduced to a system of first order ODEs: $$ \begin{align} \frac{dz}{dt} = v, \label{_auto3}\\ \frac{dv}{dt} = -\left[\frac{2\,g\,z}{L} + \frac{f}{2D}v \lvert v \rvert\right] \label{_auto4} \end{align} $$
And employing Euler's method gives: $$ \begin{align} z_{n + 1} = z_{n} + \Delta t\, v_{n}, \label{_auto5}\\ v_{n + 1} = v_{n} + \Delta t \left( -\left[\frac{2\,g\,z_{n}}{L} + \frac{f}{2D}v_{n} \lvert v_{n} \rvert\right]\right) \label{_auto6} \end{align} $$
b) Calculate \( z \) and \( v = \frac{dz}{dt} \) after 3 \( s \) using Heuns method with a time-step of \( \Delta t = 1 s \).
solution: \( z = -4.709 m \), \( v = 0.803 m/s \).
Heun's method for Eq. \eqref{eq:motion}: $$ \begin{align} z_p = z_{n} + \Delta t\, v_{n}, \label{_auto7}\\ v_p = v_{n} + \Delta t \left( -\left[\frac{2\,g\,z_{n}}{L} + \frac{f}{2D}v_{n} \lvert v_{n} \rvert\right]\right) \label{_auto8} \end{align} $$ $$ \begin{align} z_{n + 1} = z_{n} + \frac{\Delta t}{2} \left(v_{n} + v_p\right), \label{_auto9}\\ v_{n + 1} = v_{n} + \frac{\Delta t}{2} \left( -\left[\frac{2\,g\,z_{n}}{L} + \frac{f}{2D}v_{n} \lvert v_{n} \rvert\right] -\left[\frac{2\,g\,z_p}{L} + \frac{f}{2D}v_p \lvert v_p \rvert\right]\right) \label{_auto10} \end{align} $$
c) Solve the initial value ODE given by Eqs. \eqref{eq:motion} -\eqref{eq:init} by Employing Taylor's method (around \( t=0 \)).
solution: $$ \begin{align} z = -6 + \frac{3\,t^2}{20} - \frac{t^4}{1000}\,. \label{_auto11} \end{align} $$
test