16.12.2012 Views

Computer Algebra Recipes

Computer Algebra Recipes

Computer Algebra Recipes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

324 CHAPTER 8. NONLINEAR DIAGNOSTIC TOOLS<br />

For N = 1, the motion can be described by a trajectory in the q1 vs. p1 phase<br />

plane. For N>1, the trajectory is in a 2N-dimensional phase space.<br />

Originally motivated to study the motion of a star inside a galaxy, Henon<br />

and Heiles [HH64] introduced a conservative Hamiltonian describing the motion<br />

of a unit mass in the two-dimensional potential<br />

V = 1<br />

2 q2 1 + 1<br />

2 q2 2 + q 2 1 q2 ¡ 1<br />

3 q3 2: (8.4)<br />

The ¯rst two terms in V would generate a paraboloid of revolution characteristic<br />

of a two-dimensional harmonic oscillator. The force ~ F = ¡rV in this case is<br />

just the two-dimensional form of Hooke's law. The inclusion of the two cubic<br />

terms in V distort the shape of the potential away from a paraboloid, add<br />

nonlinear terms to Hooke's law, and Hamilton's equations generate nonlinear<br />

ODEs in the 4-dimensional phase space.<br />

In this recipe, we shall use specialized commands found in the DEtools<br />

library package to generate these equations, numerically solve them to produce<br />

the trajectory for a speci¯ed energy and initial conditions, and produce a<br />

Poincare section.<br />

> restart: with(plots): with(DEtools):<br />

Entering the Henon{Heiles potential (8.4), a two-dimensional contour plot is<br />

generated, the contour lines given by V =0:04 i with i = 0 to 9. To obtain<br />

smooth curves, the number of plotting points is taken to be 5000.<br />

> V:=q1^2/2+q2^2/2+q1^2*q2-q2^3/3:<br />

> contourplot(V,q1=-2..2,q2=-2..2,contours=[seq(0.04*i,<br />

i=0..9)],numpoints=5000,color=black);<br />

q2<br />

2<br />

1<br />

–2 –1 0<br />

1 q1 2<br />

–1<br />

–2<br />

Figure 8.4: Contour plot of the Henon{Heiles potential.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!