Harmonic Engine

A wave as a sum of turning wheels

Abstract

A pin on a turning wheel, read through a scotch yoke, writes a sine exactly: the pin's radius is the amplitude, the wheel's gearing the frequency, the pin's angle the phase. Carry wheels on each other's pins and the last pin is the vector sum of their radii, so the yoke writes a Fourier series. This companion builds three results on that construction. First, a series aimed at a curve with a jump overshoots beside the jump by the same fraction of the jump whatever the number of wheels, $(2/\pi)\operatorname{Si}(\pi) - 1 \approx 0.179$, which Michelson and Stratton's eighty-term harmonic analyser drew in 1898 and Gibbs explained. Second, the same wheels read a quarter turn round write the conjugate series, which at a jump grows without bound as $(2/\pi)(\ln 4N + \gamma)$. Third, with speeds set by the Moon and Sun and amplitudes and phases set by a port, the machine is Kelvin's tide predictor: San Francisco's ten largest constituents give a great diurnal range of 1.756 m over nineteen years against 1.780 m observed, and two wheels at a time beat at the synodic, tropical and anomalistic months to six significant figures. Every number here is measured off the machine's own output.


1. One wheel

1.1 The scotch yoke

A pin at radius $r$ on a wheel turned through $\theta$ is at $(r\cos\theta,\ r\sin\theta)$. A scotch yoke is a frame with a slot at right angles to its own guide: the pin slides freely along the slot, and the frame can move only along the guide. It therefore takes the pin's coordinate along the guide and discards the other:

$$y_{\text{yoke}} = r\sin\theta.$$

The linkage approximates nothing. Sampled at 4096 points over a turn, the curve one wheel writes has a total harmonic distortion of $9\times10^{-16}$, the rounding error of the arithmetic, and differs from $\sin\theta$ by less than $10^{-15}$ anywhere.

1.2 A harmonic is three numbers

A sinusoid $a\sin(n\theta + \varphi)$ is fixed by an amplitude, a frequency and a phase, and a crank has a part for each: the pin's radius, the ratio of the gears that turn the wheel relative to the input shaft, and the angle the pin is set at when the input is at zero. A negative coefficient is a pin set half a turn round, since a radius cannot be negative. Paper fed past the pen at a rate proportional to $\theta$ turns the motion into a graph against angle, or against time if the input turns uniformly.

1.3 Why not a connecting rod

The familiar way to turn rotation into reciprocation is the slider-crank of a piston engine, and it is not a sine generator. With crank radius $r$, rod length $l$ and $\lambda = r/l$, the slider's distance from top dead centre is

$$\frac{x}{r} = (1-\cos\theta) + \frac{1}{\lambda}\left(1-\sqrt{1-\lambda^2\sin^2\theta}\right),$$

and the square root puts every even harmonic into the motion. Measured by Fourier analysis of the exact displacement:

$l/r$second harmonic of displacement, relative to firstsecond harmonic of acceleration, relative to firstfirst-order theory, $\lambda$
3.50.07290.29180.2857
40.06350.25400.2500

Acceleration multiplies harmonic $n$ by $n^2$, so the displacement ratio is multiplied by four. The result is the secondary inertia force that an inline four-cylinder engine cannot cancel between its pistons (Heywood 1988). The yoke's is zero, which is why the pen hangs from one.


2. Wheels on wheels

2.1 The chain

Mount a second wheel on the first wheel's pin, geared to turn at its own rate relative to the frame, and the second pin is at the sum of two vectors. A chain of wheels, each carried on the previous pin, puts the last pin at

$$P(\theta) = \sum_k a_k, e^{,i(n_k\theta + \varphi_k)},$$

and the yoke writes $\operatorname{Im} P$. This is the construction of Ptolemaic epicycles, whose power to approximate any periodic motion is that of a trigonometric series (Hanson 1960). The harmonic machines of the nineteenth century summed the same terms by other means: Kelvin's tide predictor with a wire passed over a pulley on each crank, so that the wire's end moved by the sum of their displacements (Thomson 1881), and Michelson and Stratton's analyser with eighty springs acting on a single lever (Michelson and Stratton 1898). Any exact summing linkage writes the same curve; the epicycle chain makes the addition of vectors visible.

