Module: stochasticAtmDensity
Executive Summary
The StochasticAtmDensity module applies scalar mean-reverting stochastic noise to atmospheric density by
specializing MeanRevertingNoise. It scales incoming atmospheric
density by a stochastic multiplicative factor and republishes the perturbed atmosphere message.
Module Description
The inherited Ornstein-Uhlenbeck state \(x\) evolves as
The output neutral density is
All other atmospheric payload fields are passed through unchanged.
Message Interfaces
Msg Variable Name |
Msg Type |
Description |
|---|---|---|
atmoDensInMsg |
Input atmosphere properties message containing baseline |
|
atmoDensOutMsg |
Output atmosphere properties message with stochastic density 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
atmoDensInMsg.Multiplies
neutralDensityby \((1+x)\).Writes the modified payload to
atmoDensOutMsg.
The OU process parameters are configured through base-class setters:
setStationaryStd(sigma_st)setTimeConstant(tau)
Module Assumptions and Limitations
The model applies multiplicative density noise only; it does not model spatial correlation or altitude-dependent stochastic parameters internally.
If \(x < -1\), the corrected density can become negative unless constrained externally.
Verification and Testing
The module behavior is validated in
src/simulation/mujocoDynamics/meanRevertingNoise/_UnitTest/test_meanRevertingNoise.py by checking that the output
density time series has the expected OU statistics (mean, variance, and correlation time) for a constant nominal
density input.
-
class StochasticAtmDensity : public MeanRevertingNoise
- #include <stochasticAtmDensity.h>
Applies a mean-reverting (Ornstein–Uhlenbeck) correction to atmospheric density.
This class derives from MeanRevertingNoise, which provides the scalar OU state \(x\) evolving as:
\[ dx = -\frac{1}{\tau}\, x \, dt + \sqrt{\frac{2}{\tau}}\, \sigma_{\text{st}}\, dW \]The corrected density is:
\[ \rho_\text{out} = \rho_\text{in}\,(1 + x) \]The state \(x\) is stored and propagated by the base class. This class only specifies how the state modifies the atmosphere message.
Public Members
-
ReadFunctor<AtmoPropsMsgPayload> atmoDensInMsg
Input atmospheric properties message.
This message is read each step to obtain the unperturbed atmospheric density and temperature before applying the stochastic correction.
-
Message<AtmoPropsMsgPayload> atmoDensOutMsg
Output atmospheric properties message.
This message is written each step with the corrected neutral density value.
Protected Functions
-
virtual void writeOutput(uint64_t CurrentSimNanos, double x) override
Apply the OU correction factor and write output.
Called automatically by MeanRevertingNoise::UpdateState(), after the stochastic state has been updated and before the simulation advances.
- Parameters:
CurrentSimNanos – Current simulation time in nanoseconds.
x – Current value of the scalar mean-reverting correction factor.
-
ReadFunctor<AtmoPropsMsgPayload> atmoDensInMsg