VI. Notes (Played) On The Vibrating String

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

73

version of 8 December 1997

VI. Notes (played) on the vibrating string †

There are three basic models in the subject of partial differential equations, which describe
very different physics and have very different mathematical properties. They are simple in
form, yet realistic for many problems in science and engineering. Moreover, they teach us
what to expect when we encounter more complicated equations used to model complicated
laboratory situations. They are:

The wave equation,

utt = c2 uxx; (WE)

the heat equation, also known as the diffusion equation,

ut = k uxx; (HE)

and the potential equation, also known as Poisson’s equation,

uxx + uyy = α ρ(x,y), (PE)

where ρ is a given function corresponding in electrostatics to a charge distribution, and the


other quantities c, k, and α are physical constants. Often there is no charge in the region
where you want to measure a potential , and (PE) reduces to Laplace’s equation

uxx + uyy = 0. (LE)

One thing you are likely to notice if you take several advanced courses in science or
engineering is that these same equations arise in many different contexts. The function u
† Copyright © 1994, 1997 by Evans M. Harrell II and James V. Herod.
74 Linear Methods of Applied Mathematics

may have a different interpretation in each incarnation, but the mathematics remains the
same. For example, the function u in (PE) or (LE) might be an electric potential, a
magnetic potential, the height of a taut membrane, or the potential of the velocity field in a
fluid.

The reason these equations arise again and again is that they are the most symmetric second
order partial differential equations that can be written down. Fundamental physical
principles usually do not involve derivatives of higher than second order. If a physical
model is isotropic, has a superposition principle, and is based on fundamental physical
principles, it is very likely to lead to an equation of one of these forms. In the appendix,
however, you will find a derivation of the wave equation for the problem of the vibrating
string.

The mathematics and physics of the three types of equations differ in important ways, and
lead to a classification of the equations as hyperbolic (WE), parabolic (HE), and elliptic
(PE/LE). Other second-order equations of a given type will share the qualitative features
of our three models.

We shall begin our study of the method of separation of variables with the wave equation,
which was in fact the first of these equations to be analyzed in this way. The wave
equation (WE) can be written with the aid of a wave operator

f t,x) := 12 ∂ 2 – ∂ 2 f t,x) ,
2 2

c ∂t ∂x
so that (WE) is the equation for the kernel of this operator. This operator is also known as
the d'Alembertian. The wave equation is a linear, homogeneous equation, so the
superposition principle holds for its solutions. If we can find some solutions u1, ..., u k,
then any linear combination of these solutions is again a solution. We also classify it as
"second-order," since derivatives up to second order occur, but no higher-order
derivatives. This will be the case for the great majority of PDE's in this class.

We shall solve the wave equation in two entirely different ways. The first method is
known as separation of variables. Let's set c = 1 for convenience. (Equivalently, we
could choose a clock with time variable t' = c t.) Let's test out the wave operator by
calculating its action on some representative functions:
The vibrating string 75

t sin 2 x = –2t cos2 x + 2 t sin2 x ;


sin x – t = 0.

Somewhat surprisingly, the second seemingly arbitrary function is a solution of the PDE!
As we shall see, there are lots of them, and several strategies for finding them.

With the method of separation of variables, we try to find solutions of a special form, u =
T(t) X(x). This is a special assumption of form - what is referred to as an ansatz, to give
some definiteness to our search for solutions. Some other physical circumstances, called
the boundary and initial conditions, will be quite important, and will constrain us in
choosing T and X; a partial differential equation coupled with some boundary
conditions will be called a boundary-value problem . For the vibrating string, the most
common boundary conditions are the zero Dirichlet conditions, named after the German
mathematician Gustav Lejeune-Dirichlet (1805-1859), a pioneer in the study of PDEs:
u(t,0) = 0, u(t,L) = 0 (DBC)
This means that the string is fastened at two ends, x=0 and x=L. Actually, if we assigned
some other fixed values to u besides 0 at the end points, we could just redefine the
dependent variable:
If u(t,0) = a, u(t,L) = b,
then define v := u(t,x) - a - (b-a) x/L.
Then v will still solve the wave equation, but will have the simpler boundary conditions
(DBC). When we act on a product T(t)X(x) with the wave operator and divide the result
by T(t)X(x), we get

T''(t) X''(t)
T(t) – T(t) .