2.2 The targets

With unit amplitude and the jumps at $0$ and $\pi$:

targetserieswheels
square$\dfrac{4}{\pi}\displaystyle\sum_{n\ \text{odd}} \frac{\sin n\theta}{n}$odd ratios, radii $4/n\pi$
sawtooth$\dfrac{2}{\pi}\displaystyle\sum_{n\ge1} (-1)^{n+1}\frac{\sin n\theta}{n}$all ratios, radii $2/n\pi$, every other pin reversed
triangle$\dfrac{8}{\pi^2}\displaystyle\sum_{n\ \text{odd}} (-1)^{(n-1)/2}\frac{\sin n\theta}{n^2}$odd ratios, radii $8/n^2\pi^2$

The analyser can be run backwards over the machine's own output: a Fourier sum over one turn of the written curve, knowing nothing of the wheels, recovers their radii. For eighty square-wave wheels the first harmonic found is 1.273240, which is $4/\pi$ to the six places given.

2.3 The selector

A selector that moves the yoke from one pin to a second set a quarter turn round makes the same machine write $\cos\theta$. For a chain the equivalent is to turn the whole chain on its mounting through an angle $\psi$, so that the yoke reads

$$\operatorname{Im}!\left(e^{i\psi}P\right) = \operatorname{Im}P\cos\psi + \operatorname{Re}P\sin\psi.$$

At $\psi = 0$ this is the sine channel and at $\psi = 90^\circ$ the cosine channel, $\operatorname{Re}P$. Between them it adds the same phase to every harmonic, which keeps every amplitude and changes the shape of the sum completely.


3. The overshoot that stays

3.1 History

Michelson and Stratton's analyser of 1898 set eighty harmonics by hand and drew their sum. Its drawings of a square wave have flat tops, steep sides, and beside every jump a spike the flat top does not have. Michelson wrote to Nature that year about what the Fourier series of a curve with a jump converges to (Michelson 1898). Gibbs replied in the same journal (Gibbs 1898), and in a correction the following spring described the limiting curve correctly, with the overshoot (Gibbs 1899). Wilbraham had found and computed it in 1848, in a paper overlooked for decades (Ustina 1974; Hewitt and Hewitt 1979). Bôcher gave the general theory in 1906 and named it after Gibbs.

3.2 The constant

The partial sum of $N$ odd harmonics of the square wave has derivative

$$S_N'(\theta) = \frac{4}{\pi}\sum_{k=1}^{N}\cos\big((2k-1)\theta\big) = \frac{2}{\pi},\frac{\sin 2N\theta}{\sin\theta},$$

so its first maximum after the jump is at $\theta = \pi/2N$, and its height there tends to

$$\frac{2}{\pi}\operatorname{Si}(\pi) = \frac{2}{\pi}\int_0^\pi \frac{\sin t}{t},dt = 1.178979744\ldots$$

The playground computes the constant from the power series of the sine integral, a route that shares nothing with summing wheels, and compares the machine with it:

wheels $N$highest pointat, degrees$\pi/2N$, degrees
11.2732409090
21.2004224545
51.1823281818
101.17981499
201.1791884.54.5
401.1790322.252.25
801.1789931.1251.125
3201.1789810.281250.28125

The overshoot is $0.179$ of the half-jump from five wheels on. More wheels move it toward the jump and make it narrower, and do not lower it. The series converges at every point, the spike passing each fixed $\theta$ as $N$ grows, and not uniformly, since the largest error never shrinks.

3.3 Measured against the curve

A square wave is flat beside its jumps, so its peak and its overshoot are the same thing. A sawtooth rises toward its jump, so its peak sits below the Gibbs height:

wheelssawtooth peakat, degreesexcess over the sawtooth at the peak
101.086693163.640.177602
801.166609177.780.178954
3201.175863179.440.178978

