7 minute read Undergraduate

From the archive (2024). Corrected in October 2026; see the note at the end.

When a container of liquid starts or stops suddenly, as it does on a packaging line, the liquid sloshes. The full problem is governed by the Navier–Stokes equations, which have closed-form solutions only in special cases. This page sets out a simpler research problem: can a few coupled pendulums, or a simple wave equation, describe the moving surface well enough to be useful?

It began as a group research project at the Edinburgh Scientific Researchers Association (ESRA), with Patrick Truong, Gregory Barbanel and Abdullah Fouzuddeen.

The starting point

The paper Modelling Transient Liquid Slosh Behavior at Variable Operating Speeds Induced by Intermittent Motions in Packaging Machines represents the liquid surface as a plane that stays perpendicular to a single imaginary pendulum. A real surface does not stay flat, so we looked at two ways of letting it bend: several coupled pendulums, each setting the direction of part of the surface, and a continuous description of the surface as a wave.

Discrete model: a chain of pendulums

The surface is split into straight pieces, and each piece takes its direction from a pendulum. The pendulums form a chain hanging from the centre of the surface, each from the one above. With \(n\) pendulums the surface has \(2n\) pieces, and the \(k\)-th piece on each side stays perpendicular to rod \(k\). One pendulum gives the flat, tilting surface of the original paper; more pendulums let the surface bend.

For a container of mass \(M\) at position \(x\) and bobs of mass \(m\) on rods of length \(\ell\), bob \(k\) sits at

\[X_k = x + \ell \sum_{j=1}^{k}\sin\theta_j, \qquad Y_k = -\ell \sum_{j=1}^{k}\cos\theta_j,\]

and the Lagrangian is

\[\mathcal{L} = \tfrac12 M\dot x^2 + \sum_{k=1}^{n}\left[\tfrac12 m\left(\dot X_k^2+\dot Y_k^2\right) + \tfrac12 d\left(\dot X_k-\dot x\right)^2 - mgY_k\right],\]

where the \(d\) terms add an extra mass \(d\) that moves horizontally with each pendulum point. For two pendulums this expands to

\[\begin{aligned} \mathcal{L} ={}& \left(m+\tfrac12 M\right)\dot x^2 + m\ell\,\dot x\left(2\cos\theta_1\,\dot\theta_1+\cos\theta_2\,\dot\theta_2\right)\\ &+ \tfrac12 m\ell^2\left(2\dot\theta_1^2+\dot\theta_2^2\right) + m\ell^2\,\dot\theta_1\dot\theta_2\cos(\theta_1-\theta_2)\\ &+ mg\ell\left(2\cos\theta_1+\cos\theta_2\right)\\ &+ \tfrac12 d\ell^2\left[\cos^2\theta_1\,\dot\theta_1^2+\left(\cos\theta_1\,\dot\theta_1+\cos\theta_2\,\dot\theta_2\right)^2\right]. \end{aligned}\]

There is no analytic solution, so the equations of motion are integrated numerically. To compare different \(n\) fairly, the totals are kept fixed: the rods add up to 10 cm, the bobs to 0.2 kg and the extra masses to 0.1 kg, in a 1 kg container. Starting at rest with every rod at 0.2 rad, a high-accuracy adaptive solver conserves the energy to better than \(10^{-12}\) for every \(n\) from 2 to 5, and fourth-order Runge–Kutta with a 1 ms step agrees with it to better than \(2\times10^{-7}\) rad.

pendulums
The pendulum model at half speed; choose how many pendulums. They hang in a chain from the centre of the surface, top rod teal and bottom rod orange, and the k-th piece of the surface on each side stays perpendicular to rod k. The container is 20 cm wide and is free to move, so the liquid pushes it back and forth; the tick on the ground marks where it started.

More pendulums let the surface bend more: the largest rod angle grows from 0.28 rad with two pendulums to 0.42 rad with five. The lowest sloshing frequency of the chain, found from its small oscillations, settles as \(n\) grows: 9.20, 9.46, 9.61 and 9.70 rad/s for \(n\) = 2, 3, 4 and 5. A real tank of the same size, 20 cm wide with 12 cm of liquid, sloshes at 12.1 rad/s, so with these parameters the chain is about 20 % too slow.

Continuous model: the surface as a wave

The second model has no pendulums. It describes the surface as a smooth curve, the height \(\eta(x, t)\) of the surface above its resting level at each point \(x\) across the container, and asks how that curve moves.

