This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
vpde_lecture26 [2020/04/04 21:05] trinh |
vpde_lecture26 [2020/04/04 21:46] (current) trinh |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Lecture 26: Computation of the wave equation | + | ====== Lecture 26: Computation of the wave equation |
< | < | ||
Line 5: | Line 5: | ||
</ | </ | ||
+ | ===== Theorem 16.3 (Solution of the zero-Dirichlet wave equation) ===== | ||
+ | |||
+ | 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) = \sum_{n=0}^\infty \sin\left(\frac{n\pi x}{L}\right) \left[ A_n \cos\left(\frac{n\pi ct}{L}\right) + B_n \sin\left(\frac{n\pi ct}{L}\right)\right] | ||
+ | $$ | ||
+ | |||
+ | where | ||
+ | $$ | ||
+ | A_n = \frac{2}{L} \int_0^L u_0(x) \sin\left(\frac{n\pi x}{L}\right) \ \mathrm{d}{x}. | ||
+ | $$ | ||
+ | |||
+ | and | ||
+ | Again we recognise this as the sine series, so we now need to equate | ||
+ | $$ | ||
+ | B_n = \frac{2}{L} \left(\frac{L}{n\pi c}\right)\int_0^L v_0(x) \sin\left(\frac{n\pi x}{L}\right) \ \mathrm{d}{x}. | ||
+ | $$ | ||
+ | |||
+ | ===== Example 16.4: Plucked string ===== | ||
+ | |||
+ | 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 | ||
+ | $$ | ||
+ | A_n = \frac{4}{n^2\pi} \sin(n\pi/ | ||
+ | $$ | ||
+ | |||
+ | We showed off the simulations of the problem using the following code. | ||
+ | |||
+ | < | ||
+ | % 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/ | ||
+ | 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, | ||
+ | end | ||
+ | plot(x, u); | ||
+ | ylim([-pi/ | ||
+ | drawnow | ||
+ | if j == 1 | ||
+ | pause; | ||
+ | else | ||
+ | pause(0.1) | ||
+ | end | ||
+ | end | ||
+ | </ |