August 18, 2023
Discussion on HackerNews.
Some people pointed out some flaws in my modelling (eg: assuming zero distance from swing to floor) which I’ve tried to fix. The original maximum distance estimation was around $1m$.
This summer I’ve spent an absurd amount of time reading and learning about the physics of swings. Yes, you read it right, I’ve been learning about the physical processes that happen when a kid is playing with a swing in the park. Blame it on my kids and the countless hours spent enjoying these moments with them. In particular, I read about the physics of pumping a swing and about the physics of jumping from a swing. Amidst my deep dive into swing physics, I came up with a new Olympic sport in which you start seated on a swing with length $L$, your feet comfortably touching the ground. As a countdown of $T$ seconds commences, you embark on the art of swing-pumping. Your challenge is to execute a skillful leap before the countdown reaches zero. With your jump, you travel a distance $d$ from your initial point, aiming to achieve the greatest possible $d$.
The question is then, which is the best method to maximize $d$?
Before I present you with the answer to the question I’ll summarize the learnings I got from reading about the physics of a swing. As usual, you can find all the code I used for this post in my repo.

Notice that 1 and 2 answer a very similar question: what is the optimal time $t$ to jump off, so as to reach farthest. However, these references do not deal with the pumping of a swing, they just assume that you start swinging at some angle $lambda$ and jump at an angle $phi$, without pumping the swing at any point. Solving this problem is interesting, but I think it’s more exciting to solve it when the person swinging can control the system. This makes it feel more like a real game that you can play in a park or at the Olympic Games.
There are several papers about the pumping of a swing 3, 4, and 5 and much more. In this section, I’ll focus in particular on 4.
The model for a swing I’ll use is a rigid dumbbell made up of three masses, suspended by a rigid rod of length $l_1$ attached to the middle mass $m_1$. The distances from $m_1$ to the other masses $m_2$ and $m_3$ are $l_2$ and $l_3$ respectively. The angle of the rod $l_1$ with the vertical is $phi$ and the angle of the dumbbell with the rod is $theta$. In the next figure, you can see a diagram of the system

The Lagrangian of this system is
[begin{align}
mathcal{L} = & frac{1}{2} I_1 dotphi^2 + frac{1}{2} I_2 left(dotphi + dotthetaright)^2 – l_1 N dotphileft( dot phi + dottheta right) cos theta \
&+ M l_1 g cos phi – N g cosleft(phi + thetaright)
end{align}]
where $M = m_1 + m_2 + m_3$, $N = m_3 l_3 – m_2 l_2$, $I_1 = M l_1^2$, and $I_2 = m_2 l_2^2 + m_3 l_3^2$. Therefore, the Lagrange’s equation for $phi$ is
[begin{align}
(I_1 + I_2) ddot phi + M l_1 sin phi = & -I_2 ddot theta – l_1 N dottheta^2 sin theta \
& + l_1 N dottheta^2 cos theta + N g sin(phi + theta) \
& – 2 l_1 N dot theta dot phi sin theta \
& + 2l_1 N ddot phi cos theta
end{align}]
The paper proceeds by assuming the swinger pumps the swing by forcing $theta(t) = theta_0 cos(omega t)$, where $omega$ is the natural angular frequency of the pendulum. Then, they show that there are two regi