Worksheet: wave.mw
Fourier Sine Series
Solution to the Wave Equation
This worksheet examines the sine series that arises in a separation of variables
solution for the wave equation :
=
0 < x < L u(0,t)=u(L,t)=0
with initial condition
u(x,0)=F(x)=L/2-abs(x-L/2) 0 < x< L
(x,0)=G(x)=0 0 < x< L
 |
 |
(1) |
Least Squares Approximation of The Initial Condition
Let's approximate the initial condition F(x) with the sum of sines that came from separation of variables.
 |
(1.1) |
 |
(1.2) |
| > |
a:=n->(2/L)*int(F(x)*f(n),x=0..L); |
 |
(1.3) |
| > |
seq(a[n]=a(n),n=1..10); |
![a[1] = `+`(`/`(`*`(4), `*`(`^`(Pi, 2)))), a[2] = 0, a[3] = `+`(`-`(`/`(`*`(`/`(4, 9)), `*`(`^`(Pi, 2))))), a[4] = 0, a[5] = `+`(`/`(`*`(`/`(4, 25)), `*`(`^`(Pi, 2)))), a[6] = 0, a[7] = `+`(`-`(`/`(`*`...](wave_images/wave_11.gif) |
(1.4) |
| > |
g:= M->sum(a(m)*f(m),m=1..M); |
 |
(1.5) |
 |
(1.6) |
| > |
s:=seq(g(2*M-1),M=1..6); |
Wave Equation Solution via Fourier Sine Series
We can now reconstitute our solution to the heat equation, with the initial condition we derived.
| > |
u:=M->sum(a(m)*sin(m*Pi*x/L)*cos(c*m*Pi*t/L),m=1..M); |
 |
(2.1) |

 |
(2.2) |
| > |
plot3d(up,x=0..L,t=0..2.0,style=patchcontour,shading=zhue,axes=boxed); |
| > |
animate(up,x=0..L,t=0..2*L,frames=51); |