pub struct RollDynamics { /* private fields */ }Expand description
Scalar roll channel: roll rate driven by fin cant and opposed by roll
damping. Drive torque = q·A·d·Clδ·δ, damping torque = q·A·d²·Clp·ω/(2V).
Equilibrium rate = 2·Clδ·δ·V/(d·Clp). Feed the resulting effective twist
(speed / rate, in inches per turn) to BallisticForces::set_twist
between public steps.
Implementations§
Source§impl RollDynamics
impl RollDynamics
Sourcepub fn new(
cant_rad: f64,
cl_delta: f64,
clp: f64,
inertia_kg_m2: f64,
diameter_m: f64,
) -> Result<Self>
pub fn new( cant_rad: f64, cl_delta: f64, clp: f64, inertia_kg_m2: f64, diameter_m: f64, ) -> Result<Self>
cant_rad: fin cant angle. cl_delta: roll-drive slope per radian of
cant. clp: roll-damping coefficient (positive = damping).
inertia_kg_m2: roll inertia about the body axis.
Sourcepub fn rate_rad_s(&self) -> f64
pub fn rate_rad_s(&self) -> f64
Current roll rate in rad/s (snapshot state).
Sourcepub fn set_rate_rad_s(&mut self, rate: f64)
pub fn set_rate_rad_s(&mut self, rate: f64)
Restore a previously snapshotted roll rate.
Sourcepub fn update(&mut self, dt_s: f64, q_pa: f64, speed_mps: f64)
pub fn update(&mut self, dt_s: f64, q_pa: f64, speed_mps: f64)
Advance one public step given dynamic pressure (Pa) and airspeed (m/s).
Sourcepub fn equilibrium_rate(&self, speed_mps: f64) -> f64
pub fn equilibrium_rate(&self, speed_mps: f64) -> f64
Equilibrium roll rate for the current cant and airspeed, rad/s.
Trait Implementations§
Source§impl Clone for RollDynamics
impl Clone for RollDynamics
impl Copy for RollDynamics
Auto Trait Implementations§
impl Freeze for RollDynamics
impl RefUnwindSafe for RollDynamics
impl Send for RollDynamics
impl Sync for RollDynamics
impl Unpin for RollDynamics
impl UnsafeUnpin for RollDynamics
impl UnwindSafe for RollDynamics
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,
Source§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.