Skip to main content

integrate_symplectic

Function integrate_symplectic 

Source
pub fn integrate_symplectic<F, G, H>(
    q0: f64,
    p0: f64,
    h: f64,
    steps: u64,
    force: F,
    kinetic_velocity: G,
    hamiltonian: H,
    method: SymplecticMethod,
) -> SymplecticResult
where F: Fn(f64) -> f64, G: Fn(f64) -> f64, H: Fn(f64, f64) -> f64,
Expand description

Integrate a separable Hamiltonian system for steps steps of size h.

hamiltonian(q, p) returns the total energy (for the conservation diagnostic). Returns the final (q, p) and the maximum |E - E₀| observed. Zero-heap.