At the start of the lecture, we continue deriving the Fourier coefficients for the problem of zero Dirichlet conditions on the wave equation. We show that
u(x,t)=∞∑n=0sin(nπxL)[Ancos(nπctL)+Bnsin(nπctL)]
where An=2L∫L0u0(x)sin(nπxL) dx.
and Again we recognise this as the sine series, so we now need to equate Bn=2L(Lnπc)∫L0v0(x)sin(nπxL) dx.
The next thing we did was look at the solution for the plucked string of example 16.4 in the notes. This yields the above Fourier series solution with Bn=0 and An=4n2πsin(nπ/2).
We showed off the simulations of the problem using the following code.
Plucked string
- % MA20223 Plucked String
- clear
- close all
- % c = 1
- x = linspace(0, pi, 100);
- t = linspace(0, 2*(2*pi), 80);
- Afunc = @(k) 4*(-1)^k/((2*k+1)^2*pi);
- un = @(x, t, k) Afunc(k)*sin((2*k+1)*x).*cos((2*k+1)*t);
- Nk = 80;
- figure(1)
- for j = 1:length(t)
- tt = t(j);
- u = 0;
- for k = 0:Nk
- u = u + un(x,tt,k);
- end
- plot(x, u);
- ylim([-pi/2, pi/2]);
- drawnow
- if j == 1
- pause;
- else
- pause(0.1)
- end
- end