# Part I: Hamilton Dynamics

Consider a system described by a Hamiltonian dynamics

$\dot p_n = - \frac{\partial\mathcal H}{\partial q_n}\quad$
$\dot q_n = \frac{\partial\mathcal H}{\partial p_n} \quad$
where qn(t) represents a positions and pn(t) a momenta and qn(0), pn(0) are the initial conditions. Here the total energy

$E=\mathcal H\left(q_n(0),p_n(0)\right)$
is a constant of the motion.

## Euler Discretization

$p_{t+\Delta t} = p_t - \Delta t \, \left( \frac{\partial\mathcal H}{\partial q} \right)_{q=q_t, p=p_t} \quad$
$q_{t+\Delta t} = q_t + \Delta t \left( \frac{\partial\mathcal H}{\partial p} \right)_{q=q_t, p=p_t} \quad$

import pylab
Ntime = 200
dt = 0.1
q = 0.
p = 1.
posq = [ q ]
posp = [ p ]
for itime in range(Ntime):
oldq = q
oldp = p
p = oldp - dt * oldq
q = oldq + dt * pold
energy = p**2 + q**2
posp.append(p)
posq.append(q)
print "time= ", itime * dt, " energy= ", energy
pylab.xlabel('q', fontsize=24)
pylab.ylabel('p', fontsize=24)
pylab.plot(posq,posp,'b-')
pylab.show()

## Symplectic and Poincaré theorem (1899)

 The cat and the pendulum: area preservation of the flow of Hamiltonian systems

• Symplectic transformation
• Symplectic mapping
• Poincaré theorem: The Hamiltonian evolution is a symplectic mapping (generalization of Liouville theorem). The theorem is shown in figure for the simple example of the mathematical pendulum

$\quad \quad \mathcal H_{\text{pendulum}} = \frac{p^2}{2} - \cos q$

## Symplectic integrators

$p_ {t+\Delta t} = p_t - \Delta t \, \left( \frac{\partial\mathcal H}{\partial q} \right)_{q=q_t, p=p_ {t} } \quad$
$q_ {t+\Delta t} = q_t + \Delta t\, \left( \frac{\partial\mathcal H}{\partial p} \right)_{q=q_t, p=p_ {t+\Delta t} } \quad$

# Short history:

The study of hard-sphere systems goes back a long time. Many people see a precursor in the Roman poet and philosopher Lucretius. Another mile-stone was Daniel Bernoulli's (1700 – 1782) discussion of the pressure dependence of a hard-sphere gas (1738). Boltzmann worked on hard spheres, so did Maxwell, and many researchers since then. The phase transition in hard disks, discovered by Alder and Wainwright [1] in 1962 is an important discovery made by numerical simulations using the event-driven algorithm.
Event driven dynamics was invented by Alder and Wainwright, in 1957. Here is a cartoon of the time-evolution of four hard disks in a square box.

 Event-driven Molecular Dynamics simulation for 4 disks in a box

At time t=0, each disk starts at a given position and with a given velocity. The entire time-evolution is simply the solution of Newton's equations: Each disk moves freely until it collides either with another disk or with a wall. In this simulation, time is continuous, and the time for the next "event" can be computed exactly: it is given by the minimum of N(N-1)/2 pair collision times for isolated pairs of particles, without walls, and N wall-collision times (for isolated disks). The figure on the top is SMAC fig. 2.1.

# How to test ergodicity? Explain the movie

 Molecular Dynamics evolution for four hard disks in a box with walls (simulation by Maxim Berman).

### Chaos

 The same MD simulation executed with different precisions of arithmetic

The event-driven molecular dynamics algorithm has no time-step error, and the only source of error comes from the finite precision of the arithmetic. These errors are magnified from iteration to iteration. The cartoons on the left illustrates the influence of tiny rounding errors on the dynamics. This is SMAC fig. 2.5. This extreme influence on the initial conditions is called ''chaos''. In this simulation, chaos has two consequences:
• Molecular dynamics cannot really give rigorous results for the dynamics: How can we compute the exact positions of particles at t = 100000 if for t = 33, we already need double precision?
• The hard-sphere system is chaotic for all radii. Chaos implies that statistical mechanics applies to a finite system of hard spheres and hard disks. This was proven in fundamental theorems by Sinai[2] and Simanyi[3] . The mathematical problems in these works are formidable, however, and the situation does not seem to be fully under control.

Here's how to change the
Python

# Part I: Hamilton Dynamics

Consider a system described by a Hamiltonian dynamics

p˙n=−qn
q˙n=pn

where qn(t) represents a positions and pn(t) a momenta and qn(0), pn(0) are the initial conditions. Here the total energy
E=(qn(0),pn(0))
is a constant of the motion.

## Euler Discretization

