This lecture will do apply separation of variables and Fourier series in order to solve for the wave equation on a finite interval.
We look to solve utt=c2uxxu(0,t)=0=u(L,t)u(x,0)=u0(x),ut(x,0)=v0(x),
which models the deflection of a string of length L given initial displacement and velocities.
In the video, we'll cover the separation of variables procedure, which follows Sec. 16.2 of the notes. The procedure is virtually identical to the case of the heat equation, with the exception that the equation for two components,
u(x,t)=X(t)T(t),
yields a second-order ODE for T(t) instead of a first-order ODE. Consequently, the relevant solutions are sinusoidals for both X and T. We will show that the separable solutions are given by
un(x,t)=sin(nπxL)[Ancos(nπctL)+Bnsin(nπctL)]
Once you sum this over all the positive integers, then you will obtain the general solution in terms of the Fourier series. To this solution, we must satisfy the initial displacement and velocities.
I want to help you imagine what the modes, un, look like. For simplicity, take the length L=π. Also, we may take c=1. The individual modes we want to examine are: un(x,t)=sin(nx)[Ancos(nct)+Bnsin(nct)]
Demonstration of the modes
- % Code for MA20223 30 Mar 2020
- clear
- close all
- % Length and time
- L = pi; T = 2*pi/(c*n);
- % Function
- n = 2; c = 1;
- un = @(x,t) sin(n*x/L).*cos(n*c*t/L);
- % Make vectors for space and time
- x = linspace(0, pi, 50); t = linspace(0, 2*T, 50);
- % Create a mesh of x vs. t
- [X,T] = meshgrid(x,t);
- % Matrix of U values to imagine the surface
- U = sin(n*X).*cos(n*T);
- figure(1); subplot(1,2,1); xlabel('x'); ylabel('u');
- subplot(1,2,2);
- % Plot the surface and make it pretty
- s = surf(X,T,U); set(s, 'EdgeColor', 'none', 'FaceColor', 'interp');
- view([-48, 17]); xlabel('x'); ylabel('t'); zlabel('u');
- hold on
- % Plot an animation in time
- for j = 1:length(t)
- tt = t(j); uu = un(x,tt);
- subplot(1,2,1);
- plot(x, uu); title(['t = ', num2str(tt)]);
- ylim([-1,1]); xlim([0, pi]);
- subplot(1,2,2);
- if j == 1
- p = plot3(x, tt*ones(size(x)), un(x, t(j)), 'LineWidth', 3);
- pause;
- else
- set(p, 'XData', x, 'YData', tt*ones(size(x)), 'ZData', un(x,t(j)));
- end
- drawnow
- shg
- end
Now we need to look to solve for the coefficients of our series by applying the boundary conditions. We have that u(x,t)=∞∑n=0sin(nπxL)[Ancos(nπctL)+Bnsin(nπctL)]
Imposing the initial displacement, we have u0(x)=∞∑n=0Ansin(nπxL),
which we recognise as the sine series for the odd 2L-periodic extension of the function u0(x) originally defined on [0,L]. So the coefficients are (see theorem 12.7) An=2L∫L0u0(x)sin(nπxL).
Imposing the initial velocity, we have v0(x)=∞∑n=1(nπcL)Bnsin(nπxL)
Again we recognise this as the sine series, so we now need to equate (nπcL)Bn=2L∫L0v0(x)sin(nπxL).
(The video gets very close to the end of this; we managed to get the An coefficients and need to address the Bn coefficients in lecture 26)