You are on page 1of 5

Introduction to

Hamiltonian systems

Examples
Mathematical biology: Lotka-Volterra model
First numerical methods
Mathematical pendulum
Kepler problem
Outer solar system
Molecular dynamics

Marlis Hochbruck
Heinrich-Heine Universitat D
usseldorf

Oberwolfach Seminar, November 2008

Lotka-Volterra model I


u(t) number of predators

v (t) number of prey

First integrals
Energy, linear invariants
Quadratic and polynomial invariants
Reversible dierential equations
Symmetric methods

Lotka-Volterra model II

u = u(v 2)

v = v (1 u)

general autonomous system of odes


y = f (y )

y point in phase space

f (y ) vector eld (velocity in y )

ow: t : y0  y (t) if y (0) = y0

Invariant of Lotka-Volterra model

3u

u number of predators, v number of prey

First numerical methods


autonomous problem y  = f (y )

equations
u = u(v 2),

v = v (1 u)

yn+1 = yn + hf (yn )

divide by each other and separation of variables


0=

1u
v 2
d
u
v = I (u, v )
u
v
dt

explicit Euler method:

implicit Euler method:


yn+1 = yn + hf (yn+1 )

with invariant
I (u, v ) = ln u u + 2 ln v v


every solution lies on level curve of I

level curves are closed thus all solutions are periodic

implicit midpoint rule



yn+1 = yn + hf

yn + yn+1
2

discrete or numerical ow: h : yn  yn+1

Partitioned systems symplectic Euler

Lotka-Volterra model experiment

partitioned system
u = f (u, v ),

v = g (u, v )

explicit Euler
v

combine explicit and implicit Euler: symplectic Euler


un+1 = un + hf (un , vn+1 )
vn+1 = vn + hg (un , vn+1 )

implicit Euler
v

(SE1)

y82

y0

or

symplectic Euler

y49
y50

y83

un+1 = un + hf (un+1 , vn )
vn+1 = vn + hg (un+1 , vn )

y0

y0

SE1 becomes explicit if f (u, v ) = f (u), g (u, v ) = g (v )


SE2 becomes explicit if f (u, v ) = f (v ), g (u, v ) = g (u)

Hamiltonian problem

Mathematical pendulum

Hamiltonian H(p, q) = H(p1 , . . . , pd , q1 , . . . , qd )


(total energy)

q1 , . . . , qd positions
p1 , . . . , pd momenta

Hamiltonian equations of motion

mass m = 1, massless rod of length  = 1,


gravitational acceleration g = 1

Hamiltonian


p = Hq ,

H q = q H =

H
q

T

energy conservation: H(p(t), q(t)) = const for all t

Area preservation

cos q

equations of motion p = Hq , q = Hp
p = sin q,


m

q = p

or

q = Hp

1
H(p, q) = p 2 cos q
2

y0

(SE2)

q = sin q


vector eld 2-periodic in q = phase space cylinder R S 1

ow t (p, q) is an area preserving mapping

Pendulum numerical experiment

explicit Euler
h = 0.2

symplectic Euler
h = 0.3

St
ormer-Verlet
h = 0.6

Kepler problem two-body problem




1st body as center of coordinate system

(p, q) coordinates of second body

Numerical example Kepler problem


400 000 steps
h = 0.0005

Hamiltonian

1
H(p1 , p2 , q1 , q2 ) = (p12 + p22 ) (q12 + q22 )1/2
2

1
1

implicit midpoint

q i = pi ,

p i = Hqi =

qi (q12

explicit Euler

equations of motion:
q22 )3/2

4 000 steps
h = 0.05

symplectic Euler

4 000 steps
h = 0.05

rst integrals
2

total energy H(p, q)

angular momentum L(p1 , p2 , q1 , q2 ) = q1 p2 q2 p1


(Keplers second law)

Stormer Verlet

Numerical example Kepler problem II

1 4 000 steps

h = 0.05

Qualitative long-time behavior Kepler problem

conservation of energy
.02

explicit Euler, h = 0.0001

method

.01

symplectic Euler, h = 0.001


50

100

global error of solution

.4

explicit Euler, h = 0.0001

error in H

error in L

global error

explicit Euler

O(th)

O(th)

