Pumping a swing with parametric resonance

You sit on a swing of length l=2\mbox{ m}, swinging at a small amplitude. How much time will it take to double the amplitude, by moving your center of mass up and down by h=0.3\mbox{ m}?

I’m gearing up to teach junior/senior-level classical mechanics again in the fall and remembered this half-baked idea from the last time I was teaching this course. My department is fortunate enough to have several TeachSpin torsional oscillators at our disposal, and I’ve used them for the lab component in this course. Most basically, these devices are experimental realizations of a simple harmonic oscillator with a really high Q-factor and a natural frequency on the order of seconds. Students can cook up experimental realizations of all the standard harmonic oscillator theory from this course with a really nice device they can touch and see working. It’s great for that.

But I’m repeatedly taken aback by all the non-standard stuff one can explore with this device. For starters, it’s actually easy to introduce three types of drag: sliding (constant) friction, viscous (proportional to velocity) drag, and high-Reynolds number (quadratic) drag. The linear drag is the only one students typically encounter in textbooks, presumably because it’s the only case with a clean, analytic solution. There’s a number of AJP/EJP articles about dealing with these special cases in great detail (see here, here, here, here, and references therein for starters). In the slow-dissipation limit, where only a small fraction of the energy is lost to friction during each cycle, it’s possible to obtain the trajectory approximately for arbitrary drag. We have a really nice lab where students investigate the validity of this approximation by comparing to a numerical solution, and then they end up doing the experiment to confirm that the approximate solution works pretty well in the experimentally-relevant range of parameter space.

Back in 2020, I saw David Van Baak give a talk at the AAPT Summer Meeting about using the torsion oscillator to investigate parametric resonance. In a nutshell, if the resonant frequency of an oscillator “wiggles” slightly at twice the resonant frequency, the oscillator’s amplitude increases. The TeachSpin oscillator can be tweaked to realize this phenomenon, and as I recall, the data looked pretty impressive. But how to model it? But how to model it without some fairly elaborate analysis involving the dreaded Mathieu functions?

Quick side note: here’s a great AJP article for learning about Mathieu functions.

At the top of this post is a homework question from when I was a TA for this course as a graduate student. The official textbook was Landau and Lifshitz with a generous dose of Arnold. I put more work into keeping on top of this class than I did in some of my own classes. But what a ride it was. As it turns out, I stayed up all night trying to resolve that question with exact analysis and got nowhere close to having physical insight. I suppose what follows represents some growth.

The classic example of parametric resonance is the aforementioned swing situation: how does one increase the amplitude while swinging on an ordinary playground swing? Intuitively, children (and some adults) know exactly what to do: “pump.”

The above cartoon depicts various poses one can take during a swing. But it’s not terribly descriptive, because one might vary the pose depending on the cycle. The question of interest here is whether physics suggests an optimal position for each point in the full (forward + backward) swing cycle. For that, we need a model.

Toy models make things as simple as possible, but not simpler. The leg motion suggests a double-pendulum-like system, but that’s fairly complicated to analyze. In essence, pumping legs has the effect of shifting the center of mass up and down along the radial direction aligned with the chains of the swing. So taking a cue from the problem stated at the top of this post, let’s just consider a simple (point mass) pendulum in which the length varies periodically at some arbitrary (angular) frequency \omega. Specifically, we’ll take the instantaneous pendulum length to be r(t) = \ell + h(t) = \ell + h\cos(\omega t+\phi). The cosine function gives us the basic kind of oscillation we’ll need with two parameters (\omega, \phi) to be determined.

The “parametric resonance” arises from the natural frequency of this oscillator being \omega_{0} = \sqrt{g/\ell} for small amplitudes. By varying \ell periodically, we will find a condition in which resonance occurs. In the absence of appreciable damping, this parametric drive will lead to an amplitude that increases exponentially with time.

Even this simple model leads to a pretty complicated equation of motion. The beauty of physical models is that they allow one to make reasonable approximations to simplify the math. For example, an oscillator with a slowly increasing amplitude could reasonably be expected to have the angular behavior given by

\displaystyle \theta(t) = A(t)\cos(\omega_{0} t)

Here it’s assumed that the variation of the length \ell is small enough so that the natural resonant frequency \sqrt{g/\ell} still retains some meaning. Additionally, we’ll work in the small-angle (|\theta(t)| \ll 1) regime so that the un-driven system is just a harmonic oscillator. Our goal is to calculate the approximate form of A(t) and show that one can infer physically-motivated information about how to pump a swing from the dynamics.