Measured as the excess over the target, the sawtooth's overshoot converges to the same $0.178980$, faster than its peak does. The constant belongs to the jump, not to the curve. A triangle wave has no jump, and its partial sums approach it from below everywhere: at forty wheels the highest point is 0.994934 and the RMS error $3.3\times10^{-4}$.


4. The other channel

On the cosine channel the square wave's wheels write the conjugate series,

$$\tilde S_N(\theta) = \frac{4}{\pi}\sum_{k=1}^{N}\frac{\cos\big((2k-1)\theta\big)}{2k-1},$$

whose limit is $\frac{2}{\pi}\ln\left|\cot\frac{\theta}{2}\right|$: finite everywhere except at the jumps, where it has a logarithmic singularity. Its partial sums have a spike at each jump growing without bound (Zygmund 2002):

wheels $N$highest point, measured$\frac{2}{\pi}(\ln 4N + \gamma)$
52.275662.27461
102.716152.71588
403.598443.59842
804.039704.03969
3204.922244.92224

The pen has stops at 1.42 times full scale, so on this channel it hits them from two wheels at unit gain. The two channels of one chain are a function and its conjugate: where one converges with a bounded overshoot, the other diverges.


5. Tides

5.1 The harmonic method

The tide at a port is, to a good approximation, a sum of sinusoids,

$$h(t) = \sum_j A_j\cos(\omega_j t - g_j),$$

whose speeds $\omega_j$ are fixed by the motions of the Moon and Sun (Doodson 1921) and whose amplitudes $A_j$ and phases $g_j$ are fixed by the port and found by analysing its record. Kelvin's first tide-predicting machine, built in 1872 to 1873, summed ten such terms with a wire over pulleys and turned a year of a port's tides into a curve in a few hours (Thomson 1881). Machines of this kind computed the world's tide tables for most of a century, including the tides for the Normandy landings (Parker 2011).

In the playground the first wheel is M2 and one turn is one M2 cycle, 12.4206 hours. Each other constituent is a wheel of ratio $\omega_j/\omega_{M2}$, radius $A_j$ and phase $90^\circ - g_j$.

5.2 San Francisco

NOAA lists thirty-seven harmonic constants for station 9414290 at San Francisco. The machine carries the ten largest of the thirty faster than five degrees an hour:

constituentdescriptionamplitude, mphase $g$, degreesspeed, degrees per hour
M2principal lunar semidiurnal0.576208.228.984104
K1lunar diurnal0.370225.415.041069
O1lunar diurnal0.230208.413.943035
S2principal solar semidiurnal0.137216.230.000000
N2larger lunar elliptic semidiurnal0.122183.228.439730
P1solar diurnal0.114222.114.958931
Q1larger lunar elliptic diurnal0.041202.413.398661
K2lunisolar semidiurnal0.040206.030.082138
NU2larger lunar evectional0.026189.928.512583
M4shallow-water overtide of M20.022136.857.968210

The phases are used without the astronomical arguments $V_0 + u$ and the nodal factors $f$ that tie them to a date (Schureman 1958), so the machine writes a tide with the station's constituents and phase relations rather than a prediction for a particular day.

5.3 Datums

A tide gauge's record is reduced to datums by finding every high and low water, keeping the higher high and the lower low of each tidal day, and averaging (NOAA 2003). The machine's record is reduced the same way:

recordGTMNDHQDLQ
ten constituents, one year1.7581.2360.1670.354
ten constituents, nineteen years1.7561.2340.1690.353
all thirty short-period constituents, one year1.7561.2350.1770.344
all thirty-seven, one year1.7561.2350.1770.344
ten, with nodal factors, 18.61 years1.7621.2360.1700.356
observed, NOAA epoch 1983 to 20011.7801.2480.1860.346

GT is the great diurnal range, mean higher high water minus mean lower low water; MN the mean range; DHQ and DLQ the mean diurnal inequalities of the high and the low waters; all in metres. Over nineteen years the machine is 1.4% short in GT and 1.1% in MN. The other twenty-seven constituents bring the inequalities closer and leave the ranges where they were; the long-period ones change no range by more than half a millimetre; the 18.6-year nodal modulation adds 5 mm. What remains is not in the harmonic constants: it is the part of the gauge's record that is not a sum of these sinusoids.

