Partial Differential Equations PowerTool
by Dr. Jim Herod
Section 5.1: The One Dimensional Wave Equation
Maple Packages for Section 5.1
| > | restart; |
| > | with(plots): |
Warning, the name changecoords has been redefined
| > | with(PDEtools): |
| > |
We now begin a study of the classical wave equation.
The classical, linearized wave equation is
.
We classify this PDE as a special case of the more general constant coefficient, second order equation:
= 0.
Second order refers to the lack of derivatives of more than second order.We will solve the wave equation by the method of separation of variables in this worksheet. We will find there are alternate methods for this equation. We will also see that slightly more complicated situations lead to the more general second order equation.
We have seen that the standard separation of variables methods work well for the heat equation. This method is often good for linear equations. The method takes advantage of the
superposition property
. That is, if two functions
and
are solutions to a linear PDE, then so is any linear combination:
.
As with the heat equation, the wave equation commonly comes with boundary conditions and initial conditions. At the start, we take homogeneous boundary conditions, assuming that x ranges between 0 and L .
Boundary Conditions: u ( t , 0) = 0, and u ( t , L ) = 0.
Because the equation is second order in t , we expect two initial conditions. (Contrast this with the heat equation, which is first order in t and so needed only one initial condition.)
Initial Conditions:
u
(0,
x
) =
f
(
x
) and
(0,
x
) =
g
(
x
) for
x
in [0,
L
].
The usual physical realization made for this model is that of a string, held fixed at two ends, displaced by an amount f ( x ) initially, and given an initial velocity g ( x ). This model will guide our intuition and, with small displacements, gives an accurate impression for the vibrations of a taut string.
We often set c = 1 for convenience. We do this in this worksheet but remove the restriction later. It is of value to consider the difference in the left and right side of the wave equation. That difference reminds us that we are solving linear operator equations and looking for the null space of these linear operators. This example is simply a linear equation which has an infinite number of solutions. We seek one which satisfies the boundary and initial conditions.
We have had experience with the method of separation of variables and know that this method for solving partial differential equations is precisely what it says: One assumes that solutions can be written as products of separate functions of t and x . Thus, we make the assumption that u ( t , x ) is of the special form
T( t ) X( x ),
known as a product solution.
| > | u:=(t,x)->T(t)*X(x); |
| > | eq:=diff(u(t,x),t,t)-diff(u(t,x),x,x); |
This simplifies if we divide through by T( t ) X( x ).
| > | eq/X(x)/T(t); expand(%); |
| > | sep:=(%)+diff(X(x),x,x)/X(x)=diff(X(x),x,x)/X(x); |
The left side of the equation
sep
depends only on
t
and the right side depends only on
x
. Thus, each side must be constant. We do not know the value of this constant, yet. As in the heat equation, it will be negative; we call it -
.
| > | dsolve(diff(X(x),x,x)=-mu^2*X(x),X(x)); |
In order to satisfy the boundary condition at x = 0, we must have
| > | X:=x->sin(mu*x); |
| > | solve(X(L)=0,L); |
There are an infinite number of solutions for this equation, they change with
L
and
. Maple did not pick out any solution except
L
= 0. We know, however where the sine function is zero: the sine function is zero at all integral multiples of
. Thus, take
and solve for
.
| > | solve(mu*L=n*Pi,mu); |
| > | mu:=%; |
We now have the function X( x ).
| > | X(x); |
Check that X'/X is
.
| > | diff(X(x),x,x)/X(x); |
We now look at the other part of the PDE which we "separated off".
| > | dsolve(diff(T(t),t,t)=-mu^2*T(t),T(t)); |
Both the sine and cosine functions give possible solutions. We have no reason to eliminate either of these. The general solution we find is a linear combination of the particular solutions we get by separating the equation.
The most general linear combination is of the form.
| > | u:=(t,x)->sum((A[n]*cos(Pi*n*t/L)+B[n]*sin(Pi*n*t/L))*sin(n*Pi*x/L), n=1..infinity); |
The coefficients A and B have to be determined from the initial conditions in a manner that is familiar. We use the initial conditions. Suppose that
and
.
| > | u(0,x)=f(x); D[1](u)(0,x)=g(x); |
| > |
Doesn't this look like a job for Fourier Series? To compute the coefficients, recall that we have
=
and
=
=
, or
=
.
Here is an example. We can animate the graph of the solution and expect to see the vibrations of the string. The following two examples may give considerable insight for how the wave equation models the motion of a string. In the first example, take f as below and g to be zero. This will mean that all the B coefficients will be zero and A coefficients will be determined by the Fourier quotient.
| > | L:=4; f:=x->(x-1)*(Heaviside(x-1)-Heaviside(x-2))+ (3-x)*(Heaviside(x-2)-Heaviside(x-3)); |
We sketch the graph of this function f .
| > | plot(f(x),x=0..L); |
We compute the Fourier coefficients. Since
, the B coefficients are also zero..
| > | for n from 1 to 5 do A[n]:=int(f(x)*sin(n*Pi*x/L),x=0..L)/ int(sin(n*Pi*x/L)^2,x=0..L); B[n]:=0: od; n:='n': |
We define the solution u .
| > | u:=(t,x)->sum((A[n]*cos(Pi*n*t/L)+B[n]*sin(Pi*n*t/L))*sin(n*Pi*x/L), n=1..5); |
Check that this is a solution
| > | diff(u(t,x),t,t)-diff(u(t,x),x,x); |
Here are the boundary conditions.
| > | u(t,0); u(t,L); |
We see how close u (0, x ) is to f ( x ).
| > | plot([u(0,x),f(x)],x=0..L); |
We check the other initial condition.
| > | D[1](u)(0,x); |
| > |
Now, we draw the graph of u and then we watch an animation. We should expect to see the motion of a vibrating string.
| > | plot3d(u(t,x),x=0..L,t=0..2*L,axes=NORMAL,orientation=[-45,70]); |
| > | animate(u(t,x),x=0..L,t=0..2*L, frames=30); |
| > |
In the second example, take f to be zero and g to be as below. The formula for f and g suggests that the string is at rest and we give the middle an initial velocity. This will mean that all the B coefficients will be zero and A coefficients will be determined by the Fourier quotient.
| > | L:=4; g:=x->-(Heaviside(x-1)-Heaviside(x-3)); |
| > | plot(g(x),x=0..L,discont=true,color=RED); |
| > | n:='n': for n from 1 to 5 do A[n]:=0: B[n]:=2/(n*Pi)*int(g(x)*sin(n*Pi*x/L),x=0..L); od; n:='n': |
| > | u:=(t,x)->sum((A[n]*cos(Pi*n*t/L)+B[n]*sin(Pi*n*t/L))*sin(n*Pi*x/L), n=1..5); |
| > | plot3d(u(t,x),x=0..L,t=0..2*L,axes=NORMAL,orientation=[-135,45]); |
| > | animate(u(t,x),x=0..L,t=0..2*L, frames=30); |
| > |
Unassisted Maple
Again, it is of interest to see what progress Maple can make with this problem unassisted by humans. Note that we have read in the PDE package.
We define the partial differential equation.
| > | PDE:=diff(v(t,x),t,t)-diff(v(t,x),x,x)=0; |
Look to see what form Maple gets for a solutions.
| > | ans := pdsolve(PDE); |
Maple suggests that solutions have a particular form. There are no Fourier coefficients, no integrals to compute. The answer seems compact.
No surprise. This solution for the one dimensional wave equation is classical. It is called the d'Alembert solution. It is the subject of the next section.
EMAIL: herod@math.gatech.edu or jherod@tds.net
URL: http://www.math.gatech.edu/~herod
Copyright © 2003 by James V. Herod
All rights reserved