Академический Документы
Профессиональный Документы
Культура Документы
Guitar Modes
Mathematica 7
1. Introduction
In class we looked at the motion produced in a stretched string of length L, by displacing it from equilib-
rium and releasing it from rest. The displacement is produced by pulling the string upward a distance d at the
point x0 in the interval [0,L]. We define the piecewise linear displacement dis[x,x0 ], and then define a function
initgraph[x0 ] which gives a graph of the initial displacement for excitation at x0 . The vertical scale is greatly
exaggerated by choosing d = 0.5L. In the motion of a real guitar string, the vertical displacements are very small
compared with the string length.
For simplicity in this part of the notebook, we choose the length to be 1 m and the wave speed to be 1
m/s. These choices have no significant effect on the visualization of the modes excited by the excitation. In the
last part of the notebook, where we produce the sounds associated with the vibration, we will use realistic values
of the parameters.
d = 0.5 * L;
2 y 2 y
= c2 , 0 < x < L, t > 0
t2 x2
(1)
y
with y H0, tL = 0, y HL, tL = 0, y Hx, 0L = dis@x, x0 D, Hx, 0L = 0.
t
We showed in class that the solution to this problem is given by
npx
y Hx, tL = An cos Hn w1 tL sin O,
n=1 L
(2)
cp 2 Hd LL2 sin Hnpx0 LL
where w1 = , and An = .
L x0 H1 - x0 L n2 p2
Following our discussion in class, we examine the amplitudes of the modes relative to the first mode. We use
lower case a for these normalized amplitudes:
An sin Hnpx0 LL
an = = . (3)
A1 n2 sin Hpx0 LL
We define this function for Mathematica.
Sin@n * p * x0 LD
a@n_D :=
n2 * Sin@p * x0 LD
We will use these normalized amplitudes in producing both sounds and graphs.
The complete nth mode in this normalization is given by the function m[x,t,n], defined by
modearray[t_,r_] := Module[{n},Table[Plot[m[x,t,n],{x,0,L},
Axes -> False, Frame -> True,
PlotRange->{-1,1},FrameTicks -> None,
DisplayFunction -> Identity,
PlotLabel -> Row[{"n = ",PaddedForm[n,2]}]
],{n,1,r}]]
Finally the function makearray[p] produces a sequence of p arrays going through one period of the fundamental.
When animated, the sequence shows the modes dynamically.
guitar.nb 3
Finally the function makearray[p] produces a sequence of p arrays going through one period of the fundamental.
When animated, the sequence shows the modes dynamically.
2. Mid-Point Excitation
We set x0 = 0.5L. A graph of the displacement is given below.
x0 = 0.5 * L;
initgraph@x0D
Excitation at x0 = 0.5
0.5
0.4
0.3
0.2
0.1
Let's look at a table of values for the amplitudes a[n], for the first 10 modes.
TableFormA
TableA9n, PaddedFormAIfAIAbs@a@nDD < 10-4 M, 0, a@nDE, 85, 3<E=,
8n, 1, 10<E, TableHeadings 8None, 8"n", " a@nD"<<E
n a@nD
1 1.000
2 0.000
3 -0.111
4 0.000
5 0.040
6 0.000
7 -0.020
8 0.000
9 0.012
10 0.000
We see several interesting things from this table. First, the even harmonics are absent. This is a symme-
try result. The excitation is symmetric about the string midpoint, but the even harmonics are anti-symmetric
about the midpoint, hence they are absent. Second we see that the amplitude of the fundamental is much larger
than the other odd harmonics present. Thus we come reasonably close to exciting a pure single frequency tone
with this excitation.
Now we construct construct an array with 48 time increments per period. When you animate the array,
you will see a movie of the first six modes. The even modes (2,4,6) are absent, and the first mode has a much
greater amplitude than modes 3 or 5. We group all of the graphs in the sequence into the first cell, so that only
the first array is visible. To animate the sequence, select the graphs and go to the menu Graphics->Rendering-
>Animate Selected Graphics.
4 guitar.nb
Now we construct construct an array with 48 time increments per period. When you animate the array,
you will see a movie of the first six modes. The even modes (2,4,6) are absent, and the first mode has a much
greater amplitude than modes 3 or 5. We group all of the graphs in the sequence into the first cell, so that only
the first array is visible. To animate the sequence, select the graphs and go to the menu Graphics->Rendering-
>Animate Selected Graphics.
x0 = 0.5 * L;
makearray@48D;
t = 0.000
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
For visualization in the printed version of this notebook, we make a short sequence of 8 graph arrays in
one period.
makearray@8D
t = 0.000
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
guitar.nb 5
t = 0.250
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
t = 0.500
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
t = 0.750
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
6 guitar.nb
t = 1.000
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
t = 1.250
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
t = 1.500
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
guitar.nb 7
t = 1.750
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
x0 = 0.95 * L;
initgraph@x0D
Excitation at x0 = 0.95
0.5
0.4
0.3
0.2
0.1
Let's look at a table of values for the amplitudes a[n], for the first 10 modes.
8 guitar.nb
TableFormA
TableA9n, PaddedFormAIfAIAbs@a@nDD < 10-4 M, 0, a@nDE, 85, 3<E=,
8n, 1, 10<E, TableHeadings 8None, 8"n", " a@nD"<<E
n a@nD
1 1.000
2 -0.494
3 0.322
4 -0.235
5 0.181
6 -0.144
7 0.116
8 -0.095
9 0.078
10 -0.064
There is no longer the symmetry that we had with midpoint excitiation, and all the modes are present. Further-
more, the amplitudes of the first few higher harmonics are appreciable, and this excitation will give a different
sound (as we will see in section 5 of this notebook).
Now we construct construct an array with 48 time increments per period. When you animate the array,
you will see a movie of the first six modes.
makearray@48D;
t = 0.000
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
There is much more energy in the higher modes for this case than for the midpoint excitation. This accounts for
the harsh tinny sound of a guitar string plucked near the bridge.
For visualization in the printed version of this notebook, we construct a short sequence of 8 graph arrays
in a period.
makearray@8D;
guitar.nb 9
t = 0.000
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
t = 0.250
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
t = 0.500
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
10 guitar.nb
t = 0.750
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
t = 1.000
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
t = 1.250
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
guitar.nb 11
t = 1.500
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
t = 1.750
n = 1 n = 2 n = 3
n = 4 n = 5 n = 6
4. Modal Energy
As shown in class, the solution given by equation (2) has a constant energy E, given by
E = 2 2 2
n= 1 En , where En = (Tp n An )/(4L) . (4)
En is the energy in the nth mode and is also constant. We will work with the energy in the nth mode relative to
the energy in the first mode, given by
2
En sin Hnpx0 L
en = = n2 a2n = . (5)
E1 n sin Hpx0 L
In this section we show the normalized energy of the first ten harmonics as a function of the excitation point x0 .
We us bar graphs to show the energy. In version 7 of Mathematica, the bar graph routines are part of the kernel,
and do not eed to be loaded in
The function e[n,x0] gives the normalized energy in the nth mode for an excitation point x0.
e[n_,x0_] := N[(Sin[n*p*x0])^2/(n*n*(Sin[p*x0])^2)]
The function harmlist[x0,j] produces a list suitable for a bar plot, showing the energy for the first j harmonics
when the excitation point is x0 .
12 guitar.nb
The function harmlist[x0,j] produces a list suitable for a bar plot, showing the energy for the first j harmonics
when the excitation point is x0 .
harmonic[x0_,n_] := BarChart[harmlist[x0,n],
PlotRange -> {{0,n+1},{0.0, 1.0}},
AxesLabel -> {"Harmonic","Energy"},ImageSize->400,
PlotLabel -> Row[{"x0 = ",PaddedForm[x0,{5,3}]}]]
We look first at the energy when the excitation point is the midpoint. We see that modes 2, 4, 6, 8, 10,...
are absent. We expect this because the excitation is symmetric about the midpoint and these modes are antisym-
metric about the midpoint. Similar symmetries show up at other values of x0 . In fact you can show that any
mode which has a node at x0 will have zero energy.
harmonic[0.5*L,10]
Now we make a systematic study of the effect of the excitation point by constructing a sequence of 100
graphs from x0 = 0.5 to x0 = 0.99. The 100 graphs are collected in the cell below. To animate them, select the
cell, and then go to the menu Graphics->Rendering->Animate Selected Graphics. From the animation of the
graph sequence, we see that the modal energies become asymptotically equal as we approach the bridge of the
guitar.
Do[Print[harmonic[0.5 + j*0.005,10]],{j,0,99}];
guitar.nb 13
For visualization in the printed version of this notebook, we construct a sequence of 10 energy graphs
with the excitation point varying from 0.5 to 0.95 in increments of 0.05.
Do[Print[harmonic[0.5 + j*0.05,10]],{j,0,9}]
14 guitar.nb
guitar.nb 15
16 guitar.nb
guitar.nb 17
18 guitar.nb
c = 2 * L * n H** ms **L
429.
x0 = 0.5 * L;
We call the sum of the first six harmonics midtone.
guitar.nb 19
Now we create midtone. To play it, click on the small triangle at the lower left.
Now we set x0 to 0.95*L corresponding to a position very near the bridge. We call the sum of the first 6 harmon-
ics bridgetone.
x0 = 0.95 * L;
Bridgetone is clearly tinny and much harsher than midtone. Neither tone sounds like a guitar, and you might
want to think about the many reasons for that.