ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1....

15
ME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L, by displacing it from equilibrium and releas- ing it from rest. The displacement is produced by pulling the string upward a distance d at the point x 0 in the interval [0,L]. We define the piecewise linear displacement dis[x,x 0 ], and then define a function initgraph[x 0 ] which gives a graph of the initial displacement for excitation at x 0 . 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. In[1]:= dis[x_,x0_] := If[(x <= x0),d*x/x0,d*(L - x)/(L-x0)] In[2]:= initgraph[x0_]:= Plot[dis[x,x0],{x,0,L},AspectRatio -> 0.2,ImageSize->250, PlotLabel -> Row[{"Excitation at x0 = ",x0}]]; 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. In[3]:= L = 1.0 H** m **L; In[4]:= d = 0.5 * L; In[5]:= c = 1.0 H** mês **L; In the examples of sections 2 and 3, we look at the cases of midpoint excitation and excitation at the 0.95L, very near the bridge of the guitar. The intial-value problem for the displacement y(x,t) is given below.

Transcript of ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1....

Page 1: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

ME 201/MTH 281/ME400/CHE400Guitar Modes

1. Introduction

In class we looked at the motion produced in a stretched string of length L, by displacing it from equilibrium and releas-ing it from rest. The displacement is produced by pulling the string upward a distance d at the point x0 in the interval [0,L]. Wedefine the piecewise linear displacement dis[x,x0], and then define a function initgraph[x0] which gives a graph of the initialdisplacement for excitation at x0. The vertical scale is greatly exaggerated by choosing d = 0.5L. In the motion of a real guitarstring, the vertical displacements are very small compared with the string length.

In[1]:= dis[x_,x0_] := If[(x <= x0),d*x/x0,d*(L - x)/(L-x0)]

In[2]:= initgraph[x0_]:= Plot[dis[x,x0],{x,0,L},AspectRatio -> 0.2,ImageSize->250,PlotLabel -> Row[{"Excitation at x0 = ",x0}]];

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 choiceshave no significant effect on the visualization of the modes excited by the excitation. In the last part of the notebook, where weproduce the sounds associated with the vibration, we will use realistic values of the parameters.

In[3]:= L = 1.0 H** m **L;

In[4]:= d = 0.5 * L;

In[5]:= c = 1.0 H** mês **L;

In the examples of sections 2 and 3, we look at the cases of midpoint excitation and excitation at the 0.95L, very near the bridgeof the guitar.

The intial-value problem for the displacement y(x,t) is given below.

(1)

Page 2: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

(1)

∂2y

∂ t2= c2

∂2y

∂x2, 0 < x < L, t > 0

with y H0, tL = 0, y HL, tL = 0, y Hx, 0L= dis@x, x0D,∂y

∂ tHx, 0L = 0.

We showed in class that the solution to this problem is given by

(2)

y Hx, tL = ‚n=1

An cos Hn w1 tL sinnpx

L,

where w1 =cp

L, and An =

2 Hd LL2

x0 H1 - x0L

sin Hnpx0 êLL

n2 p2.

Following our discussion in class, we examine the amplitudes of the modes relative to the first mode. We use lower case a forthese normalized amplitudes:

(3)an =An

A1=

sin Hnpx0 êLL

n2 sin Hpx0 êLL.

We define this function for Mathematica.

In[6]:= a@n_D :=Sin@n * p * x0 ê LD

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

In[7]:= m@x_, t_, n_D := N@a@nD * Cos@Hn * p * c * tL ê LD * Sin@Hn * p * xL ê LDD

The function modearray[t,r], defined below, produces a table of graphs of the first r modes at time t. This function is suitable foruse in a GraphicsArray plot.

In[8]:= 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 ani-mated, the sequence shows the modes dynamically.

In[9]:= makearray@p_D := Module@8n<,Do@Print@Show@GraphicsGrid@Partition@modearray@HH2. * n * LL ê Hp * cLL, 6D, 3DD, ImageSize Ø

400, PlotLabel Ø Row@8"t = ", PaddedForm@HH2 n LL ê Hp cLL, 85, 3<D<DDD, 8n, 0, p - 1<DD;

Now we look at two examples.

2. Mid-Point Excitation

We set x0 = 0.5L. A graph of the displacement is given below.