A year is not quite long enough for the ranges to settle. Started at different moments, a year of the ten-constituent machine gives a great diurnal range between 1.730 and 1.758 m: a year holds only two cycles of the slowest beats among the ten, K1 against P1 and S2 against K2, each 182.6 days.

5.4 Where the inequality falls

K1 and O1 together turn at exactly the speed of M2,

$$\omega_{K1} + \omega_{O1} = 15.041069 + 13.943035 = 28.984104 = \omega_{M2},$$

because their astronomical arguments add up to M2's (Doodson 1921). The phase combination

$$g_{K1} + g_{O1} - g_{M2} = 225.4 + 208.4 - 208.2 = 225.6^\circ$$

therefore never drifts. It is a constant of the station, and it decides where the difference between a day's two tides shows: near $180^\circ$ the diurnal wave peaks with a low water and the low waters are unequal, near $0^\circ$ with a high water. San Francisco's 225.6° puts most of the inequality in the lows, 0.346 m against 0.186 m observed.

The selector adds one phase $\psi$ to every constituent, which a change of date cannot do, and so changes this constant by $\psi$. Each row is a year of machine tide:

selector, degrees$g_{K1}+g_{O1}-g_{M2}$GTMNDHQDLQ
0225.61.7571.2350.1670.354
45180.61.7061.2350.0800.391
90135.61.7651.2360.1650.364
13590.61.7891.2350.2730.281
18045.61.7571.2350.3540.167

At 45° the two high waters of a day come closest to equal and the lows carry the inequality; at 180° every constituent is reversed, the tide is upside down, and the two inequalities trade places. The mean range does not move.

5.5 Beats

Two wheels of nearly the same speed beat, and the envelope of what the pen writes is the length of the chain, $|P|$, which the pen never draws. The playground measures the envelope's period from the spacing of its maxima over 400 days:

pairbeat, measured, daysastronomy, daysmonth
M2 + S214.7652914.76529half the synodic month: springs and neaps
K1 + O113.6607813.66079half the tropical month: the Moon's declination
M2 + N227.5545927.55455the anomalistic month: perigee to perigee

M2 and S2 come into step at every new and full Moon. K1 and O1 do so twice a tropical month, as the Moon crosses the equator. N2 exists to carry the monthly change in the Moon's distance, so M2 and N2 beat once per anomalistic month, not twice.


6. How the model is checked

Nineteen calibration cases, every predicted value measured off what the machine writes:

casemeasuredexpectedsource
one wheel, largest difference from $\sin\theta$00kinematics of the yoke
one wheel, harmonic distortion00a sinusoid has one component
quarter turn, largest difference from $\cos\theta$00$\cos\theta = \sin(\theta + 90^\circ)$
square wave, fundamental found by analysis1.2732401.273240$4/\pi$
highest point, 80 wheels1.1789931.178980Gibbs 1899; Hewitt and Hewitt 1979
where it sits, degrees1.1251.125$\pi/2N$ (Bôcher 1906)
overshoot at 10 wheels0.1798140.178980$(2/\pi)\operatorname{Si}(\pi) - 1$
sawtooth overshoot, 320 wheels0.1789780.178980Bôcher 1906
triangle, highest point, 40 wheels0.9949341uniform convergence
cosine channel, 80 wheels4.03974.0397$\frac{2}{\pi}(\ln 4N + \gamma)$ (Zygmund 2002)
$(2/\pi)\operatorname{Si}(\pi)$1.1789797441.178979744Hewitt and Hewitt 1979
San Francisco GT, m1.75561.780NOAA CO-OPS
San Francisco MN, m1.23381.248NOAA CO-OPS
San Francisco DLQ, m0.35320.346NOAA CO-OPS
San Francisco DHQ, m0.16860.186NOAA CO-OPS
M2 + S2 beat, days14.7652914.76529half the synodic month
K1 + O1 beat, days13.6607813.66079half the tropical month
M2 + N2 beat, days27.5545927.55455the anomalistic month
slider-crank secondary ratio, $l/r = 3.5$0.29180.2857Heywood 1988

