pub struct Morse;Expand description
Morse potential implementation for 1-2 bond stretching.
§Physics
Models bond stretching with anharmonicity, allowing for bond dissociation.
- Formula: $$ E = D_e [ e^{-\alpha(R - R_0)} - 1 ]^2 $$
- Derivative Factor (
diff): $$ D = \frac{2 \alpha D_e e^{-\alpha(R - R_0)} \left( e^{-\alpha(R - R_0)} - 1 \right)}{R} $$
§Parameters
de: Dissociation energy $D_e$.r0: Equilibrium distance $R_0$.alpha: Stiffness parameter $\alpha$.
§Inputs
r_sq: Squared distance $r^2$ between two atoms.
§Implementation Notes
- Requires
sqrtandexp. - More computationally expensive than Harmonic.
Trait Implementations§
Source§impl<T: Real> PairKernel<T> for Morse
impl<T: Real> PairKernel<T> for Morse
Source§fn diff(r_sq: T, (de, r0, alpha): Self::Params) -> T
fn diff(r_sq: T, (de, r0, alpha): Self::Params) -> T
Computes only the force pre-factor $D$.
§Formula
$$ D = \frac{2 \alpha D_e e^{-\alpha(R - R_0)} \left( e^{-\alpha(R - R_0)} - 1 \right)}{R} $$
This factor is defined such that the force vector can be computed by a single vector multiplication: $\vec{F} = -D \cdot \vec{r}$.
Source§fn compute(r_sq: T, (de, r0, alpha): Self::Params) -> EnergyDiff<T>
fn compute(r_sq: T, (de, r0, alpha): Self::Params) -> EnergyDiff<T>
Computes both energy and force pre-factor efficiently.
This method reuses intermediate calculations to minimize operations.
impl Copy for Morse
Auto Trait Implementations§
impl Freeze for Morse
impl RefUnwindSafe for Morse
impl Send for Morse
impl Sync for Morse
impl Unpin for Morse
impl UnwindSafe for Morse
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