pub struct Dual {
pub re: f64,
pub eps: f64,
}Expand description
A first-order dual number re + eps·ε (ε² = 0). Evaluating f on Dual::var(x) yields f(x) in re
and f'(x) in eps.
Fields§
§re: f64§eps: f64Implementations§
Trait Implementations§
impl Copy for Dual
Source§impl Real for Dual
The bridge that makes derivatives of dynamics free: Dual satisfies the generic-scalar contract
of ferromotion_core::gendyn, so seeding a dual in any state (q, q̇, q̈) or any inertial
parameter (mass, COM, inertia entry) and running RNEA/forward dynamics yields the exact partial
derivative in eps — no hand-derived derivative code, no finite-difference truncation error.
This is the differentiation engine of gradient-based system identification and calibration.
impl Real for Dual
The bridge that makes derivatives of dynamics free: Dual satisfies the generic-scalar contract
of ferromotion_core::gendyn, so seeding a dual in any state (q, q̇, q̈) or any inertial
parameter (mass, COM, inertia entry) and running RNEA/forward dynamics yields the exact partial
derivative in eps — no hand-derived derivative code, no finite-difference truncation error.
This is the differentiation engine of gradient-based system identification and calibration.
Auto Trait Implementations§
impl Freeze for Dual
impl RefUnwindSafe for Dual
impl Send for Dual
impl Sync for Dual
impl Unpin for Dual
impl UnsafeUnpin for Dual
impl UnwindSafe for Dual
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ClosedNeg for Twhere
T: Neg<Output = T>,
impl<T, U> Imply<T> for U
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 moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.