O(t 2 h)

symplectic Euler

O(h)

O(th)

implicit midpoint

O(h2 )

O(th2 )

St
ormer-Verlet

O(h2 )

O(th2 )

.2

symplectic Euler, h = 0.001


50

100

Outer solar system

Outer solar system numerical example

Hamiltonian
H(p, q) =

1
2

5

i=0

1 T
p pi g
mi i

5 
i1

i=1 j=0

explicit Euler, h = 10

implicit Euler, h = 10

symplectic Euler, h = 100

Stormer Verlet, h = 200

mi mj
qi qj 

astronomical units (1 A.U. = 149 597 870 km)

masses relative to mass of sun

m0 = 1.00000597682 (account for inner planets)

g = 2.95 . . . 104 gravitational constant

initial positions and initial velocity from Sept. 5, 1994, 0h00

Molecular dynamics

Numerical experiment frozen argon crystal

Hamiltonian
N = 7 argon atoms in a plane


 
1 1 T
pi pi +
Vij qi qj 
2
mi
i1

H(p, q) =

i=2 j=1

i=1

2
7

Vij (r ) potential function

qi , pi positions and momenta of atoms

mi atomic mass of ith atom

3
1

4
5

in molecular dynamics: Vij Lennard-Jones potential


.2

Vij (r ) = 4ij

 
12
ij

 6 
ij

.0

temperature

.2

30

explicit Euler, h = 0.5[fs]

0
30
60

symplectic Euler, h = 10[fs]

30
30

Verlet, h = 80[fs]

total energy

30

total energy

30

explicit Euler, h = 10[fs]

60

First integrals

Verlet, h = 40[fs]

30

N
1 
mi q i 2
NkB
i=1

Numerical experiment argon crystal

60

T =

Verlet, h = 10[fs]

Denition. A non-constant function I (y ) is called a rst integral of


y = f (y ) if
I  (y )f (y ) = 0
for all y .
synonyms: invariant, conserved quantity, constant of motion

30

30
30

0
30
60

symplectic Euler, h = 10[fs]

30

temperature

Verlet, h = 20[fs]

temperature

Examples of rst integrals

Quadratic and polynomial invariants


consider

total energy H(p, q) in Hamiltonian systems

total linear and angular momentum of N-body systems



1 1 T
pi pi +
Vij (rij ),
2
mi
N

H(p, q) =

i=1

rij = qi qj 

i=2 j=1

p i =

N


ij (qi qj ),

A(Y ) skew symmetric for all Y

where Y is a vector or a matrix

i1

equations of motion
1
pi ,
q i =
mi

Y = A(Y )Y ,

ij =

Vij (rij )/rij

j=1

linear invariants I (y ) = d T y , d constant, s.t. d T f (y ) = 0

Theorem. The quadratic function I (Y ) = Y T Y is invariant. In


particular, orthogonality of Y0 is conserved.
Lemma. Let Y , A(Y ) Rn,n . If trace A(Y ) = 0 for all Y , then
det Y is an invariant.


det Y represents volume of parallelepiped generated by


columns of Y

volume convervation for trace A(Y ) = 0

Reversible dierential equations

Reversible vector elds examples

Denition. Let be an invertible linear transformation in the phase


space of y = f (y ). The dierential equation and the vector eld
f (y ) are called -reversible if
f (y ) = f (y )

partitioned system
u = f (u, v ),

v = g (u, v )

for all y
where

f (y )

y
f (y )
f (y )

y0

f (y )

u
y0

g (u, v ) = g (u, v )

is ()-reversible for (u, v ) = (u, v )

u
y

f (u, v ) = f (u, v ),

y1

t y1

second order dierential equations


u = g (u) u = v , v = g (u)
are ()-reversible

Do numerical methods produce a reversible numerical ow when


applied to a reversible dierential equation?

Symmetric methods
Denition. A numerical one-step method h is symmetric or time
reversible if
h h = id.
y1 = h (y0 ) is symmetric if exchanging
y0 y1 and h h
leaves the method unaltered
Examples: implicit midpoint rule, St
ormer-Verlet method
Theorem. If a numerical method applied to a -reversible
dierential equations satises
h = h
then h is -reversible if and only if h is a symmetric method.

You might also like