implementations.problem_classes.HenonHeiles module

class henon_heiles[source]

Bases: ptype

This class implements the second-order Hénon-Heiles system

\[\frac{d^2 x}{dt^2} = - x - 2 x y,\]
\[\frac{d^2 y}{dt} = - y - x^2 + y^2\]

with Hamiltonian

\[H = 0.5 \left[\left(\frac{d x}{d t}\right)^2 + \left(\frac{d y}{d t}\right)^2\right] + 0.5 \left(x^2 + y^2\right) + x^2 y - \frac{y^3}{3}.\]
dtype_f

alias of acceleration

dtype_u

alias of particles

eval_f(u, t)[source]

Routine to compute the right-hand side of the problem.

Parameters:
  • u (dtype_u) – Current values of the particles.

  • t (float) – Current time of the particles is computed (not used here).

Returns:

me – The right-hand side of the problem.

Return type:

dtype_f

eval_hamiltonian(u)[source]

Routine to compute the Hamiltonian.

Parameters:

u (dtype_u) – Current values of The particles.

Returns:

ham – The Hamiltonian.

Return type:

float

u_exact(t)[source]

Routine to compute the exact/initial trajectory at time \(t\).

Parameters:

t (float) – Time of the exact/initial trajectory.

Returns:

me – Exact/initial position and velocity.

Return type:

dtype_u