Examples and Numerical Experiments: I.1 First Problems and Methods
Examples and Numerical Experiments: I.1 First Problems and Methods
Examples and Numerical Experiments: I.1 First Problems and Methods
This chapter introduces some interesting examples of differential equations and il-
lustrates different types of qualitative behaviour of numerical methods. We deliber-
ately consider only very simple numerical methods of orders 1 and 2 to emphasize
the qualitative aspects of the experiments. The same effects (on a different scale)
occur with more sophisticated higher-order integration schemes. The experiments
presented here should serve as a motivation for the theoretical and practical inves-
tigations of later chapters. The reader is encouraged to repeat the experiments or to
invent similar ones.
Our first problems, the Lotka–Volterra model and the pendulum equation, are dif-
ferential equations in two dimensions and show already many interesting geometric
properties. Our first methods are various variants of the Euler method, the midpoint
rule, and the Störmer–Verlet scheme.
Fig. 1.1. Vector field, exact flow, and numerical flow for the Lotka–Volterra model (1.1)
this model to study parasitic invasion of insect species, and, with its help, V. Volterra
(1927) explained curious fishing data from the upper Adriatic Sea following World
War I.
Equations (1.1) constitute an autonomous system of differential equations. In
general, we write such a system in the form
ẏ = f (y) . (1.2)
Every y represents a point in the phase space, in equation (1.1) above y = (u, v)
is in the phase plane R2 . The vector-valued function f (y) represents a vector field
which, at any point of the phase space, prescribes the velocity (direction and speed)
of the solution y(t) that passes through that point (see the first picture of Fig. 1.1).
For the Lotka–Volterra model, we observe that the system cycles through three
stages: (1) the prey population increases; (2) the predator population increases by
feeding on the prey; (3) the predator population diminishes due to lack of food.
Flow of the System. A fundamental concept is the flow over time t. This is the
mapping which, to any point y0 in the phase space, associates the value y(t) of the
solution with initial value y(0) = y0 . This map, denoted by ϕt , is thus defined by
The second picture of Fig. 1.1 shows the results of three iterations of ϕ t (with t =
1.3) for the Lotka–Volterra problem, for a set of initial values y0 = (u0 , v0 ) forming
an animal-shaped set A.1
Invariants. If we divide the two equations of (1.1) by each other, we obtain a single
equation between the variables u and v. After separation of variables we get
1−u v−2 d
0= u̇ − v̇ = I(u, v)
u v dt
1
This cat came to fame through Arnold (1963).
I.1 First Problems and Methods 3
where
I(u, v) = ln u − u + 2 ln v − v, (1.4)
so that I(u(t), v(t)) = Const for all t. We call the function I an invariant of the
system (1.1). Every solution of (1.1) thus lies on a level curve of (1.4). Some of
these curves are drawn in the pictures of Fig. 1.1. Since the level curves are closed,
all solutions of (1.1) are periodic.
It uses a constant step size h to compute, one after the other, approximations y 1 , y2 ,
y3 , . . . to the values y(h), y(2h), y(3h), . . . of the solution starting from a given
initial value y(0) = y0 . The method is called the explicit Euler method, because
the approximation yn+1 is computed using an explicit evaluation of f at the already
known value yn . Such a formula represents a mapping
Φh : yn 7→ yn+1 ,
which we call the discrete or numerical flow. Some iterations of the discrete flow for
the Lotka–Volterra problem (1.1) (with h = 0.5) are represented in the third picture
of Fig. 1.1.
Implicit Euler Method. The implicit Euler method
is known for its all-damping stability properties. In contrast to (1.5), the approx-
imation yn+1 is defined implicitly by (1.6), and the implementation requires the
numerical solution of a nonlinear system of equations.
Implicit Midpoint Rule. Taking the mean of yn and yn+1 in the argument of f , we
get the implicit midpoint rule
y + y
n n+1
yn+1 = yn + hf . (1.7)
2
It is a symmetric method, which means that the formula is left unaltered after ex-
changing yn ↔ yn+1 and h ↔ −h (more on symmetric methods in Chap. V).
Symplectic Euler Methods. For partitioned systems
u̇ = a(u, v)
(1.8)
v̇ = b(u, v),
4 I. Examples and Numerical Experiments
6 y81 6 6
y49
y50 y1
y82
4 4 y51 4
y37
y83 y2
2 y0 2 2 y0 y0
2 4 u 2 4 u 2 4 u
Fig. 1.2. Solutions of the Lotka–Volterra equations (1.1) (step sizes h = 0.12; initial values
(2, 2) for the explicit Euler method, (4, 8) for the implicit Euler method, (4, 2) and (6, 2) for
the symplectic Euler method.)
which treat one variable by the implicit and the other variable by the explicit Euler
method. In view of an important property of this method, discovered by de Vogelaere
(1956) and to be discussed in Chap. VI, we call them symplectic Euler methods.
Numerical Example for the Lotka–Volterra Problem. Our first numerical exper-
iment shows the behaviour of the various numerical methods applied to the Lotka–
Volterra problem. In particular, we are interested in the preservation of the invariant
I over long times. Fig. 1.2 plots the numerical approximations of the first 125 steps
with the above numerical methods applied to (1.1), all with constant step sizes. We
observe that the explicit and implicit Euler methods show wrong qualitative be-
haviour. The numerical solution either spirals outwards or inwards. The symplectic
Euler method (implicit in u and explicit in v), however, gives a numerical solution
that lies apparently on a closed curve as does the exact solution. Note that the curves
of the numerical and exact solutions do not coincide.
degrees of freedom; Hp and Hq are the vectors of partial derivatives. One verifies
easily by differentiation (see Sect. IV.1) that, along the solution curves of (1.10),
(1.11)
H p(t), q(t) = Const,
i.e., the Hamiltonian is an invariant or a first integral. More details about Hamil-
tonian systems and their derivation from Lagrangian mechanics will be given in
Sect. VI.1.
Pendulum. The mathematical pendulum (mass m = 1,
massless rod of length ` = 1, gravitational acceleration
g = 1) is a system with one degree of freedom having the
Hamiltonian
q
1 2 1
H(p, q) = p − cos q, (1.12) cos q
2
so that the equations of motion (1.10) become m
ṗ = − sin q, q̇ = p. (1.13)
Fig. 1.3. Exact and numerical flow for the pendulum problem (1.13); step sizes h = t = 1.
Area Preservation. Figure 1.3 (first picture) illustrates that the exact flow of a
Hamiltonian system (1.10) is area preserving. This can be explained as follows: the
derivative of the flow ϕt with respect to initial values (p, q),
0 ∂ p(t), q(t)
ϕt (p, q) = ,
∂(p, q)
6 I. Examples and Numerical Experiments
where the second partial derivatives of H are evaluated at ϕt (p, q). In the case of
one degree of freedom (d = 1), a simple computation shows that
d d ∂p(t) ∂q(t) ∂p(t) ∂q(t)
det ϕ0t (p, q) = − = . . . = 0.
dt dt ∂p ∂q ∂q ∂p
Since ϕ0 is the identity, this implies det ϕ0t (p, q) = 1 for all t, which means that the
flow ϕt (p, q) is an area-preserving mapping.
The last two pictures of Fig. 1.3 show numerical flows. The explicit Euler
method is clearly seen not to preserve area but the symplectic Euler method is (this
will be proved in Sect. VI.3). One of the aims of ‘geometric integration’ is the study
of numerical integrators that preserve such types of qualitative behaviour of the ex-
act flow.
Fig. 1.4. Solutions of the pendulum problem (1.13); explicit Euler with step size h = 0.2,
initial value (p0 , q0 ) = (0, 0.5); symplectic Euler with h = 0.3 and initial values q0 = 0,
p0 = 0.7, 1.4, 2.1; Störmer–Verlet with h = 0.6.
Fig. 1.5. Carl Störmer (left picture), born: 3 September 1874 in Skien (Norway), died: 13 Au-
gust 1957.
Loup Verlet (right picture), born: 24 May 1931 in Paris.
pn+ 1
2
pn− 1
qn+1 2 qn+1
qn−1 qn−1
qn+ 1
2
qn− 1
2
qn qn
h h pn
tn−1 tn tn+1 tn−1 tn− 1 tn tn+ 1 tn+1
2 2
to the left). But we can also think of polygons, which possess the right slope in the
midpoints (Fig. 1.6 to the right).
Approximations to the derivative p = q̇ are simply obtained by
qn+1 − qn−1 qn+1 − qn
pn = and pn+1/2 = . (1.16)
2h h
One-Step Formulation. The Störmer–Verlet method admits a one-step formulation
which is useful for actual computations. The value qn together with the slope pn and
the second derivative f (qn ), all at tn , uniquely determine the parabola and hence
also the approximation (pn+1 , qn+1 ) at tn+1 . Writing (1.15) as pn+1/2 − pn−1/2 =
hf (qn ) and using pn+1/2 + pn−1/2 = 2pn , we get by elimination of either pn+1/2
or pn−1/2 the formulae
h
pn+1/2 = pn + f (qn )
2
qn+1 = qn + hpn+1/2 (1.17)
h
pn+1 = pn+1/2 + f (qn+1 )
2
which is an explicit one-step method Φh : (qn , pn ) 7→ (qn+1 , pn+1 ) for the corre-
sponding first order system of (1.14). If one is not interested in the values p n of the
derivative, the first and third equations in (1.17) can be replaced by
One of the great achievements in the history of science was the discovery of the
laws of J. Kepler (1609), based on many precise measurements of the positions of
Mars by Tycho Brahe and himself. The planets move in elliptic orbits with the sun
at one of the foci (Kepler’s first law)
I.2 The Kepler Problem and the Outer Solar System 9
d
r= = a − ae cos E, (2.1)
1 + e cos ϕ
(where
√ a = great √ axis, e = eccentricity, b =
a 1 − e2 , d = b 1 − e2 = a(1 − e2 ), E = ec- b
centric anomaly, ϕ = true anomaly).
Newton (Principia 1687) then explained this M
motion by his general law of gravitational attrac- a
d
tion (proportional to 1/r 2 ) and the relation between r
forces and acceleration (the “Lex II” of the Prin-
E ϕ
cipia). This then opened the way for treating arbi-
ae F a
trary celestial motions by solving differential equa-
tions.
Two-Body Problem. For computing the motion of two bodies which attract each
other, we choose one of the bodies as the centre of our coordinate system; the motion
will then stay in a plane (Exercise 3) and we can use two-dimensional coordinates
q = (q1 , q2 ) for the position of the second body. Newton’s laws, with a suitable
normalization, then yield the following differential equations
q1 q2
q̈1 = − 2 2
, q̈2 = − 2 . (2.2)
(q1 + q2 ) 3/2 (q1 + q22 )3/2
This is equivalent to a Hamiltonian system with the Hamiltonian
1 2 1
p1 + p22 − p 2 (2.3)
H(p1 , p2 , q1 , q2 ) = , pi = q̇i .
2 q1 + q22
f (qn ) qn+1
qn+1 −qn
qn
qn−1 qn −qn−1
Fig. 2.1. Proof of Kepler’s Second Law (left); facsimile from Newton’s Principia (right).
We have not only an elegant proof for this invariant, but we also see that the
Störmer–Verlet scheme preserves this invariant for every h > 0.
It is now interesting, inversely to the procedure of Newton, to prove that any solution
of (2.2) follows either an elliptic, parabolic or hyperbolic arc and to describe the
solutions analytically. This was first done by Joh. Bernoulli (1710, full of sarcasm
against Newton), and by Newton (1713, second edition of the Principia, without
mentioning a word about Bernoulli).
By (2.3) and (2.4), every solution of (2.2) satisfies the two relations
1 2 1
q̇1 + q̇22 − p 2 (2.5)
= H0 , q1 q̇2 − q2 q̇1 = L0 ,
2 q1 + q22
where the constants H0 and L0 are determined by the initial values. Using polar
coordinates q1 = r cos ϕ, q2 = r sin ϕ, this system becomes
1 2 1
ṙ + r 2 ϕ̇2 − = H0 , r 2 ϕ̇ = L0 . (2.6)
2 r
For its solution we consider r as a function of ϕ and write ṙ = dr
dϕ · ϕ̇. The elimina-
tion of ϕ̇ in (2.6) then yields
2
1 dr 2 2 L0 1
+r − = H0 .
2 dϕ r4 r
In this equation we use the substitution r = 1/u, dr = −du/u2 , which gives (with
0
= d/dϕ)
1 02 u H0
(u + u2 ) − 2 − 2 = 0. (2.7)
2 L0 L0
This is a “Hamiltonian” for the system
I.2 The Kepler Problem and the Outer Solar System 11
1 1 1 + e cos(ϕ − ϕ∗ )
u00 + u = i.e., u = + c1 cos ϕ + c2 sin ϕ = (2.8)
d d d
where d = L20 and the constant e becomes, from (2.7),
(by Exercise 7, the expression 1+2H0 L20 is non-negative). This is precisely formula
(2.1). The angle ϕ∗ is determined by the initial values r0 and ϕ0 . Equation (2.1)
represents an elliptic orbit with eccentricity e for H0 < 0 (see Fig. 2.2, dotted line),
a parabola for H0 = 0, and a hyperbola for H0 > 0.
Finally, we must determine the variables r and ϕ as functions of t. With the
relation (2.8) and r = 1/u, the second equation of (2.6) gives
d2
2 dϕ = L0 dt (2.10)
1 + e cos(ϕ − ϕ∗ )
which, after an elementary, but not easy, integration, represents an implicit equation
for ϕ(t).
−2 −1 1 −2 −1 1
4 000 steps
−1 explicit Euler symplectic Euler h = 0.05
−2 −1 1 −2 −1 1
−1 −1
Störmer–Verlet
Fig. 2.2. Numerical solutions of the Kepler problem (eccentricity e = 0.6; in dots: exact
solution)
12 I. Examples and Numerical Experiments
conservation of energy
.02 explicit Euler, h = 0.0001
.01
symplectic Euler, h = 0.001
50 100
.4
global error of the solution
explicit Euler, h = 0.0001
.2
symplectic Euler, h = 0.001
50 100
Fig. 2.3. Energy conservation and global error for the Kepler problem
I.2 The Kepler Problem and the Outer Solar System 13
Table 2.1. Qualitative long-time behaviour for the Kepler problem; t is time, h the step size.
error due to their higher order. We remark that the angular momentum L(p, q) is ex-
actly conserved by the symplectic Euler, the Störmer–Verlet, and the implicit mid-
point rule.
We next apply our methods to the system which describes the motion of the five
outer planets relative to the sun. This system has been studied extensively by as-
tronomers. The problem is a Hamiltonian system (1.10) (N -body problem) with
5 5 Xi−1
1X 1 T X mi mj
H(p, q) = pi pi − G . (2.12)
2 i=0 mi i=1 j=0
kq i − qj k
P J S P J S
U U
N N
P J S P J S
U U
N N
To this system we apply the explicit and implicit Euler methods with step size
h = 10, the symplectic Euler and the Störmer–Verlet method with much larger
step sizes h = 100 and h = 200, repectively, all over a time period of 200 000
days. The numerical solution (see Fig. 2.4) behaves similarly to that for the Kepler
problem. With the explicit Euler method the planets have increasing energy, they
spiral outwards, Jupiter approaches Saturn which leaves the plane of the two-body
motion. With the implicit Euler method the planets (first Jupiter and then Saturn)
I.3 The Hénon–Heiles Model 15
fall into the sun and are thrown far away. Both the symplectic Euler method and
the Störmer–Verlet scheme show the correct behaviour. An integration over a much
longer time of say several million years does not deteriorate this behaviour. Let us
remark that Sussman & Wisdom (1992) have integrated the outer solar system with
special geometric integrators.
The Hénon–Heiles model was created for describing stellar motion, followed for a
very long time, inside the gravitational potential U0 (r, z) of a galaxy with cylindrical
symmetry (Hénon & Heiles 1964). Extensive numerical experimentations should
help to answer the question, if there exists, besides the known invariants H and L,
a third invariant. Despite endless tentatives of analytical calculations during many
decades, such a formula had not been found.
After a reduction of the dimension, a Hamiltonian in two degrees of freedom of
the form
1
H(p, q) = (p21 + p22 ) + U (q) (3.1)
2
is obtained and the question is, if such an equation has a second invariant. Here,
Hénon and Heiles put aside the astronomical origin of the problem and choose
1 1
U (q) = (q12 + q22 ) + q12 q2 − q23 (3.2)
2 3
(see citation). The potential U is represented in Fig. 3.1. When U approaches 61 , the
level curves of U tend to an equilateral triangle, whose vertices are saddle points
of U . The corresponding system
q2
1
q2 q2
U U
P2
P1
q1 q1
P0
−.5 .5 q1
−.5
p2 p2
1
H= 1
.4 H= 8
12
.3
P2
P2
−.3 .3 q2 −.4 .4 q2
P0 P1
P0 P1
−.3
−.4
Fig. 3.2. Poincaré cuts for q1 = 0, p1 > 0 of the Hénon–Heiles Model for H = 1
12
(6 orbits,
left) and H = 18 (1 orbit, right)
p2 Explicit Euler p2 Implicit Euler
.4 h = 10−5 1 .4 h = 10−51
H0 = 12 H0 = 8
P8000
P2
P2
−.4 q2 −.4 .4 q2
P1
P0
P0 P1
−.4 −.4
P7600
in bold: P1 , . . . , P400 in bold: P8000 , . . . , P8328
Fig. 3.3. Poincaré cuts for numerical methods, one orbit each; explicit Euler (left), implicit
Euler (right). Same initial data as in Fig. 3.2.
10−1
global error
expl. Euler, h = .0001
10−2
10−4
evidence” for the existence of a second invariant, for which Gustavson (1966) has
derived a formal expansion, whose first terms represent perfectly these curves.
“But here comes the surprise” (Hénon–Heiles, p. 76): Fig. 3.2 shows to the right
the same picture in the (q2 , p2 ) plane for a somewhat higher Energy H = 18 . The
motion turns completely to chaos and all hope for a second invariant disappears.
Actually, Gustavson’s series does not converge.
Numerical Experiments. We now apply numerical methods, the explicit Euler
method to the low energy initial values H = 12 1
(Fig. 3.3, left), and the implicit
Euler method to the high energy initial values (Fig. 3.3, right), both methods with a
very small step size h = 10−5 . As we already expect from our previous experiences,
the explicit Euler method tends to increase the energy and turns order into chaos,
while the implicit Euler method tends to decrease it and turns chaos into order. The
Störmer–Verlet method (not shown) behaves as the exact solution even for step sizes
as large as h = 10−1 .
In our next experiment we study the global error (see Fig. 3.4), once for the case
of the nearly quasiperiodic orbit (H = 12 1
) and once for the chaotic one (H = 81 ),
both for the explicit Euler, the symplectic Euler, and the Störmer–Verlet scheme.
It may come as a surprise, that only in the first case we have the same behaviour
(linear or quadratic growth) as in Fig. 2.3 for the Kepler problem. In the second case
(H = 18 ) the global error grows exponentially for all methods, and the explicit Euler
method is worst.
Study of a Mapping. The passage from a point Pi to the next one Pi+1 (as ex-
plained for the left picture of Fig. 3.2) can be considered as a mapping Φ : P i 7→
Pi+1 and the sequence of points P0 , P1 , P2 , . . . are just the iterates of this mapping.
This mapping is represented for the two energy levels H = 12 1
and H = 18 in
Fig. 3.5 and its study allows to better understand the behaviour of the orbits. We see
no significant difference between the two cases, simply for larger H the deforma-
tions are more violent and correspond to larger eigenvalues of the Jacobian of Φ. In
18 I. Examples and Numerical Experiments
p2 p2
.4 1 .4
H=
12
−.4 .4 q2 −.4 .4 q2
−.4 −.4
p2 p2
1
.4 H= .4
8
−.4 q2 −.4 q2
−.4 −.4
both cases we have seven fixed points, which correspond to periodic solutions of the
system (3.3). Four of them are stable and lie inside the white islands of Fig. 3.2.
Molecular dynamics requires the solution of Hamiltonian systems (1.10), where the
total energy is given by
N N Xi−1
1X 1 T X
H(p, q) = pi pi + Vij kqi − qj k , (4.1)
2 i=1 mi i=2 j=1
I.4 Molecular Dynamics 19
and Vij (r) are given potential functions. Here, qi and pi denote the positions and
momenta of atoms and mi is the atomic mass of the ith atom. We remark that the
outer solar system (2.12) is such an N -body system with Vij (r) = −Gmi mj /r. In
molecular dynamics the Lennard–Jones potential
σij 12 σij 6
Vij (r) = 4εij − (4.2)
r r
is very popular (εij and σij are suit-
able constants depending on the atoms). .2 Lennard - Jones
This potential has an
√absolute minimum
at distance r = σij 6 2. The force due to .0
this potential strongly repels the atoms
−.2
when they are closer than this value,
and they attract each other when they 3 4 5 6 7 8
are farther away.
Numerical Experiments with a Frozen Argon Crys- 2
tal. As in Biesiadecki & Skeel (1993) we consider the
7 3
interaction of seven argon atoms in a plane, where six of
them are arranged symmetrically around a centre atom. 1
where kB = 1.380658 · 10−23 [J/K] is Boltzmann’s constant (see Allen & Tildesley
(1987), page 21). As units for our calculations we take masses in [kg], distances in
nanometers (1 [nm] = 10−9 [m]), and times in nanoseconds (1 [nsec] = 10−9 [sec]).
Initial positions (in [nm]) and initial velocities (in [nm/nsec]) are given in Table 4.1.
They are chosen such that neighbouring atoms have a distance that is close to the
one with lowest potential energy, and such that the total momentum is zero and
therefore the centre of gravity does not move. The energy at the initial position is
H(p0 , q0 ) ≈ −1260.2 kB [J].
For computations in molecular dynamics one is usually not interested in the tra-
jectories of the atoms, but one aims at macroscopic quantities such as temperature,
pressure, internal energy, etc. Here we consider the total energy, given by the Hamil-
tonian, and the temperature which can be calculated from the formula (see Allen &
Table 4.1. Initial values for the simulation of a frozen argon crystal
atom 1 2 3 4 5 6 7
0.00 0.02 0.34 0.36 −0.02 −0.35 −0.31
position
0.00 0.39 0.17 −0.21 −0.40 −0.16 0.21
−30 50 −70 90 80 −40 −80
velocity
−20 −90 −60 40 90 100 −60
20 I. Examples and Numerical Experiments
Fig. 4.1. Computed total energy and temperature of the argon crystal
We apply the explicit and symplectic Euler methods and also the Verlet method
to this problem. Observe that for a Hamiltonian such as (4.1) all three methods
are explicit, and all of them need only one force evaluation per integration step. In
Fig. 4.1 we present the numerical results of our experiments. The integrations are
done over an interval of length 0.2 [nsec]. The step sizes are indicated in femtosec-
onds (1 [fsec] = 10−6 [nsec]).
The two upper pictures show the values H(pn , qn ) − H(p0 , q0 ) kB as a func-
tion of time tn = nh. For the exact solution, this value is precisely zero for all times.
Similar to earlier experiments we see that the symplectic Euler method is qualita-
tively correct, whereas the numerical solution of the explicit Euler method, although
computed with a much smaller step size, is completely useless (see the citation at
the beginning of this section). The Verlet method is qualitatively correct and gives
much more accurate results than the symplectic Euler method (we shall see later
that the Verlet method is of order 2). The two computations with the Verlet method
show that the energy error decreases by a factor of 4 if the step size is reduced by a
factor of 2 (second order convergence).
The two lower pictures of Fig. 4.1 show the numerical values of the temperature
difference T − T0 with T given by (4.3) and T0 ≈ 22.72 [K] (initial temperature).
In contrast to the total energy, this is not an exact invariant, but for our problem it
fluctuates around a constant value. The explicit Euler method gives wrong results,
I.5 Highly Oscillatory Problems 21
but the symplectic Euler and the Verlet methods show the desired behaviour. This
time a reduction of the step size does not reduce the amplitude of the oscillations,
which indicates that the fluctuation of the exact temperature is of the same size.
The problem of Fermi, Pasta & Ulam (1955) is a simple model for simulations in
statistical mechanics which revealed highly unexpected dynamical behaviour. We
consider a modification consisting of a chain of 2m mass points, connected with al-
ternating soft nonlinear and stiff linear springs, and fixed at the end points (see Gal-
gani, Giorgilli, Martinoli & Vanzini (1992) and Fig. 5.1). The variables q 1 , . . . , q2m
stiff soft
harmonic nonlinear
Fig. 5.1. Chain with alternating soft nonlinear and stiff linear springs
(q0 = q2m+1 = 0) stand for the displacements of the mass points, and pi = q̇i for
their velocities. The motion is described by a Hamiltonian system with total energy
m m m
1X 2 2
ω2 X 2
X
H(p, q) = p2i−1 + p2i + (q2i − q2i−1 ) + (q2i+1 − q2i )4 ,
2
i=1
4 i=1 i=0
I
1 I2
I1 .4
I1
I2 I3
I3 .2
0
100 200 70 72
Fig. 5.2. Exchange of energy in the exact solution of the Fermi–Pasta–Ulam model. The
picture to the right is an enlargement of the narrow rectangle in the left-hand picture.
√ √
x0,i = q2i + q2i−1 / 2, x1,i = q2i − q2i−1 / 2,
√ √ (5.1)
y0,i = p2i + p2i−1 / 2, y1,i = p2i − p2i−1 / 2,
and zero for the remaining initial values. Fig. 5.2 displays the energies I 1 , I2 , I3
of the stiff springs together with the total oscillatory energy I = I1 + I2 + I3 as a
function of time. The solution has been computed very carefully with high accuracy,
so that the displayed oscillations can be considered as exact.
I.5 Highly Oscillatory Problems 23
and the eigenvalues λi of M (hω) determine the long-time behaviour of the numeri-
cal solution. Stability (i.e., boundedness of the solution of (5.5)) requires the eigen-
values to be less than or equal to one in modulus. For the explicit Euler method
we have λ1,2 = 1 ± ihω, so that the energy In = (yn2 + ω 2 x2n )/2 increases as
(1 + h2 ω 2 )n/2 . For the implicit Euler method we have λ1,2 = (1 ± ihω)−1 , and
the energy decreases as (1 + h2 ω 2 )−n/2 . For the implicit midpoint rule, the ma-
trix M (hω) is orthogonal and therefore In is exactly preserved for all h and for all
times. Finally, for the symplectic Euler method and for the Störmer–Verlet scheme
we have
2 2
!
h2 ω 2
1 − h 2ω − hω 1 −
1 −hω 2 4
M (hω) = , M (hω) = ,
hω 1 − h2 ω 2 hω
1 − h2 ω 2
2 2
0
100 200 100 200 100 200
h = 0.03
1
h = 0.03 h = 0.03
0
100 200 100 200 100 200
Fig. 5.3. Numerical solution for the FPU problem (5.2) with data as in Sect. I.5.1, obtained
with the implicit midpoint rule (left), symplectic Euler (middle), and Störmer–Verlet scheme
(right); the upper pictures use h = 0.001, the lower pictures h = 0.03; the first four pictures
show the Hamiltonian H − 0.8 and the oscillatory energies I1 , I2 , I3 , I; the last two pictures
only show I2 and I.
to the stability limit of the symplectic Euler and the Störmer–Verlet methods. The
values of H and I are still bounded over very long time intervals, but the oscillations
do not represent the true behaviour. Moreover, the average value of I is no longer
close to 1, as it is for the exact solution. These phenomena call for an explanation,
and for numerical methods with an improved behaviour (see Chap. XIII).
I.6 Exercises
1. Show that the Lotka–Volterra problem (1.1) in logarithmic scale, i.e., by putting
p = log u and q = log v, becomes a Hamiltonian system with the function (1.4)
as Hamiltonian (see Fig. 6.1).
.5 t = 1.3 A
.1 .2 .3 .5 1 2 3p
2. Apply the symplectic Euler method (or the implicit midpoint rule) to problems
such as
2
u̇ (v − 2)/v u̇ u v(v − 2)
= , =
v̇ (1 − u)/u v̇ v 2 u(1 − u)
with various initial conditions. Both problems have the same first integral (1.4)
as the Lotka–Volterra problem and therefore their solutions are also periodic.
Do the numerical solutions also show this behaviour?
3. A general two-body problem (sun and planet) is given by the Hamiltonian
1 T 1 T GmM
H(p, pS , q, qS ) = p pS + p p− ,
2M S 2m kq − qS k
where qS , q ∈ R3 are the positions of the sun (mass M ) and the planet (mass
m), pS , p ∈ R3 are their momenta, and G is the gravitational constant.
a) Prove: in heliocentric coordinates Q := q − qS , the equations of motion are
Q
Q̈ = −G(M + m) .
kQk3
b) Prove that dt
d
Q(t) × Q̇(t) = 0, so that Q(t) stays for all times t in the
6. Deduce Kepler’s first law from (2.2) by the elegant method of Laplace (1799).
Hint. Multiplying (2.2) with (2.5) gives
d q2 d q1
L0 q̈1 = , L0 q̈2 = − ,
dt r dt r
and after integration L0 q̇1 = qr2 + B, L0 q̇2 = − qr1 + A, where A and B are
integration constants. Then eliminate q̇1 and q̇2 by multiplying these equations
by q2 and −q1 respectively and by subtracting them. The result is a quadratic
equation in q1 and q2 .
7. Whatever the initial values for the Kepler problem are, 1 + 2H0 L20 ≥ 0 holds.
Hence, the value e is well defined by (2.9).
Hint. L0 is the area of the parallelogram spanned by the vectors q(0) and q̇(0).
26 I. Examples and Numerical Experiments
8. Implementation of the Störmer–Verlet scheme. Explain why the use of the one-
step formulation (1.17) is numerically more stable than that of the two-term
recursion (1.15).
9. Runge–Lenz–Pauli vector. Prove that the function
p1 0 q1
A(p, q) = p2 × 0 − p 1 q2
0 q1 p 2 − q 2 p 1 q12 + q22 0
is a first integral of the Kepler problem, i.e., A p(t), q(t) = Const along
The precession can also be expressed analytically: the equation for u = 1/r as
a function of ϕ, corresponding to (2.8), here becomes
1
u00 + u = + µu2 , (6.1)
d
where d = L20 . Now compute the derivative of this solution with respect to µ,
at µ = 0 and u = (1 + e cos(ϕ − ϕ∗ ))/d after one period t = 2π. This leads to
η = µ(e/d2 ) · 2π sin ϕ (see the small picture). Then, for small µ, the precession
after one period is
2πµ
∆ϕ = . (6.2)
d
7
We are grateful to Prof. Ruth Durrer for helpful hints about this subject.