The tidal datums are the only cases where the machine meets observations, and they are where it is least exact: 1.4% in GT, 9% in DHQ. The slider-crank's 2% is the second-order term the first-order theory leaves out.


7. What this does not do

It is kinematic. No mass, friction, backlash, or stretch of wire or spring. Kelvin's machine and Michelson's analyser had elastic and frictional errors this one does not.

Its gear ratios are exact. Real tide machines approximated each speed ratio by trains of whole-number tooth counts, and a ratio wrong by one part in a million shifts M2 by a quarter of a degree over a year.

Its tides carry no calendar. Without $V_0 + u$ and $f$, the curves have San Francisco's shape and predict no particular day.

It draws the chain smaller as it grows. A real machine fixes its crank radii and chooses a lever ratio; the playground rescales the drawing and lengthens the lever so that any reach fits the flywheel. The curve written is the same.


References

  • Bôcher, M. (1906). Introduction to the theory of Fourier's series. Annals of Mathematics 7(3), 81. https://doi.org/10.2307/1967238
  • Doodson, A. T. (1921). The harmonic development of the tide-generating potential. Proceedings of the Royal Society of London A 100, 305. https://doi.org/10.1098/rspa.1921.0088
  • Gibbs, J. W. (1898). Fourier's series. Nature 59, 200. https://doi.org/10.1038/059200b0
  • Gibbs, J. W. (1899). Fourier's series. Nature 59, 606. https://doi.org/10.1038/059606a0
  • Hammack, B., Kranz, S. and Carpenter, B. (2014). Albert Michelson's Harmonic Analyzer: A Visual Tour of a Nineteenth Century Machine that Performs Fourier Analysis. Articulate Noise Books.
  • Hanson, N. R. (1960). The mathematical power of epicyclical astronomy. Isis 51(2), 150. https://doi.org/10.1086/348869
  • Hewitt, E. and Hewitt, R. E. (1979). The Gibbs-Wilbraham phenomenon: an episode in Fourier analysis. Archive for History of Exact Sciences 21, 129. https://doi.org/10.1007/BF00330404
  • Heywood, J. B. (1988). Internal Combustion Engine Fundamentals. McGraw-Hill.
  • Michelson, A. A. (1898). Fourier's series. Nature 58, 544. https://doi.org/10.1038/058544b0
  • Michelson, A. A. and Stratton, S. W. (1898). A new harmonic analyzer. American Journal of Science 5(25), 1. https://doi.org/10.2475/ajs.s4-5.25.1
  • NOAA (2003). Computational Techniques for Tidal Datums Handbook. NOAA Special Publication NOS CO-OPS 2.
  • NOAA CO-OPS. Harmonic constituents and datums for station 9414290, San Francisco, CA. https://tidesandcurrents.noaa.gov/stationhome.html?id=9414290
  • Parker, B. (2011). The tide predictions for D-Day. Physics Today 64(9), 35. https://doi.org/10.1063/PT.3.1257
  • Schureman, P. (1958). Manual of Harmonic Analysis and Prediction of Tides. US Coast and Geodetic Survey Special Publication 98.
  • Thomson, W. (1881). The tide gauge, tidal harmonic analyser, and tide predicter. Minutes of Proceedings of the Institution of Civil Engineers 65, 2. https://doi.org/10.1680/imotp.1881.22262
  • Ustina, F. (1974). Henry Wilbraham and Gibbs phenomenon in 1848. Historia Mathematica 1, 83. https://doi.org/10.1016/0315-0860(74)90173-6
  • Wilbraham, H. (1848). On a certain periodic function. Cambridge and Dublin Mathematical Journal 3, 198.
  • Zygmund, A. (2002). Trigonometric Series, 3rd edition. Cambridge University Press.