Phyllotaxis and Fibonacci

3 surprising facts about the cycloid!

Yay! Clickbait for nerds!

What's this?  Read on to find out!



A cycloid is the shape traced out by a dot on the rim of a wheel between two places where it touches the ground when rolling along.  But from here on I'll mean the upside down version of that curve when I use the term.

Fact One: It's the perfect timekeeper!

Better than your granddad's pendulum!
Drop a ball anywhere on this curve, it doesn't matter where, it will take the same time to get back where it started.  Here's why:

If $\theta$ is the angle between the spoke the dot lives on and the vertical then
$$
\begin{align}
x &= r\theta - rsin\theta \\
y &= r + rcos\theta \\
dx &= r(1-cos\theta) \ d\theta \\
dy &= -rsin\theta \ d\theta \\
\end{align}
$$
which allows us to calculate the path length $s$ as a function of $\theta$

$$
\begin{align}
ds^2 &= dx^2 + dy^2 \\
&= r^2 d\theta^2((1-cos\theta)^2 + sin^2\theta)) \\
&= r^2 d\theta^2(2 - 2cos\theta) \\
&= 4 r^2 d\theta^2 sin^2 \frac{\theta}{2} \\
\implies s &= \int ds \\
&= 2 r \int sin \frac{\theta}{2} d\theta \\
&= - 4 r \ cos\frac{\theta}{2}
\end{align}
$$
(setting the constant of integration to zero.) If we now note that $y$ can be rewritten in terms of $s$
$$
\begin{align}
y &= r(1 + cos\theta) \\
&= 2 r\ cos^2\frac{\theta}{2} \\
&= \frac{s^2}{8r}
\end{align}
$$

Then we can write the Lagrangian in terms of $s$ alone

$$
\begin{align}
L &= T - V \\
&= \frac{1}{2}\dot{s}^2 - gy \\
&= \frac{1}{2}\dot{s}^2 - \frac{1}{2}\omega^2 s^2 \\
\end{align}
$$
where $\omega = \frac{1}{2}\sqrt{\frac{g}{r}}$.  This should be familiar as the Lagrangian for the Simple Harmonic Oscillator with fixed period $\frac{2\pi}{\omega}$ and solution

$$
s = A\ sin \omega t + B\ cos \omega t
$$

Fact Two: The wheel rolls along at a fixed speed


Let's try to find a particular solution for the case where the ball starts off with zero velocity at the top left corner:

$$
\begin{align}
\dot{s}(0) &= 0 &\implies A &= 0 \\
s(0) &= -4r &\implies B &= -4r\\
\end{align}
$$

So, comparing our two expressions for s:
$$
-4r\ cos(\omega t) = -4r cos(\frac{\theta}{2})
$$
or
$$
\theta = \pm 2 \omega t + 4\pi n
$$
In other words: paint a dot on the rim of a wheel, roll it along at a constant speed, and the movement of the dot will match the movement of a ball rolling along a cycloid with maximal amplitude (except upside down).  And if you want it to work for more than half a cycle you need to place buffers so that the wheel keeps bouncing back and forth!

$\theta$ vs time



Fact Three:  Every curve of minimum time is a section of the cycloid

Yes, the cycloid solves the Brachistochrone problem!  Let's see why:

Let's look at a small section of a curve as shown above.  We have three points $(x_0,y_0)$, $(x_1,y_1)$, and $(x_2,y_2)$ but we're only going to treat $x_1$ as variable and we're going to see what we can say about a value of $x_1$ that minimises the time.

First we need to write the time in terms of $s$ and the speed $\dot{s}$
$$
\begin{align}
t &= t_1 + t_2 \\
&= \frac{s_1}{\dot{s}_1} + \frac{s_2}{\dot{s}_2}\\
\end{align}

$$
If $x_1$ minimises $t$ then $\frac{dt}{dx_1} = 0$ or
$$
\frac{1}{\dot{s}_1}\frac{ds_1}{dx_1} +
\frac{1}{\dot{s}_2}\frac{ds_2}{dx_1} = 0 \tag{1}
$$
This is because $\dot{s}$ is a function of height and is independent of $x_1$.  Let's work out those derivatives now:
$$
\begin{align}
 &s_1^2 = x_1^2 + \delta y ^2 \\
