pdes_part2
pdes_part2
pdes_part2
In this section we will look at the 1D wave equation for a wave H(x, t)
∂ 2 H(x, t) 1 ∂ 2 H(x, t)
=
∂x2 c2 ∂t2
We will start by obtaining standing wave solutions of it via the method of standing variables. We will
then consider travelling wave solutions of this wave equation, including one that is a Fourier series.
Then we look at applying boundary conditions.
Note that T (t) is a function of t, not the temperature. At the moment, X and T are unknown
functions.
Now, by assuming that we can write the solution to the PDE as a product of a function of x times
a function of t, we can obtain a solution of PDE but we will not obtain the general solution to the
PDE. Typically (as we will see below) we use this method to obtain sets of possible solutions, and then
we sum many of these solutions to obtain the particular solution that we want, i.e., one that satisfies
the boundary conditions on the solution. An example of this is when the solutions are sine and cosine
waves and the the sum over many of these solutions is a Fourier series.
If we substitute H(x, t) = X(x)T (t) into the one-dimensional wave equation we get
d2 X(x) 1 d2 T (t)
T (t) = X(x)
dx2 c2 dt2
because we can take T out of the x differentiation as it is independent of x, and similarly we can take
X out of the t differentiation. If we divide both sides by XT , we get
1 d2 X(x) 1 1 d2 T (t)
=
X(x) dx2 c2 T (t) dt2
Now, we notice that the left-hand side is a function of x but not of t while the right-hand side is a
function of t but not of x. So the LHS tells us that the equation cannot depend on t, and the RHS
tells us that it cannot depend on x. Therefore it cannot depend on either x or t, and so must be a
constant. We will call this constant −k 2 . As we will see the minus sign will give us the sine and cosine
functions that will be most useful here1 . The fact that k is squared is just to make some of the later
equations look neater.
1
We choose the − sign as we wanted sine and cosine functions. If we picked a + sign, we would get exponentials,
which are not useful for the problems we study here but might be in other problems.
8
So we have
1 d2 X(x) 1 1 d2 T (t)
= = −k 2
X(x) dx2 c2 T (t) dt2
which gives us the two ODEs
d2 X(x) d2 T (t)
= −k 2 X(x) and = −k 2 c2 T (t)
dx2 dt2
The solutions of these ODEs are
X(x) = A cos(kx) + B sin(kx) and T (t) = C cos(kct) + D sin(kct)
where A, B, C and D are constants. You can check this by substituting these solutions back into the
ODEs and checking that the LHS equals the RHS. These ODEs were covered in the semester 1 ODE
course, please refer to your notes or to a textbook if you are unsure about these solutions. You need
to understand how to solve these simple ODEs if you are to understand how to solve the PDEs.
We can multiply X and T together and get the solution for H
H(x, t) = X(x)T (t) = [A cos(kx) + B sin(kx)] [C cos(kct) + D sin(kct)]
or
H(x, t) = AC cos(kx) cos(kct) + AD cos(kx) sin(kct) + BC sin(kx) cos(kct) + BD sin(kx) sin(kct)
Defining the four new constants I = AC, J = AD, P = BC and Q = BD we have that the solution is
H(x, t) = I cos(kx) cos(kct) + J cos(kx) sin(kct) + P sin(kx) cos(kct) + Q sin(kx) sin(kct)
This solution has four terms: the four combinations of sines and cosines as functions of space and of
time.
It is a solution but not the most general solution. However, as the wave equation is a linear
homogeneous PDE then the sum of any solutions of this PDE is also a solution to the PDE. In other
words we can add lots of terms like cos(kx) cos(kct), with different k ′ s, and the sum is also a solution,
e.g.,
H(x, t) = I1 cos(k1 x) cos(k1 ct) + I2 cos(k2 x) sin(k2 ct)
is a solution of the PDE, for any values of the constants I1 and I2 , and of the wavevectors k1 and k2 .
This means that we can add lots of these terms together and vary the constants, and so get an
expression that satisfies the boundary conditions. This is how we can use a Fourier series to obtain a
particular solution of a PDE.
To write a Fourier series general solution to the wave PDE we add subscript n’s to the I, J, P , Q
and k to indicate that we could have many terms like these with different values of I, k, etc. Then we
have
X∞
H(x, t) = [In cos(kn x) cos(kn ct) + Jn cos(kn x) sin(kn ct) + Pn sin(kn x) cos(kn ct) + Qn sin(kn x) sin(kn ct)]
n=1
Note that for each solution all the constants are different, the In , Jn , Pn , Qn and kn are all different.
kn = 2π/λn is the wavevector of the nth term in the sum, and so the nth term is 4 waves, each with the
same wavelength, but each term has a different wavelength. The boundary conditions will determine
the values of the constants In , Jn , Pn and Qn , and of the kn and then once these values are determined
we have the particular solution.
9
Figure 2: A plot of a square wave H(x) of wavelength L = 1, plus two sine wave series approximations
to it. The square wave is the black solid curve. A sine wave of the same wavelength is shown as a
dot-dashed green (grey) curve. This is a sine series approximation to the square wave, truncated after
the first term. A sum of up to the n = 9 terms is shown as the dashed red (grey) curve. We see
that the dashed curve follows the square wave much better than the dot-dashed curve but it is still an
approximation, only an infinite series perfectly follows the square wave.
0
h
-1
The first two terms are sine and cosine waves moving to the right, with speed c, whereas the last two
terms are sine and cosine waves moving to the left, with speed −c.
This just gives a sine curve of course, but other shapes can be built up from a sum of sines (and/or
cosines). We can consider a simple example: the square wave, defined by
+1 0 < x < L/2
H(x, t = 0) =
−1 L/2 < x < L
10
This can be written as the sum of sine waves
X 8 nπx
H(x, t = 0) = sin
n=2,6,10,14,...
nπ L
Note that for this particular square wave, the sum only includes every 4th term, the n = 3, 4 and 5
terms are zero, the n = 6 term is non-zero, the n = 7, 8 and 9 terms are zero, and so on.
Starting with this square wave at t = 0, a square wave moving with speed c is then obtained by
just subtracting ct from x in the argument of the sine waves, i.e.,
X 8 nπ(x − ct)
H(x, t) = sin
n=2,6,10,14,...
nπ L
As a simple example of how boundary conditions are applied, we consider boundary conditions that
are initial conditions. The first initial condition is that at time t = 0, the function H(x, t = 0) is given
by
H(x, t = 0) = 10 cos(kx)
and the second initial condition is that the time derivative is zero, i.e., the string is stationary at t = 0
∂H(x, t)
=0
∂t t=0
where the subscript t = 0 on the brackets indicates that we evaluate the time derivative at t = 0.
11
Now, having written down the boundary conditions that the particular solution must satisfy, we
must apply these boundary conditions. We start2 by applying the boundary condition on H at t = 0
H(x, t = 0) = 10 cos(kx) = I cos(kx) cos(0) + J cos(kx) sin(0) + P sin(kx) cos(0) + Q sin(kx) sin(0)
Now we apply the boundary condition on the initial time derivative. First we take the time
derivative of H
∂H(x, t)
= −10kc cos(kx) sin(kct) + Jkc cos(kx) cos(kct) + Qkc sin(kx) cos(kct)
∂t
At t = 0, this time derivative equals zero
∂H(x, t)
= 0 = −10kc cos(kx) sin(0) + Jkc cos(kx) cos(0) + Qkc sin(kx) cos(0)
∂t t=0
As before, the first initial condition is that at time t = 0, the function H(x, t = 0) is given by
H(x, t = 0) = 10 cos(kx)
so we have
12
The second initial condition is that the time derivative is zero at t = 0. The time derivative of the
solution is
∂H(x, t)
= Akc sin(k(x − ct)) − Bkc cos(k(x − ct)) − Ckc sin(k(x + ct)) + Dkc cos(k(x + ct))
∂t
At t = 0 this derivative is zero
∂H(x, t)
= Akc sin(kx) − BkcB cos(kx) − Ckc sin(kx) + Dkc cos(kx)
∂t t=0
∂H(x, t)
= kc(A − C) sin(kx) + kc(D − B) cos(kx) = 0
∂t t=0
so to satisfy this boundary condition A − C = 0 and D − B = 0.
By combining the equations for A and C from the two boundary conditions we obtain two simul-
taneous linear equations for A and C
A + C = 10 A−C =0
which have the solution A = C = 5. For B and D we have two simultaneous linear equations
B+D =0 D−B =0
which have the solution B = D = 0. So the particular travelling wave solution that satisfies these
boundary conditions is
H(x, t) = 5 cos(k(x − ct)) + 5 cos(k(x + ct))
These are two cosine travelling waves, one travelling left to right and the other right to left. These
two travelling waves sum to give the standing wave we found in the previous section, i.e., the two
solutions we found, one in terms of a standing wave, and the other in terms of two travelling waves,
are completely equivalent. We can choose to use one or the other, whichever we find more convenient
for the problem we are studying.
13
Figure 3: Plot of the metal strip in the xy plane. The x and y axes are shown, and the strip itself is
the shaded area bounded by the dashed line. Although the x axis is shown only up to a little over
four, the strip continues off to x → ∞.
0 1 2 3 4 x
where D is the diffusion constant for thermal energy in the metal, and in second equation we have
written ∇2 out for two dimensions. Now once the metal has reached steady state, the temperature is
no longer a function of time, we have T (x, y), and so the derivative with respect to time is zero and
we have the two-dimensional Laplace’s equation
∂ 2T ∂ 2T
+ =0
∂x2 ∂y 2
Solving this and applying the boundary conditions will give us the temperature as function of position
in the metal strip.
The specific strip of metal is illustrated in Fig. 3. The strip is rectangular, with its bottom edge
along the x axis and its top along the line y = 2. Its leftmost edge is along the y axis, and it is so long
in the x direction that we will take its length along the x axis to be infinite. We take the temperature
T = 100◦ C along the side of the strip along the y axis and T = 0◦ C along the other three sides. These
boundary conditions are along all four sides of the metal strip and so are a complete set of boundary
conditions.
14
Now, the standard way to solve our PDE is to assume that the solution is a product of a function
of x only, X(x), times a function of y only, Y (y). This is the method of separation of variables. Now,
substituting T (x, y) = X(x)Y (y) into our PDE we get
1 d2 X(x) 1 d2 Y (y)
= −
X(x) dx2 Y (y) dy 2
Now, we notice that the LHS is a function of x but not of y while the RHS is a function of y but not
of x. However, they must be equal to each other for all values of x and y. So, if we change y the
LHS does not change, and if we change x the RHS does not change. As the LHS = RHS then neither
can change if x is changed, or if y is changed. So the equation must equal a constant. We call this
constant k 2 , and then
1 d2 X(x) 1 d2 Y (y)
= − = k2
X(x) dx2 Y (y) dy 2
We can now separate this into two equations
1 d2 X(x) 1 d2 Y (y)
= k2 = −k 2
X(x) dx2 Y (y) dy 2
We have split the PDE into two ODEs. We can now solve these two ODEs and combine the solutions
X and Y to make up T , the temperature profile of interest. The solution of
d2 X(x)
= k 2 X(x) is X(x) = C exp(kx) + D exp(−kx)
dx 2
with C and D the two unknown constants, that we always get in the general solution of a second-order
ODE. The solution of
d2 Y (y)
= −k 2 Y (y) is Y (y) = E sin(ky) + F cos(ky)
dy 2
with E and F the two unknown constants.
Note that because the ODE for x is the second derivative equal to a positive constant times X,
the solutions for X(x) were exponentials, while the constant for the ODE for y was negative, and so
we got sines and cosines for Y . We could have used −k 2 instead of k 2 , and then we would have got an
X which was sines and cosines, and a Y in terms of exponentials. That other solution is just as valid
a solution of Laplace’s equation as the one just above. Which one is best depends on the boundary
conditions.
We in fact chose to arrange things so that the right-hand side of the equation of Y was negative
so that we got cosine and sine functions for Y . This is because we know that T = 0 at the top and
bottom of the strip and so we expect that trig functions, which are of course periodic, will be better
suited to the y direction. Also, along the x axis one side is at infinity, and sines and cosines of infinity
are not well defined, whereas exponentials are OK at infinity.
15
Let us return to the solution, now that we have general solutions for X and Y we have for the
temperature profile
Now, this is a solution of T (x, y) although it is not the most general solution of our PDE. The constants
C, D, E and F are arbitrary, as is k, but note that the same k appears in both parts of the solution.
T (x → ∞, y) = C × ∞ × [E sin(ky) + F cos(ky)] = 0
where in the final equality we applied the boundary condition, and equated it to zero. Now unless
either C = 0 or both E and F are zero, the LHS is infinity, not 0. We cannot have both E and F
equal to zero as then the entire solution is zero and disappears. So we must have that C = 0. So our
first boundary condition has told us the value of the one of the four constants. Then with C = 0, the
solution T simplifies to
T (x, y) = D exp(−kx) [E sin(ky) + F cos(ky)]
16
4.1.3 Boundary condition 3
The third boundary condition we apply is along the top of the strip, at y = 2, where the temperature
T (x, y = 2) = 0. So we must have that
As G has to be a non-zero constant to avoid the entire solution being zero, and as exp(−kx) is also
non-zero the sine term must be zero. So,
sin(k2) = 0 2k = nπ
nπ
n = 1, 2, 3, . . .
k=
2
In order to have T = 0 along the top, k must equal an integer, n, times π/2. Putting this in our
solution, it is
T (x, y) = Gn exp (−nπx/2) sin (nπy/2) n = 1, 2, 3, . . .
we have not one solution but a whole series of them, depending on the value of n. As each solution
can have a different constant in front we have replaced the constant G by Gn , where G1 is the constant
for the n = 1 solution, G2 for the n = 2 solution etc.
As usual with Fourier series we want to calculate the values of the constants Gn , which we get by
multiplying both sides by sin(mπy/2) and integrating. Here the integration interval is along y, and
from y = 0 to y = 2
X Z 2 Z 2
Gn dy sin (mπy/2) sin (nπy/2) = 100 dy sin (mπy/2)
n=1,2,... 0 0
Now, the integral over the product of sine functions is zero unless m = n so we have
Z 2 Z 2
2
Gm dy sin (mπy/2) = 100 dy sin (mπy/2)
0 0
17
The integral on the left-hand side is
2 2 2
1 1 1 1
Z Z
2
dy sin (mπy/2) = dy [1 − cos(mπy)] = y− sin(mπy) = (2 − 0 − 0 + 0) = 1
0 0 2 2 mπ 0 2
18