Packaging the solution as a time-dependent amplitude multiplied by a simple cosine function also works when one looks for the solution of a damped oscillator with arbitrary types of drag. For this more complex situation, we employ a Lagrangian to obtain the equation of motion:

\displaystyle L = \frac{1}{2}m\left[\dot{x}^{2} + \dot{y}^{2}\right] - mgy = \frac{1}{2}m\left[\dot{r}^{2} + r^{2}\dot{\theta}^{2}\right] - mgr(1-\cos\theta).

The Euler-Lagrange equation for the angular coordinate yield

\displaystyle \ddot{\theta} + \frac{2\dot{r}}{r}\dot{\theta}+ \frac{g}{r}\sin\theta  = 0.

Under the small-angle approximation, \sin\theta \simeq \theta, this looks a lot like the equation of motion for a damped oscillator. But the coefficient of \dot{\theta} isn’t constant. The radial coordinate r gives the instantaneous length of the pendulum r(t) = \ell + h(t), and by choosing its dynamics appropriately, we can effectively produce a type of anti-drag that causes the amplitude of the swing to increase—our original goal!

To keep things PG, I’ll just point out the broad strokes of the calculation. Taking the energy of the pendulum, E(t) = \frac{1}{2}m\dot{r}^{2} + \frac{1}{2}mr^{2}\dot{\theta}^{2} + mgr(1-\cos\theta), one can take its time derivative, apply the equation of motion, and use the small-angle approximation to find

\displaystyle \dot{E}(t) \approx m\dot{r}\ddot{r} - mr\dot{r}\dot{\theta}^{2} + \frac{1}{2}mg\dot{r}\theta^{2}

Using \theta(t) = A(t)\cos(\omega_{0} t), taking appropriate derivatives, and applying the approximations \sin\theta \simeq \theta and |h(t)| \ll \ell liberally, one can also show that

\displaystyle \dot{E}(t) = m\dot{r}\ddot{r}+\frac{1}{2}mg\dot{r}A^{2} + mgrA\dot{A}

Equating the two expressions, and performing some simplification gives the equation of motion for the amplitude

\displaystyle \frac{\dot{A}}{A} = -\frac{3}{2}\frac{\dot{r}}{r}\sin^{2}(\omega_{0}t)

Given that r(t) = \ell + h\cos(\omega t + \phi), this simplifies to

\displaystyle \frac{\dot{A}}{A} \approx \frac{3\omega h}{4\ell}\sin(\omega t + \phi)(1-\cos(2\omega_{0}t))

Now we could deal with this mess, but we don’t actually have to solve the equation as written. In this case, at least, we can isolate the important part. To do so, let us proceed as if we wish to solve it by integrating both sides. Supposing the swing starts from some initial angular displacement \theta(0) = \theta_{0}, we have

\displaystyle \ln\frac{A(t)}{\theta_{0}} = \frac{3\omega h}{4\ell}\int_{0}^{t}\sin(\omega t'+\phi)(1-\cos(2\omega_{0}t'))dt'

If one unpacks the integrand and uses \sin\alpha\cos\beta = \frac{1}{2}(\sin(\alpha+\beta) + \sin(\alpha - \beta)), it becomes clear that all but one term on the right-hand side just oscillate. The (potentially) important term is

\displaystyle \int_{0}^{t}\frac{1}{2}\sin(\omega t' - 2\omega_{0}t'-\phi)dt'

Now if \omega \rightarrow 2\omega_{0}, this term gives

\displaystyle \int_{0}^{t}\frac{1}{2}\sin(\omega t' - 2\omega_{0}t'-\phi)dt' \rightarrow \frac{1}{2}\sin(-\phi)\int_{0}^{t}dt' = \frac{\sin(-\phi)}{2}t

Being proportional to t, this special term has the ability to grow rather than just oscillate. So now we have two important insights: (1) the amplitude can change appreciably if the driving frequency is twice that of the natural resonant frequency of the swing (\omega = 2\omega_{0}), and (2) it will grow most rapidly if the drive has the phase \phi = -\frac{\pi}{2}. Under those conditions, we get the really simple result:

\displaystyle \theta(t) = \theta_{0}\exp\left[\frac{3\sqrt{g}h}{4\ell^{\frac{3}{2}}}t\right]\cos\left(\sqrt{\frac{g}{\ell}}t\right).

