Module: stochasticDragCoeff
Executive Summary
The StochasticDragCoeff module applies scalar mean-reverting stochastic noise to aerodynamic drag coefficient by
specializing MeanRevertingNoise. It perturbs dragCoeff in a
DragGeometryMsgPayload and republishes the modified geometry message.
Module Description
The inherited Ornstein-Uhlenbeck state \(x\) evolves as
The output drag coefficient is
The remaining geometry fields are passed through unchanged.
Message Interfaces
Msg Variable Name |
Msg Type |
Description |
|---|---|---|
dragGeomInMsg |
Input drag geometry message containing |
|
dragGeomOutMsg |
Output drag geometry message with stochastic correction applied to |
Detailed Behavior
At each update step, the module performs the following operations:
Reads the current OU state \(x\) from the base class.
Reads
dragGeomInMsg.Multiplies
dragCoeffby \((1+x)\).Writes the modified payload to
dragGeomOutMsg.
The OU process parameters are configured through base-class setters:
setStationaryStd(sigma_st)setTimeConstant(tau)
Module Assumptions and Limitations
The model perturbs only
dragCoeffand leaves projected area and center-of-pressure unchanged.If \(x < -1\), the corrected drag coefficient can become negative unless constrained externally.
Verification and Testing
This module shares the same OU stochastic base implementation as StochasticAtmDensity and uses the same
parameterization and update flow. Current automated OU-statistics testing is provided in
src/simulation/mujocoDynamics/meanRevertingNoise/_UnitTest/test_meanRevertingNoise.py through the
StochasticAtmDensity subclass path.
-
class StochasticDragCoeff : public MeanRevertingNoise
- #include <stochasticDragCoeff.h>
Applies a mean-reverting Ornstein–Uhlenbeck correction to the drag coefficient.
The scalar state \(x\) evolves as:
\[ dx = -\frac{1}{\tau}\,x\,dt + \sqrt{\frac{2}{\tau}}\,\sigma_{\text{st}}\,dW \]The outgoing coefficient is modified as\[ C_{D,\text{out}} = C_{D,\text{in}}(1 + x) \]The projected area and \(r_{CP,S}\) are passed through unchanged.
Public Members
-
ReadFunctor<DragGeometryMsgPayload> dragGeomInMsg
Input drag geometry message.
Read each step to obtain the nominal geometry and coefficient.
-
Message<DragGeometryMsgPayload> dragGeomOutMsg
Output drag geometry message with corrected drag coefficient.
Protected Functions
-
virtual void writeOutput(uint64_t CurrentSimNanos, double x) override
Apply the OU correction to \(C_D\) and write the result.
Called by MeanRevertingNoise::UpdateState after drift and diffusion are set.
- Parameters:
CurrentSimNanos – Simulation time in nanoseconds.
x – Current scalar correction factor.
-
ReadFunctor<DragGeometryMsgPayload> dragGeomInMsg