In[10]:= x0 = 0.5 * L;

2 guitar.nb

Page 3: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

In[11]:= initgraph@x0D

Out[11]=

0.2 0.4 0.6 0.8 1.0

0.10.20.30.40.5

Excitation at x0 = 0.5

Let's look at a table of values for the amplitudes a[n], for the first 10 modes.

In[12]:= TableFormATableA9n, PaddedFormAIfAIAbs@a@nDD < 10-4M, 0, a@nDE, 85, 3<E=, 8n, 1, 10<E,

TableHeadings Ø 8None, 8"n", " a@nD"<<E

Out[12]//TableForm=n a@nD1 1.0002 0.0003 -0.1114 0.0005 0.0406 0.0007 -0.0208 0.0009 0.01210 0.000

We see several interesting things from this table. First, the even harmonics are absent. This is a symmetry result. Theexcitation is symmetric about the string midpoint, but the even harmonics are anti-symmetric about the midpoint, hence they areabsent. Second we see that the amplitude of the fundamental is much larger than the other odd harmonics present. Thus wecome 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 amovie of the first six modes. The even modes (2,4,6) are absent, and the first mode has a much greater amplitude than modes 3or 5. We group all of the graphs in the sequence into the first cell, so that only the first array is visible. To animate thesequence, select the graphs and go to the menu Graphics->Rendering->Animate Selected Graphics.

In[13]:= x0 = 0.5 * L;

In[14]:= makearray@48D;

n = 1 n = 2 n = 3

n = 4 n = 5 n = 6

t = 0.000

For visualization in the printed version of this notebook, we make a short sequence of 8 graph arrays in one period.

In[15]:= makearray@8D

guitar.nb 3

Page 4: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

n = 1 n = 2 n = 3

n = 4 n = 5 n = 6

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

t = 0.750

4 guitar.nb

Page 5: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

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

t = 1.500

n = 1 n = 2 n = 3

n = 4 n = 5 n = 6

t = 1.750

guitar.nb 5

Page 6: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

3. Excitation Very Near the Bridge

Now we repeat the above graphics construction, but this time for an x0= 0.95, very near the end of the string. Thedisplacement is shown below.

In[16]:= x0 = 0.95 * L;

In[17]:= initgraph@x0D

Out[17]=

0.2 0.4 0.6 0.8 1.0

0.10.20.30.40.5

Excitation at x0 = 0.95

Let's look at a table of values for the amplitudes a[n], for the first 10 modes.

In[18]:= TableFormATableA9n, PaddedFormAIfAIAbs@a@nDD < 10-4M, 0, a@nDE, 85, 3<E=, 8n, 1, 10<E,

TableHeadings Ø 8None, 8"n", " a@nD"<<E

Out[18]//TableForm=n a@nD1 1.0002 -0.4943 0.3224 -0.2355 0.1816 -0.1447 0.1168 -0.0959 0.07810 -0.064

There is no longer the symmetry that we had with midpoint excitiation, and all the modes are present. Furthermore, the ampli-tudes of the first few higher harmonics are appreciable, and this excitation will give a different sound (as we will see in section 5of this notebook).

Now we construct construct an array with 48 time increments per period. When you animate the array, you will see amovie of the first six modes.

In[19]:= makearray@48D;

n = 1 n = 2 n = 3

n = 4 n = 5 n = 6

t = 0.000

There is much more energy in the higher modes for this case than for the midpoint excitation. This accounts for the harsh tinnysound of a guitar string plucked near the bridge.

6 guitar.nb

Page 7: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

There is much more energy in the higher modes for this case than for the midpoint excitation. This accounts for the harsh tinnysound 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.

In[20]:= makearray@8D;

n = 1 n = 2 n = 3

n = 4 n = 5 n = 6

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

guitar.nb 7

Page 8: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

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

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

8 guitar.nb

Page 9: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

n = 1 n = 2 n = 3

n = 4 n = 5 n = 6

t = 1.750

4. Modal Energy

As shown in class, the solution given by equation (2) has a constant energy E, given by

(4)E = ‚n=1

En, where En = IT p2 n2 An2Më H4 LL .

Enis 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 thefirst mode, given by

(5)en =En

E1= n2 an2 =

sin Hnpx0L

n sin Hpx0L

2

.