With such brutal approximations involved, it’s important to think about the validity of this simple result. The expression above assumes a tiny change in the center of mass of the swinger and also that the amplitude is also fairly small. It’s going to break down. Exponential growth of anything doesn’t last indefinitely, but it’s a useful model at short timescales.

To touch base with the problem posed at the top, we can set \theta(t) = 2\theta_{0} to get the doubling time

\displaystyle t_{double} = \frac{4\ln2 \ell^{\frac{3}{2}}}{3\sqrt{g}h}

For what it’s worth, this works out to about 2.8 seconds for the parameters in the original question. That can be compared to the natural period of the swing itself also being T = 2\pi\sqrt{\ell/g} \approx 2.8 seconds. So the upshot here is that two pumps (one full swing cycle) should be enough to double the amplitude, provided the amplitude is small.

But the fun happens when we go beyond “the answer.” The approximations leading to this result escalated pretty quickly. Is there any reason to trust the conclusion? For starters, we can look at the expression itself. Dimensional analysis doesn’t let us guess the answer here since there’s a dimensionless constant \frac{h}{\ell}. But we can at least check that it seems reasonable that the doubling time increases with increasing \ell and smaller h. That increasing g shrinks the doubling time might seem odd at first, but gravity is the agent driving the natural oscillation of the pendulum. We assume the rider is able to move up and down by h, but the work required to do so is going to increase with larger g.

It’s also straightforward to integrate the equation of motion numerically. In this case, one doesn’t have to make any approximations (\sin\theta \approx \theta, h\ll \ell, etc.). The plot above shows the approximate solution we obtained as compared to a numerical solution for the parameters stated at the top of this post. The initial amplitude is taken to be \theta_{0} = 0.1 \ll 1. In spite of all the approximations thrown at this system, the numerical approach and approximate result are almost indistinguishable for at least a full cycle. Both the amplitude and phase start to deviate from the simple form we obtained, but there are several cycles where the agreement is shockingly not bad. And it’s clear that the amplitude does roughly double during each full cycle. I’m not reading too much into the particulars of the breakdown because this was about the simplest integration scheme one could employ and expect reasonable results. For more accurate results, one would want to use RK4 or something similar. One can fiddle about with parameters and initial conditions to explore how this agreement gets better or worse. Unsurprisingly, so long as the conditions of the approximations are met, the two curves tend to agree with each other pretty well.

An impressive number of papers in the late 20th century have been devoted to analyzing the motion of a child on a swing with varying levels of sophistication. This one from 1998 has a pretty extensive list of references, but you can find a ton of them by just searching “swing motion” on the AJP site. Most of these works do more than to throw a cosine function into the pump function and see what happens. The article of Wirkus, Rand and Ruina linked above is probably my favorite, as it uses a step-function to model different strategies for pumping and links the functional forms to the types of sitting and standing approaches to actually pumping a swing. But the moment step functions enter a problem like this, the only viable course of action is a numerical approach.

So what’s the point in the silly cosine function we used here? It doesn’t closely resemble the actual motion of a real-life child who increases the swing amplitude almost effortlessly. It helps to go sit on a swing and observe how we naturally do this, but there’s also a great Sixty Symbols video on this. The cosine makes sense from the pragmatic point of view of trying to get as far as possible analytically while still preserving some essence of the original system. That’s the idea of a toy model. Introducing some type of periodic drive—which is the core of a pump, common to all approaches—the resonance that occurs when the pump frequency is twice that of the empty swing just pops out. Driving the system on resonance, the characteristic exponential growth is also seen. The quantitative predictions here likely don’t hold up to close scrutiny when compared to an actual child swings. But the underlying mechanism for how something like this happens is easily seen.

It’s a fun exercise to think about how \ell + h\cos(2\omega t -\frac{\pi}{2}) (shown above alongside the pendulum cycle) lines up (or doesn’t) to natural swing motion. That is, what kind of contortions would a child have to perform to mimic this drive. The diagrams in this article that depict two strategies for pumping (sitting vs. standing) are pretty instructive. The cosine was chosen for analytic simplicity, so there’s no claim this is an optimal strategy. Overfitting these toy models to realistic complications is a slippery slope. With great power, there must also come great responsibility.

2 thoughts on “Pumping a swing with parametric resonance

  1. I love this! I think I’ll be firing up Mathematica tonight to have some fun with this approach.

    Like

Leave a comment