MATH529L03: Wave equation

?Sound

Sound[{SoundNote["A"]}]

Sound[{SoundNote["C"],SoundNote["G"]}]

Sound[{SoundNote["F"],SoundNote["F"],SoundNote["F"],SoundNote["D"]}]

Sound[{Play[10 Sin[1000t(1+t^2)],{t,0,.2}],Play[10 Sin[500t (1+t^3)],{t,0,.5}]}]

freq=110;
Sound[{Play[Sin[2π freq t],{t,0,1}]}]

nT=20; (* Number of terms in trigonometric series *)

α = Table[ n (π/L),{n,1,nT}]

f[x_,p_,L_]:=If[ x<=p L,0.02x/(p L),0.02(L-x)/(L- p L)]

Plot[f[x,0.2,1.],{x,0,1},AspectRatio->Automatic]

F[c_]=Integrate[0.02 x/(p L)Sin[c x],{x,0,p L}]+Integrate[0.02 (L-x)/(L- p L)Sin[c x],{x,p L,L}]

A=Chop[Simplify[Table[(2/L) F[α[[n]]],{n,1,nT}]] /. p->0.2]

u[x_,t_,a_]=Sum[ A[[n]] Sin[ α[[n]] x ] Cos[a α[[n]] t] ,{n,1,nT}] /. L->1

Plot[Table[u[x,t,20.],{t,0,0.4,0.02}],{x,0,1},PlotRange->All,Frame->True,PlotLabel->"Wave equation solution", FrameLabel->{"x","u(x,t)"},GridLines->Automatic]

Manipulate[Plot[u[x,t,20.],{x,0,1},PlotRange->{All,{-0.025,0.025}},Frame->True,PlotLabel->"Wave equation solution", FrameLabel->{"x","u(x,t)"},GridLines->Automatic],{t,0,0.4,0.005}]

u[0.2,t,20.]

Sound[{Play[u[0.2,t,20.],{t,0,0.2}]}]

Sound[{Play[Sum[u[x,t,800.],{x,0.1,0.9,0.1}],{t,0,0.8}]}]

Questions to investigate

Effect of pluck shape upon sound

Make initial shape of plucked string to be:
(1) triangle;
(2 )sine wave centered on string;
(3) double sine wave with a node on the middle of the string;
(4) parabolic initial pluck shape.
In each case produce the sound emitted by the string.