pt+Δt=ptΔt(q)q=qt,p=pt
qt+Δt=qt+Δt(p)q=qt,p=pt

<span class="kw1">import</span> pylab
Ntime <span class="sy0">=</span> <span class="nu0">200</span>
dt <span class="sy0">=</span> <span class="nu0">0.1</span>
q <span class="sy0">=</span> <span class="nu0">0</span>.
<span class="me1">p</span> <span class="sy0">=</span> <span class="nu0">1</span>.
<span class="me1">posq</span> <span class="sy0">=</span> <span class="br0">[</span> q <span class="br0">]</span>
posp <span class="sy0">=</span> <span class="br0">[</span> p <span class="br0">]</span>
<span class="kw1">for</span> itime <span class="kw1">in</span> <span class="kw2">range</span><span class="br0">(</span>Ntime<span class="br0">)</span>:
oldq <span class="sy0">=</span> q
oldp <span class="sy0">=</span> p
p <span class="sy0">=</span> oldp - dt * oldq
q <span class="sy0">=</span> oldq + dt * pold
energy <span class="sy0">=</span> p**<span class="nu0">2</span> + q**<span class="nu0">2</span>
posp.<span class="me1">append</span><span class="br0">(</span>p<span class="br0">)</span>
posq.<span class="me1">append</span><span class="br0">(</span>q<span class="br0">)</span>
<span class="kw1">print</span> <span class="st0">"time= "</span><span class="sy0">,</span> itime * dt<span class="sy0">,</span> <span class="st0">" energy= "</span><span class="sy0">,</span> energy
pylab.<span class="me1">xlabel</span><span class="br0">(</span><span class="st0">'q'</span><span class="sy0">,</span> fontsize<span class="sy0">=</span><span class="nu0">24</span><span class="br0">)</span>
pylab.<span class="me1">ylabel</span><span class="br0">(</span><span class="st0">'p'</span><span class="sy0">,</span> fontsize<span class="sy0">=</span><span class="nu0">24</span><span class="br0">)</span>
pylab.<span class="me1">plot</span><span class="br0">(</span>posq<span class="sy0">,</span>posp<span class="sy0">,</span><span class="st0">'b-'</span><span class="br0">)</span>
pylab.<span class="me1">show</span><span class="br0">()</span>

## Symplectic and Poincaré theorem (1899)

 catpendulum.png

The cat and the pendulum: area preservation of the flow of Hamiltonian systems
• Symplectic transformation
• Symplectic mapping
• Poincaré theorem: The Hamiltonian evolution is a symplectic mapping (generalization of Liouville theorem). The theorem is shown in figure for the simple example of the mathematical pendulum

pendulum=p22cosq

## Symplectic integrators

pt+Δt=ptΔt(q)q=qt,p=pt+Δt
qt+Δt=qt+Δt(p)q=qt,p=pt+Δt

# Short history:

The study of hard-sphere systems goes back a long time. Many people see a precursor in the Roman poet and philosopher Lucretius. Another mile-stone was Daniel Bernoulli's (1700 – 1782) discussion of the pressure dependence of a hard-sphere gas (1738). Boltzmann worked on hard spheres, so did Maxwell, and many researchers since then. The phase transition in hard disks, discovered by Alder and Wainwright in 1962 [1] is an important discovery made by numerical simulations using the event-driven algorithm.

Event driven dynamics was invented by Alder and Wainwright, in 1957. Here is a cartoon of the time-evolution of four hard disks in a square box.

 Event_movie.jpg

Event-driven Molecular Dynamics simulation for 4 disks in a box

At time t=0, each disk starts at a given position and with a given velocity. The entire time-evolution is simply the solution of Newton's equations: Each disk moves freely until it collides either with another disk or with a wall. In this simulation, time is continuous, and the time for the next "event" can be computed exactly: it is given by the minimum of N(N-1)/2 pair collision times for isolated pairs of particles, without walls, and N wall-collision times (for isolated disks). The figure on the top is SMAC fig. 2.1.

# How to test ergodicity? Explain the movie

 Event_chain_box.gif

Molecular Dynamics evolution for four hard disks in a box with walls (simulation by Maxim Berman).

### Chaos

1. ^ B. J. Alder and T. E. Wainwright, Phase Transition in Elastic Disks Phys. Rev. 127, 359 (1962)
2. ^ Y. G. Sinai Dynamical systems with elastic reflections, [http://iopscience.iop.org/0036-0279/25/2/R05 Russian Mathematical Surveys 25, 137-189 (1970)]
3. ^ N. Simanyi, Proof of the Boltzmann-Sinai ergodic hypothesis for typical hard disk systems [http://www.springerlink.com/content/yf9uw55m3vm6utqx/ Inventiones Mathematicae 154, 123-178 (2003)]