C++ 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.

Message Interfaces

stochasticAtmDensity module input and output messages

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.

Module Description

The inherited Ornstein-Uhlenbeck state \(x\) evolves as

\[\text{d}x = -\frac{1}{\tau}x\,\text{d}t + \sqrt{\frac{2}{\tau}}\sigma_{st}\,\text{d}W\]

The output neutral density is

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

All other atmospheric payload fields are passed through unchanged.

Verification and Testing

The module behavior is validated in src/simulation/mujocoDynamics/stochasticAtmDensity/_UnitTest/test_stochasticAtmDensity.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.

Derives from MeanRevertingNoise. Scales the incoming neutral density by \((1 + x)\), where \(x\) is the OU state maintained by the base class.

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

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.