Class ExplicitVerletIntegrator#

Inheritance Relationships#

Base Type#

Class Documentation#

class ExplicitVerletIntegrator : public Karana::Integrators::PartitionedIntegrator#

Explicit kick-drift-kick Verlet for separable Q/U equations.

This implementation assumes that the first num_q_states are Q and the rest U coordinates.

Each advanceTo call takes one step of size h using the full-state callback:

\[U_{1/2}=U_n+\frac h2 g(t_n,Q_n),\qquad Q_{n+1}=Q_n+h f(U_{1/2}),\qquad U_{n+1}=U_{1/2}+\frac h2 g(t_{n+1},Q_{n+1}). \]
Second-order accuracy requires separable dynamics: Qdot = f(U) and Udot = g(t, Q). If the dynamics are not separable this method falls back to first order, in which case using Euler or RK4 is more appropriate.

Unequal sizes, such as one Q state and two U states, still give second-order accuracy for the smooth separable equations above. Symplecticity is a separate property: standard Hamiltonian position-momentum pairs require equal Q and U counts and equations from a separable Hamiltonian. A full three-dimensional state cannot be symplectic. If an extra state is constant or redundant, a reduced even-dimensional system may still be symplectic; this depends on the equations and how the reduced state is defined.

Public Functions

ExplicitVerletIntegrator(size_t num_states, size_t num_q_states, DerivativeFunction deriv_fn, const IntegratorOptions *options = nullptr)#

Create a one-step explicit Verlet integrator.

Parameters:
  • num_states – Total number of Q and U states.

  • num_q_states – Number of leading Q states.

  • deriv_fn – Full-state derivative callback for the documented separable equations.

  • options – Base options, or nullptr for defaults.

virtual void hardReset(size_t num_states, size_t num_q_states) override#

Replace the partition and resize the stage buffers.

Parameters:
  • num_states – New total number of states.

  • num_q_states – New number of leading Q states.

Public Static Functions

static kc::ks_ptr<ExplicitVerletIntegrator> create(size_t num_states, size_t num_q_states, DerivativeFunction deriv_fn, const IntegratorOptions *options = nullptr)#

Allocate an explicit Verlet integrator.

Parameters:
  • num_states – Total number of Q and U states.

  • num_q_states – Number of leading Q states.

  • deriv_fn – Full-state derivative callback for separable equations.

  • options – Base options, or nullptr for defaults.

Returns:

A new explicit Verlet integrator.