C++ 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.
Message Interfaces
Msg Variable Name |
Msg Type |
Description |
|---|---|---|
dragGeomInMsg |
Input drag geometry message containing |
|
dragGeomOutMsg |
Output drag geometry message with stochastic correction applied to |
Module Description
The inherited Ornstein-Uhlenbeck state \(x\) evolves as
The output drag coefficient is
The remaining geometry fields are passed through unchanged.
Verification and Testing
The module is validated in
src/simulation/mujocoDynamics/stochasticDragCoeff/_UnitTest/test_stochasticDragCoeff.py
by checking that the output drag coefficient time series has the expected OU statistics (mean, variance, and
correlation time) for a constant nominal drag geometry input.
-
class StochasticDragCoeff : public MeanRevertingNoise
- #include <stochasticDragCoeff.h>
Applies a mean-reverting Ornstein–Uhlenbeck correction to the drag coefficient.
Derives from MeanRevertingNoise. Scales the incoming drag coefficient by \((1 + x)\), where \(x\) is the OU state maintained by the base class. All other geometry fields 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
-
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