THE PHYSICS OF VIBRATING STRINGS
Vibrating strings are key components of many musical instruments, such as guitars, violins, and pianos. Hence, if we want to appreciate the physics of these instruments, we must begin with the physics of a vibrating string. To a first approximation, all strings are created equal, as all are described by the wave equation
where y is the displacement of the string from its equilibrium position, which is a function of position along the string, x, and time, t. But since guitars sound different from violins, and both sound different from pianos, we know that there must be more to the story than (1). This section of the course begins with a discussion of the wave equation and how to attack it numerically. This brings out some nice lessons in numerical stability. It turns out that the Courant condition, which concerns how to best choose the temporal and spatial grid sizes in a finite difference treatment, can be easily understood from the physics of the wave equation. We then consider waves moving on strings in several different contexts, including plucked guitar strings, and piano strings as they are struck by a (piano) ``hammer.''
To construct a numerical scheme for attacking the wave equation, we discretize x and t in units of and , so that , and write the derivatives in finite difference form
The symbol is used here to emphasize that this is only an approximation; there are correction terms which can be important. Rearranging (2) gives
where . Thus, if we know the string configuration at time steps n and n-1, we can calculate the configuration at step n+1. The initial conditions will depend on how the string is excited, and we will now consider two cases.
Some results obtained with the algorithm (3) are shown in Fig. 1. Here the initial string profile (shown at the top of the figure) was chosen to be triangular, with the string at rest, as would be appropriate for a plucked guitar string. The kink associated with this pluck is seen to split into two separate kinks, one propagating to the left and one to the right, which reflect from the ends of the string. In our simulation we kept the ends of the string fixed, so the reflections are inverted.
Figure 1: Waves propagating on a string with fixed ends. The string had a length of 0.65 m with c=200 m/s, as would be appropriate for a guitar string. The simulation used the values , and . The initial string profile is given at the top, and successive traces (moving from top to bottom) show the string at progressively later times. For clarity, each trace is shifted downwards from the previous one.
The astute reader will recognize that (3) bears a strong resemblance to a no-frills Euler algorithm. While the Euler method is a very simple and useful approach for many problems, it is known to fail miserably for some situations that involve oscillatory motion, such as a simple harmonic oscillator or planetary motion. Wave motion is also a type of oscillation, so one might have expected that an Euler approach would fail here too. However, the results in Fig. 1 suggest that it works quite nicely. Understanding why it works so well provides a useful lesson in numerical methods, and (as was noted above) leads to a derivation of the Courant condition for the stability of the algorithm.
Once we have obtained the solution for the string displacement as a function of time, as in the above figure, we can then discuss the sound which is produced and its associated spectrum. This brings us to several important issues and techniques, including spectrum analysis, the Fourier transform, and the Fast Fourier Transform.
We next proceed to the case of a piano. A piano string is set into motion by the blow from a ``hammer,'' which is actually just a wooden mallet covered with a compressible layer of felt. While our first urge might be to treat the felt as a simple spring describable by Hooke's law, it turns out that life is not this simple. Experiments have found that the restoring force for felt depends on the rate at which it is compressed, and the preceding compression history. Because of this hysteresis, a full, general treatment of the piano hammer problem has not yet been worked out. However, it is not hard to give a fairly good approximate approach, which is basically equivalent to the best that has been done to date in the research literature.
We can add the hammer to the simulation by treating it as a mass which strikes our numerical string at a certain location, with the hammer-string interaction force given by
where z is the amount which the felt is compressed, the exponent describes how the stiffness varies with compression, and K is a force constant. Here g(x) is a function which describes how the hammer force is distributed along the string. This can be accommodated by letting g(x) be a gaussian function centered at point where the middle of the hammer meets the string, with a full width which corresponds to the width of the hammer. (Note that (4) has been obtained from direct experimental measurements.) In a typical case, the hammer meets the string a distance 1/8 from one end, and has a width of about 1 cm. The strategy then is to begin at t=0 with the string in its undisplaced state (y=0 everywhere) and give the hammer some initial velocity. When the two meet, the hammer felt is compressed by an amount equal to the difference between the hammer position and the string position at the strike point, resulting in an interaction force which acts on both the string and the hammer. This causes the string to move, and the hammer to eventually rebound. Some results from such a simulation are given in Fig. 2, which shows the string profile during the initial hammer-string impact (0.3 ms), just after the hammer falls away from the string (2.1 ms), and while the string is vibrating freely (3.0 ms). Here we have used string and hammer parameters appropriate for the note middle C on a piano. The calculated hammer-string contact time is 2.1 ms, which is quite close to typical measured values.
Figure 2: Simulation of a piano string. The string and hammer parameters we used are appropriate for a string near middle C. The string profile is shown at several different times after impact with the hammer.
These results can also be compared to those for the plucked guitar string, and differences in the spectra of guitar and piano tones can be identified and understood. Other topics of interest can also be addressed, including damping, and the effect of string stiffness.