pub struct SeparableHamiltonian<F: IntegrateFloat> { /* private fields */ }Expand description
A separable Hamiltonian system with H(q, p) = T(p) + V(q)
This represents systems where the Hamiltonian can be split into kinetic energy T(p) depending only on momenta and potential energy V(q) depending only on positions.
Examples include:
- Simple harmonic oscillator: H = p²/2 + q²/2
- Pendulum: H = p²/2 - cos(q)
- Kepler problem: H = |p|²/2 - 1/|q|
Implementations§
Source§impl<F: IntegrateFloat> SeparableHamiltonian<F>
impl<F: IntegrateFloat> SeparableHamiltonian<F>
Sourcepub fn with_gradients<KG, VG>(
self,
kinetic_gradient: KG,
potentialgradient: VG,
) -> Self
pub fn with_gradients<KG, VG>( self, kinetic_gradient: KG, potentialgradient: VG, ) -> Self
Sourcepub fn harmonic_oscillator() -> Self
pub fn harmonic_oscillator() -> Self
Create a simple harmonic oscillator system
H(q, p) = p²/2 + q²/2
§Returns
A harmonic oscillator Hamiltonian
Sourcepub fn kepler_problem() -> Self
pub fn kepler_problem() -> Self
Create a 2D Kepler problem (planetary orbit)
H(q, p) = |p|²/2 - 1/|q|
§Returns
A Kepler problem Hamiltonian
Trait Implementations§
Source§impl<F: IntegrateFloat> Debug for SeparableHamiltonian<F>
impl<F: IntegrateFloat> Debug for SeparableHamiltonian<F>
Source§impl<F: IntegrateFloat> HamiltonianFn<F> for SeparableHamiltonian<F>
impl<F: IntegrateFloat> HamiltonianFn<F> for SeparableHamiltonian<F>
Source§fn dq_dt(
&self,
t: F,
q: &Array1<F>,
p: &Array1<F>,
) -> IntegrateResult<Array1<F>>
fn dq_dt( &self, t: F, q: &Array1<F>, p: &Array1<F>, ) -> IntegrateResult<Array1<F>>
Computes the time derivative of position coordinates: dq/dt = ∂H/∂p Read more
Source§fn dp_dt(
&self,
t: F,
q: &Array1<F>,
p: &Array1<F>,
) -> IntegrateResult<Array1<F>>
fn dp_dt( &self, t: F, q: &Array1<F>, p: &Array1<F>, ) -> IntegrateResult<Array1<F>>
Computes the time derivative of momentum coordinates: dp/dt = -∂H/∂q Read more
Source§fn hamiltonian(
&self,
) -> Option<Box<dyn Fn(F, &Array1<F>, &Array1<F>) -> IntegrateResult<F> + '_>>
fn hamiltonian( &self, ) -> Option<Box<dyn Fn(F, &Array1<F>, &Array1<F>) -> IntegrateResult<F> + '_>>
Optional: Computes the Hamiltonian function H(q, p) Read more
Auto Trait Implementations§
impl<F> Freeze for SeparableHamiltonian<F>
impl<F> !RefUnwindSafe for SeparableHamiltonian<F>
impl<F> Send for SeparableHamiltonian<F>
impl<F> Sync for SeparableHamiltonian<F>
impl<F> Unpin for SeparableHamiltonian<F>
impl<F> !UnwindSafe for SeparableHamiltonian<F>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more