C++ Module: radiationPressure

Executive Summary

Radiation pressure dynamics class used to compute

The module PDF Description contains further information on this module’s function, how to run it, as well as testing.

Message Connection Descriptions

The following table lists all the module input and output messages. The module msg variable name is set by the user from python. The msg type contains a link to the message structure definition, while the description provides information on what this message is used for.

radiationPressure module input and output messages

Module I/O Messages

Msg Variable Name

Msg Type

Description

sunEphmInMsg

SpicePlanetStateMsgPayload

sun state input message.

sunEclipseInMsg

EclipseMsgPayload

(optional) sun eclipse input message.

Initialization and Reset

When the spacecraft links this effector to the hub states, initialization verifies that sunEphmInMsg is connected. This validation occurs even if only the spacecraft is added to a task.

When the faceted CPU lookup model is selected, lookupSHat_B, lookupForce_B, and lookupTorque_B must contain the same nonzero number of entries. Populate all three tables before initialization or Reset(). The check also runs before each lookup evaluation, so incomplete table edits or a model change after initialization raise BasiliskError before any table entry is accessed. The cannonball model does not use these tables and does not require them to be populated.

Attachment-time validation does not replace task scheduling for this effector. Add it to a task so that UpdateState() refreshes the cached Sun ephemeris and optional eclipse data used during force evaluation.

When the effector is scheduled, its Reset() repeats the configuration checks. Reset() does not clear the cached ephemeris, illumination, force, or torque data.


Enums

enum srpModel_t

Values:

enumerator SRP_CANNONBALL_MODEL
enumerator SRP_FACETED_CPU_MODEL
class RadiationPressure : public SysModel, public DynamicEffector
#include <radiationPressure.h>

solar radiation pressure dynamic effector

Public Functions

RadiationPressure()

This is the constructor. It sets some default initializers that can be overridden by the user.

~RadiationPressure()

The destructor. Nothing of note is performed here

void Reset(uint64_t CurrentSimNanos)

Validate the module configuration when the scheduler resets the model.

Parameters:

CurrentSimNanos – [ns] Time at which the reset occurs

void UpdateState(uint64_t CurrentSimNanos)

Update model state by reading in new message data

Parameters:

CurrentSimNanos – current simulation time in nanoseconds

void linkInStates(DynParamManager &statesIn)

This method retrieves pointers to parameters/data stored in the dynamic parameter manager

Parameters:

statesIn – [in] Dynamic parameter manager containing the required states.

void readInputMessages()

This method is used to read the incoming ephemeris and spacecraft state messages. The data is stored in the associated buffer structure.

void computeForceTorque(double integTime, double timeStep)

This method computes the dynamic effect due to solar radiation pressure. It is an inherited method from the DynamicEffector class and is designed to be called by the simulation dynamics engine.

Parameters:
  • integTime – Current simulation integration time

  • timeStep – Current integration time step used

void setUseCannonballModel()

Sets the model to the cannonball model in computing the solar radiation force

void setUseFacetedCPUModel()

Sets the model to the faceted table-lookup model, evaluated on the CPU, in computing the solar radiation force

void addForceLookupBEntry(Eigen::Vector3d vec)

Add force vector in the body frame to lookup table.

Parameters:

vec – (N) Force vector for particular attitude in lookup table

void addTorqueLookupBEntry(Eigen::Vector3d vec)

Add torque vector to lookup table.

Parameters:

vec – (Nm) Torque vector for particular attitude in lookup table

void addSHatLookupBEntry(Eigen::Vector3d vec)

Add sun unit direction vector in body frame to lookup table.

Parameters:

vec – sun unit direction vector in body frame

Public Members

double area

m^2 Body surface area

double coefficientReflection

Factor grouping surface optical properties.

ReadFunctor<SpicePlanetStateMsgPayload> sunEphmInMsg

sun state input message

ReadFunctor<EclipseMsgPayload> sunEclipseInMsg

(optional) sun eclipse input message

std::vector<Eigen::Vector3d> lookupForce_B

Force on S/C at 1 AU from sun.

std::vector<Eigen::Vector3d> lookupTorque_B

Torque on S/C.

std::vector<Eigen::Vector3d> lookupSHat_B

S/C to sun unit vector defined in the body frame.

BSKLogger bskLogger

BSK Logging.

Private Functions

void validateConfiguration()

Validate the required Sun input and dimensions of the selected lookup model.

void validateLookupDimensions()

Validate the three lookup table lengths.

Validate lookup dimensions before selecting or indexing a table entry.

void computeCannonballModel(Eigen::Vector3d rSunB_N)

Computes the solar radiation force vector based on cross-sectional Area and mass of the spacecraft and the position vector of the spacecraft to the sun. The solar radiation pressure decreases quadratically with distance from sun (in AU)

Solar Radiation Equations obtained from Earth Space and Planets Journal Vol. 51, 1999 pp. 979-986

Parameters:

rSunB_N – [in] [m] Spacecraft-to-Sun position vector expressed in inertial-frame components.

void computeLookupModel(Eigen::Vector3d rSunB_B)

Computes the solar radiation force vector using a lookup table given the current spacecraft attitude and the position vector of the spacecraft to the sun. It is assumed that the lookup table has been generated with a solar flux at 1AU. Force and torque values are scaled.

Parameters:

rSunB_B – [in] [m] Spacecraft-to-Sun position vector expressed in body-frame components.

Private Members

srpModel_t srpModel

specifies which SRP model to use

SpicePlanetStateMsgPayload sunEphmInBuffer

Buffer for incoming ephemeris message data.

bool stateRead

Indicates a successful read of incoming SC state message data.

EclipseMsgPayload sunVisibilityFactor

[-] scaling parameter from 0 (fully obscured) to 1 (fully visible)

StateData *hubR_N

State data access to inertial position for the hub.

StateData *hubSigma

Hub/Inertial attitude represented by MRP.