If u solves the wave equation, this expression must be zero. (We could quibble about what
happens when T or X = 0, but that would either mean that u is the uninteresting "trivial"
solution or else the problem occurs only at isolated values of x and t.) Thus
T''/T = X''/X.
Since the left side is independent of x and the right side is independent of t, both sides must
in fact a constant. We don't know its value yet, so let us call it -µ. (It turns out to be
negative.
76 Linear Methods of Applied Mathematics

Thus
-X''(x) = µ X(x) (6.1)

This sort of equation is similar to a matrix-vector equation in linear algebra and is called an
eigenvalue equation. The function X and the number µ are both unknown, and are called
and eigenfunction and eigenvalue. We do not allow the possibility X(x) = 0 for all x.
While it is always a solution for all µ, it is not useful. By definition, an eigenfunction must
be a nonzero solution of an equation like (6.1). Along with (6.1) we have the boundary
conditions

X(0) = X(L) = 0 (6.2)


and this will restrict the µ's for which (6.1) has nonzero solutions. Eq. (6.1) is an
elementary ordinary differential equation with the familiar solution (also obtainable with
software),
X(x,µ) := D1 cos( µ x) + D2 sin( µ x).

Because of the boundary condition at x=0, we see that D1 = 0. We are left with only one
constant, which we can scale to 1, remembering that we may want to multiply our solution
by an arbitrary constant later. Because of the BC at x=0, we now know that up to a
constant multiple, X(x) = Sin( µ x). The other boundary condition in (6.2) tells us what
the allowable choices for µ are, namely µ = n π/L, n = 1,2,.... Taking L=1 for
convenience, the eigenfunctions and eigenvalues are:

Xn(x) := sin(n π x)

µn := (n π)2

Now let's look at the other part of the PDE which we "separated off":

T''(t) = - µ T(t) (6.3)

As we saw, there are many possible values of µ which are consistent with the boundary
condition for the function X, and the same possibilities occur in equation (6.3) (multiply µ
by c2 if c is not set to 1). Therefore Tn(t) = An cos(n π t) + Bn sin(n π t). We cannot go
The vibrating string 77

further with the T function without being given the initial condition, that is, information
about what happens at t=0.

We already have something of importance in science and engineering, however:


the normal modes . Many physical systems, like the vibrating string, preferentially
undergo simple motions with pure frequencies. Such a possible motion is exactly what we
find by positing a product solution, imposing any boundary conditions, and solving the
resulting eigenvalue problem.

Definition VI.1.
A normal mode of a boundary value problem is a product solution of the form
T(t) X(x),
where X(x) incorporates all boundary conditions.

Here the spatial variable x might be more than one-dimensional, as for the problem of the
vibrating drum, which will be encountered later. I have generalized the notion of a normal
mode so that any time dependence is allowed, although most commonly it will be
sinusoidal, T(t) = sin(ω t + φ). When it is sinusoidal, the angular frequency ω is usually a
simple function of the eigenvalue.

The general solution we come up with is a linear combination of the particular solutions we
get by separating the equation. It is not yet obvious that this is a completely general
solution, but it is.


u(t,x) = Σ
n =1
(A n cos(n π t) + Bn sin(n π t) ) sin(n π x), (6.4)

The coefficients A and B have to be determined from the initial conditions, that is, by the
condition of the string at t=0.

Suppose that
u(0,x) = f(x) and ∂u(0,x)/∂t = g(x) (IC)

are given. Plugging in to formula (6.4) shows that:


78 Linear Methods of Applied Mathematics


f(x) = Σ A n sin(n π x),
n=1

g(x) = Σ
n= 1
n π B n sin(n π x),

In other words, An are the Fourier sine coefficients for f(x), and the more complicated
expression
(n π) Bn
gives the Fourier sine coefficients of g(x). Notice that the stuff in the sine is n π x/L and
not 2 n π x/L (with L=1). In other words, there are more sines in this series than in the
usual Fourier series, but there are no cosines. It is precisely as if we imagine the string to
be defined on the interval [-1,1], twice as long as the actual interval, but on the nonphysical
part from x=-1 to x=0 we pretend that the shape of the string is defined to give us an odd
function: f(-x) = -f(x). This would give us only sine functions, as we have seen before.
Earlier we called those coefficients Bn, but here they happen to be called An. The thing to
remember is that since they go along with sine functions (of x) the formula for them
contains sines. we would thus write
1

A n[f] := sin(nπx) f(x) dx,


–1

but we can simplify this a bit by using the symmetry:


1

A n := 2 sin(nπx) f(x) dx.


0

