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

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

The output neutral density is

\[\rho_{out} = \rho_{in}(1 + x)\]

All other atmospheric payload fields are passed through unchanged.

Message Interfaces

Module I/O Messages

Msg Variable Name

Msg Type

Description

atmoDensInMsg

AtmoPropsMsgPayload

Input atmosphere properties message containing baseline neutralDensity and other atmospheric fields.

atmoDensOutMsg

AtmoPropsMsgPayload

Output atmosphere properties message with stochastic density correction applied to neutralDensity.

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 atmoDensInMsg.

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

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