Wednesday, November 18, 2009

Sewer-Pipe RAM

A continuing topic in Cryptonomicon is the role of Lawrence P. Waterhouse as one of the independent inventors of the digital computer, during the 1940s. The fullest description of his version of a digital computer appears on pages 744-747. The following are some of the important assertions about its operation.

“Each pipe is four inches in diameter and thirty-two feet long. There must be a hundred of them, ...” “Stuck into one end of each pipe is a little paper speaker ripped from an old radio.” “The speaker plays a signal–a note–that resonates in the pipe and creates a standing wave.” “That means that in some parts of the pipe, the air pressure is low, and in other parts it is high.” “These U-tubes are full of mercury.” “... several U-shaped glass tubes ... are plumbed into the bottom of the long pipe.” “I put an electrical contact into each U-tube–just a couple of wires separated by an air gap. If those wires are high and dry (like because high air pressure in the organ pipe is shoving the mercury down away from them), no current flows. But if they are immersed in the mercury (because low air pressure in the organ pipe is sucking the mercury up to cover them), then current flows between them, because mercury conducts electricity! So the U-tubes produce a set of binary digits that is like a picture of the standing wave–a graph of the harmonics that make up the musical note that is being played on the speaker.” “... all of those pipes come alive playing variations on the same low C.” “The crescents of mercury in all those U-tubes are shifting up and down, opening and closing the contacts, but systematically: ...”

This system has enough problems with physics, that there are several possible orderings for the things to be considered. Let us arbitrarily start with things which are stated to be seen, followed by things which are stated to be heard, to determine whether they are reasonable. We end with things which cannot be seen, but which are the actual behavior.

Each U-tube is a manometer, which responds to the difference between the air pressures applied to the two arms. In every case, one arm is open to the ambient air of the room, which can be taken as having the same pressure at all points. The manometer is itself rather symmetric, and its response can also be described symmetrically. The higher pressure in one arm acts so as to displace the mercury toward the arm with lower pressure. If the open bore of the tube is uniform along its length, which is the simplest way to do the glass-working, then the mercury level changes by the same distance in the two arms, down in one and up in the other. It is perfectly good English, even if not perfectly good physics, to speak of “sucking”. Whether in a soda straw or in a U-tube, it is actually the larger ambient pressure which makes the fluid rise.

It is admittedly nitpicking to point out that the U-tubes are only partially full of mercury. There has to be air space in both arms of each tube, so that mercury can move without spilling out the end of the tube. That air space also allows for the electrical contacts. Stephenson’s description of the motion of the mercury emphasizes the tube arm connected to the pipe, and the contacts there which are activated. He seems to overlook the simultaneous motion in both arms, which could be called 'seesawing'.

It might be useful to put another pair of contacts in the room-air arm of each tube, to provide an unambiguous signal for high pressure. As it stands, the contacts in the pipe-air arm cannot distinguish between the conditions of high pressure and of zero pressure difference there. Both conditions would leave that circuit open.

The motion of the mercury, as described by Stephenson, can be followed by the human eye. It occurs on a time scale of seconds, in response to changes in the audio signals, which can be heard simultaneously by the human ear. This implies that the changes in pressure being detected are quasi-static. The pressure has a constant value for a while, then changes to another value, etc. Unfortunately, a simple manometer will not respond in the manner described, even to quasi-static changes in pressure, because it is itself an oscillatory system. This was recognized in Quicksilver (page 107), when Daniel Waterhouse was visiting Gresham’s College, home of the Royal Society. Among many other things, he saw “A U-shaped glass tube that Boyle had filled with quicksilver to prove that its undulations were akin to those of a pendulum.”

The frequency of oscillation for an idealized manometer depends upon only one adjustable parameter. The open cross-sectional area of the tube is assumed to be uniform along its length, and the arms of the U-tube to be vertical. The length of tube filled with mercury (measured along the centerline) is L. Then the frequency of oscillation is exactly the same as that of a small-angle simple pendulum of length L/2, in the same gravitational field. The density of the fluid and the area of the tube drop out. The factor 2 arises because the restoring force, at an instant when the mercury has been displaced along the tube by x, is the weight of a column of mercury of height 2x. Reasonable values for L might be 10 or 20 centimeters, so that the natural frequency would be about 2 or 1.5 hertz.

Consider a manometer initially in equilibrium. This can be either with equal pressures in the two arms, or with unequal pressures. The manometer itself reveals, by its levels of mercury, the difference in pressures. (Note that the most sensible units to express the pressures are mm-Hg or cm-Hg.) If the pressure in one arm is suddenly changed, the mercury in the manometer cannot instantaneously shift to the new equilibrium position. The system is effectively an oscillator which has just been released from rest, at some displacement from its new equilibrium position. It would then oscillate about that new equilibrium position, for a considerable length of time. Dissipation must be introduced into the manometer, in order to damp the oscillation before the next change in pressure.