What about the other coefficients? Well, this time it is the whole expression (n π) Bn
which is a Fourier sine coefficient for g(x), so we need to divide through by the extra
factor:
1
2
B n[g] := nπ sin(nπx) g(x) dx.
0

Here is an example to illustrate the situation.

Model Problem VI.2. Solve the problem of the vibrating string using Fourier sine
series, and initial conditions u(x,0) = 0, ut(x,0) = 1.
The vibrating string 79

Solution.

We can easily calculate the formulae for the coefficients A and B, either by hand or with
software:
Am = 0
and
n
1– –1
Bn = 2 2 .

4
If n is even, Bn = 0, else B n = .
n2 π2

The general solution is:

∞ sin(nπt) sin(nπx)
u(t,x) = 2 Σ
1 .
4π n =1 n2
n odd

Next we show some plots of the solution at various times. For computational purposes we
keep terms only up to n=7. With software you can see the string vibrate by selecting the
graphs and choosing "animate." By the way, infinity is larger than 7, but 7 is close enough
to give us a reasonable picture of the solution:
80 Linear Methods of Applied Mathematics
The vibrating string 81
82 Linear Methods of Applied Mathematics

-----------------------------------------------------

The boundary conditions we have been using are not the only useful ones. Suppose that
our string is attached to a pair of tracks in the vertical direction perpendicular to the x-axis
using a frictionless roller. Then u(t,0) and u(t,L) are not specified, but instead we have:
The vibrating string 83

∂u
∂x (t,0) = 0, (NBC)
∂u
∂x (t,L) = 0,

These are called Neumann boundary conditions. after the German physicist F.E. Neumann
(1798-1895), who used them in his investigations of electricity and magnetism.
Obviously, as with DBC, it would be a minor change to impose them at x=a and x=b
where a does not have to be 0. At this stage, we can exactly repeat the analysis of
separation of variables, until the point where we first used the boundary conditions, i.e.,
(6.1). With NBC, we instead evaluate the x-derivative at 0:

Model Problem VI.3. Set up the general solution of the vibrating string with Neumann
BC., with the simplifications c = L = 1.

Solution.
The partial differential equation separates exactly as before, so we still know that when we
assume u = X(x) T(t), we get separated equations (6.1) and (6.3). The values of µ will be
different, however, because they were determined by the BC. Since as before,
X(x,µ) := D1 cos( µ x) + D2 sin( µ x),
we see that
X'(x,µ) := - µ D1 sin( µ x) + µ D2 cos( µ x),
and for this to be 0 when x=0, there are two possibilities, namely D1=0 or µ=0. (We
ignored the latter possibility before since sin(0) = 0 is not a useful solution, but cos(0) = 1
can be one.)

Possibility 1. µ=0, which means that the output just given is not really the solution to
(6.1), which has become X''(x) = 0. The solutions of this are of the form A + B x, but B
has to be 0 so that X'(0) = 0. Thus with this possibility, X(x) = 1 (times any constant).
Eq. (6.3) now also becomes T''(t) = 0, which leads to the product solution of (WE):
(A0 + B0 t) 1 = A0 + B0 t.

Since the boundary conditions do not apply to the t variable, we keep the general linear
combination. A0 and B0 will be determined by the initial conditions.
84 Linear Methods of Applied Mathematics

Possibility 2. µ > 0. The boundary condition at x=0 now forces X(x) = cos( µ x)
(again, up to a constant multiple), and the other boundary condition forces one of the
values µn = (n π)2. The product solutions become
(An cos(n π t) + Bn sin(n π t)) cos(n π t)
and the general solution will be


u(t,x) =A 0 + B0 t + Σ
n= 1
A n cos(n π t) + Bn sin(n π t) cos(n π x). (6.5)

The coefficients are determined by the initial conditions because:


u(0,x) = A 0 + Σ A ncos(n π x),
n=1

and

ut(0,x) =B 0 + Σ n π B ncos(n π x).
n =1

The numbers An are the Fourier cosine coefficients of u(x,0) = f(x), while B0 and nπBn are
the Fourier cosine coefficients of ut(x,0) = g(x). (Notice the extra factors of nπ.)
----------------------------------------------------
A realistic string or optical fiber may not be uniform, so some of the simplifying
assumptions in our derivation fo the wave equation are not valid. For example,
the constant c2 = (spring constant) / (mass density) for the spring may be different
at different positions, leading to an equation of the form

