Module: meanRevertingNoiseStateEffector

Executive Summary

The MeanRevertingNoiseStateEffector module is a spacecraft StateEffector that propagates a single scalar mean-reverting stochastic state.

Module Description

The internal state \(x\) follows an Ornstein-Uhlenbeck process:

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

No module-specific input or output messages are used. Other modules can consume the state by reading it from the dynamics state manager by name.

The registered state name can be set or queried using setStateName("...") and getStateName().

Detailed Behavior

At each integrator sub-step, the module:

  1. Reads the internal state \(x\).

  2. Sets deterministic drift \(\dot{x} = -x/\tau\).

  3. Sets one diffusion term with amplitude \(\sqrt{2/\tau}\sigma_{st}\).

Module Assumptions and Limitations

  • Because the registered state has a stochastic diffusion source, a stochastic integrator must be used for the parent spacecraft dynamics.


class MeanRevertingNoiseStateEffector : public StateEffector, public SysModel
#include <meanRevertingNoiseStateEffector.h>

State effector that propagates a scalar Ornstein-Uhlenbeck process.

This module propagates a scalar stochastic state \(x\) using

\[ dx = -\frac{1}{\tau}x\,dt + \sqrt{\frac{2}{\tau}}\sigma_{\mathrm{st}}\,dW, \]
where \(\tau\) is the time constant and \(\sigma_{\mathrm{st}}\) is the stationary standard deviation.

Public Functions

MeanRevertingNoiseStateEffector()

Constructor.

~MeanRevertingNoiseStateEffector() override = default

Destructor.

void registerStates(DynParamManager &states) override

Register this effector’s internal stochastic state with the dynamics manager.

Parameters:

states – Dynamics parameter manager used to create the correction state.

void linkInStates(DynParamManager &states) override

Link any required external states and properties.

This effector has no required external state links.

Parameters:
  • states – states

  • states – Dynamics parameter manager.

void computeDerivatives(double integTime, Eigen::Vector3d rDDot_BN_N, Eigen::Vector3d omegaDot_BN_B, Eigen::Vector3d sigma_BN) override

Compute deterministic and stochastic dynamics for the correction state.

Parameters:
  • integTime – integTime

  • rDDot_BN_N – rDDot_BN_N

  • omegaDot_BN_B – omegaDot_BN_B

  • sigma_BN – sigma_BN

  • integTime – Integration time in seconds.

  • rDDot_BN_N – Hub translational acceleration [m/s^2] (unused).

  • omegaDot_BN_B – Hub angular acceleration [rad/s^2] (unused).

  • sigma_BN – Hub attitude MRP (unused).

void setStationaryStd(double sigmaStationary)

Set the stationary standard deviation of the OU state.

Values smaller than zero are rejected.

Parameters:

sigmaStationary – Stationary standard deviation, \(\sigma_{\mathrm{st}}\) [-].

inline double getStationaryStd() const

Get the stationary standard deviation \(\sigma_{\mathrm{st}}\) [-].

void setTimeConstant(double timeConstant)

Set the OU time constant.

Values less than or equal to zero are rejected.

Parameters:

timeConstant – Time constant \(\tau\) [s].

inline double getTimeConstant() const

Get the OU time constant \(\tau\) [s].

double getStateValue() const

Get the current state value.

If called before state registration, this returns the configured initial value.

Returns:

Current scalar state \(x\) [-].

void setStateValue(double val)

Set the state value.

This updates the configured initial value and also updates the registered state immediately if registration has already occurred.

Parameters:

val – New scalar state \(x\) [-].

inline std::string getStateName() const

Get the registered state manager name.

inline void setStateName(std::string name)

Set the state manager name.

Parameters:

name – State name.

Private Members

std::string nameOfState

state manager key for scalar state \(x\)

StateData *state = nullptr

pointer to scalar state container

double sigmaStationary = 0.0

stationary standard deviation \(\sigma_{\mathrm{st}}\) [-]

double timeConstant = 1.0

OU time constant \(\tau\) [s].

double stateInit = 0.0

initial value for \(x\) used at state registration

Private Static Attributes

static uint64_t effectorID = 1

unique ID counter used to generate a distinct state name