galport.Hamiltonian.integrate

Hamiltonian.integrate(J0, theta0, t0=0.0, Tint=100, Nint=10000, rtol=1e-10, atol=1e-12)[source]

Integrate Hamiltonian trajectories

Parameters:
  • J0 ((N,) or (N,2) numpy array) –

    Initial actions

    For 2D Hamiltonians (axisym_res) array of shape (N,2) containing [JR, Jz]

  • theta0 ((N,) numpy array) – Initial angles

  • t0 (float, optional) – Initial time. Default: 0.0

  • Tint (int, optional) – Total integration time. Default: 100

  • Nint (int, optional) – Number of time steps for output. Default: 10000

  • rtol (float, optional) – Relative/absolute tolerance for solve_ivp. Default: 1e-10, 1e-12

  • atol (float, optional) – Relative/absolute tolerance for solve_ivp. Default: 1e-10, 1e-12

Returns:

  • t_eval ((M,) array) – Time points from t0 to t0+Tint.

  • (J, theta) (tuple of arrays) – Evolution of actions and angles.

    • 1D: J.shape = (N, M), theta.shape = (N, M)

    • 2D: J.shape = (2, N, M) ([JR, Jz]), theta.shape = (N, M)

Notes

Uses scipy.integrate.solve_ivp with DOP853 method.