2 2
∂ u = c(x) 2 ∂ u .
2 2 (ModWE1)
∂t ∂t
or, as a thorough examination of the derivation of the wave equation reveals,
we could more generally have:
2
∂ u = p(x) ∂ s(x) ∂u . (ModWE2)
2 ∂x ∂x
∂t

for some potentially complicated positive functions p(x) and s(x). How well does
the method of separation of variables do for problems like this? Rather well,
actually, although we may have to encounter some new functions.<P>

Model Problem VI.4. Suppose that the wave speed depends on position, so that
The vibrating string 85

c2 = 1/(1 + x), 0 < x < 1, with DBC at 0 and 1.


Find the normal modes of vibration

Solution (using software).

When we attempt to solve the equation with the ansatz u(t,x) = T(t) X(x), we find the
following eigenvalue problem.

- X"(x) = (1 + x) µ X(x)

There are actually some special functions, called Airy functions, which solve the ODE
y''(x) = x y. Two independent solutions are called Ai(x) and Bi(x):

The Airy function Ai(x).


86 Linear Methods of Applied Mathematics

The Airy function Bi(x).

The function Bi explodes exponentially to the right, while Ai decays exponentially. They
both oscillate to the left (why?). By changing variables we can get these functions to solve
our eigenvalue equation: If

y(x) := Ai(- µ1/3 (x+1)),


then
y''(x) = - µ (1+x) y(x),

and similarly for Bi(- µ1/3 (x+1)).

We need a linear combination


u(x) = Ai(- µ1/3 (1+x)) + C Bi ( - µ1/3 (1+x)) which is 0
at x=0 and 0 at x=1. Mathematica or Maple can solve for these conditions numerically, and
we find:

µ1/3 = 1.87088, C = 0.819688.

A plot of the function u shows that it has no nodes between 0 and 1:


The vibrating string 87

It thus resembles sin(π x), indicating that this is the spatial part of the fundamental (lowest-
frequency) mode. The eigenfunction and eigenvalue are numerically:

Ai(-1.87088 (1 + x)) + 0.819688 Bi(-1.87088 (1 + x)),


µ = 6.54844

The time-dependence is a combination


A0 cos(6.54844 t) + B 0 sin(6.54844 t).

The second eigenfunction and eigenvalue correspond to a solution which changes sign once
between 0 and 1:

Ai(-2.98005 (1+x)) -1.75913 Bi(-2.98005 (1+x))


µ = 26.4649

The second eigenfunction


88 Linear Methods of Applied Mathematics

Exercises VI

VI.1. Solve the wave equation with NBC at 0 and 1 and:


f(x) = |x-1/2|, g(x) = x2
Do you encounter any difficulties because the IC are not consistent with the BC?

VI.2. Put DBC at x=0 and NBC at x=L. Separate variables, solve the eigenvalue
problem for X(x), and write down a general solution.

VI.3. Solve the wave equation utt = uxx with IC:


f(x) = sin(πx), g(x) = 0
and
a) DBC at x=0 and x=1
b) NBC at x=0 and x=1
c) DBC at x=0 and NBC at x=1

Plot the solutions and compare.

VI.4. Solve the wave equation with IC:


f(x) = 0, g(x) = 1
and
a) DBC at x=0 and x=1
b) NBC at x=0 and x=1
c) DBC at x=0 and NBC at x=1

Plot the solutions and compare.

VI.5. Solve the wave equation with IC:


f(x) = sin(πx), g(x) = 1
and
a) DBC at x=0 and x=1
b) NBC at x=0 and x=1
c) DBC at x=0 and NBC at x=1

Plot the solutions and compare.

VI.6. Solve the wave equation utt = 4 uxx for 0 < x < π, 0 < t < ∞,
initial conditions:

u(0,x) = 0, u t(0,x) = x π – x = 8π Σ 13 sin nx ,


n odd n
and

Dirichlet boundary conditions at x=0 and x=π, i.e., u(t,0) = u(t,π) = 0, for 0 < t.

VI.7. Find all normal modes (product solutions) for the modified wave equation
utt + u = uxx
with Neumann boundary conditions:
The vibrating string 89

ux(t,0) = 0
ux(t,π) = 0

VI.8. (Refer to the appendix for the derivation of the wave equation for this problem.)
Derive a wave equation for the vibrating string if the x-axis is horizontal and we take
gravity into account. The gravitational potential energy of the string is
b
g u(t,x) dx ,
a
where g, the gravitational constant, is approximately 980 in the cgs system.
90 Linear Methods of Applied Mathematics

Appendix. Derivation of the wave equation.

