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

\[dx = -\frac{1}{\tau}x\,dt + \sqrt{\frac{2}{\tau}}\sigma_{st}\,dW\]

The output drag coefficient is

\[C_{D,out} = C_{D,in}(1 + x)\]

The remaining geometry fields are passed through unchanged.

Message Interfaces

Module I/O Messages

Msg Variable Name

Msg Type

Description

dragGeomInMsg

DragGeometryMsgPayload

Input drag geometry message containing dragCoeff, projected area, and center-of-pressure data.

dragGeomOutMsg

DragGeometryMsgPayload

Output drag geometry message with stochastic correction applied to dragCoeff.

Detailed Behavior

At each update step, the module performs the following operations:

  1. Reads the current OU state \(x\) from the base class.

  2. Reads dragGeomInMsg.

  3. Multiplies dragCoeff by \((1+x)\).

  4. 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 dragCoeff and 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.