The picture is a guitar string. If one part of a string is pulled up, its neighbours pull it back, and the disturbance travels along the string as a wave. A shallow layer of liquid behaves in the same way: where the surface is raised, the extra weight pushes the water underneath sideways, which lowers that part and raises its neighbours. For small motions this gives the wave equation

\[\frac{\partial^2 \eta}{\partial t^2} + \gamma\,\frac{\partial \eta}{\partial t} = c^2\,\frac{\partial^2 \eta}{\partial x^2}, \qquad c = \sqrt{gh},\]

where \(h\) is the depth of the liquid and \(\gamma\) accounts for friction. Waves cross the container at speed \(c\).

The shaking comes in through the walls. Water cannot flow through a wall, so when the container is pushed sideways with acceleration \(a(t)\), the surface has to meet each wall with slope \(-a/g\). This is the same tilt that a cup of coffee takes when you carry it forward too quickly. Writing the surface as a sum of modes \(\cos(n\pi x/L)\), where \(L\) is the width of the container, turns each mode into a damped oscillator with natural frequency \(\omega_n = n\pi c/L\), driven by the shaking:

\[\ddot q_n + \gamma\,\dot q_n + \omega_n^2\, q_n = \frac{4h}{L}\,a(t), \qquad n = 1, 3, 5, \ldots\]

Only the odd modes are excited: the ones that raise one side of the surface and lower the other. This solution agrees with a direct simulation of the shallow-water equations to 0.2 % of the wave height.

The wave model at half speed, drawn to scale: a 20 cm wide container holding 3 cm of liquid, shaken back and forth over 1.2 cm about once a second (ω = 6 rad/s, a little below the lowest natural frequency ω₁ = 8.5 rad/s). The surface rises at one wall and falls at the other, by up to about 7 mm, and the waves set off at the start slowly die away.

Open questions

  • How should the pendulums define the surface? The construction above, straight pieces perpendicular to each rod, is one choice. One could instead fit a smooth curve through the points, or let the pieces have different widths, and it is not obvious which choice best matches a real surface.
  • Can the pendulum model match a real tank? For small motions, liquid of depth \(h\) in a rectangular tank of width \(L\) sloshes at the frequencies \(\omega_n^2 = g k_n \tanh(k_n h)\) with \(k_n = n\pi/L\). With the parameters above, the chain’s lowest frequency is about 20 % below the tank’s first one. Whether \(m\), \(d\) and \(\ell\) can be chosen to reproduce the whole set is open.
  • Deeper liquid and larger motions. The wave model assumes shallow liquid and small waves. Deep liquid, large sloshing and splashing need more of the full fluid equations.
  • Driving the container. In the pendulum simulation the container moves freely. On a packaging line its motion is prescribed, with sudden starts and stops, which is the case the original paper studies.
  • Comparison with experiment. Filming the surface in a container moved along a rail would test both models directly.

Credits

This began as a group research project at the Edinburgh Scientific Researchers Association with Patrick Truong, Gregory Barbanel and Abdullah Fouzuddeen, whom I thank for their work on it. In October 2026 I redid the calculations and simulations on this page; the parameter values in them are illustrative.

Changes on 25 October 2026

What was wrong. The introduction said the Navier–Stokes equations have no analytic solution. They do in special cases; what they lack is a general closed-form solution.

What changed. The summary is rewritten to explain the two models more clearly. Previously titled “Group Research in fluid behaviours”.

Changes on 26 October 2026

What was wrong.

  • The page described the models only in words.
  • The group’s original calculations contained errors. The solution given for the continuous model satisfied neither its equation nor its initial and boundary conditions; its damping term, \(-d\,(\partial u/\partial t)^2\), did not oppose the motion; three terms of the pendulum Lagrangian were mistyped; and the reported divergence of the two-pendulum simulation could not be reproduced.
  • The continuous model treated the surface as a string held fixed at both walls and pushed up and down everywhere at once. In a real container the surface moves most at the walls, and sideways shaking acts through the walls.

What changed. The page now sets the problem out as a research problem, with corrected equations, new simulations and animations of both models, and a list of open questions. The pendulum model is extended from two pendulums to any number. The continuous model is now the shallow-water wave equation with the walls handled as above. Previously titled “Pendulum Models for Liquid Slosh”.