The physics and mathematics of the vibrating string were studied by Jean le Rond
d'Alembert and later by Joseph Louis Lagrange, Leonhard Euler and Daniel Bernoulli, who
gave the first satisfactory discussion of the physics of the vibrating string. I have not been
able to locate a detailed discussion of Bernoulli's derivation of the wave equation, but it is
likely that he based it on an energy principle, somewhat as follows.

First let us recall that in classical mechanics, Newton's equations for the motion of a
particle are equivalent to the vanishing of the first variation of the Lagrangian action
integral,
L := KE – PE dt.
C

The kinetic energy is usually of the form


m v2
KE = 2 ,

while the potential energy PE may be a function of position, U(q). (I call the position q to
avoid confusion with an x used below). The action integral is calculated along a trajectory
C = (q(t)) beginning at position and time coordinates (q0, t 0) and ending at coordinates
(q1, t 1). The trajectory chosen by physics is one which is stationary with respect to
variations of the path. In other words, if we replace C with
Cδ = (q(t) + δ h(t)),
where h(t) is a smooth function with h(t0) = h(t1) = 0, and we calculate L(δ), then
L' (0) = 0.
(You may hear that the physical trajectory minimizes the action, but this is only a necessary
condition for minimum, and the physical trajectory is not always an actual minimum.) If
we expand L in powers of δ and retain only the first-order term, the stationary condition
becomes
t1

m q(t)⋅ h(t) – ∇U(q(t))⋅ h(t) dt = 0,


t0

and if we integrate by parts, it is:


t1

h(t)⋅ – m q(t) – ∇U(q(t)) dt = 0.


t0

(The boundary terms vanish because of the conditions h(t0) = h(t1) = 0, which served to
fix the beginning and end of the trajectory.) If, now, we let the three components of h
The vibrating string 91

range over a complete set such as sin(n π t/L), with L = t1-t0, we see that the only
possibility is for
m q(t) = F = – ∇U(q),
which is Newton's law.

The big advantage of Lagrangian mechanics is that it allows us relatively easily to find the
equations of motion of an extended body, such as a string. Suppose now that we have a
taut string along the x-axis between positions a and b, but displaced laterally by an amount
u(t,x). If the density is ρ, then the kinetic energy of a small bit of string at position x is
ρ u t(t,x) 2
dKE = dx,
2
so the total kinetic energy is
b 2
ρ ut(t,x)
KE = dx.
2
a

It is plausible that the microscopic force transmitted by the string to a point x is proportional
to the amount by which the string is stretched at x, i.e., it depends on the arc length element
ds at x. As we know,

ds= ∂u
1 + ∂x
2
dx.

Thus we may assume that the differential potential energy depends on u only through
∂u/∂x. The total potential energy would be of the form
b

PE = F u 2x, x dx.
a

The Lagrangian action integral will be the integral of KE - PE with respect to time. Notice
that it is u and not x which corresponds to the q used above; the "trajectory" of the string is
specified by the function u(t,x), and a variation would entail replacing u(t,x) with
u(t,x) + δ h(t,x),
where h(t0,x) = h(t 1,x) = 0. If the ends of the string are fixed, we would also have
h(t,a) = h(t,b) = 0. The action is a double integral,
t1
ρ u 2t
b

L= 2
a
2 – F ux , x dx dt,
t0

and if we use Taylor's theorem to keep only the first-order term in δ, Lagrange's condition
reads:
t1 b

0= ρ uth t – F′ u x2, x 2ux h x dx dt.


a
t0
92 Linear Methods of Applied Mathematics

This general formula may be useful in deriving realistic wave equations for non-
homogeneous strings, but let us simplify at this stage by assuming that ρ and T := 2 F' are
constants. If we integrate the first integrand by parts in the t variable and the second by
parts in the x variable, we now find that:
t1 b

0= h –ρ utt +T u xx dx dt.
a
t0

If h is arbitrary enough to run through a complete set, we must conclude that


utt = c2 uxx, (WE)
with c2 = T/ρ a positive constant with dimensions of velocity2.

Judging from guitar strings, for which a 1 meter taut string gives a musical note in the mid
range of the musical scale, typical values of c for thin metal strings are on the order of 1000
m./sec. The wave equation (WE) also describes one-dimensional acoustic waves (c ≈ 344
m/sec. in air at room temperature or 330 m./sec. at 0 C) and light waves (c ≈ 3 × 108
m./sec.), although the derivation is not the same in these cases.

You might also like