The dissipation could be provided by a constriction of the open area of the tube near the bottom of the U, or by a porous plug filling the tube there. In either case, the viscosity of the mercury moving past the structure results in a damping force on the mercury, which is proportional to and opposing the velocity of the ends of the mercury column. The proportionality constant is effectively a 'mechanical resistance'.

If the manometer is under-damped, its motion is oscillatory at a somewhat decreased frequency, with an amplitude that decays exponentially. The decay constant is proportional to the mechanical resistance. The system exhibits mechanical 'ringing', exactly analogous to the electronic ringing in computer circuits, which Stephenson discusses on pages 436 ff in Cryptonomicon. A graph of the position of a mercury surface (versus time) would somewhat resemble the graph of electronic ringing on page 437. (The interested reader is invited to discover any problems in the details of that graph.) The ringing might cause the contacts to be closed and opened several times for a single change of pressure.

This can be avoided by increasing the mechanical resistance until the condition of critical damping is achieved. Then there is no oscillation at all, and the constant of the exponential decay is equal to the angular frequency of the undamped oscillator. This is the condition under which the system reaches equilibrium in the minimum time, after a displacement. For example, after a time equal to one period of the undamped oscillator (1/2 or 2/3 second), a displacement from the new equilibrium position would decay away to about 0.014 of its initial value. That behavior should open or close the contacts cleanly.

Thus, we have found a way to have mercury levels “shifting up and down”. The U-tubes are critically damped, and are responding to quasi-static pressure changes.

Unfortunately, resonant pipes, as described here, cannot sustain a quasi-static pressure different from the ambient pressure. Stephenson never actually says whether the ends of the pipes are open or closed. However, open ends are suggested by the statement about a small speaker stuck into one end, and by the frightfulness of the sound escaping when the computer is operating. If the pipes were closed at both ends, they could indeed support a difference between interior and ambient air pressures. However, that internal pressure would be the same at every point along a pipe. Moreover, there is no mention of a method to change the interior pressure of a pipe quasi-statically. At the very least, it would require large nearby reservoirs of high-pressure air and of near-vacuum, which could be joined to the pipe by large valves. Of course, this is completely ridiculous here, but Daniel Waterhouse’s card-punching machine at Bridewell in 1714 worked in a similar manner, including a mercury manometer to monitor the pressure in the reservoir (pages 420 ff of The System of the World).

Let us finally consider the sound in the pipes as the source of the pressure on the manometers. The terminology used to describe the audio signals supplied to the pipes by the speakers is sufficiently confused, that it is impossible even to determine how much information can be stored in one pipe at a given instant. It seems to be more than one binary digit, which could be indicated by sound being simply off or on. The first mention of “note”as something “... that resonates in the pipe, and creates a standing wave”, implies that a single frequency of oscillation is involved. A standing wave is composed of two identical sinusoidal waves traveling in opposite directions, added together. It is called “standing”, because its characteristic features do not move. Those are the nodes, where the amplitude of the oscillating quantity (here the sound pressure) is zero, and the intervening anti-nodes, where that amplitude is maximum. Resonance is achieved by selecting the frequency so that nodes occur at the effective ends of the pipe. The fundamental mode has a single anti-node at the mid-point of the length of the pipe. The harmonic modes have successively 2, 3, 4, etc. anti-nodes between the effective ends of the pipe.

On the other hand, the later statement about “... the harmonics that make up the musical note ...”, implies that several frequencies are involved in the pipe simultaneously. The same situation is also implied by the statement about “... playing variations on the same low C”. Confusion is especially likely here, because the word “variations” is standardly applied to a musical theme or tune, rather than to a single note. However, if one changes the mix of harmonics which accompany the fundamental, the resultant sound is different. This is, in fact, one of the ways in which one can identify the instrument which is making the sound.

The formal mathematical description (wave function) of a true standing wave is the product of two factors. One factor depends only on time, and is typically sinusoidal at the frequency of the wave, with either constant or exponentially decreasing amplitude. The other factor depends only on position, and is also typically sinusoidal. The zeros are the nodes of the wave, and the maxima and minima are the anti-nodes. This factor contains the information about the relative amplitude and phase of the oscillating quantity along the length of the wave medium. For a superposition of standing waves, the total wave function cannot be factored, so that the condition should not be called a standing wave.

Stephenson’s major misconception here was confusing the space factor for a standing sound wave, with the pressure itself. The space factor is only a mathematical construction, and can be changed quasi-statically. The pressure at any point (other than exactly at the nodes), must oscillate as described by the time factor. In particular, the only difference between a maximum and a minimum in the space factor, is in the phase of the pressure oscillations at those points. It is quite inappropriate to say that the pressure is “high” at one and “low” at the other.