\implies  &\frac{ds_1}{dx_1}s_1 = 2x_1 \\
\implies  &\frac{ds_1}{dx_1} = \frac{x_1}{s_1} \tag{2} \\
&s_2^2 = (x_2-x_1)^2 + \delta y ^2 \\
\implies &2 \frac{ds_2}{dx_1}s_2 = -2(x_2-x_1) \\
\implies &\frac{ds_2}{dx_1} = \frac{x_1 - x_2}{s_2} \tag{3}
\end{align}
$$

Substituting (2) and (3) into (1) gives
$$
\frac{1}{\dot{s}_1}\frac{x_1}{s_1} + \frac{1}{\dot{s}_2}\frac{x_1-x_2}{s_2} = 0
$$
which rearranges to give
$$
\left[\frac{1}{\dot{s}}\frac{\delta x}{\delta s}\right]_{y_1} =
\left[\frac{1}{\dot{s}}\frac{\delta x}{\delta s}\right]_{y_2}
$$
or, more succinctly
$$
\frac{1}{\dot{s}}\frac{dx}{ds}
$$
is CONSTANT!

Note that $\dot{s}$ is just a function of $y$ and $\frac{dx}{ds}$ is the cosine of the incline.  Anyway the last step is to show that the same is true for the cycloid:

$$
\begin{align}
\frac{dx}{ds} &= \frac{dx/d\theta}{ds/d\theta} \\

&=  \frac{1-cos\theta}{2\ sin \frac{\theta}{2}} \\
&=  \frac{2 - 2\ cos^2 \frac{\theta}{2}}{2\ sin \frac{\theta}{2}} \\
&=  \frac{2\ sin^2 \frac{\theta}{2}}{2\ sin \frac{\theta}{2}} \\
&=  sin \frac{\theta}{2} \tag{1}\\
\frac{1}{2}\dot{s}^2 &= g (2r - y) \\
&= g(r - r\ cos\theta) \\
&= gr(1 - cos\theta) \\
&= 2gr sin^2 \frac{\theta}{2} \tag{2}\\
(1) + (2) &\implies \\
\frac{1}{\dot{s}} \frac{dx}{ds} &= \frac{sin \frac{\theta}{2}}{2\ \sqrt{gr}sin \frac{\theta}{2}} \\
&= \frac{1}{2\ \sqrt{gr}} \\
\end{align}
$$
which is also a CONSTANT, and in fact any constant can be achieved just by varying $r$.

Code for the animation



#!/usr/bin/python2
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from numpy import array, linspace, sin, cos, sqrt, pi, arccos

g = 9.81

# Choose r to get freq (see (2) below)
period = 2
freq = 1./period
r = g / ((4 * pi * freq)**2)

# Integrating sqrt(dx^2+dy^2), where x = r*theta - sin(theta) and y = r + r*cos(theta):
# s(t) = -4 * r * cos(theta/2) .......................... (1)
#
# Writing the Lagrangian in terms of s and obtaining the E-L equation:
# s"(t) = -g/(4 * r) * s(t) ............................. (2)
#
# Solving for s(t) given s'(0) = 0 and s(0) = -4 * r:
# s(t) = -4 * r * cos(omega * t) ........................ (3)
#
# where
omega = 0.5 * sqrt(g/r)

# Plot the cycloid and a point at the top left
theta = linspace(0, 2*pi, 1000)
x = r * (theta - sin(theta))
y = r * (1 + cos(theta))
margin = r
fig = plt.figure()
ax = plt.axes(xlim=(x[0] - margin, x[-1] + margin), ylim=(0 - margin ,2*r + margin))
ax.set_aspect('equal')
ax.axis('off')
line_obj = ax.plot(x, y)[0]
point_obj = ax.scatter([x[0]], [y[0]])
#circle_obj, = ax.plot(r * sin(theta), r * (1 + cos(theta)))

# Update the point
def update(frame):
    t = frame * dt
    # (1) and (2) => theta = 2 * arccos(cos(omega * t))
    _theta = 2 * arccos(cos(omega * t))
    _x = r * (_theta - sin(_theta))
    _y = r * (1 + cos(_theta))
    p = array([[_x,_y]])
    point_obj.set_offsets(p)
    #circle_obj.set_xdata(r * (sin(theta) + _theta))
    #return (line_obj, point_obj, circle_obj)
    return (line_obj, point_obj)

# Animate one period
dt = 1./50
ani = animation.FuncAnimation(fig, update, frames=int(period / dt), interval=1000 * dt, repeat=True)
#ani.save('output.gif', dpi=80, writer='imagemagick')
plt.show()

Comments