In this section we show the normalized energy of the first ten harmonics as a function of the excitation point x0. We us bargraphs to show the energy. In version 7 of Mathematica, the bar graph routines are part of the kernel, and do not need to beloaded in

The function e[n,x0] gives the normalized energy in the nth mode for an excitation point x0.

In[21]:= 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 excita-tion point is x0.

In[22]:= harmlist[x0_,j_] := Module[{ans}, ans = {};Do[ans = Append[ans,e[k,x0]],{k,1,j}]; ans]

The function harmonic[x0,n] produces the bar chart of the energy for the first n harmonics when the excitation point is x0.

In[23]:= 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. Weexpect this because the excitation is symmetric about the midpoint and these modes are antisymmetric 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 zeroenergy.

guitar.nb 9

Page 10: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

In[24]:= harmonic[0.5*L,10]

Out[24]=

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 menuGraphics->Rendering->Animate Selected Graphics. From the animation of the graph sequence, we see that the modalenergies become asymptotically equal as we approach the bridge of the guitar.

In[25]:= Do[Print[harmonic[0.5 + j*0.005,10]],{j,0,99}];

For visualization in the printed version of this notebook, we construct a sequence of 10 energy graphs with the excitationpoint varying from 0.5 to 0.95 in increments of 0.05.

In[26]:= Do[Print[harmonic[0.5 + j*0.05,10]],{j,0,9}]

10 guitar.nb

Page 11: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

guitar.nb 11

Page 12: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

12 guitar.nb

Page 13: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

guitar.nb 13

Page 14: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

5. Hearing the Sounds

In this section, we use Mathematica to play the sounds produced by plucking the string. In particular, we will see howthe sound changes from midpoint excitation to excitation near the bridge. In the previous section, we used convenient values forc and L because these values gave the same picture sequence as would have more realistic values. For hearing the sounds,however, we have to use values that approximate the real ones for a guitar. We will look at the high-E string of the guitar, whichhas a fundamental frequency of

In[27]:= n = 330.0 H** Hz **L;

The length of the string is

In[28]:= L = 0.65 H** m **L;

This corresponds to a wave speed of

In[29]:= c = 2 * L * n H** mês **L

Out[29]= 429.

The nth harmonic is given by

In[30]:= tone@t_, n_D := N@a@nD * Cos@Hn * p * c * tL ê LDD

Now we set x 0to the midpoint and then we play for five seconds the sound associated with the first six harmonics. As we sawbefore, the amplitudes of the various harmonics (the a[n]'s) depend on the value of x0.

In[31]:= x0 = 0.5 * L;

We call the sum of the first six harmonics midtone.

In[32]:= midtone@t_D = Sum@tone@t, nD, 8n, 1, 6<D

Out[32]= 1. [email protected] tD + 3.06162 µ 10-17 [email protected] tD - 0.111111 [email protected] tD -

1.53081 µ 10-17 [email protected] tD + 0.04 Cos@10 367.3 tD + 1.02054 µ 10-17 Cos@12 440.7 tD

Now we create midtone. To play it, click on the small triangle at the lower left.

14 guitar.nb

Page 15: ME 201/MTH 281/ME400/CHE400 Guitar · PDF fileME 201/MTH 281/ME400/CHE400 Guitar Modes 1. Introduction In class we looked at the motion produced in a stretched string of length L,

In[33]:= sound1 = Play@midtone@tD, 8t, 0, 5<D

Out[33]=

Now we set x0to 0.95*L corresponding to a position very near the bridge. We call the sum of the first 6 harmonics bridgetone.

In[34]:= x0 = 0.95 * L;

In[35]:= bridgetone@t_D = Sum@tone@t, nD, 8n, 1, 6<D

Out[35]= 1. [email protected] tD - 0.493844 [email protected] tD + 0.322457 [email protected] tD -0.234837 [email protected] tD + 0.180806 Cos@10 367.3 tD - 0.143656 Cos@12 440.7 tD

Now we create bridgetone. Click on the triangle to play it.

In[36]:= sound2 = Play@bridgetone@tD, 8t, 0, 5<D

Out[36]=

Bridgetone is clearly tinny and much harsher than midtone. Neither tone sounds like a guitar, and you might want to think aboutthe many reasons for that.

guitar.nb 15