The assertion that the fundamental mode is always present, means that it carries no usable information whatever. Its only function seems to be the frightfulness of the sound itself. If one harmonic mode at a time was produced in each pipe, the sound might best described as “a cacophony of bugle calls.” (The notes standardly produced by a bugle are harmonics 2 through 6 of the fundamental, which is typically not excited.) We have already seen that Lawrence P. Waterhouse could produce bugle calls in an enclosed staircase at the train station on Inner Qwghlm (page 284 of Cryptonomicon). If several harmonic modes are produced simultaneously in each pipe, it might be possible to store more than one bit (binary digit) per pipe. Note, however, that the value zero for any particular bit must be clearly distinguishable from the value zero for any other bit.

The remaining question about audible qualities is how the note fits into the musical scale. If the ambient temperature was about 25 degrees Celsius (77 degrees Fahrenheit), the speed of sound in dry air would be 346.1 meter/second. The effective length of a pipe, including the end correction at both open ends, was 32.2 feet. The wavelength of the fundamental would be twice as long, or 19.63 meters. The fundamental frequency would be 17.63 hertz, and all integer multiples of it would appear as harmonics. If we consider modern orchestral tuning, with A at 440 hertz, then this fundamental was definitely C-sharp, not C (16.35 hertz). There is no obvious physical reason why Waterhouse chose this particular length of pipe. Any shorter length of pipe would have worked as well (or as poorly), except for the perceived frightfulness of notes in this frequency range.

At long last, we are ready to consider the actual response of a manometer to the sound in one of the pipes. The fundamental frequency of the sound is about 10 times the natural frequency of the manometer, and any harmonic frequency is some integer multiple larger than that. Thus we have the generic problem of a mechanical oscillator driven by an oscillatory applied force, at a frequency much larger than its natural frequency. A further simplification can be achieved by assuming that the damping of the manometer is much less than critical damping, which would make the response as large as possible.

The response of such a system always has the form of an oscillation at the frequency of the applied force, with an amplitude and phase which depend upon the applied frequency. Let us specify the amplitude of the sound pressure oscillation by the height H of a mercury column which would produce the equivalent static pressure. Then the amplitude of the oscillating displacement of the mercury surfaces in the manometer is given approximately by H divided by twice the square of the ratio of applied frequency to natural frequency. Thus the useless fundamental frequency would produce an amplitude of about H/200, the possibly useful harmonic of order 2 (the octave) would produce an amplitude of about H/800, etc.

As a ridiculously large estimate of the sound pressure, let us assume that the sound level inside the pipe at one of the U-tubes was 160 decibels absolute. This is ridiculous, because 3-inch diameter paper speakers, from 1940's era AM radios or 78 RPM record players, were very poor transducers at low frequencies. They were certainly not woofers, as used for FM radios and LP record players of later eras. That 160 decibels above the reference level of 20 micro-pascal would be a sound-pressure amplitude of about 2 kilo-pascal, or about 15 mm-Hg. This would produce an oscillation of the mercury with amplitude 0.02 millimeter or less, which is too small to see with the unaided eye. It is also too small to make a reliable contact with wires which had been pushed into the manometer tube by hand. Thus Lawrence P. Waterhouse could not have gotten useful information out of his “sewer pipe RAM”, in the manner described by Stephenson.

Another point which can be mentioned is the phase of the oscillation of the mercury in the manometer. I still find it amusing, because it is initially counter-intuitive. The displacement of a mechanical oscillator, driven at a frequency much larger than its natural frequency, is almost exactly opposite in phase to the applied force. Thus, at the instant when the pressure in the pipe-arm of the U-tube is greatest, the mercury in that arm is at, or close to, its highest point. This is exactly the opposite of Stephenson’s description, which would apply only to (non-existent) quasi-static pressure changes.

To be complete, I must acknowledge one quite accurate piece of historic science reporting, which Stephenson supplied. On page 744 of Cryptonomicon appears: “Pea-sized drops of mercury are scattered around the floor like ball bearings. The flat soles of Comstock’s shoes explode them into bursts rolling in all directions.” I was familiar with five different educational institutions, which were active before, during, and after World War II. One feature they had in common, was mercury in the cracks in the floors of lecture rooms and laboratories, used for introductory courses in physics or chemistry. It came with the territory. Mercury was always being spilled, and the cleanup was always casual. The instructors knew that mercury was dangerous, but they didn’t worry about it. They wouldn’t drink it, or boil it openly, but almost any other manipulation was OK. Military personnel would have been even more casual than educators, because they would not have been concerned about how to pay to replace the spillage.

No comments:

Post a Comment