You are on page 1of 11

Exercises

Day 1
Consider a differential equation of the form

y = f (z)
z = g(y)

Use Matlab to construct the following integrators for this type of differential
equations:
symplectic Euler and Strmer/Verlet. (Notice that in this case both of these
integrators are explicit).
Construct the explicit Euler, the implicit midpoint method, and an ex-
plicit Runge-Kutta 4th order method (the integrator given by the left scheme
in table 1.8 in Hairer, Lubich and Wanner [2002]) for a general autonomous
differential equation.

Solve numerically the equations governing the motion of the pendulum


   
p
=
p sin()

using the constructed integrators. Plot the vector field (use quiver) together
with some solution curves, for the explicit Euler and the symplectic Euler.
Show analytically that the energy

1
E = p2 cos()
2
is constant along the flow. How well do the different integrators conserve the
energy?
l1
1

m1 l2
2
m2

Figure 1: The double pendulum.

Day 2
Find the Euler-Lagrange equations for the following Lagrangians
)
L(, , , = 2 + 2 sin2
z)
L(, z, , = (a2 sin2 + b2 cos2 )2 + z 2
 2
2 2 xx y y
L(x, y, x,
y)
= x + y + 4 + 2
a2 b
These Lagrangians turn out to be the ones determining geodesic curves on a
sphere, an elliptic cylinder, and an elliptic paraboloid.

Find the Lagrangian giving the geodesic curves on

= {(x, y, z) R3 | x2 + y 2 = f (z)} f : R R+

i.e. a surface of revolution in R3 .


Find the geodesic curves on a cylinder S R.
Find the equations giving the geodecis curves on a hyperbolic paraboloid

x2 y 2
2 =z
a2 b
For a = b = 1 find numerically geodesic curves and plot them on the hyper-
bolic paraboloid (use plot3 and surf).
Day 3
Find the Lagrangian for the spherical pendulum (i.e. particle moving on a
sphere), the double pendulum (see figure 1), and the governor (see figure 2).

Use Noethers theorem to show that if the Lagrangian for a system of n


point masses in R3n is invariant under rotations about a certain axis then
the total angular momentum with respect to this axis is constant under the
motion of the system.
If a point mass in R3 is invariant under a helical movement with pitch `
what is then the conserved quantity?

l l

m1 m1

l l

m2

Figure 2: The governor. The whole system rotates about the vertical axis
with constant angular velocity .

Day 4
Construct for

x = f [1] (x) + f [2] (x)

a 1st order splitting method Splitting2_1st(flow1,flow2,x0,T,h), a 2nd


order splitting method, a 4th order splitting method, and a 6th order split-
ting method. Solve numerically the equations for the pendulum using these
methods. How well do the methods conserve the energy? How does max |E|
depend on the time step h?
What can make a differential equation unsuited for analysis using a split-
ting method?
Extra: Construct a splitting method of arbitrary even order p, i.e. it
should take the order as input.

Day 5
Find Hamiltons equations for the spherical pendulum and the double pen-
dulum.

A symmetric top with the tip fixed is called a Lagrange top. Using the
Euler angles (, , ), see figure 3, the kinetic energy is given by

A1 2 2 2 A3
K= ( + sin ) + ( + cos )2
2 2
where A1 is the moment of inertia about the e1 and e2 axes, and A3 is the
moment of inertia about the e3 axis. So the Lagrangian for this system is

A1 2 2 2 A3
L= ( + sin ) + ( + cos )2 mgh cos
2 2
where m is the mass , g is the gravitational accelleration, and h is the po-
sition of the center of mass on the e3 axis. Find Hamiltons equation for
the Lagrange top. Solve the system numerically, using the implicit midpoint
rule, and plot the movement of the center of mass in the (x, y, z) coordinate
system.

A class of transformations which is bigger than the canonical ones is the


one of weakly canonical transformations which is defined as follows.

Definition 1. The smooth coordinate transformation : R2n R2n , (p,


q)
(p, q), is said to be weakly canonical if for any Hamiltonian H there exist a
Hamiltonian H e such that Hamiltons equations y = J1 H(y) are equivalent
to the different set of Hamiltons equations y = J1 H(
e y ).

Homogeneous rescaling is given by

pi = i pi qi = i qi i i =
ez

e2
e3

e1
ey
n

ex

Figure 3: The Euler angles (, , ).

for i = 1, . . . , n. Show that this is a weakly canonical transformation. What


is H?
e When is homogeneous rescaling a canonical transformation?
It can actually be shown that the class of weakly canonical transformation
consists of no more than canonical transformations combined with homoge-
neous rescaling, so even though this class of transformations seems much
larger than the canonical one, it is only a trivial extension of it.

Day 6
Find the canonical transformation : R2 R2 given by the generating
function
1
S1 = mq 2 cot q
2
How does this transform the Hamiltonian for the harmonic oscillator
p2 1
H= + m 2 q 2
2m 2
For this problem give a graphical explanation of the transformation.

The three particle Toda lattice is the system with three degrees of freedom
with Hamiltonian
1
H = (p21 + p22 + p23 ) + e(1 3 ) + e(2 1 ) + e(3 2 ) 3
2
1
2

Figure 4: The three particle Toda lattice.

which corresponds to three particles moving on a ring (see figure 4) with


exponentially decreasing forces between them. Since the potential is invariant
under a rotation hs (1 , 2 , 3 ) = (1 +s, 2 +s, 3 +s) we know from Noethers
theorem that the total momentum is a constant of the motion. Transform
the Hamiltonian using the canonical transformation given by

p3 p1 p2 )3
S2 = p1 1 + p2 2 + (

This transformation shows that p1 + p2 + p3 is constant, how? With out


loss of generality we choose the case where p1 + p2 + p3 = 0. Explain why
the system effectively is determined by the system with 2 degrees of freedom
with Hamiltonian

= 1 p21 + p22 + (
p1 + p2 )2 + e1 + e(2 1 ) + e2 3

H
2
Transform this Hamiltonian to H 0 using the generating function
1  
S20 = (p0x 3p0y )1 + (p0x + 3p0y )2
4 3
(p0x , p0y , x0 , y 0 ) being the new coordinates. Finally transform this Hamiltonian
to H b by use of the homogeneous rescaling

p0x = 8 3px x0 = x p0y = 8 3py y0 = y

Since H
t = H t the dynamics of the system with Hamiltonian H = H/ 3
e b
is quivalent to that with Hamiltonian H b up to a rescaling of time.
The Hamiltonian H, e if correct, corresponds to the Hamiltonian for a
2
particle in R in a potential. Sketch some level curves of this potential
(implicitplot in Maple is an easy way to do this).

Day 7
Construct a program Poincare(x,y,z) which for a numerically calculated flow
in R3 plots the Poincar section with surface of section being the (y, z) plane
with x = 0. It shouldnt distinguish between the two different directions the
flow can go from one side of the surface of section to the other, just plot the
point of intersection with the surface of section when the flow changes side.
Use linear interpolation to find the point of intersection.
The Toda lattice continued. For x = 0 find the boundary of WE , for H, e
in the (y, py ) plane, i.e. the boundary as a function of E and y. Construct a
program Toda_boundary(E) which for a given value E of the energy plots
this boundary in the (y, py ) plane. Make the following program work by
filling in the place between %, and perhaps adjusting it to your previously
constructed programs.

function []=Toda_Poincare(E)
h=1/10;
T=500;
Toda_boundary(E);
title([The Toda Lattice. H=,sprintf(%0.3f,E) ],fontsize,14)
xlabel(y,fontsize,14)
ylabel(p_y,fontsize,14)
hold on
[y0, py0,ok] = ginput(1);
while ok ~= 13
px0=%px(0) as a function of y(0)=y0, py(0)=py0, and E (and x=0)%
[x,t]= Splitting2_4th(Toda_flowV,Toda_flowK,[px0;py0;0;y0],T,h);
Poincare(x(3,:),x(4,:),x(2,:))
[y0, py0,ok] = ginput(1);
end

Here Splitting2_4th is the fourth order splitting method for a vector


field with two integrable components constructed day 4, and Toda_flowV is
the flow of y = J1 V (y) and Toda_flowK is the flow of y = J1 K(y),
V and K being the potential part and the kinetic part of H e respectively.
ginput enables the user to get the value of something, here the initial value
of y and py for the Toda lattice, by clicking on a figure.
Write explanatory text in the program.
Use this program to make Poincare sections for E = 1 and E = 5. What
does these figures suggest about the system? For

F = 8px (p2x 3p2y ) + (px + 3py )e2y2 3x
2px e4y + (px 3py )e2y+2 3x

d
what is dt F H
t ? Plot F along an approximate solution found by Split-
e

ting2_4th.

If the spring constant changes slowly in time for the harmonic oscillator
the Hamiltonian for this system is now

p2 1
H= + m( )2 q 2
2m 2
where = t, 0   1.
For  small, find numerically, using the implicit midpoint method, how
p(t), given as for the time independent S1 used day 6, and H(t) behaves for

( ) = arctan( ) + 2

Using the graphical picture of the transformation derived day 6, explain the
behavior. If done correctly p(t) should be almost conserved this is an
example of an adiabatic invariant.

Day 8
Construct Toda_perturbed_Poincare(E,e), working similar to Toda_Poincare,
for the pertured Toda lattice with Hamiltonian

=H
H e +  sin x

For E = 1 make Poincar sections for different values of , can you find a
value where you can see both dynamics of the unperturbed system and a new
kind of dynamics?
Analyse numerically the model of model of n = 3 weakly coupled rotators
with Hamiltonian
H(I, ) = h(I) + f ()
with
n n
1X 2 X
h(I) = I f () = cos(j j1 ) 0 = n
2 j=1 j j=1

Take the initial conditions to be


 
2 4
I(0) = (6, 8, 8) (0) = 0, ,
3 3
Use a splitting method with f [1] = J1 h and f [2] = J1 f . Are the re-
sults in agreement with Nekhoroshevs theorem? Should they expected to be
so? Can you give an estimate of b?

Given a numerical solution (t; p; ) = (t1 , . . . , tm ; p1 , . . . , pm ; 1 , . . . , qm ) to


the pendulum equations, used day 1, the following program can, when given
(t; ) make an animation of the pendulum in the x-y plane.

function []= pendulum_animation(t,theta)


x=sin(theta);
y=-cos(theta);

figure
axis equal
axis([-1.2 1.2 -1.2 1.2])

hold on
for j=1:length(t)
cla;
plot([0 x(j)],[0 y(j)],k,linewidth,2)
plot(x(j),y(j),o,markersize,12,...
markeredgecolor,[1 0 0],markerfacecolor,[1 0 0])
title([The Pendulum. t=,sprintf(%0.3f,t(j)) ],fontsize,14)
getframe;
end

Use the bits and pieces in this program to construct a program which
makes an animation of the douple pendulum or of the governor. Write ex-
planatory text in the program.
Day 9
Consider a particle moving in one dimension in the scattering potential
2
eq
V =
q

with the usual expression for the kinetic energy K = 21 p2 . Use the second
order splitting method h = K V K
h/2 h h/2 and an explicit 4th order Runge-
Kutta method to find a solution for q(0) = 20, p(0) = 1. With respect to
the energy how do the two methods perform, how are they different?
Reconstruct the splitting method in such a way that it stops when the
value of q is back to q(0), in this way it shouldnt be given a time interval.
Let y start = (pstart , qstart ) be the initial value and y end = (pend , qend ) the final
value. For the Hamiltonian H = T + V define
max |H(y end ) H(y start )|
H =
H(y start )

How does H approximately depend on q0 for h = 10? How does H ap-


proximately depend on h for q0 = 20?

Consider a diatomic molecule in a scattering potential described classi-


cally by
2 2
1 1 e(q1 +q2 /2) e(q1 q2 /2)
K = (p21 + p22 ) V = q22 + + H =K +V
2 2 q1 + q2 /2 q1 q2 /2

where q1 is the position of the center of mass and q2 is the distance between
the atoms. Consider the splitting h = K V K
h/2 h h/2 and the splitting
method h = H H2 H1
h/2 h h/2 with
1

2 2
1 e(q1 +q2 /2) e(q1 q2 /2)
H1 = (p21 + p22 + q22 ) H2 = +
2 q1 + q2 /2 q1 q2 /2

Choose initial condition to be

p(0) = (1, 0.5) q = (20, 0.2)

With respect to the energy how do the two methods perform, how are they
different?
Day 10
Explain the figure of F vs. t made day 7.

Find the modified Hamiltonian H b for the integrator h constructed day


9. Plot level curves for H along with level curves for the Hamiltonian for the
b
system. Can you explain the behavior of H vs. q0 and the behavior of H
vs. h?
How do you know from the modified Hamiltonians that h is better suited
for analysis of the diatomic molecule than h ?

You might also like