|
Dedekind 0.0.0
A structuralist C++23 Module Library
|
The Principle of Least Action (Hamiltonian Dynamics). More...
#include <cmath>#include <concepts>#include <cstddef>#include <functional>import dedekind.sequences;import dedekind.geometry;import dedekind.analysis:ftc;import dedekind.algebra;import dedekind.category;
Classes | |
| struct | dedekind::analysis::HarmonicOscillator< R > |
| Concrete Hamiltonian carrier for the 1-D harmonic oscillator. More... | |
Concepts | |
| concept | dedekind::analysis::IsHamiltonian |
| Formal verification of the energy mapping. | |
| concept | dedekind::analysis::IsPoissonAlgebra |
| A Ring equipped with a bracket satisfying the Jacobi Identity. | |
Typedefs | |
| template<std::floating_point R> | |
| using | dedekind::analysis::PhasePoint = Vector<R, 2> |
| Canonical 1D phase-space state (q, p). | |
Functions | |
| template<std::floating_point R, std::size_t N> | |
| constexpr R | dedekind::analysis::poisson_bracket (auto &&f, auto &&g, const Vector< R, N > &state) |
| The Poisson Bracket: The fundamental operation of Classical Mechanics. | |
| template<std::floating_point R> | |
| constexpr PhasePoint< R > | dedekind::analysis::harmonic_oscillator_closed_form (R q0, R p0, R t, R ω=R{1}) |
| Closed-form harmonic-oscillator flow at time t. | |
| template<std::floating_point R> | |
| constexpr auto | dedekind::analysis::harmonic_oscillator_curve (R q0, R p0, R ω=R{1}) |
| Continuum-indexed Hamiltonian trajectory as a Curve. | |
| template<std::floating_point R> | |
| constexpr auto | dedekind::analysis::harmonic_oscillator_leapfrog_path (R q0, R p0, R dt, R ω=R{1}) |
| Discrete Hamiltonian trajectory via leapfrog/Verlet (infinite path). | |
| template<std::floating_point R> | |
| constexpr auto | dedekind::analysis::harmonic_oscillator_leapfrog_finite_path (R q0, R p0, R dt, std::size_t steps, R ω=R{1}) |
The Principle of Least Action (Hamiltonian Dynamics).
@partition :hamilton
This partition defines the generator of motion ( \mathcal{H} ). In the Dedekind Category, the Hamiltonian is the Morphism that maps the Phase Space (Position and Momentum) to the Energy Scalar Field.
Following the Poisson formulation:
|
constexprexport |
Closed-form harmonic-oscillator flow at time t.
For H(q,p) = 1/2 (p^2 + ω^2 q^2) with unit mass: q(t) = q0 cos(ωt) + (p0/ω) sin(ωt) p(t) = p0 cos(ωt) - ω q0 sin(ωt)
|
constexprexport |
Discrete Hamiltonian trajectory via leapfrog/Verlet (infinite path).
The update is the symplectic kick-drift-kick form used in N-body style benchmark loops: preserve qualitative energy behavior over long horizons.
|
constexprexport |
The Poisson Bracket: The fundamental operation of Classical Mechanics.
{f, g} = Σ (∂f/∂q ∂g/∂p - ∂f/∂p ∂g/∂q)