pub struct DrydenGenerator { /* private fields */ }Expand description
A seeded Dryden turbulence generator that advances along the flight path.
The state is normalized, so the intensities and scale lengths may change from one step to the
next (for example with altitude); within a step they are held constant. Draws come from a
SeededRng in a fixed order (u, then two for v, then two for w), so the same seed
and the same steps give bit-identical gusts on one platform. (Across platforms the math
library’s exp and ln may differ in the last bit.)
It serializes as its generator and state, so a run can be checkpointed and resumed; a non-finite state is rejected when deserialized.
Implementations§
Source§impl DrydenGenerator
impl DrydenGenerator
Sourcepub fn new(seed: u64) -> Self
pub fn new(seed: u64) -> Self
A generator whose initial state is drawn from the stationary distribution using seed.
Sourcepub fn gust_m_s(&self, parameters: &DrydenParameters) -> DVec3
pub fn gust_m_s(&self, parameters: &DrydenParameters) -> DVec3
The current gust (u, v, w) for parameters, m/s.
Sourcepub fn advance(
&mut self,
distance_m: f64,
parameters: &DrydenParameters,
) -> Result<DVec3, AtmosError>
pub fn advance( &mut self, distance_m: f64, parameters: &DrydenParameters, ) -> Result<DVec3, AtmosError>
Moves distance_m along the path through turbulence described by parameters, and
returns the gust there.
§Errors
AtmosError::Domain if the distance is negative or not finite.
Trait Implementations§
Source§impl Clone for DrydenGenerator
impl Clone for DrydenGenerator
Source§fn clone(&self) -> DrydenGenerator
fn clone(&self) -> DrydenGenerator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DrydenGenerator
impl Debug for DrydenGenerator
Source§impl<'de> Deserialize<'de> for DrydenGenerator
impl<'de> Deserialize<'de> for DrydenGenerator
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for DrydenGenerator
impl PartialEq for DrydenGenerator
Source§fn eq(&self, other: &DrydenGenerator) -> bool
fn eq(&self, other: &DrydenGenerator) -> bool
self and other values to be equal, and is used by ==.