WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
warptwin Namespace Reference

Class to propagate CR3BP dynamics in characteristic units. More...

Namespaces

namespace  ms_py_writer

Classes

class  ConfigurationWriter
 Write out script from UX to execute using set toolchain. Base class for override. More...
struct  Connection
 Hold all information related to a connection point in the ImGUI UX. More...
class  EventLogger
 Class to handle event and debug logging. More...
struct  ImNode
 Hold all data related to a visual node in the ImGUI UX. More...
class  NodeBuilder
 Generate a list of mapped nodes and connections from json. More...
class  WarpTwinPyConfigWriter
 Write out WarpTwin Python file from node information. More...
class  CR3BPDynamics
class  Body
 Class to define a body as a frame with mass and inertia. More...
class  Frame
 Frame class definition. More...
class  FrameDynamics
class  Joint
 Joint class defining relationship between frames. More...
class  Node
 Node class to apply forces and moments to frames. More...
class  CsvLogger
 Class for logging to CSV. More...
class  Hdf5Logger
 Class for logging to HDF5. More...
class  LogManager
 Class to manage logs. More...
class  SpicePlanet
 High fidelity planet model using the JPL cspice framework under the hood for ultra accurate states. More...
struct  _accel_output_struct
 Accelerometer Model. More...
struct  _gps_output_struct
 GPS Model. More...
class  GroundStationSensor
 Wrapper for ground station model which perturbs range and range rate for navigation purposes. More...
struct  _gyro_output_struct
 Gyro Model. More...
struct  _magnetometer_output_struct
 Configurable magnetometer model which takes input from simplified or high fidelity magnetic field models. More...
struct  _pressure_output_struct
 Pressure Sensor Model. More...
struct  _sunsensor_output_struct
 Model of sun sensor which produces look vector to the sun. More...
class  ExternalInterfaceModel
 Manage all external interfaces to and from warptwin. More...
struct  Inputs
struct  Outputs
class  SixDOFDynamicsModel
 Model to implement 6-DOF dynamics. More...
class  ArgParser
 Class to parse arguments from the command line in any language. More...
struct  Dispersion
 Struct to store all data associated with dispersion. More...
struct  UniformDispersion
 Struct to store all data associated with uniform dispersion. More...
struct  NormalDispersion
 Struct to store all data associated with normal dispersion. More...
class  DispersionEngine
 Class to generate input dispersions for the simulation. More...
class  Model
 Base model class for derived implementation. More...
class  NormalRandom
 Class to generate random numbers according to normal distribution. More...
class  SimScheduler
 Simple implementation of the scheduler class. More...
class  SimTimeManager
 Class to manage time for the simulation object. More...
class  SimulationExecutive
 Implementation of the executive class for simulation. More...
class  UniformRandom
 Class to generate random numbers according to uniform distribution. More...
class  VisualsModel
 Class for managing WarpTwin visuals. More...
class  AutoDoc
 Class to document from code. More...
class  DataIOShmemRelay
 Relay DataIO data over a shared memory. More...
class  DataIOSocketRelay
 Relay DataIO data over a socket. More...
class  Interpolate2D
 A class for performing simple x-y linear interpolation. More...
class  InterpolateBilinear
 A class for performing simple x-y-z bilinear interpolation. More...
class  InterpolateTrilinear
 A class for performing simple a-b-c-d trilinear interpolation. More...
class  LatencyUtil
 Latency model. More...
class  SpiceManager
 The Spice Manager is a single class instance to manage spice frames and return SPICE states. More...

Enumerations

enum  connection_type_e {
  PARAM = -1 , INPUT = -2 , LOG = -3 , ALL_INPUT = -4 ,
  OUTPUT = 1
}
 Hold acceptable values for connection type. More...
enum  gui_data_types_e {
  NUMERIC = 0 , STRING = 1 , POINTER = 2 , VECTOR3 = 3 ,
  QUATERNION = 4 , FRAME_PTR = 5 , UNDEFINED = 6 , MATRIX = 7 ,
  ARRAY = 8 , TIME = 9 , STD_VECTOR = 10
}
 Type definition for valid connections in the warptwin GUI. More...
enum  node_types_e {
  STANDARD = 0 , MODEL = 1 , SIM_EXEC = 2 , TEXT_NODE = 3 ,
  FRAME = 4 , LOGGER = 5 , VIZKIT = 6 , CESIUM_VIZ = 7
}
 Node type definition to allow config writer to identify custom nodes. More...
enum  joint_type_e { NOT_SET , MIXED , FULLY_FREE , FULLY_LOCKED }
enum  cmds_e { OFF = 0 , ON }
enum  power_load_mode_e { OFF = 0 , IDLE = 1 , ACTIVE = 2 }
enum  integrator_type_e { FORWARD_EULER = 1 , RK4 = 4 }
enum  nav_time_sources_e { NAV_SRC_SYSTEM , NAV_SRC_GPS , NAV_SRC_UTC , NAV_SRC_TDB }
enum  simulation_steps_e : int16 {
  NOT_SCHEDULED =-2 , STARTUP_ONLY =-1 , ALL =0 , START_STEP =1 ,
  DERIVATIVE =2 , END_STEP =3
}

Functions

template<typename T>
int mean (T *array, unsigned int size, T &result)
template<typename T>
int variance (T *array, unsigned int size, T &result)
template<typename T>
int stdev (T *array, unsigned int size, T &result)
template<typename T>
int max (T *array, unsigned int size, T &result)
template<typename T>
int min (T *array, unsigned int size, T &result)
double muStar (double m1, double m2)
 Function to return the characteristic mass for CR3BP.
double lStar (double r)
 Function to return the characteristic length for CR3BP.
double tStar (double r, double mu)
 Function to return the characteristic time for the CR3BP.
clockwerk::CartesianVector< 3 > convertPosDim2Nd (clockwerk::CartesianVector< 3 > pos_d, double l_star)
 Function to convert position from dimensional to characteristic units.
clockwerk::CartesianVector< 3 > convertVelDim2Nd (clockwerk::CartesianVector< 3 > vel_d, double l_star, double t_star)
 Function to convert velocity from dimensional to characteristic units.
clockwerk::CartesianVector< 3 > convertPosNd2Dim (clockwerk::CartesianVector< 3 > pos_nd, double l_star)
 Function to convert position from characteristic to dimensional units.
clockwerk::CartesianVector< 3 > convertVelNd2Dim (clockwerk::CartesianVector< 3 > vel_nd, double l_star, double t_star)
 Function to convert velocity from characteristic to dimensional units.
int16 start () override
 Class to execute logging.
int16 execute () override
 Function to check monitor input conditions and set trigger flag accordingly. Should be implemented in derived class.
int getFrameRelativeDCM (Frame &f1, Frame &f2, clockwerk::DCM &dcm_f1_f2)
 A function to get the DCM represnting the relationship [f1/f2].
int frameRotate (const clockwerk::CartesianVector< 3 > &vec__f1, Frame &f1, Frame &f2, clockwerk::CartesianVector< 3 > &vec__f2)
 A function to rotate vector vec__f1 from frame f1 into frame f2.
int framePositionTransform (const clockwerk::CartesianVector< 3 > &vec_f1__f1, Frame &f1, Frame &f2, clockwerk::CartesianVector< 3 > &vec_f2__f2)
 A function to transform a position vector relative to the origin of f1 to a vector relative to the origin of f2.
int frameVelocityTransform (const clockwerk::CartesianVector< 3 > &vel_f1__f1, const clockwerk::CartesianVector< 3 > &pos_f1__f1, Frame &f1, Frame &f2, clockwerk::CartesianVector< 3 > &vel_f2__f2)
 A function to transform a velocity vector represented in frame f1 to a vector represented in f2.
clockwerk::DCM getCompositeRotation (clockwerk::DCM &dcm_f1_f2, clockwerk::DCM &dcm_f2_f3)
 A function to get the composite rotation generated by subsequent rotations.
clockwerk::Quaternion getCompositeRotationQuat (clockwerk::Quaternion &quat_f1_f2, clockwerk::Quaternion &quat_f2_f3)
 A function to get the composite rotation generated by subsequent rotations.
void simpleEncrypt (char *unencrypted, char *encrypted, char size, const std::string &key)
 Function to perform a simple encryption of a buffer of data.
void simpleDecrypt (char *encrypted, char *unencrypted, char size, const std::string &key)
 Function to decrypt a buffer of data – companion to simpleEncrypt.
void writeFileBinarySize (char *buffer, char buffer_size, const std::string &filename)
 Function to write a buffer of bytes to a file, along with their size.
void readFileBinarySize (char buffer[MAX_SIZE_CHAR], char *size_actual, const std::string &filename)
 Function to read a buffer of bytes from a file.
int checkVerifyLicense (const std::string &license_file, const std::string &license_server)
 Function to check and verify that user has license for the simulation.
void parseLicenseString (std::string str, std::string &licensee, int &year, int &month, int &day)
 Function to parse license string for relevant data.
MODEL(Servo) public int16 deactivate () override
 Model to simulate a servo's motion.
 MODEL (TimedImpulsiveBurnModel) public
 Model which applies a fixed impulse to a vehicle at a set sim or UTC time.
warptwin::ImpulseModel * impulseModel ()
 Function to get a handle to the impulse model contained within this model.
MODEL(Spacecraft) public int initializePositionVelocity (CartesianVector3 position_sc_frame__frame, CartesianVector3 velocity_sc_frame__frame, const std::string &frame_name)
 Spacecraft Model.
int initializeFromOrbitalElements (double a, double e, double i, double RAAN, double w, double f)
 Function to initialize the spacecraftrelative to planet from orbital elements.
int initializeAttitude (clockwerk::Quaternion quat_sc_frame__frame, CartesianVector3 ang_vel_sc_frame__sc, Frame *frame_ptr=nullptr)
 Initialize attitude and angular velocity of the spacecraft body frame.
int initializeAttitude (clockwerk::Quaternion quat_sc_frame__frame, CartesianVector3 ang_vel_sc_frame__sc, const std::string &frame_name)
 Initialize attitude and angular velocity of the spacecraft body frame.
warptwin::TimedImpulsiveBurnModel * programManeuver (CartesianVector3 delta_v__f, std::string time_string, Frame *force_frame_ptr)
 Function to program a timed impulsive burn into the spacecraft.
warptwin::TimedImpulsiveBurnModel * programManeuver (CartesianVector3 delta_v__f, double sim_time, Frame *force_frame_ptr)
 Function to program a timed impulsive burn into the spacecraft.
int addPowerLoad (clockwerk::DataIO< double > *power_load_ptr)
 Add a power load to the spacecraft.
void clearPowerLoads ()
 Clear the list of power loads.
int addPowerSource (clockwerk::DataIO< double > *power_source_ptr)
 Add a power source to the spacecraft.
void clearPowerSources ()
 Clear the list of power sources.
warptwin::FrameStateSensorModel * planetInertialStateSensor ()
 Function to get a handle to the frame state sensor relative to the planet inertial frame.
warptwin::FrameStateSensorModel * planetRotatingStateSensor ()
 Function to get a handle to the frame state sensor relative to the planet rotating frame.
warptwin::LvlhFrameManagerModel * lvlhFrameManager ()
 Function to get a handle to the LVLH frame manager contained within this model.
warptwin::AsphericalGravityModel * asphericalGravityModel ()
 Function to get a handle to the aspherical gravity model contained within this model.
warptwin::SphericalHarmonicsGravityModel * sphericalHarmGravityModel ()
 Function to get a handle to the spherical harmonics gravity model contained within this model.
warptwin::PlanetRelativeStatesModel * planetRelativeModel ()
 Function to get a handle to the planet relative state model contained within this model.
warptwin::GravityGradientModel * gravityGradientModel ()
 Function to get a handle to the gravity gradient model contained within this model.
warptwin::MSISAtmosphereModel * msisModel ()
 Function to get a handle to the MSIS atmosphere model contained within this model.
warptwin::FlatPlateDragModel * atmosDrag ()
 Function to get a handle to the flat plate drag model contained within this model.
int _configureFromPlanet ()
 Configure the spacecraft class to map to planet.
void _mapInternal ()
 Function to internally map relationships between sensors.
void _calculatePowerAccumulation ()
 Sum the power loads and sources to calculate power accumulation.
 SIGNAL (_mu, double, warpos::earth_wgs84.mu)
 SIGNAL (_eq_radius, double, warpos::earth_wgs84.eq_radius)
 SIGNAL (_flattening, double, warpos::earth_wgs84.flattening)
 SIGNAL (_J2, double, warpos::earth_wgs84.J2)
 SIGNAL (_J3, double, warpos::earth_wgs84.J3)
double _computeFreeSpacePathLoss (double range, double frequency) const
 Function to compute the free space path loss.
void _configureInternal ()
 Function to configure sensor – runs in all constructors.
 MODEL (MSISAtmosphereModel) public
 High fidelity atmosphere model utilizing the NRL MSIS implementation.
int _msisCheckInputs ()
 Function to check range of input values.
MODEL(Accelerometer) public warptwin::MarkovUncertaintyModel * getNoiseModel ()
 Accessor for the internal noise model.
warptwin::RateMonitor * rateMonitor ()
 Accessor for the internal rate monitor model.
int16 activate () override
 MODEL (IMU) public
 Model of IMU on vehicle which accounts for noise, bias, and drift.
warptwin::Gyroscope * Gyroscope ()
 Function to access the internal gyro model.
MODEL(Magnetometer) public warptwin::MarkovUncertaintyModel * biasNoiseModel ()
 Accessor for the internal bias and noise model.
 MODEL (PressureSensor) public
 Accessor for the internal noise model.
warptwin::OccultationModel * occultationModel ()
 Accessor for the internal occultation model.
MODEL(GroundStationModel) public warptwin::FrameStateSensorModel * frameStateSensorEnu ()
 Simple ground station model.
warptwin::RangeAzElSensorModel * rangeAzElSensor ()
int _updateStates ()
MODEL(DirectionalAdaptiveGuidance) public CartesianVector3 _calcForceRswFromAlphaBeta (double alpha, double beta)
 Weighted Directional Adaptive Guidance for Low Thrust Maneuvering.
MODEL(MarkovUncertaintyModel) public double getBias ()
 Markov Uncertainty Model.
virtual int16 registerApp (warpos::App &app, int16 slot)
 Function to register apps with the table scheduler.
int16 _executeScheduleStep (const clockwerk::Time &step_time)
 Execute schedule step given current step time.
bool contains (const std::string &parent_str, const std::string &substr)
 Function to return whether substr is in parent_str.
std::string trim (const std::string &str, const std::string &whitespace=" \t")
 Function to trim leading and trailing whitespace from string.
int frameRelativeInit (Frame &target, Frame &reference, const CartesianVector3 &pos_tgt_ref__ref, const CartesianVector3 &vel_tgt_ref__ref)
 Function to initialize frame target relative to freame reference inertially.
int orbitInit (Frame &target, Frame &planet, double mu, double a, double e, double i, double RAAN, double w, double f)
 Function to initialize a body's position and velocity from an orbit.
template<typename T, long unsigned int N>
std::string printArray (const std::array< T, N > &val)
 Debug function to print an array.
bool fileExist (const std::string &name)
 Function to quickly check and verify whether a file exists.
int readTxtFile (const std::string &filename, std::vector< std::vector< double > > &data, const std::string &header_end_mark="!", const std::string &delimeter=" ", unsigned int num_cols=10)
 Reads a text file and populates a 2D vector with column-based numerical data.
template<typename T>
int satlin (T input, T &output, T limit=1.0)
 This function is a saturated linear function that behaves like a linear function in the range of [0, limit], everywhere else the function is 0th order and piecewise continuous.
template<typename T>
int satlins (T input, T &output, T limit=1.0)
 This function is a symmetric saturated linear function that behaves like a linear function in the range of [-limit, limit], everywhere else the function is 0th order and piecewise continuous.
template<typename T>
int poslin (T input, T &output)
 This function is a positive linear transfer function that behaves like a linear function only when x > 0, otherwise the function returns zero.
template<typename T>
int Heaviside (T input, T &output, T center=0.0)
 This function is the Heaviside step function (or more colloquially the unit step function). This returns zero for all values less than center and return one for all values greater of equal than the center.
template<typename T>
int signum (T input, T &output)
 This function is the signum function (typically denoted sgn). Described simply, it outputs the sign (e.g. negative one, positive one, or zero) or the input.
template<typename T>
int deadzoneTrimmed (T input, T bounds, T &output)
 This function will supress all inputs within (±) the specified bounds. The trimmed deadzone function is piecewise continuous, so it will shift the inputs in the linear regions.
template<typename T>
int deadzone (T input, T bounds, T &output)
 This function will supress all inputs within (±) the specified bounds. The deadzone function is NOT piecewise continuous, so it will have discontinuities at the bounds.
template<typename T>
int clamp (T input, T min_val, T max_val, T &output)
 This function will force a value to be between the defined minimum and maximum values. If input is less than the minimum, then the output will be the minimum. If the output is larger than, then the output will be the maximum. Otherwize the output is the input.
template<typename T>
int factorial (int n, T &output)
 Computes the factorial of a non-negative integer. Currently the gamma function is not supported.
template<typename T>
factorial (int n)
 Wrapper for factorial function with no error code return, only use if confident on valid inputs.
std::string writeTrajectory (const std::vector< double > &lat, const std::vector< double > &lon, const std::vector< double > &alt, bool project_to_ground=true, const std::string &color="7f00ffff")
 Function to write a trajectory into a KML file.
void writeKmlFile (const std::string &file, const std::vector< std::vector< double > > &lat, const std::vector< std::vector< double > > &lon, const std::vector< std::vector< double > > &alt, const std::vector< std::string > &colors, bool project_to_ground=true)
 Function to write a full KML file from trajectory data.
int twoBodyPropagate (double time, double mu, clockwerk::CartesianVector< 3 > pos_initial, clockwerk::CartesianVector< 3 > vel_initial, clockwerk::CartesianVector< 3 > &pos_final, clockwerk::CartesianVector< 3 > &vel_final)
 Function to propagate a body between two points in time using a keplerian orbit.
int mean2eccentric (double mean_anomaly, double eccentricity, double &eccentric_anomaly, double tol, int max_iter)
 Function to convert mean anomaly to eccentric anomaly.
int eccentric2true (double eccentric_anomaly, double eccentricity, double &true_anomaly)
 Function to convert eccentric anomaly to true anomaly.
int true2eccentric (double true_anomaly, double eccentricity, double &eccentric_anomaly)
 Function to convert true anomaly to eccentric anomaly.
int eccentric2mean (double eccentric_anomaly, double eccentricity, double &mean_anomaly)
 Function to convert eccentric anomaly to mean anomaly.
int readWMMCoefficientsFile (const std::string &filename, double g[NUMBER_OF_READ_COEFFICIENTS], double h[NUMBER_OF_READ_COEFFICIENTS], double gdot[NUMBER_OF_READ_COEFFICIENTS], double hdot[NUMBER_OF_READ_COEFFICIENTS], double &epoch)
 Reads magnetic field coefficients for WMM from a file and stores them in provided matrices.
double muWMM (double input)
 Unary functional input to the associated Legendre function specific to the WMM model. This is typically denoted as mu or t in literature such as Winch et al. 2005 or Heiskanen and Moritz 1967, respectively.
double dmuWMM (double input)
 Unary functional input to the associated Legendre function specific to the WMM modelm, derivative w.r.t. the functional's input. This is typically denoted as mu or t in literature such as Winch et al. 2005 or Heiskanen and Moritz 1967, respectively.
int schmidtSemiNormLegendreWMM (int N, double x, double *Pcup, double *dPcup)
 Computes the Schmidt Semi-Normalized Legendre function outputs provided the maximum degree (N) as a positive integer. The formula's require that N > 0, and abs(input) <= 1.0.
int schmidtSemiNormLegendreSingularityWMM (int N, double x, double *PcupS)
 Computes the Schmidt Semi-Normalized Legendre function outputs provided the maximum degree (N) as a positive integer when the position is at a singularity. The formula's require that N > 0, and abs(input) <= 1.0.
int rv2coe (const CartesianVector3 &pos, const CartesianVector3 &vel, double mu, CartesianVector6 &elements)
 Function to convert cartesian xyz pos/vel to orbital elements.
int coe2rv (CartesianVector6 &elements, double mu, CartesianVector3 &pos, CartesianVector3 &vel)
 Function to convert orbital elements to cartesian xyz.
DCM dcmPqr2Xyz (double i, double W, double w)
 Function to generate a 3-1-3 DCM to rotate from PQR to XYZ coordinates.
int lvlhFrame (const CartesianVector3 &pos, const CartesianVector3 &vel, clockwerk::DCM &lvlh_frame, CartesianVector3 &lvlh_ang_vel__lvlh)
 Function to generate an LVLH frame attitude DCM from position and velocity.
double true2eccentric (double true_anomaly)
 Convert true anomaly to eccentric anomaly.
std::vector< std::vector< double > > pcr2lla (const std::vector< double > &pcr_x, const std::vector< double > &pcr_y, const std::vector< double > &pcr_z, double a=6378137.0, double flattening=(1.0/298.257223563))
 Wrapper around pcrDeticToLLA for bulk conversion of x, y, z coordinates.
int heikkinenLla (const clockwerk::CartesianVector< 3 > &pos__pcr, double r_planet_equatorial, double flattening, double &lat_rad, double &lon_rad, double &alt)
 Function to calculate detic LLA from PCR state using the Heikkinen algorithm.
int readGravityCoefficientsFile (const std::string &filename, double cbar[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], double sbar[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], long int &n, long int &m)
 Reads gravitational coefficients from a file and stores them in provided matrices.
void neumannNormalization (double cbar[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], double sbar[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], double c[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], double s[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1])
 Applies Neumann normalization to spherical harmonic coefficients.
int sphericalHarmonics (long N, long M, double r, double phi, double theta, double Re, double K, double C[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], double S[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], clockwerk::CartesianVector< 3 > &grad_v)
 Computes the gradient of the gravitational potential using spherical harmonics.
int legendre (long N, long M, double x, double P[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1], double sd_p[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1])
 Calculates the associated Legendre functions and their derivatives.
double fact (long n)
 Computes the factorial of a non-negative integer.
double oddfact (long n)
 Computes the double factorial of an odd integer.
void loadKernel (std::string kernel)
 A function to load in a sinle spice kernel.
std::string toUpper (const std::string &input)
 Function to convert a string to all upper case.
std::string toLower (const std::string &input)
 Function to convert a string to all lower case.
bool caseInsensitiveEqual (const std::string &in_a, const std::string &in_b)
 Function to compare two strings independent of case.
std::string strip (const std::string &input)
 Removes leading and trailing whitespace characters from a string.
std::string stringReplace (const std::string &source, const std::string &orig_str, const std::string &new_str)
 Replace the first element of a source string with a new element.
bool isValidNumber (const std::string &s)
 Checks if the given string is a valid numeric representation.
int splitString (const std::string &text, const std::string &delimiter, std::vector< std::string > &tokens)
 Splits a string into a vector of substrings based on a specified string delimiter.
template<typename T, long unsigned int N>
int setArrayFromString (const std::string &s, std::array< T, N > &retval)
 Set a std::array from a string.
template<typename T>
int setVectorFromString (const std::string &s, std::vector< T > &retval)
 Set a std::array from a string.
Name of the model type

List all default options for the specified model type

Returns
Vector containing all default options for the model type

This function returns all of the pre-configured default json configurations for the model as stored in data/defaults/<Model type name>

std::vector< std::string > listDefaultConfigsByModelName (std::string name)
int parseDefaultConfigFromJson (const std::string &class_type, const std::string &default_name, nlohmann::json &j)
 Parse the default configuration from a JSON file into a PBR JSON object.

Variables

const std::vector< std::pair< connection_type_e, std::string > > INPUT_CONN_TYPES
 Hold all connection type enum values to loop through.
const unsigned int DEFAULT_MAX_MSG = 280
 Define some standard messages for writing to file.
const std::vector< std::string > NODE_CATEGORIES
const int MAX_ITER = 5
const unsigned int NUM_CR3BP_STATES = 6
clockwerk::SimLogger * _logger = nullptr
 Handle to our logger object.
constexpr uint32 FRAME_MAXIMUM_NUM_CHILDREN = 100
const int MAX_SIZE_CHAR = 0xFF
const std::string KEY = "kodasandymoosebuddy"
const int NO_ERROR = 0
const int ERROR_LICENSE = 300
double _mu_star
double _l_star
double _t_star
clockwerk::CartesianVector< 3 > _internal_pos
clockwerk::CartesianVector< 3 > _internal_vel
std::array< double, 6 > _input_states
std::array< double, 6 > _rates
CR3BPDynamics _dynamics
clockwerk::CartesianVector< 3 > _tmp
BiasNoiseModel _torque_bias_noise
 The bias and noise model for torque output.
Node _wheel_node
 The reaction wheel node.
Matrix3 _mom_inertia_tensor
 Matrix to hold the moment of inertia tensor of the wheel.
double _torque_perturbation = 0.0
 Value to hold perturbation to torque.
double _total_torque = 0.0
 Value to hold total torque calculation.
double _rps_to_rpm = 60.0/(2*M_PI)
 Conversion between radians per second and revolutions per minute.
bool _prev_com = false
 Boolean to store the previous operational state.
BiasNoiseModel _noise_model
 The bias and noise model for servo angle output.
LatencyUtil< double > _latency_model
 The latency model for servo angle output.
double _servo_angle_actual
 Temporary value that has perturbations acted upon it.
double _latency_return
 Temporary value for the return of the latency value.
double _turn_direction
 The turn direction of the servo for this time step.
double _max_turn_amount
 The maximum amount that the servo can spin in the time of a single simulation step.
const double ON_STATE = 1e-15
BiasNoiseModel _thruster_bias_noise
 The bias and noise model for thrust output.
Node _thruster_node
 The node at which thrust is applied.
double _nominal_thrust = 0.0
 Our nominal thrust calculation from Isp and the like.
double _thrust_perturbation = 0.0
 Value to hold perturbation to thrust.
double _total_thrust = 0.0
 Value to hold total thrust calculation.
int _cmd_state = OFF
 Value to hold last thrust command.
int _prev_cmd = OFF
TimeTriggerMonitor _time_trigger
ImpulseModel _impulse
Node _force_node
bool _triggered = false
BiasNoiseModel _current_bias_noise
 The bias and noise model for current.
Node _coil_node
 The torque coil node.
double _perturbation = 0.0
 Value to hold perturbation to current command.
CartesianVector3 _torque_vec
 Value to hold total torque calculation.
CartesianVector3 _z_axis
 Vector to hold temporary axes during orientation calculation.
clockwerk::DCM _DCM_Body_Mag
 Temporary DCM for quaternion calculation.
double _misalignment_x = 0.0
 Misalignment angle.
double _misalignment_y = 0.0
double _misalignment_z = 0.0
clockwerk::Quaternion _tempQuat
 Temporary quaternion for misalignment calculation.
double _theta = 0.0
 Misalignment angle magnitude and unit vector.
CartesianVector3 _evec
CartesianVector3 _mag_field_vec_body
 Temporary DCM for magnetic field transformation.
MODEL(CustomPlanet) public Frame _planet_inertial = Frame("planet_inertial_frame")
 Custom planet consisting of inertial and rotating frame which can be configured with custom rotation rate.
Frame _planet_rotating = Frame("planet_rotating_frame")
clockwerk::DataIO< Body * > body = clockwerk::DataIO<Body*>(this, "body", &_body)
clockwerk::DataIO< Body * > lvlh = clockwerk::DataIO<Body*>(this, "lvlh", nullptr)
Body _body
Node _gravity_node
Node _drag_node
FrameStateSensorModel _planet_inertial_state_sensor
FrameStateSensorModel _planet_rotating_state_sensor
LvlhFrameManagerModel _lvlh_frame_manager
GravityGradientModel _gravity_gradient
PlanetRelativeStatesModel _planet_relative
FlatPlateDragModel _atmos_drag
AsphericalGravityModel * _asp_ptr = nullptr
SphericalHarmonicsGravityModel * _sph_ptr = nullptr
MSISAtmosphereModel * _msis_ptr = nullptr
std::string _planet_name = "earth"
std::vector< TimedImpulsiveBurnModel * > _planned_burn_ptrs
std::vector< clockwerk::DataIO< double > * > _power_load_ptrs
std::vector< clockwerk::DataIO< double > * > _power_source_ptrs
SimpleComAnalysisModel _tx_com_analysis_model
SimpleComAnalysisModel _rx_com_analysis_model
FrameStateSensorModel _fss
double _power_TX_dBm
 Power leaving the transmitter in decibel-milliWats.
double _power_reflected_W
 Power reflected back into the system in Watts.
const double PC_15_2 = 0.5*15.0
const double PC_3_2 = 0.5*3.0
const double PC_35_2 = 0.5*35
double r
double precalc_j2
double precalc_j3
CartesianVector3 grav_force__planet
CartesianVector3 _mean_wind__comp
 Internal variables for rotated vectors.
CartesianVector3 _dist_wind__comp
CartesianVector3 _gust_wind__comp
clockwerk::DCM _DCM_directMeanWindFrame_to_meanWindFrame
 Internal variable for the rotation from the direct mean wind frame to the mean wind vector representation frame.
double _mean_wind_rot_angle
 Internal variable for the mean wind frame rotation angle.
int _err
CartesianVector3 _mag_dipole__PCR
CartesianVector3 _mag_field__PCR
double _scaling_factor
MODEL(GravityGradientModel) public CartesianVector3 _pos_body_pci__body
 Gravity Gradient Model.
double _r
 Point mass gravity model.
double _multiplier
CartesianVector3 _ggTorque
nrlmsise_flags _flags
nrlmsise_input _input
nrlmsise_output _output
unsigned int _step_counter = 0
unsigned int _start_run = 0
MODEL(OccultationModel) public double _a_i
 Occultation model using spherical representations of objects.
double _d
double _d_1
double _d_2
double _d_e
double _d_i
double _d_o
double _tmp1
double _tmp2
double _tmp3
double _tmp4
double _tmp5
CartesianVector3 _s_ob_vec
CartesianVector3 _tmpvec
CartesianVector3 _grav_force__planet
const std::vector< double > ALTITUDE_INTERPOLATE = {2000.0, 11000.0, 44000.0, 200000.0}
const std::vector< double > TURBULENCE_INTERPOLATE = { 10.0, 10.0, 4.0, 4.0}
const double NEGATIVE_FIVE_OVER_SIX = -5.0/6.0
const double NEGATIVE_ELEVEN_OVER_SIX = -11.0/6.0
const double NUM_1P339 = 1.339
const double NUM_2P678 = 2.678
const double NUM_0P00823 = 0.00823
const double NUM_0P177 = 0.177
double _turb_intensity_u
double _turb_intensity_v
double _turb_intensity_w
double _scale_length_u
double _scale_length_v
double _scale_length_w
double _altitude_feet
double _wind_u_feet
double _wind_v_feet
double _wind_w_feet
NormalRandom< double > * _normal_random
Interpolate2D _interpolate2D_model
const int NUMBER_OF_SET_POINTS = 16
const std::vector< double > PREIMAGE_SET = {0.0, 1000.0, 2000.0, 3000.0, 4000.0, 5000.0, 6000.0, 7000.0, 8000.0, 9000.0, 10000.0, 20000.0, 30000.0, 40000.0, 50000.0, 100000.0}
std::vector< double > _image_set
double _altitude_true
double _azimuth
double _magnitude
UniformRandom< double > _uniform_random
CartesianVector3 _unitpos_body_sun_f
double _K
double _c [NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1]
double _s [NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1]
CartesianVector3 _accel_grav__spherical
double _lat
double _lon
double _alt
double _r_pos
double _colatitude
double _sth
double _cth
double _sph
double _cph
CartesianVector3 _fe
double _alt_km
double _min_altitude_km
double _max_altitude_km
std::vector< std::vector< double > > _atmos_table
Interpolate2D _interp_pressure
Interpolate2D _interp_temperature
Interpolate2D _interp_density
bool _min_warned = false
bool _max_warned = false
const double WMM_EARTH_RADIUS = 6371200.0
double _g [NUMBER_OF_READ_COEFFICIENTS]
 Implicit returns form the read coefficients function in magneticFieldUtils.h.
double _h [NUMBER_OF_READ_COEFFICIENTS]
double _gdot [NUMBER_OF_READ_COEFFICIENTS]
double _hdot [NUMBER_OF_READ_COEFFICIENTS]
double _epoch
double _lat_centric
double _lat_detic
double _dummy
 Dummy variables for ignoring unneeded function implicit returns.
double _rad
double _Xprime
double _Yprime
double _Zprime
double dt
bool _WARN_BAD_FILE_EPOCH
double _g_n_m
double _h_n_m
int _index
double _P_n_m
int _N
bool _WARN_CANT_CHANGE_N
double * _P
double * _dP
double * _PcupS
bool _at_singularity
double _pow_a_by_r
double _cos_m_lon
double _sin_m_lon
clockwerk::DCM _temp_NED_ECEF
double _total_system_capacity
double _peak_system_voltage
double _system_shutoff_capacity
double _current_capacity
Interpolate2D _voltage_interp_table
OccultationModel _oc
FrameStateSensorModel _fss_sc_s
EffectiveSolarAreaModel _esa
SolarPanelPowerModel _spp
Frame _sensor_frame
 The sensor frame in which all measurements will be taken.
MarkovUncertaintyModel _sensor_noise_model
 The bias and noise model for sensor output.
RateMonitor _rate_monitor
 Rate monitor to control the rate at which the sensor runs.
CartesianVector3 _previous_bias
 Temporary variable to hold the bias vector at last function call.
CartesianVector3 _perturbed_accel
 Temporary variable to hold the perturbed acceleration with and without gravity.
CartesianVector3 _perturbed_accel_no_grav
clockwerk::DCM _dcm_sf_root
 A DCM relating our sensor frame to root.
CartesianVector3 _gravity__sensor
 The gravity vector as represented in the sensor frame.
clockwerk::CartesianVector< 3 > _in_deadzone
 Temporary variable for checking if sensor is in deadzone. Each element of vector corresponds to an axis.
_accel_output_struct _last_output
 Temporary variable for the latest recorded output added to latency model and dummy output for stepping though latency.
GroundStationModel _gs
bool _seen_last_step
FrameStateSensorModel _state_GPS_PCR
 Frame state sensor model of the GPS frame relative to the PCR frame.
double _truth_altitude
 Truth altitude used for dead-zone determination.
double _truth_speed
 Truth speed used for dead-zone determination.
double _output_lon
 Internal variables for function implicit returns.
double _output_lat
double _output_alt
CartesianVector3 _previous_pos_bias
 Internal variables for the previous bias of the position and velocity measurements.
CartesianVector3 _previous_vel_bias
CartesianVector3 _perturbed_pos
 Internal variables for the perturbed position and velocity.
CartesianVector3 _perturbed_vel
CartesianVector3 _total_error
 Temporary variable to hold total error for gyro.
CartesianVector3 _perturbed_ang_vel
 Temporary variable to hold the perturbed ang vel.
warptwin::Accelerometer _accelerometer
 The IMU accelerometer model.
warptwin::Gyroscope _gyro
 The IMU gyro model.
CartesianVector3 _truth_mag_field__mag
 Temporary variable to hold the truth magnetic field vector in the sensor frame.
CartesianVector3 _perturbed_mag
 Temporary variable to hold the perturbed acceleration with and without gravity.
double _meas_pres
 Temporary variable to hold the measured pressure before bound checks and reolution quantinization.
BiasNoiseModel _sensor_bias_noise
 The bias and noise model for sensor output.
clockwerk::DCM _tmp_dcm
CartesianVector3 _pos_tgt_mount__mount
OccultationModel _occult
 Occultation model.
FrameStateSensorModel _sun_relative_state
 Model to compute the position of the sun relative to the sun sensor frame.
FrameStateSensorModel _primary_orbiter_relative_state
 Model to compute the position of the primary orbiter relative to the sun sensor frame.
UniformRandom< double > * _uniform_random_model = nullptr
 Interal model for generating a uniform random number.
CartesianVector3 _pos_ss_ss__ss = CartesianVector3({0.0, 0.0, 0.0})
 Internal variable for the position of the sun sensor with respect to the sun sensor represented in sun sensor frame coordinates. Zero vector always.
CartesianVector3 _pos_PCI_ss__ss
 Internal variable for the position of the primary orbiter with respect to the sun sensor represented in sun sensor frame coordinates.
CartesianVector3 _pos_SCI_ss__ss
 Internal variable for the position of the Sun with respect to the sun sensor represented in sun sensor frame coordinates.
CartesianVector3 _pos_SCI_ss__ss_unit
CartesianVector3 _w
 Temporary vector used for random rotations.
clockwerk::Quaternion _q
 Temporary quaternion used for random rotations.
CartesianVector3 _v_obj__aero
CartesianVector3 _v_wind__aero
double _safesqrtresult
clockwerk::DCM _dcm_tmp
CartesianVector3 _tmp_tgt
Frame _enu_frame
 The ENU frame created for the GS by this model.
FrameStateSensorModel _fss_enu
 The frame state sensor for relative states to the ENU frame.
RangeAzElSensorModel _range_az_el_sensor
 The range az el sensor for our actual ground station.
FrameStateSensorModel _fss_gs_pci
 The frame state sensor for GS state in the PCI frame.
MODEL(LlaDeticStateInit) public int _error
 Model to produce position/velocity vector from a set of detic latitude, longitude, altitude coordinates.
CartesianVector3 _pos__pcr
MODEL(OrbitalElementsSensorModel) public CartesianVector6 _orbital_elements
 Model for sensing the instantaneous orbital elements of a vehicle given its position and velocity.
CartesianVector3 _pos
CartesianVector3 _vel
double _radius
 The radius set by the enum centric_by.
double _polar_radius
clockwerk::Quaternion _sc_quat_tmp_root
CartesianVector3 _sc_pos_tmp__root
CartesianVector3 _sc_vel_tmp__root
CartesianVector3 _sc_pos_tmp__sc
CartesianVector3 _sc_vel_tmp__sc
NormalRandom< double > * _rng = nullptr
 RNG to produce our distribution.
MODEL(EffectiveSolarAreaModel) public CartesianVector3 _face_normal_vector__body
 Effective Solar Area model.
CartesianVector3 _face_normal_vector__sun
 Temporary variable to hold the vector that is normal to the surface after converting to the solar frame.
double _dot_product_normal_solar
 Temporary variable to hold the result of the dot product between the normal vector and solar vector.
Frame _lvlh_frame = Frame("lvlh_frame")
 This is the actual LVLH frame.
clockwerk::DCM _lvlh_attitude__r
 Temporary variable to hold lvlh attitude.
CartesianVector3 _lvlh_ang_vel__lvlh
 Temporary variable to hold LVLH angular velociyt in lvlh frame.
double _bias
 Internal variable for holding the bias and its deviations from the initial value.
double _bias_drift
double _scale_factor
 Internal variables for the different noise sources.
double _noise
double _sqrt_time_step
 Internal variable for 1/sqrt(Hz).
MODEL(SimTableScheduleModel) public Params params = Params(this, "params")
 Model of simulated table schedule for flight software emulation.
Inputs inputs = Inputs(this, "inputs")
Outputs outputs = Outputs(this, "outputs")
std::vector< std::pair< warpos::App *, int16 > > _registries
warpos::TableScheduler< 10 > * _ts_10 = nullptr
warpos::TableScheduler< 50 > * _ts_50 = nullptr
warpos::TableScheduler< 100 > * _ts_100 = nullptr
warpos::TableScheduler< 200 > * _ts_200 = nullptr
warpos::TableScheduler< 1000 > * _ts_1000 = nullptr
clockwerk::Time _time_per_slot
clockwerk::Time _step_end_sys_time
clockwerk::Time _next_step_start
int _total_slots = 0
std::vector< std::vector< double > > _timing_values_micros
 The number of microseconds per app to run.
std::vector< int > _schedule_mapping
 Map schedule indices to timing vector.
std::vector< warpos::App * > _app_record
 Record of mapped apps.
std::vector< std::string > _names
int16 _last_sch_step = 0
bool _first_run = true
std::chrono::time_point< std::chrono::high_resolution_clock > _start_time
std::chrono::time_point< std::chrono::high_resolution_clock > _end_time
std::vector< std::vector< double > > _thrust_table
Interpolate2D _interp_thrust
double _min_time_s
double _max_time_s
bool _out_of_range
MODEL(ProximityMonitor) public CartesianVector3 _rel_position
const std::string ARG_INDICATOR = "--"
const int HASH_MULTIPLIER = 37
const int HASH_ADDER = 3
const int DAYS_BEFORE_MONTH [12]
const std::map< std::string, int > MONTH_MAP
const std::string DEFAULT_SIMULATION_TIME = "2023 September 26, 12:00:00 MDT"
 This is the default simulation time.
const double GPS_TO_J2000_ET_OFFSET = 630763200.0
 This is the offset between the GPS and J2000 epochs for calculation of GPS time The GPS epoch is January 6, 1980.
const std::string VISUALS_FILE_LOC_NAME = warptwinDir() + slash() + "CesiumViz" + slash() + "tmp-data" + slash() + "ms-visuals.czml"
const std::string VISUALS_APP_ADDR = warptwinDir() + slash() + "CesiumViz" + slash() + "runVisualsApp.py"
const std::string CZML_FILE_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "template.txt"
const std::string SOCKET_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "template_socket_update.txt"
const std::string CZML_SATELLITE_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "satellite.txt"
const std::string CZML_FACILITY_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "facility.txt"
const std::string CZML_FACILITY_LINK_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "facilitylink.txt"
const std::string CZML_LINK_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "link.txt"
const std::string CZML_SPACECRAFT_LINK_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "spacecraftlink.txt"
const std::string CZML_START_INTERVAL = "<<START_INTERVAL>>"
const std::string CZML_END_INTERVAL = "<<END_INTERVAL>>"
const std::string CZML_SATELLITE_STRINGS = "<<SAT_STRINGS>>"
const std::string CZML_GS_STRINGS = "<<GS_STRINGS>>"
const std::string CZML_LINK_STRINGS = "<<LINK_STRINGS>>"
const std::string CZML_SPACECRAFT_LINK_STRINGS = "<<SPACECRAFT_LINK_STRINGS>>"
const std::string CZML_SPACECRAFT_NAME = "<<SPACECRAFT_NAME>>"
const std::string CZML_MODEL_START = "<<MODEL_START>>"
const std::string CZML_MODEL_END = "<<MODEL_END>>"
const std::string CZML_MODEL_FILE_NAME = "<<MODEL_FILE_NAME>>"
const std::string CZML_FACILITY_NAME = "<<FACILITY_NAME>>"
const std::string CZML_PRIMARY_SPACECRAFT_NAME = "<<PRIMARY_SPACECRAFT_NAME>>"
const std::string CZML_SECONDARY_SPACECRAFT_NAME = "<<SECONDARY_SPACECRAFT_NAME>>"
const std::string CZML_DESCRIPTION = "<<DESCRIPTION>>"
const std::string CZML_LEAD_TIME = "<<LEAD_TIME>>"
const std::string CZML_TRAIL_TIME = "<<TRAIL_TIME>>"
const std::string CZML_SPACECRAFT_POSITION = "<<SPACECRAFT_POSITION>>"
const std::string CZML_SPACECRAFT_ATTITUDE = "<<SPACECRAFT_ATTITUDE>>"
const std::string CZML_LINK_INTERVALS = "<<LINK_INTERVALS>>"
const std::string CZML_IS_CONNECTED = "<<IS_CONNECTED>>"
const std::string CZML_VISIBLE_INTERVALS = "<<VISIBLE_INTERVALS>>"
const std::string TITLE = "= "
const std::string AUTHOR_EMAIL_START = " <"
const std::string AUTHOR_EMAIL_END = "> "
const std::string HEADER_ONE = "== "
const std::string HEADER_TWO = "=== "
const std::string CODE_LITERAL = "```"
const std::string TABLE_HEADER_START = "[\%header,cols="
const std::string TABLE_HEADER_END = "*]\n"
const std::string TABLE_MARKER = "|===\n"
const std::string TABLE_LINE_START = "|"
const std::string IMAGE_START = "image::"
const std::string ALIAS_START = "["
const std::string ALIAS_END = "]"
const std::string LINK_START = "link:++"
const std::string LINK_END = "++"
const std::string DOC_REF_START = "xref:"
const int SHMEM_STRING_ALLOC_SIZE = 1000
 Amount of space reserved for strings in shmem.
const int DATASOCK_IO_BUFFER_SIZE = 1000
const std::map< int, double > FACTORIAL_CACHE
const int MAX_HARMONIC_COEFFICIENTS = 12
const int NUMBER_OF_READ_COEFFICIENTS = (MAX_HARMONIC_COEFFICIENTS*(MAX_HARMONIC_COEFFICIENTS+1))/2 + MAX_HARMONIC_COEFFICIENTS
const double ORBIT_DOUBLE_TOL = 1e-12
const int NMAX_SPHERICAL_HARMONICS = 18
const int MAX_SPICE_NAME_LENGTH = 33

Detailed Description

Class to propagate CR3BP dynamics in characteristic units.

File: Conversions.h

This file contains analysis utilities to convert units in the circular restricted three body problem (cr3bp).

All conversions are per Dr. Pernicka of Missouri S&T and the following online utilities: https://orbital-mechanics.space/the-n-body-problem/circular-restricted-three-body-problem.html

Author: Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m..tech

This class is used to propagate circular restricted 3 body problem dynamics in characteristic units. It sets internal parameters on the basis of the setters for mu and l, which are used in the propagation.

Note
The CR3BP Dynamics class explicitly does not use the floating_point type because the use of float with 3-body dynamics can introduce numerical precision issues quite easily.

Enumeration Type Documentation

◆ cmds_e

Enumerator
OFF 
ON 

◆ connection_type_e

Hold acceptable values for connection type.

Enumerator
PARAM 
INPUT 
LOG 
ALL_INPUT 
OUTPUT 

◆ gui_data_types_e

Type definition for valid connections in the warptwin GUI.

Enumerator
NUMERIC 
STRING 
POINTER 
VECTOR3 
QUATERNION 
FRAME_PTR 
UNDEFINED 
MATRIX 
ARRAY 
TIME 
STD_VECTOR 

◆ integrator_type_e

Enumerator
FORWARD_EULER 
RK4 

◆ joint_type_e

Enumerator
NOT_SET 
MIXED 
FULLY_FREE 
FULLY_LOCKED 

◆ nav_time_sources_e

Enumerator
NAV_SRC_SYSTEM 
NAV_SRC_GPS 
NAV_SRC_UTC 
NAV_SRC_TDB 

◆ node_types_e

Node type definition to allow config writer to identify custom nodes.

Enumerator
STANDARD 
MODEL 

Simplified dynamics model representing motion in the circular restricted 3 body problem.

Tabular thrust model This model reads and returns thrust on the basis of simulation time based on a predetermined thrust table provided for specific vehicles.

LVLV Frame Manager Model.

Bias and noise model.

Simple spacecraft-to-spacecraft link model.

Model for determining the latitude, longitude, altitude state of a vehicle relative to an oblate planet.

Model to produce position/velocity vector from orbital elements.

Model for sensing the relative state between two frames in WarpTwin.

Aerodynamics State Model.

Accessor for the internal bias and noise model.

Model of spacecraft star tracker.

Simple Camera Model.

Accessor for the internal noise model.

Accessor for the internal rate monitor model.

Simple Earth Observation Model.

Solar panel model.

Simplified model of vehicle battery system which estimates battery capacity considering power input, draw.

Model of a power load.

Tabular atmosphere model.

Spherical Harmonics Model.

Solar Radiation Pressure Model.

Simple mean wind model.

Simple disturbance wind model.

Point mass gravity model.

Simplified magnetic field model which treats Earth as a dipole magnet.

Composite wind model.

Aspherical gravity model with J2 and J3 effects.

Model of spacecraft radio including losses and gains with comm links and power draw.

Torque Coil Model.

Reaction Wheel Model.

This model calculates the expected acceleration experienced by a body acting under three-body dynamics using the circular restricted three body assumptions.

Note the synodic frame definition is consistent with the definitions in this same directory, which is as follows:

  • Frame centered at the system barycenter
  • Frame +x directed from the major body to the minor body
  • Frame +z aligned to the minor body's angular momentum vector
  • Frame +y completes the RH frame along the definition of minor planet travel

Key assumptions:

  • The model outputs acceleration, not force, and so to apply it to a WarpTwin frame requires conversion or a body with unit mass The gravitational parameter of the primary body of the system. Defaults to the gravitational parameter of the Earth in m^3/s^2 The gravitational parameter of the secondary body of the system. Defaults to the gravitational parameter of the Moon in m^3/s^2 The distance the secondary body maintains from the primary body in the CR3BP Flag to indicate whether model should use ND canonical units (true) or standard units (false) The position of the spacecraft in the rotating three body "synodic" frame. Default is in meters The velocity of the spacecraft in the rotating three body "synodic" frame. Default is in meters/second The acceleration of the spacecraft in the rotating three body "synodic" frame. Default is in meters/s^2

This is a model of a reaction wheel which applies a torque to a reaction wheel and thus the spacecraft in the opposite direction. The momentum stored in the reaction wheel and the wheel speed are both recorded. A positive torque is applied about the z axis of the reaction wheel which is the orthoganal vector to the reaction wheel.

Note that the torque applied to the sc body will be negative of the commmanded torque. Noise is applied as a gaussian noise about the commanded torque.

Author
Alex Jackson alex..nosp@m.jack.nosp@m.son@a.nosp@m.ttx..nosp@m.tech The body which will be controlled by this model. The torque will be applied to a node aligned to this body, and WarpTwin will translate to force and torque at the body The reaction wheel location relative to the provided body in the body frame The reaction wheel orientation wrt the body frame. This z axis of the reaction wheel is the orthogonal vector to the reaction wheel that a positive torque is applied about The bias in the wheel which is applied to every time it is commanded. The standard deviation of torque noise. A new noise draw is taken every time a new torque command is received. Value to seed the internal RNG for this model. The mass of the reaction wheel in kg. Default is massless The moment of inertia of the reaction wheel about its rotational axis in kg-m^2. The radiation tolerance of the reaction wheel in krad. Default is no radiation tolerance The peak torque that can be applied by the reaction wheel in Nm The momentum capacity of the reaction wheel in Nms The power draw of the reaction wheel in watts. Default is no power draw Boolean value to specify if the reaction wheel is on and drawing power. Default is on The commanded torque to the reaction wheel about its normal vector The momentum stored by the reaction wheel in Nms Boolean to specify if the wheel is saturated The wheel speed of the reaction wheel in rpm The power draw of the reaction wheel. Simply outputs the power parameter when the reaction wheel is on The torque applied to the body

This is a model of a torque coil which applies a torque using the magnetic field generated by an electromagnet (with no ferromagnetic core) interacting with the Earth's magnetic field. A positive torque is applied about the torque vector when a positive current is applied. Note that this direction is the orthogonal vector (Area Vector) of the wire coil.

Noise is applied as a gaussian noise about the commanded current.

Author
Alex Jackson alex..nosp@m.jack.nosp@m.son@a.nosp@m.ttx..nosp@m.tech The body which will be controlled by this model. The torque will be applied to a node aligned to this body, and WarpTwin will translate to torque at the body The frame in which the magnetic field vector is expressed. This is most typically the magnetometer frame The torque coil vector wrt the body frame. This is the area vector of the torque coil that a positive torque is applied about The standard deviation of input current noise. A new noise draw is taken at each timestep. Value to seed the internal RNG for this model. The area inside the loop (m^2) Number of loops of wire in the torque coil The standard deviation of the misalignment angle (degrees) The resistance of the torque coil in Ohms The idle power draw of the torque coil when operational in Watts The input current in Amps. Positive current creates a positive torque about the torque vector The external magnetic field vector in the mag frame (nanoTesla) The power draw of the reaction wheel in Watts The torque applied to the body in the body frame in N-m

This model is used to calculate the communications link and power draw of a radio system. It is meant to be configured in pairs. All the parameters are referring to the characteristics of this radio. First, define all of the attributes of this radio model and pass in another radio model with its own configuration as a parameter. The the output of this model uses simple communication analysis to calculate the comms data based on the relationship between the two radios. For example, you could have one radio model attached to a ground station and another representing a spacecraft. You assign the transmit and receive characteristics in each radio model and then set the other_radio parameter to point to the other model. The model will then output information about the link in both the receive and transmit direction from the point of view of this radio. The output from each radio will be identical except from the perspective of the radio. This means to analyze the full link between the two, you only need the output of one of the models.

This model also calculates the power draw of the radio based on whether it is transmitting or receiving. If the radio is transmitting,the power draw output will be the power_draw_TX parameter, and if it is receiving, the power draw output will be the power_draw_RX parameter.

IMPORTANT: Though loss is generally expressed as a negative gain, this model assumes that loses are positive and will subtract accordingly. For example, suppose your receiver system has poor circuitry and you expect the power received to decrease by half. This would be a gain of -3 dB, however this model expects the user to input a loss of positive 3 dB. In general, loss = -gain.

Author: Alex Jackson alex..nosp@m.jack.nosp@m.son@a.nosp@m.ttx..nosp@m.tech The transmitter carrier frequency in hertz (Hz) (MUST MATCH OTHER RADIO). Default is the amateur radio satellite communication frequency of 437 MHz. The bandwidth of transmission (Hz) 50 kHz is common for UHF (MUST MATCH OTHER RADIO) The bit rate in bits per second (bps) 9600bps is a common value for UHF (MUST MATCH OTHER RADIO) The transmit power in Watts (W). Transmit power is usually around 1 Watt for cubesats Return loss of this radio when transmitting, this value describes ratio of power that is reflected back into the system. Should be input as positive but is normally negative. Default is a representative value of 14 dB The transmit antenna gain in decibels relative to isotropic (dBi) Default is 2.15 representative of a dipole The total transmit system loss in decibels (dB). This is the accumulation of transmitter pointing loss, and transmitter circuit loss. Inputting zero assumes that there is no return loss (despite this actually being 100% return loss). 5 db is a conservative estimate for typical satellite systems The receive antenna gain in decibels relative to isotropic (dBi). Usually the same as the transmit antenna gain unless there is a separate receive antenna. The noise temperature in Kelvin (K). This value is realted to the system noise density by Boltzmann*noise_temp and system noise power by the equation band_width*noise_density. Generic input of 307.5 should be replaced by data sheet value(MUST MATCH OTHER RADIO) The total receive system loss in decibels (dB). This is the accumulation of receiver side loss such as pointing loss, radome loss, polarization loss, and atmospheric loss. 4 db is a conservative estimate for typical satellite systems The cross polarization loss in decibels (dB). General rule of thumb, if both RX and TX have same-hand circular or linear (0dB), if there is a circular to linear match (3dB), but a right vs left circular mismatch can result in 20 to 30 dB loss. (MUST MATCH OTHER RADIO) The energy per bit to noise ratio required in dB. Based on various modulation schemes for a desired bit error rate. For BPSK an Eb/N0 required of about 11 allows for a bit error rate around 1e-6. (MUST MATCH OTHER RADIO) The power draw of the radio when transmitting in Watts (W) Note that this is different from the transmit power. Default is no power draw The power draw of the radio when receiving in Watts (W). Default is no power draw A pointer to the other radio model to which this radio is communicating The frame that the radio is attached to. Used to calculate range This is the mask flag for the ground station. True for masked, False for visible An int to indicate if the radio is transmitting. The power draw is set to the TX power draw if greater than 0 and RX power draw if equal to 0. If this is less than zero it is set to the opposite of the masked flag (constantly transmitting when in view) The free space path loss in decibels (FSPL) (dB). This is the same in both directions The effective isotropic radiated power (EIRP) in decibel-milliWatts (dBm) The receive power in decibel-milliWatts (dBm) The system noise figure (NF) in decibel-milliWatts/Hz (dBm/Hz) The signal-to-noise density ratio (SNR) in decibel (dB) The energy per bit to noise ratio in in decibels (dB) The link margin in decibels (dB) The effective isotropic radiated power (EIRP) in decibel-milliWatts (dBm) The receive power in decibel-milliWatts (dBm) The system noise figure (NF) in decibel-milliWatts/Hz (dBm/Hz) The signal-to-noise density ratio (SNR) in decibel (dB) The energy per bit to noise ratio in in decibels (dB) The link margin in decibels (dB) The power draw of the radio in Watts (W)

This model calculates gravity for a planetary body, accounting for effects due to the J2 and J3 perturbations. This is the gravitational parameter of our parent planet. Defaults to Earth's gravitational parameter in m^3/s^2 for ease of use This is the J2 parameter of our parent planet. Defaults to Earth's J2 parameter for ease of use This is the J3 parameter of our parent planet. Defaults to Earth's J3 parameter for ease of use This is the radius of our parent planet. Defaults to Earth's radius, in meters for ease of use This is the mass of the body, which will be multiplied by our force to get the force calculation The position of the object body in the reference frame f This is the total acceleration due to gravity calculated in the same reference frame as pos_body__f This is the total force due to gravity calculated in the same reference frame as pos_body__f This is the acceleration due to point mass gravity calculated in the same reference frame as pos_body__f This is the acceleration due to J2 calculated in the same reference frame as pos_body__f This is the acceleration due to J3 calculated in the same reference frame as pos_body__f

This model takes in the three major components to a high fidelity wind model: 1). Mean wind: the average steady-state wind velocity vector 2). Gust wind: the stochastic and time dependent busts of intense wind 3). Disturbance wind: the stochastic and time dependent random fluctuations in the wind

The model takes the three components and their respective frames and outputs the composite wind (sum of all components) in the desired output frame.

Author: James Tabony james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech The frame of the mean wind input vector. The frame of the gust wind input vector. The frame of the disturbance wind input vector. If left as nullptr, the model assumes the disturbance frame is the direct mean wind frame: X : In the direction of the mean wind Y : Cross-wind, perpendicular to the direction of mean wind but in local surface horizontal plane (Z cross X = Y) Z : Aligned with the mean wind frame. Perpendicular to surface. The frame of the composite wind output vector. Mean wind vector expressed in the frame specified by the params. Velocity must be relative to a planet rotating frame. (meters/second) Gust wind vector expressed in the frame specified by the params. Velocity must be relative to a planet rotating frame. (meters/second) Disturbance wind vector expressed in the frame specified by the params. Velocity must be relative to a planet rotating frame. (meters/second) The composite wind vector expressed in the frame specifiec by the params. The velocity is expressed relative to the planet rotating frame. (meters/second)

This model calculates the magnetic field vector represented in the PCI frame and object frame using a simple dipole model. The equations and parameters used for this model come from "Fundamentals of Spacecraft Attitude Determination and Control" by Markley and Crassidis, chapter 11 section 1.1, equation 11.5

Note: Crassidis defines the equations from the magnetic south pole, I define my equations from the magnetic north pole.

Author: James Tabony Email: james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech The colatitude of the IGRF magnetic north pole as referenced in the global latitude/longitude map. Defaults to global north pole (radians) The longitude of the IGRF magnetic north pole as referenced in the global latitude/longitude map. Defaults to globak north pole (radians) Planet magnetic field magnitude at planet equitorial distance. Defaults to Earth. (nT ~ nanoTesla) Planet equitorial distance, specific to the magnetic field model. Defaults to Earth. (meters) Planet rotating frame pointer. Position of the object frame with respect to the planet rotating frame, resolved/expressed in the planet rotating frame coordinates. (meters) The magnetic field vector local to the object, represented in the planet centered rotating frame, PCR. (nT ~ nanoTesla)

This model generates forces acting on a body under the influence of a simple point mass gravity field. This is the gravitational parameter of our parent planet. Defaults to Earth's gravitational parameter for ease of use This is the mass of the body, which will be multiplied by our force to get the force calculation... TODO to replace this with accel methods The position of the object body in the reference frame f This is the acceleration due to gravity calculated in the same reference frame as pos_body__f

This model generates an objects experienced mean wind through a pseudo-deterministic process. The mean wind magnitude is based an a power function sclaled by a reference wind spead at a given altitude.

$$ V(h) = V_{ref} * \left( \frac{h}{h_{ref}} \right)^\alpha $$

The wind direction perturbed around a provided value (wind direction at reference altitude) in a continuous (not smooth) manner. By a function f(h) with uniformly distributed outputs for select altitudes between the values of [-1, 1]. This relationship is:

$$ \theta(h) = \theta_0 + \Delta \theta \cdot f(h) \qquad f:h \in \mathbb{R} \mapsto [-1, 1] \, \, \text{and} \, f(0) := 0 $$

Author: James Tabony james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech Wind speed at 20 feet altitude from surface NOT WGS84 ellipsoid. Defaults to 30 knots which corresponds to moderate turbulence. (meters/second) Altitude of the surface relative to the WGS84 model. (meters) Value to seed the internal RNG for this model. Altitude of the object as relative to the WGS84 model. (meters) The disturbance wind vector of the object expressed in the mean wind frame (meters/second), defined as: X : In the direction of the mean wind Y : Cross-wind, perpendicular to the direction of mean wind but in local surface horizontal plane (Z cross X = Y) Z : Aligned with the mean wind frame. Perpendicular to surface. The velocity is expressed relative to a planet rotating frame.

This model generates an objects experienced mean wind through a pseudo-deterministic process. The mean wind magnitude is based an a power function sclaled by a reference wind spead at a given altitude.

$$ V(h) = V_{ref} * \left( \frac{h}{h_{ref}} \right)^\alpha $$

The wind direction perturbed around a provided value (wind direction at reference altitude) in a continuous (not smooth) manner. By a function f(h) with uniformly distributed outputs for select altitudes between the values of [-1, 1]. This relationship is:

$$ \theta(h) = \theta_0 + \Delta \theta \cdot f(h) \qquad f:h \in \mathbb{R} \mapsto [-1, 1] \, \, \text{and} \, f(0) := 0 $$

Author: James Tabony james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech The average wind speed measured at the reference altitude. (meters/second) The average wind azimuth angle (angle of the wind vector measured off of local north towards east) at the reference altitude. Make sure to set before exc.startup. (radians) Reference altitude, typically close to the surface. This altitude is measured from surface NOT WGS84 ellipsoid. (meters) Altitude of the surface relative to the WGS84 model. (meters) Wind shear factor. Used to describe the change in mean wind magnitude with respect to altitude. This parameter is dependent on the terrain underneath the flight operation. Open sea ~ 0.1, Suburban ~ 0.25, Forest/Mountains ~ 0.4. Maximum direction shift of mean wind. You can effectively turn off the wind vector shear by setting this value to zero. (radians) Value to seed the internal RNG for this model. Altitude of the object as relative to the WGS84 model. (meters) The mean wind vector of the object expressed in the local NED frame of the reference position. The velocity is expressed relative to the planet rotating frame. (meters/second)

This model calculates the solar radiation pressure perturbation that acts on a body in orbit. The methods and calculations in this model come from https://freeflyer.com/_help_Files/spherical_srp.htm

Author: Sam Matez Email: sam.m.nosp@m.atez.nosp@m.@attx.nosp@m..tec.nosp@m.h The solar flux , defaults to the mean solar flux at one astronomical unit (W/m^2) The body coefficient of reflectivity () The area of the body subject to solar radiation (the mean area that faces the sun). Defaults to 1 m^2 The body position wrt the Sun in any generic frame. Defaults to 1 AU in meters with sun in X direction The current solar intensity on a scale of 0 to 1 where 0 is eclipse and 1 is direct sunlight The force acting on the body due to solar radiation pressure (N) in the smae generic frame as the input

Implements spherical harmonic gravity up to an 18x18 field based on the implementation in the 42 simulation: https://github.com/ericstoneking/42/blob/4be580d8defc968da97d937ce09ef107c07860cb/Kit/Source/envkit.c#L82

Author: Sam Matez Email: sam.m.nosp@m.atez.nosp@m.@attx.nosp@m..tec.nosp@m.h The filename for the file that contains the coefficients for spherical harmonic calculation. These coefficients should be un-normalized, as the model applies a Neumann normalization to the loaded coefficients. This is the gravitational parameter of our parent planet. Defaults to Earth's gravitational parameter for ease of use This is the radius of our parent planet. Defaults to Earth's radius, in meters for ease of use The coefficient n which represents the variations in gravitational field in the latitudinal direction The coefficient m which represents the variations in gravitational field in the longitudinal direction. must be less than or equal to n This is the mass of the body, which will be multiplied by our force to get the force calculation... TODO to replace this with accel methods The body position wrt the planet in a planet-centered, planet fixed frame (m) This is the acceleration due to gravity calculated in the same reference frame as pos_body__f This is the force due to gravity calculated in the same reference frame as pos_body__f

This model reads and returns atmospheric parameters pressure, temperature, and density on the basis of altitude in meters above ground level.

The model reads from files in the format defined in data/atmosphere, which is a txt format input.

This is a highly simplified implementation – for ultra high fidelity propagation consider using a different model.

For values above the tabulated range, the model returns the values at the end of the table for temperature and zero for pressure and density. For values below the end of the table the model returns the lowest altitude value in the table.

Speed of sound calculation based on Introduction to Flight by Anderson, p. 177 eq 4.54

Text file must be in the format H(km) T(K) p(Pa) ρ(kg/m^3)

Author: Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m.engin.nosp@m.eeri.nosp@m.ng.co.nosp@m.m The atmosphere data file which should be loaded. Default is 1976 std atmosphere. Our ideal gas constant for speed of sound calculation. Default is for air The specific heat ratio for air – used in calculation of the speed of sound The reference altitude in meters above sea level The temperature of the atmosphere in degrees kelvin The pressure of the atmosphere in Pascals (N/m^2) The density of the atmosphere in kg/m^3 The speed of sound in meters per second

Implements the World Magnetic Model (WMM)

References: [1] The US/UK World Magnetic Model for 2020-2025 by Arnaud Chulliat et al. (NOAA) and William Brown et al. (British Geological Survey Geomagnitsm Team) [2] Pysical Geodesy by Heiskanen and Moritz 1967 [3] Geomagnetism and Schmidt quasi-normalization by Winch et al. 2005

Note
This model can be expanded to a higher fidelity with the WMMHF model procuded by NOAA

Author: James Tabony Email: james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech The filename for the file that contains the Gauss coefficients for spherical harmonic calculation. NOAA releases a new set of coefficients every 5 years on years that are divisible by 5 (e.g. 2015, 2020, 2025, ...) that are most valid from the year they are realseed until the next coefficient set release. The coefficient n which represents the variations in gravitational field in the latitudinal direction. Also the harmonic function order. This value must be chosen before executive startup. (1 <= N <= 12) The body position wrt the planet in a planet-centered rotating frame (meters) The local magnetic field vector expressed in body's local North East Down frame. (nanoTesla) The local magnetic field vector expressed in ECEF frame. (nanoTesla)

The power load model is a simple model of a power load meant to represent the power draw of components that are otherwise unmodeled (such as heaters or scientific instruments). The model accounts for power draw in three modes: active, idle, and off (no power draw). Power draw while in ACTIVE mode, in Watts Power draw while in IDLE mode, in Watts Power draw while in OFF mode, in Watts The current mode of the power load: 0 = off, 1 = idle, 2 = active Instantaneous power draw of the power load, in Watts

Author: Alex Reynolds alex@.nosp@m.attx.nosp@m..tech The peak voltage provided by a single battery (summed to make full pack) The capacity, in W*hr, provided by a single spacecraft battery The % of charge at which power shuts off. Default is 0.0 (no shutoff until capacity is empty) Should be a percent. value in the range 0-->1 indicating the initial charge state of the system The number of batteries configured in series. Determines the system voltage and shutoff The number of batteries configured in parallel. Used with series to determine system capacity The capacity-voltage curve defined by percent capacity against pct max voltage. Default is lithium ion The amount of power generated by the system in the given step, in W The amount of power drawn from the system in the given step, in W The net change in power in the system for the step, in W The depth of discharge, a percentage value denoting the depletion of the battery system. (%) The current voltage of the power system The current draw of the system, in Amps Boolean indicating whether power is available (true) or not (false) from the system

This model defines a solar panel model that accounts for eclipse, pointing, size, and efficiency. This is a combination of the Solar Panel Power, Occultation, and Effective Solar Area moddels to aide in ease of use. Author: Alex Jackson Email: alex..nosp@m.jack.nosp@m.son@a.nosp@m.ttx..nosp@m.tech The mass of the solar panel in kg. Default is massless The solar irradiance at the location of interest in power per area (the default is in W/m^2) The solar panel efficiency on a scale of 0 to 1 where 0 is 0 percent efficiency and 1 is 100 percent efficiency The area of the solar panel. The solar panel normal vector in the body frame. This is used to describe the orientation of the solar panel wrt to the body frame (default is the x axis ) The inertial Sun frame Sun radius in m The parent frame which the body frame is orbiting Planet radius in m (default is Earth radius) Body frame of the spacecraft Whether the solar panel should remain body fixed and perform effective area calculations (true/default), or should assume effective solar area is always 100% of panel size for a simpler calculation (false) The power generated by the panel in watts Fraction of two spherical representations of objects that are visible from the point of view of the observer. 0 is fully occulted, 1 is not occulted, 0-1 is visible fraction of observed object.

This model defines a simple Earth Observation configuration with revisit counts, range, and observation times. The maximum angle off nadir the spacecraft is allowed to look for a valid pass, in radians The frame of the spacecraft object that the ground station will sense The planet rotating frame to which the ground station is attached. Note that the planet rotating frame must be a child of the associated planet inertial frame, which is also used in this model. This is the detic latitude of the target site, in radians The longitude of the target site, in radians The total amount of time, in seconds, that the site has been observable The total number of visits by the spacecraft to the site This is the range of the spacecraft to the target This is the range rate of the spacecraft wrt the target This is the look angle of the spacecraft wrt the target site, in radians This flag indicates whether the targeted ground site is visible or not. 1 = visible

The initial bias in position measurement output described as a three-element vector in meters. Default is no bias. Must be set before model startup. The initial bias in velocity measurement output described as a three-element vector in meters/second. Default is no bias. Must be set before model startup. The vehicle frame relative to which the sensor is mounted and aligned. This is most typically the body frame of a spacecraft or other vehicle. mount_position__mf and mount_alignment_mf are described relative to this frame. The position of the sensor in the mount frame, represented in the default simulation unit (meters by default. pretty much always meters) The rate at which the sensor generates an output, in hertz. This value must be some positive (non-zero) integer. (Hz) Value to seed the internal RNG for this model. The frame in which the GPS measurements are given relative to. This is the primary planets rotating frame (e.g. ECEF). For now, this must be Earth's rotating frame. Maximum altitude above the WGS84 ellipsoid that the GPS will work. Defaults to 18,000 meters, the maximum altitude set by CoCom for civilian GPS devices. (meters) Minimum altitude above the WGS84 ellipsoid that the GPS will work. (meters) Maximum speed with respect to the rotating primary that the GPS will work. Defaults to 1900 km/hr, the maximum speed set by CoCom for civilian GPS devices. (meters/second) Latency of the gps sensor, millisecond value for the amount of delay in sim time for the correct values to be reflected in the outputs. Must be set before executive startup. Defaults to no delay. (milliseconds) Power draw of the GPS. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Mass of the GPS. (kg) The one-sigma Gaussian noise in position measurement output described as a three-element vector in meters. Default is no noise. The one-sigma Gaussian noise in velocity measurement output described as a three-element vector in meters/second. Default is no noise. The one-sigma Gaussian noise in the position bias drift described as a three-element vector in meters/sqrt(second). Default is no walking-bias drift. The one-sigma Gaussian noise in the velocity bias drift described as a three-element vector in meters/second/sqrt(second). Default is no walking-bias drift. Output time tied to measurements. Output time is exactly the navigation time (see SimTimeManager for configuration), without latency (instantaneous) but but with a rate that mirrors output rate The measured output position of the GPS sensor frame with respect to the PCR frame. This is not the position of the body but instead the position of the GPS sensor. This value includes noise, bias, and blackout-zones. The "perfect" output position of the GPS sensor with respect to the PCR frame. This is not the position of the body but instead the position of the GPS sensor. This value does not include noise, bias, or blackout-zones. This is an informational parameter and is not subject to latency. The measured output velocity of the GPS sensor frame with respect to the PCR frame. This is not the velocity of the body but instead the velocity of the GPS sensor. This value includes noise, bias, and blackout-zones. The "perfect" output velocity of the GPS sensor frame with respect to the PCR frame. This is not the velocity of the body but instead the velocity of the GPS sensor. This value does not include noise, bias, or blackout-zones. This is an informational parameter and is not subject to latency. The detic longitude of the GPS sensor frame. Does include sensor noise, bias, and blackout-zones. (rad) The detic latitude of the GPS sensor frame. Does include sensor noise, bias, and blackout-zones. (rad) The detic altitude of the GPS sensor frame. Does include sensor noise, bias, and blackout-zones. (meters) Boolean value to notify if the output measurement is valid (i.e. boolean for blackout-zones). True = not in blackout-zone, False = in blackout-zone. Power draw of the sensor. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts)

Returns
Pointer to the rate monitor model

The initial bias in gyroscope measurement output described as a three-element vector in radians/second. Default is no bias. Must be set before model startup. The minimum angular velocity that the sensor can record in each axis. Default is -540 degrees/second (radians/second) The maximum angular velocity that the sensor can record in each axis. Default is 540 degrees/second (radians/second) The vehicle frame relative to which the sensor is mounted and aligned. This is most typically the body frame of a spacecraft or other vehicle. mount_position__mf and mount_alignment_mf are described relative to this frame. The position of the sensor in the mount frame, represented in the default simulation unit (meters by default. pretty much always meters) The alignment of the gyroscope relative to the mount frame The measurement resolution. The output value will be some multiple of this value. If the value is left at zero, an infinite resolution will be assumed, i.e. no data loss/quantinization. From a data sheet, this value can be computed as (measurement range) / 2^(bits per measurement) . (radians/second) The rate at which the sensor generates an output, in hertz. This value must be some positive (non-zero) integer. (Hz) Value to seed the internal RNG for this model. Latency of the pressure sensor, millisecond value for the amount of delay in sim time for the correct values to be reflected in the outputs. Must be set before executive startup. Defaults to no delay. (milliseconds) Power draw of the gyroscope. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Mass of the gyroscope. (kg) The one-sigma Gaussian noise in gyroscope measurement output described as a three-element vector in radians/second. Default is no noise. The one-sigma Gaussian noise in the gyroscope bias drift described as a three-element vector in radians/second/sqrt(second). Default is no walking-bias drift. The one-sigma scale percent increase/decrease of the measurement. Default is no scaling. Output time tied to measurements. Output time is exactly the navigation time (see SimTimeManager for configuration), without latency (instantaneous) but but with a rate that mirrors output rate The measured output angular velocity produced by the gyro describing the angular velocity of the sensor frame relative to the simulation root frame appropriate bias, noise, latency, and rate limiting. (radians/second) The "perfect" output angular velocity produced by the gyro describing the angular velocity of the sensor frame (incl. misalignment) relative to the simulation root frame without bias and noise. This is an informational parameter and thus is not subject to latency. (radians/second) Boolean value to notify if the output measurement is valid (i.e. boolean for blackout-zones). True = not in blackout-zone, False = in blackout-zone. Power draw of the sensor. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts) Current bias of the gyroscope. (rad/s)

Returns
Pointer to the internal noise model

This model simulates a simplified camera which produces line of sight (alpha and beta) angles relative to a target

Author: Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m..tech The frame of the object being sensed by the simple camera model. The bias in the alpha angle measurement output described as a single scalar, with angle in RADIANS. This parameter may account for a number of factors, including misalignment, measurement bias, etc. Default is no bias. The bias in the beta angle measurement output described as a single scalar, with angle in RADIANS. This parameter may account for a number of factors, including misalignment, measurement bias, etc. Default is no bias. The one-sigma gaussian noise in alpha measurement output described as a scalar, with angle in RADIANS. Default is no noise. The one-sigma gaussian noise in beta measurement output described as a scalar, with angle in RADIANS. Default is no noise. The vehicle frame relative to which the camera is mounted and aligned. This is most typically the body frame of a spacecraft or other vehicle. mount_position__mf and mount_alignment_mf are described relative to this frame. The position of the camera in the mount frame, represented in the default simulation unit (meters by default. pretty much always meters) The alignment of the camera relative to the mount frame The rate at which the camera generates an output, in hertz. Setting this value to 0 forces the camera to output at the simulation rate. Value to seed the internal RNG for this model. Power draw of the camera. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Mass of the camera. (kg) The alpha angle measurement output produced from the camera describing the location of the target object frame relative to the reference frame plus appropriate bias, noise, and rate limiting. The beta angle measurement output produced from the camera describing the location of the target object frame relative to the reference frame plus appropriate bias, noise, and rate limiting. The alpha angle measurement output produced from the camera describing the location of the target object frame relative to the reference frame without noise or error. This parameter is informational. The beta angle measurement output produced from the camera describing the location of the target object frame relative to the reference frame without noise or error. This parameter is informational. Power draw of the sensor. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts)

Accessor for the internal bias and noise model

Returns
Pointer to the bias noise model

This model represents a simple star tracker which may be parameterized with a given bias, noise, and rate. It measures the attitude of the star tracker frame, which is internally configured, relative to an externally assigned reference frame.

The mount frame is defined as: Centered in the center of the reference image X is "up" in the image Y is "right" in the image Z is "into" the image completing the right hand frame

|-------------------—| | x^ | | |-->y | | | |-------------------—|

Author: Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m..tech The bias in measurement output described as a 3-2-1 Euler angle sequence, with angles in RADIANS. This parameter may account for a number of factors, including misalignment, measurement bias, etc. Default is no bias. The cross axis accuracy of the star tracker in radians. Default is perfect accuracy The twist axis accuracy of the star tracker in radians. The default is perfect accuracy The field of view of the star tracker defined as the full cone angle in Radians. Default is pi/6 radians. The mass of the star tracker in kg. Default is massless The vehicle frame relative to which the star tracker is mounted and aligned. This is most typically the body frame of a spacecraft or other vehicle. mount_position__mf and mount_alignment_mf are described relative to this frame. The position of the star tracker in the mount frame, represented in the default simulation unit (meters by default. pretty much always meters) The alignment of the star tracker relative to the mount frame The radiation tolerance of the star tracker in krad. Default is no radiation tolerance The reference frame relative to which all star tracker measurements will be returned. If a reference frame is not set, all star tracker measurements will be returned relative to the simulation root frame. The rate at which the star tracker generates an output, in hertz. Setting this value to 0 forces the star tracker to output at the simulation rate. Value to seed the internal RNG for this model. Power draw of the star tracker. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Output time tied to measurements. Output time is exactly the navigation time (see SimTimeManager for configuration), without latency (instantaneous) but but with a rate that mirrors output rate The measurement output quaternion produced by the star tracker describing the orientation of the star tracker "sensor frame" relative to the reference frame plus appropriate bias, noise, and rate limiting. The "perfect" output quaternion produced by the star tracker describing the orientation of the star tracker "sensor frame" relative to the reference frame. This parameter is informational and free from error. Power draw of the sensor. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts)

Accessor for the internal bias and noise model

Returns
Pointer to the bias noise model

The fixed bias of the sun sensor. This could be a mixture of a misalignment error and/or measurement noise offset. The field of view respective to the horizontal of the focal plane. This is defined as full FOV NOT the half angle measured from boresight. (degrees) The field of view respective to the vertical of the focal plane. This is defined as full FOV NOT the half angle measured from boresight. (degrees) The vehicle frame relative to which the sensor is mounted and aligned. This is most typically the body frame of a spacecraft or other vehicle. mount_position__mf and mount_alignment_mf are described relative to this frame. The position of the sensor relative to the mount frame and resolved in the mount frame. (meters) The alignment of the sun sensor relative to the mount frame. Rotation from mount frame to sensor frame. The rate at which the sensor generates an output, in hertz. This value must be some positive (non-zero) integer. (Hz) Value to seed the internal RNG for this model. The inertial frame of the sun. The inertial frame of the spacecraft's primary orbiter (e.g. Earth). This is used for occultation. Radius of the primary orbiter, occultation assumes circular cross-sections. Defaults to Earth. (m) Latency of the sun sensor, millisecond value for the amount of delay in sim time for the correct values to be reflected in the outputs. Must be set before executive startup. Defaults to no delay. (milliseconds) Power draw of the sun sensor. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Mass of the sun sensor. (kg) The one-sigma Gaussian noise in sun sensor measurement output described as the error in angle between true sun-vector and expected sun-vector. This value is provided by most data sheets and is the same between fine and coarse sun sensors. (radians) Output time tied to measurements. Output time is exactly the navigation time (see SimTimeManager for configuration), without latency (instantaneous) but but with a rate that mirrors output rate The "noisy" unit vector representing the direction of the sun relative to the sun sensor frame in sun sensor frame coordinates. This value is subject to noise, bias, dead-zoning, occultation, sensor rate, and latency. The "truth" unit vector representing the direction of the sun relative to the sun sensor frame in sun sensor frame coordinates. This value is NOT subject to noise, bias, dead-zoning, occultation, or latency; but is subject to sensor rate. Boolean value to notify if the output measurement is valid (i.e. boolean for blackout-zones). True = not in blackout-zone, False = in blackout-zone. This value is subject to latency and will line-up with a measurement value. Power draw of the sensor. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts)

Returns
Pointer to the bias noise model

This model calculates the common "vehicle relative" wind effects alpha, beta, mach, v_infinity, and airspeed on the vehicle in the vehicle "aerodynamics frame" which is defined for the purpose of this model as follows:

  • X points forward on the vehicle out the nose (generally in the direction of travel)
  • Y points out the right wing of the vehicle
  • Z points down

Such that the vehicle generally moves with positive velocity in x. The body frame state of the vehicle being analyzed The frame in which the input vehicle velocity is measured The frame in which the wind velocity is measured The velocity of the object as measured in the velo frame – for instance, velocity in ECEF The velocity vector of the wind as measured in the wind frame – for instance, wind in NED The speed of sound from the atmospheric model. Default value is 343.0 meters per second The velocity of the aerodynamics frame relative to the oncoming wind, in aero frame coords The relative wind experienced by the aerodynamics frame in aerodynamics coordinates. Opposite of v_aero__aero Angle between velocity vector and body x-axis in x–z plane Angle between velocity vector and body x–z plane Magnitude of air-relative velocity The ratio of the object's speed in relation to the speed of sound.

The frame state sensor model senses the relative state between two frames and outputs that state difference as represented in a third, output frame. It applies basic kinematics using base functions developed in the clockwerk module to generate a step-by-step difference between two frames.

The results output by this model can be described as "the state of target_frame relative to reference_frame as output in output_frame coordinates" The target_frame is the frame state we are sensing – we want to know where target_frame is The reference_frame is the frame relative to which we are sensing. Results are output relative to the reference frame, in either reference frame or output frame coordinates. The output_frame is the frame in which the output results are represented. If it is set to nullptr, reference_frame is used. Not used for attitude. This is the position of the target frame origin wrt the reference frame origin, output in output frame coordinates This is the velocity of our target frame origin as represented IN the reference frame. It is NOT simply the difference in the velocities of their origins, which is different. This value accounts for reference frame rotation. Output is in output coordinates This is the inertial velocity of our target frame origin relative to our reference frame origin, represented in output frame coordinates. It is an inertial differencing of the origins represented in reference, and does not account for reference rotation. This is the attitude of the target frame relative to the reference frame This is the angular velocity of the target frame wrt the reference frame, output in output frame coordinates

This model produces the xyz cartesian state of a spacecraft from orbital elements for state initialization. This is the gravitational parameter of our parent planet. Defaults to Earth's gravitational parameter for ease of use The semimajor axis of the spacecraft orbit, in meters. Default is arbitrary 500 km alt orbit at Earth The orbit eccentricity. Default is arbitrary nearly circular orbit. The orbit inclination, in radians. Default is arbitrary 45 degree inclination The orbit RAAN, in radians The orbit argument of periapsis The true anomaly, in radians The position of the spacecraft in a generic inertial frame The velocity of the spacecraft in a generic inertial frame

This model is a one-stop-shop for useful states of a vehicle relative to a celestial body. It uses the FrameStateSensor and planetrelutils from clockwerk internally then returns results every step. It is primarily a configuration wrapper model – that is, it does the large majority of its work in startup, and adds little to no functionality at runtime, and instead runs the innter frame state sensor and planetrelutils, which do the heavy lifting.

Author
Gabe Heredia Acevedo gabe@.nosp@m.attx.nosp@m..tech This is the equatorial radius of the planet. Default is Earth in meters The celestial body’s flattening parameter The cartesian position coordinates we will use to perform our calculations relative to the reference frame, typically Planet Centered Relative frame. The cartesian velocity coordinates we will use to perform our calculations relative to the reference frame, typically Planet Centered Relative frame. The quaternion which represents the nodal attitude relative to the reference frame, typically Planet Centered Relative frame. The attitude rate which represents the nodal attitude rate relative to the reference frame, typically Planet Centered Relative frame. The nodal detic latitude relative to the reference frame. Takes into account the ellipsoidal form of the celestial body. The nodal centric latitude relative to the reference frame. Assumes the celestial body is spherical. The nodal detic altitude relative to the reference frame. Takes into account the ellipsoidal form of the celestial body. The nodal centric altitude relative to the reference frame. Assumes the celestial body is spherical. The nodal longitude relative to the reference frame.

This is a simple model of a spacecraft to spacecraft link. It performs calculations and determines the relative states of two spacecraft and, if link conditions on range, range rate, occultation, and look angle are met, calculates the link between them.

This model assumes the boresight vector for the spacecraft-to-spacecraft link is the spacecraft frame +Y vector, in keeping with the convention maintained by the RangeAzElSensorModel and ground station sensor. See that model for more details on azimuth and elevation definition. The frame of the first spacecraft in the spacecraft to spacecraft link. This is the spacecraft which receives az/el masking and, when configured, must point at the target spacecraft (sc2). The frame of the second spacecraft in the spacecraft to spacecraft link The planet rotating or inertial frame which is used in the internal link occultation model. Planet radius in m (default is Earth radius) The maximum range at which link can be achieved. Default is an arbitrarily large distance, indicating no range restriction. The maximum range rate at which link can be achieved. Default is an arbitrarily large relative velocity, indicating no range rate restriction. The maximum azimuth look angle between spacecraft 1's boresight vector and the other spacecraft for link to be achieved. In RADIANS. The default is arbitrarily large angle with no look angle requirement. The maximum elevation look angle between spacecraft 1's boresight vector and the other spacecraft for link to be achieved. In RADIANS. The default is arbitrarily large angle with no look angle requirement. This is the range between the two spacecraft. Will be zero if not visible. This is the range rate between the two spacecraft. Will be zero if not visible. This is the azimuth look angle between sc1's boresight and sc2. Will be zero if not visible. This is the elevation look angle between sc1's boresight and sc2. Will be zero if not visible. This is the link indicator flag for the two spaecraft. True for visible, False for not visible.

This model perturbs a single output according to a bias and noise value configured at start time. Distribution is gaussian.

Author
Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m..tech The bias in the object as a raw, constant error across all draws for the entire simulation The standard deviation of noise in the object as a gaussian random noise Value to seed the internal RNG for this model. The input value to be perturbed by noise and bias The output value as perturbed by noise and bias

This model creates and maintains the LVLH reference frame according to the NASA definition here: https://ntrs.nasa.gov/api/citations/19780010162/downloads/19780010162.pdf

It creates a frame as a child of the parent frame parameterized by parent. It locks position to the parent frame, leaves attitude free, then updates attitude at every derivative step according to the LVLH frame definition.

Definition: +Z axis directed toward the center of the Earth +Y axis perpendicular to the orbit plane with direction opposite angular momentum +X axis completes the right hand frame in the direction of orbit travel

Important: This is a position-only frame. Angular velocity is not updated The inertial parent frame which the target frame is orbiting The reference target frame to which the LVLH frame should attach This is the orbital position of the object for which we're calculating LVLH This is the orbital velocity of the object for which we're calculating LVLH The LVLH frame produced by this model

The model reads from files in the format defined in cpp/test/thrust_text.txt, which is a txt format input.

For values below and above the tabulated time range, the model returns a thrust value of zero to account for time before launch and after engine cutoff.

Text file must be in the format t(s) T(N)

Author: Sam Matez sam.m.nosp@m.atez.nosp@m.@attx.nosp@m..tec.nosp@m.h The thrust data file which should be loaded. Default is TBD. The thrust data file which should be loaded. Default is 0N for prelaunch and touchdown purposes. The reference time in seconds since sim start The thrust generated by the engine

SIM_EXEC 
TEXT_NODE 
FRAME 
LOGGER 
VIZKIT 
CESIUM_VIZ 

◆ power_load_mode_e

Enumerator
OFF 
IDLE 
ACTIVE 

◆ simulation_steps_e

Enumerator
NOT_SCHEDULED 
STARTUP_ONLY 
ALL 
START_STEP 
DERIVATIVE 
END_STEP 

Function Documentation

◆ _calcForceRswFromAlphaBeta()

clockwerk::CartesianVector< 3 > warptwin::DirectionalAdaptiveGuidance::_calcForceRswFromAlphaBeta ( double alpha,
double beta )

Weighted Directional Adaptive Guidance for Low Thrust Maneuvering.

This task calculates the pointing vector for a low thrust orbit control of orbital elements in the two body problem. It is based on an excellent NASA paper on low thrust control laws, found here: https://ntrs.nasa.gov/api/citations/20140011269/downloads/20140011269.pdf

Original source here: https://electricrocket.org/IEPC/IEPC-2011-102.pdf

It uses the weighting parameters Wx to weight the algorithm, and calculates control on the basis of difference in orbital parameters.

The output is a unit vector pointed in the direction of the desired acceleration.

Algorithm is capable of controlling semimajor axis, eccentricity, inclination, and RAAN. Can be extended to control argument of periapsis (which is in the original source) as needed. This is the gravitational parameter of our parent planet. Defaults to Earth's gravitational parameter for ease of use The weight applied to semimajor axis control The weight applied to eccentricity control The weight applied to inclination control The weight applied to RAAN control Total thrust force produced by the system. Default is in N The desired semimajor axis for the spacecraft orbit. Default is in m. The desired eccentricity for the spacecraft orbit The desired orbit inclination, in radians The desired orbit RAAN, in radians The body axis vector which will be pointed to desired_primary The desired primary vector expressed in an arbitrary frame The desired acceleration thrusting direction in the planet centered inertial frame

Calculate force vector from alpha and beta parameters

Parameters
alphaThe in-plane (pitch) angle
betaThe out of plane (yaw) angle
Returns
Force vector calculated from alpha and beta

◆ _calculatePowerAccumulation()

void warptwin::Spacecraft::_calculatePowerAccumulation ( )
protected

Sum the power loads and sources to calculate power accumulation.

◆ _computeFreeSpacePathLoss()

double warptwin::SimpleComAnalysisModel::_computeFreeSpacePathLoss ( double range,
double frequency ) const
protected

Function to compute the free space path loss.

Parameters
rangeDistance between TX and RX in meters
frequencyFrequency of the comminucation in Hz
Returns
Free space path loss in dB

◆ _configureFromPlanet()

int warptwin::Spacecraft::_configureFromPlanet ( )
protected

Configure the spacecraft class to map to planet.

Returns
Error code corresponding to success/failure

◆ _configureInternal()

void warptwin::_configureInternal ( )

Function to configure sensor – runs in all constructors.

◆ _executeScheduleStep()

int16 warptwin::SimTableScheduleModel::_executeScheduleStep ( const clockwerk::Time & step_time)
protected

Execute schedule step given current step time.

Parameters
step_timeThe current step time to execute
Returns
Error code out of schedule step

◆ _mapInternal()

void warptwin::Spacecraft::_mapInternal ( )
protected

Function to internally map relationships between sensors.

◆ _msisCheckInputs()

int warptwin::MSISAtmosphereModel::_msisCheckInputs ( )
protected

Function to check range of input values.

Returns
Error code corresponding to success/failure

◆ _updateStates()

int warptwin::PlanetRelativeStatesModel::_updateStates ( )

◆ activate()

int16 warptwin::activate ( )
override

◆ addPowerLoad()

int warptwin::Spacecraft::addPowerLoad ( clockwerk::DataIO< double > * power_load_ptr)

Add a power load to the spacecraft.

Parameters
power_load_ptrPointer to the power load (Watts) to add
Returns
Error code corresponding to success/failure
Note
The value within the DataIOBase pointer must be a double

◆ addPowerSource()

int warptwin::Spacecraft::addPowerSource ( clockwerk::DataIO< double > * power_source_ptr)

Add a power source to the spacecraft.

Parameters
power_source_ptrPointer to the power source (Watts) to add
Returns
Error code corresponding to success/failure
Note
The value within the DataIOBase pointer must be a double

◆ asphericalGravityModel()

warptwin::AsphericalGravityModel * warptwin::asphericalGravityModel ( )

Function to get a handle to the aspherical gravity model contained within this model.

Returns
Pointer to the aspherical gravity model
Note
Returns nullptr if aspherical gravity is not the active gravity model

◆ atmosDrag()

warptwin::FlatPlateDragModel * warptwin::atmosDrag ( )

Function to get a handle to the flat plate drag model contained within this model.

Returns
Pointer to the flat plate drag model

◆ biasNoiseModel()

MODEL(Magnetometer) public warptwin::MarkovUncertaintyModel * warptwin::biasNoiseModel ( )

Accessor for the internal bias and noise model.

Model of spacecraft star tracker.

Simple Camera Model.

The initial bias in magnetometer measurement output described as a three-element vector in meters/second^2. Default is no bias. Must be set before model startup. The minimum magnetic field strength that the sensor can record in each axis. Default is -800 µT assuming input unit is in nanoTesla. (same unit as input) The maximum magnetic field strength that the sensor can record in each axis. Default is 800 µT assuming input unit is in nanoTesla. (same unit as input) The vehicle frame relative to which the sensor is mounted and aligned. This is most typically the body frame of a spacecraft or other vehicle. mount_position__mf and mount_alignment_mf are described relative to this frame. The position of the sensor in the mount frame, represented in the default simulation unit (meters by default. pretty much always meters) The alignment of the magnetometer relative to the mount frame. Rotation from sensor frame to mount frame The measurement resolution. The output value will be some multiple of this value. If the value is left at zero, an infinite resolution will be assumed, i.e. no data loss/quantization. From a data sheet, this value can be computed as (measurement range) / 2^(bits per measurement) . (same unit as input) The rate at which the sensor generates an output, in hertz. This value must be some positive (non-zero) integer. (Hz) Value to seed the internal RNG for this model. External magnetic field model output frame, see inputs for further explanation. Latency of the magnetometer, millisecond value for the amount of delay in sim time for the correct values to be reflected in the outputs. Must be set before executive startup. Defaults to no delay. (milliseconds) Power draw of the magnetometer. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Mass of the magnetometer. (kg) The one-sigma Gaussian noise in magnetometer measurement output described as a three-element vector in same unit as input. Default is no noise. The one-sigma Gaussian noise in the magnetometer bias drift described as a three-element vector in (input unit)/sqrt(second) e.g. nT/sqrt(sec). Default is no walking-bias drift. The one-sigma scale percent increase/decrease of the measurement. Default is no scaling. The local magnetic field of the sensor gathered from an external magnetic field model (e.g. dipole, IGRF, WMM), expressed in the model output frame. (input unit) Output time tied to measurements. Output time is exactly the navigation time (see SimTimeManager for configuration), without latency (instantaneous) but but with a rate that mirrors output rate The measured output magnetic field produced by the magnetometer describing the local magnetic vector of the sensor frame expressed in sensor frame coordinates with appropriate bias, noise, latency, and rate limiting. (Same unit as input) The "perfect" output magnetic field produced by the magnetometer describing the local magnetic field of the sensor frame expressed in sensor frame coordinates without bias and noise. This is an informational parameter. This value is not effected by latency. (Same unit as input) Boolean value to notify if the output measurement is valid (i.e. boolean for blackout-zones). True = not in blackout-zone, False = in blackout-zone. Power draw of the sensor. This value is populated when the model is active, and zero when the model is deactivated. Allows the user to create duty cycles and power budgets. (Watts)

Returns
Pointer to the bias noise model

This model simulates a simplified camera which produces line of sight (alpha and beta) angles relative to a target

Author: Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m..tech The frame of the object being sensed by the simple camera model. The bias in the alpha angle measurement output described as a single scalar, with angle in RADIANS. This parameter may account for a number of factors, including misalignment, measurement bias, etc. Default is no bias. The bias in the beta angle measurement output described as a single scalar, with angle in RADIANS. This parameter may account for a number of factors, including misalignment, measurement bias, etc. Default is no bias. The one-sigma gaussian noise in alpha measurement output described as a scalar, with angle in RADIANS. Default is no noise. The one-sigma gaussian noise in beta measurement output described as a scalar, with angle in RADIANS. Default is no noise. The vehicle frame relative to which the camera is mounted and aligned. This is most typically the body frame of a spacecraft or other vehicle. mount_position__mf and mount_alignment_mf are described relative to this frame. The position of the camera in the mount frame, represented in the default simulation unit (meters by default. pretty much always meters) The alignment of the camera relative to the mount frame The rate at which the camera generates an output, in hertz. Setting this value to 0 forces the camera to output at the simulation rate. Value to seed the internal RNG for this model. Power draw of the camera. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Mass of the camera. (kg) The alpha angle measurement output produced from the camera describing the location of the target object frame relative to the reference frame plus appropriate bias, noise, and rate limiting. The beta angle measurement output produced from the camera describing the location of the target object frame relative to the reference frame plus appropriate bias, noise, and rate limiting. The alpha angle measurement output produced from the camera describing the location of the target object frame relative to the reference frame without noise or error. This parameter is informational. The beta angle measurement output produced from the camera describing the location of the target object frame relative to the reference frame without noise or error. This parameter is informational. Power draw of the sensor. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts)

Accessor for the internal bias and noise model

Returns
Pointer to the bias noise model

This model represents a simple star tracker which may be parameterized with a given bias, noise, and rate. It measures the attitude of the star tracker frame, which is internally configured, relative to an externally assigned reference frame.

The mount frame is defined as: Centered in the center of the reference image X is "up" in the image Y is "right" in the image Z is "into" the image completing the right hand frame

|-------------------—| | x^ | | |-->y | | | |-------------------—|

Author: Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m..tech The bias in measurement output described as a 3-2-1 Euler angle sequence, with angles in RADIANS. This parameter may account for a number of factors, including misalignment, measurement bias, etc. Default is no bias. The cross axis accuracy of the star tracker in radians. Default is perfect accuracy The twist axis accuracy of the star tracker in radians. The default is perfect accuracy The field of view of the star tracker defined as the full cone angle in Radians. Default is pi/6 radians. The mass of the star tracker in kg. Default is massless The vehicle frame relative to which the star tracker is mounted and aligned. This is most typically the body frame of a spacecraft or other vehicle. mount_position__mf and mount_alignment_mf are described relative to this frame. The position of the star tracker in the mount frame, represented in the default simulation unit (meters by default. pretty much always meters) The alignment of the star tracker relative to the mount frame The radiation tolerance of the star tracker in krad. Default is no radiation tolerance The reference frame relative to which all star tracker measurements will be returned. If a reference frame is not set, all star tracker measurements will be returned relative to the simulation root frame. The rate at which the star tracker generates an output, in hertz. Setting this value to 0 forces the star tracker to output at the simulation rate. Value to seed the internal RNG for this model. Power draw of the star tracker. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Output time tied to measurements. Output time is exactly the navigation time (see SimTimeManager for configuration), without latency (instantaneous) but but with a rate that mirrors output rate The measurement output quaternion produced by the star tracker describing the orientation of the star tracker "sensor frame" relative to the reference frame plus appropriate bias, noise, and rate limiting. The "perfect" output quaternion produced by the star tracker describing the orientation of the star tracker "sensor frame" relative to the reference frame. This parameter is informational and free from error. Power draw of the sensor. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts)

Accessor for the internal bias and noise model

Returns
Pointer to the bias noise model

The fixed bias of the sun sensor. This could be a mixture of a misalignment error and/or measurement noise offset. The field of view respective to the horizontal of the focal plane. This is defined as full FOV NOT the half angle measured from boresight. (degrees) The field of view respective to the vertical of the focal plane. This is defined as full FOV NOT the half angle measured from boresight. (degrees) The vehicle frame relative to which the sensor is mounted and aligned. This is most typically the body frame of a spacecraft or other vehicle. mount_position__mf and mount_alignment_mf are described relative to this frame. The position of the sensor relative to the mount frame and resolved in the mount frame. (meters) The alignment of the sun sensor relative to the mount frame. Rotation from mount frame to sensor frame. The rate at which the sensor generates an output, in hertz. This value must be some positive (non-zero) integer. (Hz) Value to seed the internal RNG for this model. The inertial frame of the sun. The inertial frame of the spacecraft's primary orbiter (e.g. Earth). This is used for occultation. Radius of the primary orbiter, occultation assumes circular cross-sections. Defaults to Earth. (m) Latency of the sun sensor, millisecond value for the amount of delay in sim time for the correct values to be reflected in the outputs. Must be set before executive startup. Defaults to no delay. (milliseconds) Power draw of the sun sensor. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Mass of the sun sensor. (kg) The one-sigma Gaussian noise in sun sensor measurement output described as the error in angle between true sun-vector and expected sun-vector. This value is provided by most data sheets and is the same between fine and coarse sun sensors. (radians) Output time tied to measurements. Output time is exactly the navigation time (see SimTimeManager for configuration), without latency (instantaneous) but but with a rate that mirrors output rate The "noisy" unit vector representing the direction of the sun relative to the sun sensor frame in sun sensor frame coordinates. This value is subject to noise, bias, dead-zoning, occultation, sensor rate, and latency. The "truth" unit vector representing the direction of the sun relative to the sun sensor frame in sun sensor frame coordinates. This value is NOT subject to noise, bias, dead-zoning, occultation, or latency; but is subject to sensor rate. Boolean value to notify if the output measurement is valid (i.e. boolean for blackout-zones). True = not in blackout-zone, False = in blackout-zone. This value is subject to latency and will line-up with a measurement value. Power draw of the sensor. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts)

Returns
Pointer to the bias noise model

◆ caseInsensitiveEqual()

bool warptwin::caseInsensitiveEqual ( const std::string & in_a,
const std::string & in_b )

Function to compare two strings independent of case.

Parameters
in_aThe first string to compare
in_bThe second string to compare
Returns
True if strings equal in case-independent fashion. False otherwise

◆ checkVerifyLicense()

int warptwin::checkVerifyLicense ( const std::string & license_file,
const std::string & license_server )

Function to check and verify that user has license for the simulation.

Parameters
license_fileThe license file containing the user's data, if it exists
license_serverThe license server which may be used to locate another file
Returns
Error code corresponding to success/failure

◆ clamp()

template<typename T>
int warptwin::clamp ( T input,
T min_val,
T max_val,
T & output )

This function will force a value to be between the defined minimum and maximum values. If input is less than the minimum, then the output will be the minimum. If the output is larger than, then the output will be the maximum. Otherwize the output is the input.

min <= clamp(x) <= max

Parameters
inputInput to the unary function
min_valMinimum output value
max_valMaximum output value
outputImplicit return of the output
Returns
Error code, zero if there is no error

◆ clearPowerLoads()

void warptwin::clearPowerLoads ( )

Clear the list of power loads.

◆ clearPowerSources()

void warptwin::clearPowerSources ( )

Clear the list of power sources.

◆ coe2rv()

int warptwin::coe2rv ( CartesianVector6 & elements,
double mu,
CartesianVector3 & pos,
CartesianVector3 & vel )

Function to convert orbital elements to cartesian xyz.

Parameters
elementsThe orbital elements as {a, e, i, W, w, f} – angles in radians
muThe gravitational parameter of the reference planet
posReturn of the x, y, z position of the reference object
velReturn of the x, y, z velocity of the reference object
Returns
Error code corresponding to success/failure
Note
Overloaded for float and double
Automatically rounds 0 values for circular and zero-inclined orbits to a minimum tolerance. Some values for orbits in circular and zero-inclined orbits may not be valid.
Todo
Update to handle parabolic orbits

◆ contains()

bool warptwin::contains ( const std::string & parent_str,
const std::string & substr )

Function to return whether substr is in parent_str.

Parameters
parent_strThe string to search
substrThe string to search for
Returns
True if substr is in parent_str. False otherwise

◆ convertPosDim2Nd()

clockwerk::CartesianVector< 3 > warptwin::convertPosDim2Nd ( clockwerk::CartesianVector< 3 > pos_d,
double l_star )

Function to convert position from dimensional to characteristic units.

Parameters
pos_dThe position of the body in dimensional units
l_starThe characteristic length of the system
Returns
Position in characteristic units

◆ convertPosNd2Dim()

clockwerk::CartesianVector< 3 > warptwin::convertPosNd2Dim ( clockwerk::CartesianVector< 3 > pos_nd,
double l_star )

Function to convert position from characteristic to dimensional units.

Parameters
pos_ndThe position of the body in non-dimensional units
l_starThe characteristic length of the system
Returns
Position in dimensional units

◆ convertVelDim2Nd()

clockwerk::CartesianVector< 3 > warptwin::convertVelDim2Nd ( clockwerk::CartesianVector< 3 > vel_d,
double l_star,
double t_star )

Function to convert velocity from dimensional to characteristic units.

Parameters
vel_dThe velocity of the body in dimensional units
l_starThe characteristic length of the system
t_starThe characteristic time of the system
Returns
Velocity in characteristic units

◆ convertVelNd2Dim()

clockwerk::CartesianVector< 3 > warptwin::convertVelNd2Dim ( clockwerk::CartesianVector< 3 > vel_nd,
double l_star,
double t_star )

Function to convert velocity from characteristic to dimensional units.

Parameters
vel_ndThe velocity of the body in non-dimensional units
l_starThe characteristic length of the system
t_starThe characteristic time of the system
Returns
Velocity in dimensional units

◆ dcmPqr2Xyz()

clockwerk::DCM warptwin::dcmPqr2Xyz ( double i,
double W,
double w )

Function to generate a 3-1-3 DCM to rotate from PQR to XYZ coordinates.

Parameters
iOrbit inclination, in radians
WRAAN, in radians
wArgument of periapsis, in radians
Returns
DCM defining the relationship
Note
TODO: Make this function more efficient by pre-defining DCM

◆ deactivate()

int16 warptwin::deactivate ( )
override

Model to simulate a servo's motion.

Model of a power load.

Spherical Harmonics Model.

Torque Coil Model.

This model simulates the behavior of a servo. The servo accounts for the following properties: Command noise - Represented as Gaussian additive noise, present due to physical imperfections Servo turn bounds - most servos cannot spin indefinitely in either direction, this model lets one set those bounds Servo speed - Servos cannot instantly transition between command states, they must move at some maximum speed Latency - Commands sent to the servo must traverse over physical wires, this will introduce delay

Author
James Tabony james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech The maximum angle to which the servo can spin to, in the positive angle direction. [radians] The minimum angle to which the servo can spin to, in the negative angle direction. This value should be not abs(angle), for example if the servo can spin to +- pi radians, then the minimum would be -pi. [radians] The standard deviation of servo actuation noise. [radians] Value to seed the internal RNG for this model. The latency of the servo, this is the delay of between the command to the servo and realization of that command. [milliseconds] The misalignment angle of the servo. This comes from imperfect installation. This sign of this value should be the same as the positive and negative angle representation in the servo point of reference. [radians] The initial angle of the servo on model startup. [radians] The maximum speed at which the servo can spin. [radians/second] The commanded angle of the servo. [radians] The actual current angle of the servo with noise, latency, and servo speed implemented. [radians]

This is a model of a torque coil which applies a torque using the magnetic field generated by an electromagnet (with no ferromagnetic core) interacting with the Earth's magnetic field. A positive torque is applied about the torque vector when a positive current is applied. Note that this direction is the orthogonal vector (Area Vector) of the wire coil.

Noise is applied as a gaussian noise about the commanded current.

Author
Alex Jackson alex..nosp@m.jack.nosp@m.son@a.nosp@m.ttx..nosp@m.tech The body which will be controlled by this model. The torque will be applied to a node aligned to this body, and WarpTwin will translate to torque at the body The frame in which the magnetic field vector is expressed. This is most typically the magnetometer frame The torque coil vector wrt the body frame. This is the area vector of the torque coil that a positive torque is applied about The standard deviation of input current noise. A new noise draw is taken at each timestep. Value to seed the internal RNG for this model. The area inside the loop (m^2) Number of loops of wire in the torque coil The standard deviation of the misalignment angle (degrees) The resistance of the torque coil in Ohms The idle power draw of the torque coil when operational in Watts The input current in Amps. Positive current creates a positive torque about the torque vector The external magnetic field vector in the mag frame (nanoTesla) The power draw of the reaction wheel in Watts The torque applied to the body in the body frame in N-m

Implements the World Magnetic Model (WMM)

References: [1] The US/UK World Magnetic Model for 2020-2025 by Arnaud Chulliat et al. (NOAA) and William Brown et al. (British Geological Survey Geomagnitsm Team) [2] Pysical Geodesy by Heiskanen and Moritz 1967 [3] Geomagnetism and Schmidt quasi-normalization by Winch et al. 2005

Note
This model can be expanded to a higher fidelity with the WMMHF model procuded by NOAA

Author: James Tabony Email: james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech The filename for the file that contains the Gauss coefficients for spherical harmonic calculation. NOAA releases a new set of coefficients every 5 years on years that are divisible by 5 (e.g. 2015, 2020, 2025, ...) that are most valid from the year they are realseed until the next coefficient set release. The coefficient n which represents the variations in gravitational field in the latitudinal direction. Also the harmonic function order. This value must be chosen before executive startup. (1 <= N <= 12) The body position wrt the planet in a planet-centered rotating frame (meters) The local magnetic field vector expressed in body's local North East Down frame. (nanoTesla) The local magnetic field vector expressed in ECEF frame. (nanoTesla)

The power load model is a simple model of a power load meant to represent the power draw of components that are otherwise unmodeled (such as heaters or scientific instruments). The model accounts for power draw in three modes: active, idle, and off (no power draw). Power draw while in ACTIVE mode, in Watts Power draw while in IDLE mode, in Watts Power draw while in OFF mode, in Watts The current mode of the power load: 0 = off, 1 = idle, 2 = active Instantaneous power draw of the power load, in Watts

◆ deadzone()

template<typename T>
int warptwin::deadzone ( T input,
T bounds,
T & output )

This function will supress all inputs within (±) the specified bounds. The deadzone function is NOT piecewise continuous, so it will have discontinuities at the bounds.

if abs(x) <= dx :: deadzoneTrimmed(x) = 0 if abs(x) > dx :: deadzoneTrimmed(x) = x

Parameters
inputInput to eht unary function
boundsDeadzone bounds (must be positive)
outputImplicit return of the output
Returns
Error code, zero if there is no error

◆ deadzoneTrimmed()

template<typename T>
int warptwin::deadzoneTrimmed ( T input,
T bounds,
T & output )

This function will supress all inputs within (±) the specified bounds. The trimmed deadzone function is piecewise continuous, so it will shift the inputs in the linear regions.

if abs(x) <= dx :: deadzoneTrimmed(x) = 0 if abs(x) > dx :: deadzoneTrimmed(x) = x - signum(x)*dx

Parameters
inputInput to the unary function
boundsDeadzone bounds (must be positive)
outputImplicit return of the output
Returns
Error code, zero if there is no error

◆ dmuWMM()

double warptwin::dmuWMM ( double input)

Unary functional input to the associated Legendre function specific to the WMM modelm, derivative w.r.t. the functional's input. This is typically denoted as mu or t in literature such as Winch et al. 2005 or Heiskanen and Moritz 1967, respectively.

For the WMM model, this is defined as:

dμ/dφ' = cos(φ')

Where φ' is the geocentric latitude

Parameters
[in]inputInput to the unary function
Returns
Output to the unary function

◆ eccentric2mean()

int warptwin::eccentric2mean ( double eccentric_anomaly,
double eccentricity,
double & mean_anomaly )

Function to convert eccentric anomaly to mean anomaly.

Parameters
eccentric_anomaly
eccentricityThe orbit eccentricity
mean_anomaly
Returns
Error code corresponding to success/failure

◆ eccentric2true()

int warptwin::eccentric2true ( double eccentric_anomaly,
double eccentricity,
double & true_anomaly )

Function to convert eccentric anomaly to true anomaly.

Parameters
eccentric_anomaly
eccentricityThe orbit eccentricity
true_anomaly
Returns
Error code corresponding to success/failure

◆ execute()

int16 warptwin::execute ( )
overrideprotected

Function to check monitor input conditions and set trigger flag accordingly. Should be implemented in derived class.

Function to check our current (base) time against our rate conditions.

Tabular thrust model This model reads and returns thrust on the basis of simulation time based on a predetermined thrust table provided for specific vehicles.

LVLV Frame Manager Model.

Bias and noise model.

Simple spacecraft-to-spacecraft link model.

Model for determining the latitude, longitude, altitude state of a vehicle relative to an oblate planet.

Model for sensing the relative state between two frames in WarpTwin.

Aerodynamics State Model.

Simple Earth Observation Model.

Solar panel model.

Simplified model of vehicle battery system which estimates battery capacity considering power input, draw.

Tabular atmosphere model.

Spherical Harmonics Model.

Simple mean wind model.

Simple disturbance wind model.

Simplified magnetic field model which treats Earth as a dipole magnet.

Composite wind model.

Aspherical gravity model with J2 and J3 effects.

Model of spacecraft radio including losses and gains with comm links and power draw.

Reaction Wheel Model.

Simplified dynamics model representing motion in the circular restricted 3 body problem.

Returns
Error code corresponding to success/failure
Note
Will NOT run if trigger and persistence are true

This model calculates the expected acceleration experienced by a body acting under three-body dynamics using the circular restricted three body assumptions.

Note the synodic frame definition is consistent with the definitions in this same directory, which is as follows:

  • Frame centered at the system barycenter
  • Frame +x directed from the major body to the minor body
  • Frame +z aligned to the minor body's angular momentum vector
  • Frame +y completes the RH frame along the definition of minor planet travel

Key assumptions:

  • The model outputs acceleration, not force, and so to apply it to a WarpTwin frame requires conversion or a body with unit mass The gravitational parameter of the primary body of the system. Defaults to the gravitational parameter of the Earth in m^3/s^2 The gravitational parameter of the secondary body of the system. Defaults to the gravitational parameter of the Moon in m^3/s^2 The distance the secondary body maintains from the primary body in the CR3BP Flag to indicate whether model should use ND canonical units (true) or standard units (false) The position of the spacecraft in the rotating three body "synodic" frame. Default is in meters The velocity of the spacecraft in the rotating three body "synodic" frame. Default is in meters/second The acceleration of the spacecraft in the rotating three body "synodic" frame. Default is in meters/s^2

This is a model of a reaction wheel which applies a torque to a reaction wheel and thus the spacecraft in the opposite direction. The momentum stored in the reaction wheel and the wheel speed are both recorded. A positive torque is applied about the z axis of the reaction wheel which is the orthoganal vector to the reaction wheel.

Note that the torque applied to the sc body will be negative of the commmanded torque. Noise is applied as a gaussian noise about the commanded torque.

Author
Alex Jackson alex..nosp@m.jack.nosp@m.son@a.nosp@m.ttx..nosp@m.tech The body which will be controlled by this model. The torque will be applied to a node aligned to this body, and WarpTwin will translate to force and torque at the body The reaction wheel location relative to the provided body in the body frame The reaction wheel orientation wrt the body frame. This z axis of the reaction wheel is the orthogonal vector to the reaction wheel that a positive torque is applied about The bias in the wheel which is applied to every time it is commanded. The standard deviation of torque noise. A new noise draw is taken every time a new torque command is received. Value to seed the internal RNG for this model. The mass of the reaction wheel in kg. Default is massless The moment of inertia of the reaction wheel about its rotational axis in kg-m^2. The radiation tolerance of the reaction wheel in krad. Default is no radiation tolerance The peak torque that can be applied by the reaction wheel in Nm The momentum capacity of the reaction wheel in Nms The power draw of the reaction wheel in watts. Default is no power draw Boolean value to specify if the reaction wheel is on and drawing power. Default is on The commanded torque to the reaction wheel about its normal vector The momentum stored by the reaction wheel in Nms Boolean to specify if the wheel is saturated The wheel speed of the reaction wheel in rpm The power draw of the reaction wheel. Simply outputs the power parameter when the reaction wheel is on The torque applied to the body

This model is used to calculate the communications link and power draw of a radio system. It is meant to be configured in pairs. All the parameters are referring to the characteristics of this radio. First, define all of the attributes of this radio model and pass in another radio model with its own configuration as a parameter. The the output of this model uses simple communication analysis to calculate the comms data based on the relationship between the two radios. For example, you could have one radio model attached to a ground station and another representing a spacecraft. You assign the transmit and receive characteristics in each radio model and then set the other_radio parameter to point to the other model. The model will then output information about the link in both the receive and transmit direction from the point of view of this radio. The output from each radio will be identical except from the perspective of the radio. This means to analyze the full link between the two, you only need the output of one of the models.

This model also calculates the power draw of the radio based on whether it is transmitting or receiving. If the radio is transmitting,the power draw output will be the power_draw_TX parameter, and if it is receiving, the power draw output will be the power_draw_RX parameter.

IMPORTANT: Though loss is generally expressed as a negative gain, this model assumes that loses are positive and will subtract accordingly. For example, suppose your receiver system has poor circuitry and you expect the power received to decrease by half. This would be a gain of -3 dB, however this model expects the user to input a loss of positive 3 dB. In general, loss = -gain.

Author: Alex Jackson alex..nosp@m.jack.nosp@m.son@a.nosp@m.ttx..nosp@m.tech The transmitter carrier frequency in hertz (Hz) (MUST MATCH OTHER RADIO). Default is the amateur radio satellite communication frequency of 437 MHz. The bandwidth of transmission (Hz) 50 kHz is common for UHF (MUST MATCH OTHER RADIO) The bit rate in bits per second (bps) 9600bps is a common value for UHF (MUST MATCH OTHER RADIO) The transmit power in Watts (W). Transmit power is usually around 1 Watt for cubesats Return loss of this radio when transmitting, this value describes ratio of power that is reflected back into the system. Should be input as positive but is normally negative. Default is a representative value of 14 dB The transmit antenna gain in decibels relative to isotropic (dBi) Default is 2.15 representative of a dipole The total transmit system loss in decibels (dB). This is the accumulation of transmitter pointing loss, and transmitter circuit loss. Inputting zero assumes that there is no return loss (despite this actually being 100% return loss). 5 db is a conservative estimate for typical satellite systems The receive antenna gain in decibels relative to isotropic (dBi). Usually the same as the transmit antenna gain unless there is a separate receive antenna. The noise temperature in Kelvin (K). This value is realted to the system noise density by Boltzmann*noise_temp and system noise power by the equation band_width*noise_density. Generic input of 307.5 should be replaced by data sheet value(MUST MATCH OTHER RADIO) The total receive system loss in decibels (dB). This is the accumulation of receiver side loss such as pointing loss, radome loss, polarization loss, and atmospheric loss. 4 db is a conservative estimate for typical satellite systems The cross polarization loss in decibels (dB). General rule of thumb, if both RX and TX have same-hand circular or linear (0dB), if there is a circular to linear match (3dB), but a right vs left circular mismatch can result in 20 to 30 dB loss. (MUST MATCH OTHER RADIO) The energy per bit to noise ratio required in dB. Based on various modulation schemes for a desired bit error rate. For BPSK an Eb/N0 required of about 11 allows for a bit error rate around 1e-6. (MUST MATCH OTHER RADIO) The power draw of the radio when transmitting in Watts (W) Note that this is different from the transmit power. Default is no power draw The power draw of the radio when receiving in Watts (W). Default is no power draw A pointer to the other radio model to which this radio is communicating The frame that the radio is attached to. Used to calculate range This is the mask flag for the ground station. True for masked, False for visible An int to indicate if the radio is transmitting. The power draw is set to the TX power draw if greater than 0 and RX power draw if equal to 0. If this is less than zero it is set to the opposite of the masked flag (constantly transmitting when in view) The free space path loss in decibels (FSPL) (dB). This is the same in both directions The effective isotropic radiated power (EIRP) in decibel-milliWatts (dBm) The receive power in decibel-milliWatts (dBm) The system noise figure (NF) in decibel-milliWatts/Hz (dBm/Hz) The signal-to-noise density ratio (SNR) in decibel (dB) The energy per bit to noise ratio in in decibels (dB) The link margin in decibels (dB) The effective isotropic radiated power (EIRP) in decibel-milliWatts (dBm) The receive power in decibel-milliWatts (dBm) The system noise figure (NF) in decibel-milliWatts/Hz (dBm/Hz) The signal-to-noise density ratio (SNR) in decibel (dB) The energy per bit to noise ratio in in decibels (dB) The link margin in decibels (dB) The power draw of the radio in Watts (W)

This model calculates gravity for a planetary body, accounting for effects due to the J2 and J3 perturbations. This is the gravitational parameter of our parent planet. Defaults to Earth's gravitational parameter in m^3/s^2 for ease of use This is the J2 parameter of our parent planet. Defaults to Earth's J2 parameter for ease of use This is the J3 parameter of our parent planet. Defaults to Earth's J3 parameter for ease of use This is the radius of our parent planet. Defaults to Earth's radius, in meters for ease of use This is the mass of the body, which will be multiplied by our force to get the force calculation The position of the object body in the reference frame f This is the total acceleration due to gravity calculated in the same reference frame as pos_body__f This is the total force due to gravity calculated in the same reference frame as pos_body__f This is the acceleration due to point mass gravity calculated in the same reference frame as pos_body__f This is the acceleration due to J2 calculated in the same reference frame as pos_body__f This is the acceleration due to J3 calculated in the same reference frame as pos_body__f

This model takes in the three major components to a high fidelity wind model: 1). Mean wind: the average steady-state wind velocity vector 2). Gust wind: the stochastic and time dependent busts of intense wind 3). Disturbance wind: the stochastic and time dependent random fluctuations in the wind

The model takes the three components and their respective frames and outputs the composite wind (sum of all components) in the desired output frame.

Author: James Tabony james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech The frame of the mean wind input vector. The frame of the gust wind input vector. The frame of the disturbance wind input vector. If left as nullptr, the model assumes the disturbance frame is the direct mean wind frame: X : In the direction of the mean wind Y : Cross-wind, perpendicular to the direction of mean wind but in local surface horizontal plane (Z cross X = Y) Z : Aligned with the mean wind frame. Perpendicular to surface. The frame of the composite wind output vector. Mean wind vector expressed in the frame specified by the params. Velocity must be relative to a planet rotating frame. (meters/second) Gust wind vector expressed in the frame specified by the params. Velocity must be relative to a planet rotating frame. (meters/second) Disturbance wind vector expressed in the frame specified by the params. Velocity must be relative to a planet rotating frame. (meters/second) The composite wind vector expressed in the frame specifiec by the params. The velocity is expressed relative to the planet rotating frame. (meters/second)

This model calculates the magnetic field vector represented in the PCI frame and object frame using a simple dipole model. The equations and parameters used for this model come from "Fundamentals of Spacecraft Attitude Determination and Control" by Markley and Crassidis, chapter 11 section 1.1, equation 11.5

Note: Crassidis defines the equations from the magnetic south pole, I define my equations from the magnetic north pole.

Author: James Tabony Email: james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech The colatitude of the IGRF magnetic north pole as referenced in the global latitude/longitude map. Defaults to global north pole (radians) The longitude of the IGRF magnetic north pole as referenced in the global latitude/longitude map. Defaults to globak north pole (radians) Planet magnetic field magnitude at planet equitorial distance. Defaults to Earth. (nT ~ nanoTesla) Planet equitorial distance, specific to the magnetic field model. Defaults to Earth. (meters) Planet rotating frame pointer. Position of the object frame with respect to the planet rotating frame, resolved/expressed in the planet rotating frame coordinates. (meters) The magnetic field vector local to the object, represented in the planet centered rotating frame, PCR. (nT ~ nanoTesla)

This model generates an objects experienced mean wind through a pseudo-deterministic process. The mean wind magnitude is based an a power function sclaled by a reference wind spead at a given altitude.

$$ V(h) = V_{ref} * \left( \frac{h}{h_{ref}} \right)^\alpha $$

The wind direction perturbed around a provided value (wind direction at reference altitude) in a continuous (not smooth) manner. By a function f(h) with uniformly distributed outputs for select altitudes between the values of [-1, 1]. This relationship is:

$$ \theta(h) = \theta_0 + \Delta \theta \cdot f(h) \qquad f:h \in \mathbb{R} \mapsto [-1, 1] \, \, \text{and} \, f(0) := 0 $$

Author: James Tabony james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech Wind speed at 20 feet altitude from surface NOT WGS84 ellipsoid. Defaults to 30 knots which corresponds to moderate turbulence. (meters/second) Altitude of the surface relative to the WGS84 model. (meters) Value to seed the internal RNG for this model. Altitude of the object as relative to the WGS84 model. (meters) The disturbance wind vector of the object expressed in the mean wind frame (meters/second), defined as: X : In the direction of the mean wind Y : Cross-wind, perpendicular to the direction of mean wind but in local surface horizontal plane (Z cross X = Y) Z : Aligned with the mean wind frame. Perpendicular to surface. The velocity is expressed relative to a planet rotating frame.

This model generates an objects experienced mean wind through a pseudo-deterministic process. The mean wind magnitude is based an a power function sclaled by a reference wind spead at a given altitude.

$$ V(h) = V_{ref} * \left( \frac{h}{h_{ref}} \right)^\alpha $$

The wind direction perturbed around a provided value (wind direction at reference altitude) in a continuous (not smooth) manner. By a function f(h) with uniformly distributed outputs for select altitudes between the values of [-1, 1]. This relationship is:

$$ \theta(h) = \theta_0 + \Delta \theta \cdot f(h) \qquad f:h \in \mathbb{R} \mapsto [-1, 1] \, \, \text{and} \, f(0) := 0 $$

Author: James Tabony james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech The average wind speed measured at the reference altitude. (meters/second) The average wind azimuth angle (angle of the wind vector measured off of local north towards east) at the reference altitude. Make sure to set before exc.startup. (radians) Reference altitude, typically close to the surface. This altitude is measured from surface NOT WGS84 ellipsoid. (meters) Altitude of the surface relative to the WGS84 model. (meters) Wind shear factor. Used to describe the change in mean wind magnitude with respect to altitude. This parameter is dependent on the terrain underneath the flight operation. Open sea ~ 0.1, Suburban ~ 0.25, Forest/Mountains ~ 0.4. Maximum direction shift of mean wind. You can effectively turn off the wind vector shear by setting this value to zero. (radians) Value to seed the internal RNG for this model. Altitude of the object as relative to the WGS84 model. (meters) The mean wind vector of the object expressed in the local NED frame of the reference position. The velocity is expressed relative to the planet rotating frame. (meters/second)

Implements spherical harmonic gravity up to an 18x18 field based on the implementation in the 42 simulation: https://github.com/ericstoneking/42/blob/4be580d8defc968da97d937ce09ef107c07860cb/Kit/Source/envkit.c#L82

Author: Sam Matez Email: sam.m.nosp@m.atez.nosp@m.@attx.nosp@m..tec.nosp@m.h The filename for the file that contains the coefficients for spherical harmonic calculation. These coefficients should be un-normalized, as the model applies a Neumann normalization to the loaded coefficients. This is the gravitational parameter of our parent planet. Defaults to Earth's gravitational parameter for ease of use This is the radius of our parent planet. Defaults to Earth's radius, in meters for ease of use The coefficient n which represents the variations in gravitational field in the latitudinal direction The coefficient m which represents the variations in gravitational field in the longitudinal direction. must be less than or equal to n This is the mass of the body, which will be multiplied by our force to get the force calculation... TODO to replace this with accel methods The body position wrt the planet in a planet-centered, planet fixed frame (m) This is the acceleration due to gravity calculated in the same reference frame as pos_body__f This is the force due to gravity calculated in the same reference frame as pos_body__f

This model reads and returns atmospheric parameters pressure, temperature, and density on the basis of altitude in meters above ground level.

The model reads from files in the format defined in data/atmosphere, which is a txt format input.

This is a highly simplified implementation – for ultra high fidelity propagation consider using a different model.

For values above the tabulated range, the model returns the values at the end of the table for temperature and zero for pressure and density. For values below the end of the table the model returns the lowest altitude value in the table.

Speed of sound calculation based on Introduction to Flight by Anderson, p. 177 eq 4.54

Text file must be in the format H(km) T(K) p(Pa) ρ(kg/m^3)

Author: Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m.engin.nosp@m.eeri.nosp@m.ng.co.nosp@m.m The atmosphere data file which should be loaded. Default is 1976 std atmosphere. Our ideal gas constant for speed of sound calculation. Default is for air The specific heat ratio for air – used in calculation of the speed of sound The reference altitude in meters above sea level The temperature of the atmosphere in degrees kelvin The pressure of the atmosphere in Pascals (N/m^2) The density of the atmosphere in kg/m^3 The speed of sound in meters per second

Author: Alex Reynolds alex@.nosp@m.attx.nosp@m..tech The peak voltage provided by a single battery (summed to make full pack) The capacity, in W*hr, provided by a single spacecraft battery The % of charge at which power shuts off. Default is 0.0 (no shutoff until capacity is empty) Should be a percent. value in the range 0-->1 indicating the initial charge state of the system The number of batteries configured in series. Determines the system voltage and shutoff The number of batteries configured in parallel. Used with series to determine system capacity The capacity-voltage curve defined by percent capacity against pct max voltage. Default is lithium ion The amount of power generated by the system in the given step, in W The amount of power drawn from the system in the given step, in W The net change in power in the system for the step, in W The depth of discharge, a percentage value denoting the depletion of the battery system. (%) The current voltage of the power system The current draw of the system, in Amps Boolean indicating whether power is available (true) or not (false) from the system

This model defines a solar panel model that accounts for eclipse, pointing, size, and efficiency. This is a combination of the Solar Panel Power, Occultation, and Effective Solar Area moddels to aide in ease of use. Author: Alex Jackson Email: alex..nosp@m.jack.nosp@m.son@a.nosp@m.ttx..nosp@m.tech The mass of the solar panel in kg. Default is massless The solar irradiance at the location of interest in power per area (the default is in W/m^2) The solar panel efficiency on a scale of 0 to 1 where 0 is 0 percent efficiency and 1 is 100 percent efficiency The area of the solar panel. The solar panel normal vector in the body frame. This is used to describe the orientation of the solar panel wrt to the body frame (default is the x axis ) The inertial Sun frame Sun radius in m The parent frame which the body frame is orbiting Planet radius in m (default is Earth radius) Body frame of the spacecraft Whether the solar panel should remain body fixed and perform effective area calculations (true/default), or should assume effective solar area is always 100% of panel size for a simpler calculation (false) The power generated by the panel in watts Fraction of two spherical representations of objects that are visible from the point of view of the observer. 0 is fully occulted, 1 is not occulted, 0-1 is visible fraction of observed object.

This model defines a simple Earth Observation configuration with revisit counts, range, and observation times. The maximum angle off nadir the spacecraft is allowed to look for a valid pass, in radians The frame of the spacecraft object that the ground station will sense The planet rotating frame to which the ground station is attached. Note that the planet rotating frame must be a child of the associated planet inertial frame, which is also used in this model. This is the detic latitude of the target site, in radians The longitude of the target site, in radians The total amount of time, in seconds, that the site has been observable The total number of visits by the spacecraft to the site This is the range of the spacecraft to the target This is the range rate of the spacecraft wrt the target This is the look angle of the spacecraft wrt the target site, in radians This flag indicates whether the targeted ground site is visible or not. 1 = visible

This model calculates the common "vehicle relative" wind effects alpha, beta, mach, v_infinity, and airspeed on the vehicle in the vehicle "aerodynamics frame" which is defined for the purpose of this model as follows:

  • X points forward on the vehicle out the nose (generally in the direction of travel)
  • Y points out the right wing of the vehicle
  • Z points down

Such that the vehicle generally moves with positive velocity in x. The body frame state of the vehicle being analyzed The frame in which the input vehicle velocity is measured The frame in which the wind velocity is measured The velocity of the object as measured in the velo frame – for instance, velocity in ECEF The velocity vector of the wind as measured in the wind frame – for instance, wind in NED The speed of sound from the atmospheric model. Default value is 343.0 meters per second The velocity of the aerodynamics frame relative to the oncoming wind, in aero frame coords The relative wind experienced by the aerodynamics frame in aerodynamics coordinates. Opposite of v_aero__aero Angle between velocity vector and body x-axis in x–z plane Angle between velocity vector and body x–z plane Magnitude of air-relative velocity The ratio of the object's speed in relation to the speed of sound.

The frame state sensor model senses the relative state between two frames and outputs that state difference as represented in a third, output frame. It applies basic kinematics using base functions developed in the clockwerk module to generate a step-by-step difference between two frames.

The results output by this model can be described as "the state of target_frame relative to reference_frame as output in output_frame coordinates" The target_frame is the frame state we are sensing – we want to know where target_frame is The reference_frame is the frame relative to which we are sensing. Results are output relative to the reference frame, in either reference frame or output frame coordinates. The output_frame is the frame in which the output results are represented. If it is set to nullptr, reference_frame is used. Not used for attitude. This is the position of the target frame origin wrt the reference frame origin, output in output frame coordinates This is the velocity of our target frame origin as represented IN the reference frame. It is NOT simply the difference in the velocities of their origins, which is different. This value accounts for reference frame rotation. Output is in output coordinates This is the inertial velocity of our target frame origin relative to our reference frame origin, represented in output frame coordinates. It is an inertial differencing of the origins represented in reference, and does not account for reference rotation. This is the attitude of the target frame relative to the reference frame This is the angular velocity of the target frame wrt the reference frame, output in output frame coordinates

This model is a one-stop-shop for useful states of a vehicle relative to a celestial body. It uses the FrameStateSensor and planetrelutils from clockwerk internally then returns results every step. It is primarily a configuration wrapper model – that is, it does the large majority of its work in startup, and adds little to no functionality at runtime, and instead runs the innter frame state sensor and planetrelutils, which do the heavy lifting.

Author
Gabe Heredia Acevedo gabe@.nosp@m.attx.nosp@m..tech This is the equatorial radius of the planet. Default is Earth in meters The celestial body’s flattening parameter The cartesian position coordinates we will use to perform our calculations relative to the reference frame, typically Planet Centered Relative frame. The cartesian velocity coordinates we will use to perform our calculations relative to the reference frame, typically Planet Centered Relative frame. The quaternion which represents the nodal attitude relative to the reference frame, typically Planet Centered Relative frame. The attitude rate which represents the nodal attitude rate relative to the reference frame, typically Planet Centered Relative frame. The nodal detic latitude relative to the reference frame. Takes into account the ellipsoidal form of the celestial body. The nodal centric latitude relative to the reference frame. Assumes the celestial body is spherical. The nodal detic altitude relative to the reference frame. Takes into account the ellipsoidal form of the celestial body. The nodal centric altitude relative to the reference frame. Assumes the celestial body is spherical. The nodal longitude relative to the reference frame.

This is a simple model of a spacecraft to spacecraft link. It performs calculations and determines the relative states of two spacecraft and, if link conditions on range, range rate, occultation, and look angle are met, calculates the link between them.

This model assumes the boresight vector for the spacecraft-to-spacecraft link is the spacecraft frame +Y vector, in keeping with the convention maintained by the RangeAzElSensorModel and ground station sensor. See that model for more details on azimuth and elevation definition. The frame of the first spacecraft in the spacecraft to spacecraft link. This is the spacecraft which receives az/el masking and, when configured, must point at the target spacecraft (sc2). The frame of the second spacecraft in the spacecraft to spacecraft link The planet rotating or inertial frame which is used in the internal link occultation model. Planet radius in m (default is Earth radius) The maximum range at which link can be achieved. Default is an arbitrarily large distance, indicating no range restriction. The maximum range rate at which link can be achieved. Default is an arbitrarily large relative velocity, indicating no range rate restriction. The maximum azimuth look angle between spacecraft 1's boresight vector and the other spacecraft for link to be achieved. In RADIANS. The default is arbitrarily large angle with no look angle requirement. The maximum elevation look angle between spacecraft 1's boresight vector and the other spacecraft for link to be achieved. In RADIANS. The default is arbitrarily large angle with no look angle requirement. This is the range between the two spacecraft. Will be zero if not visible. This is the range rate between the two spacecraft. Will be zero if not visible. This is the azimuth look angle between sc1's boresight and sc2. Will be zero if not visible. This is the elevation look angle between sc1's boresight and sc2. Will be zero if not visible. This is the link indicator flag for the two spaecraft. True for visible, False for not visible.

This model perturbs a single output according to a bias and noise value configured at start time. Distribution is gaussian.

Author
Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m..tech The bias in the object as a raw, constant error across all draws for the entire simulation The standard deviation of noise in the object as a gaussian random noise Value to seed the internal RNG for this model. The input value to be perturbed by noise and bias The output value as perturbed by noise and bias

This model creates and maintains the LVLH reference frame according to the NASA definition here: https://ntrs.nasa.gov/api/citations/19780010162/downloads/19780010162.pdf

It creates a frame as a child of the parent frame parameterized by parent. It locks position to the parent frame, leaves attitude free, then updates attitude at every derivative step according to the LVLH frame definition.

Definition: +Z axis directed toward the center of the Earth +Y axis perpendicular to the orbit plane with direction opposite angular momentum +X axis completes the right hand frame in the direction of orbit travel

Important: This is a position-only frame. Angular velocity is not updated The inertial parent frame which the target frame is orbiting The reference target frame to which the LVLH frame should attach This is the orbital position of the object for which we're calculating LVLH This is the orbital velocity of the object for which we're calculating LVLH The LVLH frame produced by this model

The model reads from files in the format defined in cpp/test/thrust_text.txt, which is a txt format input.

For values below and above the tabulated time range, the model returns a thrust value of zero to account for time before launch and after engine cutoff.

Text file must be in the format t(s) T(N)

Author: Sam Matez sam.m.nosp@m.atez.nosp@m.@attx.nosp@m..tec.nosp@m.h The thrust data file which should be loaded. Default is TBD. The thrust data file which should be loaded. Default is 0N for prelaunch and touchdown purposes. The reference time in seconds since sim start The thrust generated by the engine

◆ fact()

double warptwin::fact ( long n)

Computes the factorial of a non-negative integer.

This helper function calculates the factorial of a given integer n (n!). It is used to normalize spherical harmonics coefficients.

Parameters
[in]nNon-negative integer for which to calculate the factorial.
Returns
Factorial of the input integer.
Note
This function was adapted from open-source code in the NASA 42 simulation.

◆ factorial() [1/2]

template<typename T>
T warptwin::factorial ( int n)

Wrapper for factorial function with no error code return, only use if confident on valid inputs.

Returns
n!

◆ factorial() [2/2]

template<typename T>
int warptwin::factorial ( int n,
T & output )

Computes the factorial of a non-negative integer. Currently the gamma function is not supported.

Parameters
nInteger input
outputDouble output
Returns
Error code, zero if there is no error

◆ fileExist()

bool warptwin::fileExist ( const std::string & name)

Function to quickly check and verify whether a file exists.

Parameters
nameThe name (or path) of the file to verify
Returns
True if file exists, false if not

◆ framePositionTransform()

int warptwin::framePositionTransform ( const clockwerk::CartesianVector< 3 > & vec_f1__f1,
Frame & f1,
Frame & f2,
clockwerk::CartesianVector< 3 > & vec_f2__f2 )

A function to transform a position vector relative to the origin of f1 to a vector relative to the origin of f2.

Parameters
vec_f1__f1A vector relative to the origin of f1
f1The frame in which vec_f1__f1 is represented
f2The frame we want to rotate vec_f2__f1 into
vec_f1__f2Implicit return of our transformed vector
Returns
Error code corresponding to success/failure

◆ frameRelativeInit()

int warptwin::frameRelativeInit ( Frame & target,
Frame & reference,
const CartesianVector3 & pos_tgt_ref__ref,
const CartesianVector3 & vel_tgt_ref__ref )

Function to initialize frame target relative to freame reference inertially.

Parameters
targetThe target frame whose state we want to set
referenceThe frame we are setting state relative to
pos_tgt_ref__refThe position of target relative to reference, in ref frame coordinates
vel_tgt_ref__refThe inertial velocity of target origin relative to reference origin, in ref frame coords
Returns
Error code corresponding to success/failure

◆ frameRotate()

int warptwin::frameRotate ( const clockwerk::CartesianVector< 3 > & vec__f1,
Frame & f1,
Frame & f2,
clockwerk::CartesianVector< 3 > & vec__f2 )

A function to rotate vector vec__f1 from frame f1 into frame f2.

Parameters
vec__f1A vector represented in frame f1
f1The frame in which vec__f1 is represented
f2The frame we want to rotate vec__f1 into
vec__f2Implicit return of our rotated vector
Returns
Error code corresponding to success/failure

◆ frameStateSensorEnu()

MODEL(GroundStationModel) public warptwin::FrameStateSensorModel * warptwin::frameStateSensorEnu ( )

Simple ground station model.

This model is a simple model of a ground station. It uses the FrameStateSensor and RangeAzElSensor internally to create an ENU frame as a child of the parent frame, then returns results every step. It is primarily a configuration wrapper model – that is, it does the large majority of its work in startup, and adds little to no functionality at runtime, and instead runs the innter frame state sensor and range az el sensor model, which do the heavy lifting. The frame of the spacecraft object that the ground station will sense The planet rotating frame to which the ground station is attached. Note that the planet rotating frame must be a child of the associated planet inertial frame, which is also used in this model. This is the equatorial radius of the planet. Default is Earth in meters This is the flattening of the planet, which defines shape. Default is Earth This is the centric latitude of the ground station, in radians The longitude of the ground station, in radians This is the elevation mask value, in radians, for the ground station. Default is zero degrees The position of the spacecraft as measured in the GS East, North, Up frame The velocity of the spacecraft as measured in the GS East, North, Up frame This is the range of the input object to the frame. Will be zero if masked. This is the range rate of the spacecraft to the GS. Will be zero if masked. This is the azimuth of the spacecraft wrt the frame x vector, in radians. Will be zero if masked This is the elevation of the spacecraft wrt the frame x-y plane, in radians. Will be zero if masked. This is the mask flag for the ground station. True for masked, False for visible The position of the ground station as measured in the planet-centered inertial frame The velocity of the ground station as measured in the planet-centered inertial frame Pointer to the ground station model for GUI linking of Ground Station model

◆ frameVelocityTransform()

int warptwin::frameVelocityTransform ( const clockwerk::CartesianVector< 3 > & vel_f1__f1,
const clockwerk::CartesianVector< 3 > & pos_f1__f1,
Frame & f1,
Frame & f2,
clockwerk::CartesianVector< 3 > & vel_f2__f2 )

A function to transform a velocity vector represented in frame f1 to a vector represented in f2.

Parameters
vel_f1__f1Velocity represented in frame f1
pos_f1__f1The position in f1 at which velocity is represented
f1The frame in which vel_f1__f1 is represented
f2The frame we want to represent velocity in
vel_f1__f2Implicit return of velocity represented in f2
Returns
Error code corresponding to success/failure

◆ getBias()

double warptwin::MarkovUncertaintyModel::getBias ( )

Markov Uncertainty Model.

This model is a higher fidelity model for implementing noise, bias, and other sources of error into an input, with an implied emphesis on sensor measurements.

The foundational equation of this model is: y_meas = (1+s)*y_truth + \eta + b db/dt = \xi Where: \eta = Measurement noise which follows some zero mean Gaussian distribution with standard deviation \sigma_n b = Measurement bias and is not necessarily constant \xi = Bias random walk which follows some zero mean Gaussian distribution with standard deviation \sigma_b s = Scale factor which follows some zero mean Gaussian distribution with standard deviation \sigma_s

The Stochastic Differential Equation (SDE) governing the brownian motion of the bias random-walk (or drift) can be discretized using the Euler-Maruyama Method. The SDE in Itô calculus notation is db(t) = \sigma_b * dW(t) Where: W(t) = Wiener process (standard brownian motion) dW(t) follows a zero mean Gaussian distribution with standard deviation of sqrt(discretization time step)

The Euler-Maruyama Method would suggest a discrete time update (with variable step size) for SDE's of this form to be b_(k+1) = b_(k) + \sigma_b * sqrt(dt_(k)) * \zeta Where: \zeta follows a zero mean Gaussian distribution with standard deviation of one (white process noise)

This can be reduced into a final discrete bias update by relating random varibale multiplication with varaince scaling b_(k+1) = b_(k) + w_(k) Where: w_(k) follows a zero mean Gaussian distribution with standard deviation of \sigma_b * sqrt(dt_(k))

WHEN TO USE CERTAIN NOISE TERMS 1). Measurement noise describes the random fluctuations in measurements (or any input) and is the most basic form of error.

2). Bias is a additive off-set of the measurment or the noise. Bias along with noise describe a Guassian process that has a mean equal to the bias and a standard deviation equal to the that of the noise. Sensors such as accelerometers, GPS, or gyroscopes often have bias.

3). Bias drift describes the random fluctuations in that additive purtabative term over time. This is a good way to model the bias of a sensor drifting with age, temperature, radiative effects, etc. For long operation missions, it is typical for the bias (if present) to drift in a seemingly random manner.

4). Scale factor is a multiplicative error term that is present in a lot of sensors. This error can be thought of a small increments or decrements in the input (e.g. a 0.05 percent increase/decrease). Sensors that convert analog external properties such as pressure/temperature/strain/force into a voltage that then gets converted into a digital signal are almost always prone to scale factor errors to due slight calibration error. Some gyroscopes have scale factor errors provided in degrees per second per volt or degrees per second per bit.

TODO: The model only takes in single value inputs, so for quantities in R^3 like acceleration or angular velocity vectors, the model cannot apply misalignment error

Author
James Tabony james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech The initial bias at startup in the object. This bias is non constant unless the random-walk standard deviation is set to zero. Must be set before model startup. (input units) The standard deviation of bias random-walk as a gaussian random noise. (input units not units*srqt(Hz)) The standard deviation of noise in the object as a gaussian random noise. (input units not units*srqt(Hz)) The standard deviation of the scale factor as a gaussian random noise. (input units not units*srqt(Hz)) Rate at which model is used. This value is used for the bias brownian motion. (Hz) Value to seed the internal RNG for this model. The input value to be perturbed by noise and bias. (input units) The output value as perturbed by noise and bias. (input units) Function to retrieve the bias after some amount of random-walk.

◆ getCompositeRotation()

clockwerk::DCM warptwin::getCompositeRotation ( clockwerk::DCM & dcm_f1_f2,
clockwerk::DCM & dcm_f2_f3 )

A function to get the composite rotation generated by subsequent rotations.

Parameters
dcm_f1_f2The DCM describing the orientation between F1 and F2
dcm_f2_f3The DCM describing the orientation between F2 and F3
Returns
The DCM describing the rotation between F1 and F3

◆ getCompositeRotationQuat()

clockwerk::Quaternion warptwin::getCompositeRotationQuat ( clockwerk::Quaternion & quat_f1_f2,
clockwerk::Quaternion & quat_f2_f3 )

A function to get the composite rotation generated by subsequent rotations.

Parameters
quat_f1_f2The Quaternion describing the orientation between F1 and F2
quat_f2_f3The Quaternion describing the orientation between F2 and F3
Returns
The Quaternion describing the rotation between F1 and F3

◆ getFrameRelativeDCM()

int warptwin::getFrameRelativeDCM ( Frame & f1,
Frame & f2,
clockwerk::DCM & dcm_f1_f2 )

A function to get the DCM represnting the relationship [f1/f2].

Parameters
f1The first frame for our DCM relationship
f2The second frame for our DCM relationship
Returns
Error code corresponding to success/failure

◆ getNoiseModel()

warptwin::MarkovUncertaintyModel * warptwin::getNoiseModel ( )

Accessor for the internal noise model.

The initial bias in accelerometer measurement output described as a three-element vector in meters/second^2. Default is no bias. Must be set before model startup. The minimum acceleration that the sensor can record in each axis. Default is -20 g's (meters/second^2) The maximum acceleration that the sensor can record in each axis. Defualt is 20 g's (meters/second^2) The vehicle frame relative to which the sensor is mounted and aligned. This is most typically the body frame of a spacecraft or other vehicle. mount_position__mf and mount_alignment_mf are described relative to this frame. The position of the sensor in the mount frame, represented in the default simulation unit (meters) The alignment of the accelerometer relative to the mount frame The measurement resolution. The output value will be some multiple of this value. If the value is left at zero, an infinite resolution will be assumed, i.e. no data loss/quantinization. From a data sheet, this value can be computed as (measurement range) / 2^(bits per measurement) . (meters/second^2) The rate at which the sensor generates an output, in hertz. This value must be some positive (non-zero) integer. (Hz) Value to seed the internal RNG for this model. The frame in which gravity is represented. If this parameter is not set, the gravity frame is assumed to be the root frame of the simulation. Latency of the pressure sensor, millisecond value for the amount of delay in sim time for the correct values to be reflected in the outputs. Must be set before executive startup. Defaults to no delay. (milliseconds) Power draw of the accelerometer. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Mass of the accelerometer. (kg) The one-sigma Gaussian noise in accelerometer measurement output described as a three-element vector in meters/second^2. Default is no noise. The one-sigma Gaussian noise in the accelerometer bias drift described as a three-element vector in meters/second^2/sqrt(second). Default is no walking-bias drift. The one-sigma scale percent increase/decrease of the measurement. Default is no scaling. The gravity vector acting on the sensor as represented in the gravity frame. (meters/second^2) Output time tied to measurements. Output time is exactly the navigation time (see SimTimeManager for configuration), without latency (instantaneous) but but with a rate that mirrors output rate The measured output acceleration produced by the accelerometer describing the acceleration of the sensor frame relative to the simulation root frame appropriate bias, noise, and rate limiting, with gravity removed. (meters/second^2) The "perfect" output acceleration produced by the accelerometer describing the acceleration of the sensor frame relative to the simulation root frame without error sources, with gravity removed. This is an informational parameter and is not subject to latency. (meters/second^2) The measured output acceleration produced by the accelerometer describing the acceleration of the sensor frame relative to the simulation root frame with error sources, with gravity included. (meters/second^2) The "perfect" output acceleration produced by the accelerometer describing the acceleration of the sensor frame relative to the simulation root frame without error sources, with gravity included. This is an informational parameter and is not subject to latency. (meters/second^2) Boolean value to notify if the output measurement is valid (i.e. boolean for blackout-zones). True = not in blackout-zone, False = in blackout-zone. Power draw of the sensor. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts) Current bias of the accelerometer. (m/s^2)

Returns
Pointer to the internal noise model
Pointer to the internal noise model

The initial bias in gyroscope measurement output described as a three-element vector in radians/second. Default is no bias. Must be set before model startup. The minimum angular velocity that the sensor can record in each axis. Default is -540 degrees/second (radians/second) The maximum angular velocity that the sensor can record in each axis. Default is 540 degrees/second (radians/second) The vehicle frame relative to which the sensor is mounted and aligned. This is most typically the body frame of a spacecraft or other vehicle. mount_position__mf and mount_alignment_mf are described relative to this frame. The position of the sensor in the mount frame, represented in the default simulation unit (meters by default. pretty much always meters) The alignment of the gyroscope relative to the mount frame The measurement resolution. The output value will be some multiple of this value. If the value is left at zero, an infinite resolution will be assumed, i.e. no data loss/quantinization. From a data sheet, this value can be computed as (measurement range) / 2^(bits per measurement) . (radians/second) The rate at which the sensor generates an output, in hertz. This value must be some positive (non-zero) integer. (Hz) Value to seed the internal RNG for this model. Latency of the pressure sensor, millisecond value for the amount of delay in sim time for the correct values to be reflected in the outputs. Must be set before executive startup. Defaults to no delay. (milliseconds) Power draw of the gyroscope. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Mass of the gyroscope. (kg) The one-sigma Gaussian noise in gyroscope measurement output described as a three-element vector in radians/second. Default is no noise. The one-sigma Gaussian noise in the gyroscope bias drift described as a three-element vector in radians/second/sqrt(second). Default is no walking-bias drift. The one-sigma scale percent increase/decrease of the measurement. Default is no scaling. Output time tied to measurements. Output time is exactly the navigation time (see SimTimeManager for configuration), without latency (instantaneous) but but with a rate that mirrors output rate The measured output angular velocity produced by the gyro describing the angular velocity of the sensor frame relative to the simulation root frame appropriate bias, noise, latency, and rate limiting. (radians/second) The "perfect" output angular velocity produced by the gyro describing the angular velocity of the sensor frame (incl. misalignment) relative to the simulation root frame without bias and noise. This is an informational parameter and thus is not subject to latency. (radians/second) Boolean value to notify if the output measurement is valid (i.e. boolean for blackout-zones). True = not in blackout-zone, False = in blackout-zone. Power draw of the sensor. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts) Current bias of the gyroscope. (rad/s)

Returns
Pointer to the internal noise model

◆ gravityGradientModel()

warptwin::GravityGradientModel * warptwin::gravityGradientModel ( )

Function to get a handle to the gravity gradient model contained within this model.

Returns
Pointer to the gravity gradient model

◆ Gyroscope()

warptwin::Gyroscope * warptwin::Gyroscope ( )

Function to access the internal gyro model.

Returns
Handle to the gyro model

◆ Heaviside()

template<typename T>
int warptwin::Heaviside ( T input,
T & output,
T center = 0.0 )

This function is the Heaviside step function (or more colloquially the unit step function). This returns zero for all values less than center and return one for all values greater of equal than the center.

Parameters
inputInput to the unary function
outputImplicit return of the output
center(OPTIONAL) Activation value of the Heaviside function
Returns
Error code, zero if there is no error

◆ heikkinenLla()

int warptwin::heikkinenLla ( const clockwerk::CartesianVector< 3 > & pos__pcr,
double r_planet_equatorial,
double flattening,
double & lat_rad,
double & lon_rad,
double & alt )

Function to calculate detic LLA from PCR state using the Heikkinen algorithm.

Parameters
pos__pcrThe position of the spacecraft in PCR frame
r_planet_equatorialThe equatorial radius of the planet
flatteningThe flattening value of the planet
lat_radImplicit return of latitude in radians
lon_radImplicit return of longitude in radians
altImplicit return of altitude

◆ impulseModel()

warptwin::ImpulseModel * warptwin::impulseModel ( )

Function to get a handle to the impulse model contained within this model.

Returns
Pointer to the impulse model

◆ initializeAttitude() [1/2]

int warptwin::initializeAttitude ( clockwerk::Quaternion quat_sc_frame__frame,
CartesianVector3 ang_vel_sc_frame__sc,
const std::string & frame_name )

Initialize attitude and angular velocity of the spacecraft body frame.

Parameters
quat_sc_frame__frameThe desired attitude of the spacecraft body wrt frame_ptr
ang_vel_sc_frame__scThe desired angular velocity of the spacecraft body wrt frame_ptr in the sc body frame
frame_nameThe name of the frame relative to which state should be initialized
Returns
Error code corresponding to success/failure
Note
Overloaded to init via string or frameFrame* frame_ptr=nullptr

◆ initializeAttitude() [2/2]

int warptwin::initializeAttitude ( clockwerk::Quaternion quat_sc_frame__frame,
CartesianVector3 ang_vel_sc_frame__sc,
Frame * frame_ptr = nullptr )

Initialize attitude and angular velocity of the spacecraft body frame.

Parameters
quat_sc_frame__frameThe desired attitude of the spacecraft body wrt frame_ptr
ang_vel_sc_frame__scThe desired angular velocity of the spacecraft body wrt frame_ptr in the sc body frame
frame_ptrThe frame relative to which state is initialized. Default (nullptr) will init wrt sim root frame
Returns
Error code corresponding to success/failure
Note
Overloaded to init via string or frame

◆ initializeFromOrbitalElements()

int warptwin::Spacecraft::initializeFromOrbitalElements ( double a,
double e,
double i,
double RAAN,
double w,
double f )

Function to initialize the spacecraftrelative to planet from orbital elements.

Parameters
aSemimajor axis, m
eOrbit eccentricity
iOrbit inclination, radians
RAANOrbit RAAN, radians
wOrbit argument of periapsis, radians
fOrbit true anomaly, radians
Returns
Error code corresponding to success/failure
Note
Assumes that the spacecraft planet has been set and initializes using orbital elements relative to the configured planet.
Sets the spacecraft's parent to the planet inertial frame implicitly. Do not use this function if you are not ok with that.

◆ initializePositionVelocity()

MODEL(Spacecraft) public int warptwin::initializePositionVelocity ( CartesianVector3 position_sc_frame__frame,
CartesianVector3 velocity_sc_frame__frame,
const std::string & frame_name )

Spacecraft Model.

The spacecraft model is a convenient wrapper around a set of high-fidelity models to make building space-based simulation easy. This class is ideal for configuring a simple planet orbiter.

Default models wrapped into the spacecraft model include:

  • Gravity with J2 and J3 effects
  • Gravity gradient torque
  • Planet rotating state sensor (latitude/longitude/altitude state)
  • Earth only: MSIS atmospheric drag

Spacecraft comes with two frames

To configure spacecraft, users must assign the spacecraft planet_ptr to point to a valid instance of CustomPlanet or SpicePlanet. This is the mass of the spacecraft, in the same units as the rest of the simulation. Default is 1 kg. This is the body inertia tensor of the spacecraft, in the same units as the rest of the simulation. Default is identity matrix. The position of the spacecraft in the initialization frame, expressed in init frame. Default behavior is to take input in meters. The velocity of the spacecraft in the initialization frame, expressed in init frame Default behavior is to take input in meters/sec. The frame in which position and velocity are initialized. If not set, defaults to planet inertial frame The attitude of the spacecraft relative to the initialization frame. The angular velocity of the spacecraft relative to the initialization frame, expressed in spacecraft body frame. The frame in which attitude and angular velocity are initialized. If not set, defaults to planet inertial frame A pointer to the planet object, which may be either CustomPlanet or SpicePlanet. This variable must be set, and is cast to a planet internally within the spacecraft model. From the planet, all configuration parameters for gravity and planet relative state models are set. Accessor to the inertial frame of the planet. Set to point to _planet_inertial in constructor. Accessor to the rotating frame of the planet. Set to point to _planet_inertial in constructor. Position wrt planet centered inertial frame. Default is in meters. Velocity wrt planet centered inertial frame. Default is in meters/sec Attitude quaternion wrt planet inertial frame Angular velocity of the spacecraft wrt planet, output in body frame. In rad/s The latitude of the spacecraft wrt planet rotating frame, in radians The longitude of the spacecraft wrt the planet rotating frame, in radians The altitude of the spacecraft wrt planet ellipsoid. Default is in meters The total power input from all sources, in Watts The total power output from all sources, in Watts

Initialize position and velocity of the spacecraft body frame

Parameters
position_sc_frame__frameThe desired position of the spacecraft body wrt frame_ptr
velocity_sc_frame__frameThe desired velocity of the spacecraft body represented in frame frame_ptr
frame_ptrThe frame relative to which state is initialized. Default (nullptr) will init wrt sim root frame
Returns
Error code corresponding to success/failure
Note
Overloaded to init via string or frame

Initialize position and velocity of the spacecraft body frame

Parameters
position_sc_frame__frameThe desired position of the spacecraft body wrt frame_ptr
velocity_sc_frame__frameThe desired velocity of the spacecraft body represented in frame frame_ptr
frame_nameThe name of the frame relative to which state should be initialized
Returns
Error code corresponding to success/failure
Note
Overloaded to init via string or frame

◆ isValidNumber()

bool warptwin::isValidNumber ( const std::string & s)

Checks if the given string is a valid numeric representation.

This function attempts to parse the entire string as a floating-point number (including integers, decimals, and scientific notation).

Parameters
sThe string to check.
Returns
true if the entire string is a valid number, false otherwise.

◆ legendre()

int warptwin::legendre ( long N,
long M,
double x,
double P[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1],
double sd_p[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1] )

Calculates the associated Legendre functions and their derivatives.

Computes the associated Legendre functions up to degree N and order M with Neumann normalization. This includes calculating scaled derivatives (sdP), which handle singularities by multiplying the derivative by sqrt(1 - x^2).

Parameters
[in]NMaximum degree of the Legendre functions.
[in]MMaximum order of the Legendre functions.
[in]xArgument for Legendre functions, typically cos(theta).
[out]PMatrix of associated Legendre functions up to degree N and order M.
[out]sd_pMatrix of scaled derivatives of Legendre functions.
Returns
Error code corresponding to success/failure
Note
This function was adapted from open-source code in the NASA 42 simulation.
Warning
The derivatives sdP[n][1] are singular at x = ±1.

◆ listDefaultConfigsByModelName()

std::vector< std::string > warptwin::listDefaultConfigsByModelName ( std::string name)

◆ loadKernel()

void warptwin::loadKernel ( std::string kernel)

A function to load in a sinle spice kernel.

Parameters
Asingle spice kernel to load

◆ lStar()

double warptwin::lStar ( double r)

Function to return the characteristic length for CR3BP.

Parameters
rThe circular orbit radius of the secondary body about the first
Returns
The characteristic length

◆ lvlhFrame()

int warptwin::lvlhFrame ( const CartesianVector3 & pos,
const CartesianVector3 & vel,
clockwerk::DCM & lvlh_frame,
CartesianVector3 & lvlh_ang_vel__lvlh )

Function to generate an LVLH frame attitude DCM from position and velocity.

Parameters
posSpacecraft position
velSpacecraft velocity
lvlh_frameDCM describing the LVLH frame attitude
lvlh_ang_vel__lvlhCartesian vector to return angular velocity of LVLH frame in LVLH coordinates
Returns
Error code corresponding to success/failure
Note
This model creates and maintains the LVLH reference frame according to the NASA definition here: https://ntrs.nasa.gov/api/citations/19780010162/downloads/19780010162.pdf +Z axis directed toward the center of the Earth +Y axis perpendicular to the orbit plane with direction opposite angular momentum +X axis completes the right hand frame in the direction of orbit travel

◆ lvlhFrameManager()

warptwin::LvlhFrameManagerModel * warptwin::lvlhFrameManager ( )

Function to get a handle to the LVLH frame manager contained within this model.

Returns
Pointer to the LVLH frame manager

◆ max()

template<typename T>
int warptwin::max ( T * array,
unsigned int size,
T & result )

◆ mean()

template<typename T>
int warptwin::mean ( T * array,
unsigned int size,
T & result )

◆ mean2eccentric()

int warptwin::mean2eccentric ( double mean_anomaly,
double eccentricity,
double & eccentric_anomaly,
double tol,
int max_iter )

Function to convert mean anomaly to eccentric anomaly.

Parameters
mean_anomaly
eccentricityThe orbit eccentricity
eccentric_anomaly
tolThe tolerance for iterative conversion
max_iterThe maximum number of iterations after which the solver will exit
Returns
Error code corresponding to success/failure

◆ min()

template<typename T>
int warptwin::min ( T * array,
unsigned int size,
T & result )

◆ MODEL() [1/4]

warptwin::MODEL ( IMU )

Model of IMU on vehicle which accounts for noise, bias, and drift.

The IMU model is a simple wrapper around the accelerometer and gyro models, wrapping them into a single package. For details on each element of the IMU, see the accelerometer or gyro definitions.

Author: Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m..tech The initial bias in accelerometer measurement output described as a three-element vector in meters/second^2. Default is no bias. Must be set before model startup. The minimum acceleration that the sensor can record in each axis. Default is -20 g's (meters/second^2) The maximum acceleration that the sensor can record in each axis. Defualt is 20 g's (meters/second^2) The initial bias in gyroscope measurement output described as a three-element vector in radians/second. Default is no bias. Must be set before model startup. The minimum angular velocity that the sensor can record in each axis. Default is -540 degrees/second (radians/second) The maximum angular velocity that the sensor can record in each axis. Default is 540 degrees/second (radians/second) The vehicle frame relative to which the sensor is mounted and aligned. This is most typically the body frame of a spacecraft or other vehicle. mount_position__mf and mount_alignment_mf are described relative to this frame. The position of the sensor in the mount frame, represented in the default simulation unit (meters by de fault. pretty much always meters) The alignment of the accelerometer relative to the mount frame The rate at which the sensor generates an output, in hertz. Setting this value to 0 forces the sensor to output at the simulation rate. Value to seed the internal RNG for this model. Value to seed the internal RNG for this model. The frame in which gravity is represented. If this parameter is not set, the gravity frame is assumed to be the root frame of the simulation. The measurement resolution. The output value will be some multiple of this value. If the value is left at zero, an infinite resolution will be assumed, i.e. no data loss/quantinization. From a data sheet, this value can be computed as (measurement range) / 2^(bits per measurement) . (meters/second^2) The measurement resolution. The output value will be some multiple of this value. If the value is left at zero, an infinite resolution will be assumed, i.e. no data loss/quantinization. From a data sheet, this value can be computed as (measurement range) / 2^(bits per measurement) . (radians/second) Latency of the pressure sensor, millisecond value for the amount of delay in sim time for the correct values to be reflected in the outputs. Must be set before executive startup. Defaults to no delay. (milliseconds) Power draw of the accelerometer. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Power draw of the gyroscope. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Mass of the accelerometer. (kg) The one-sigma Gaussian noise in accelerometer measurement output described as a three-element vector in meters/second^2. Default is no noise. The one-sigma Gaussian noise in the accelerometer bias drift described as a three-element vector in meters/second^2/sqrt(second). Default is no walking-bias drift. The one-sigma scale percent increase/decrease of the measurement. Default is no scaling. The one-sigma Gaussian noise in gyroscope measurement output described as a three-element vector in radians/second. Default is no noise. The one-sigma Gaussian noise in the gyroscope bias drift described as a three-element vector in radians/second/sqrt(second). Default is no walking-bias drift. The one-sigma scale percent increase/decrease of the measurement. Default is no scaling. The gravity vector acting on the sensor as represented in the gravity frame Output time tied to measurements. Output time is exactly the navigation time (see SimTimeManager for configuration), without latency (instantaneous) but but with a rate that mirrors output rate The measured output acceleration produced by the accelerometer describing the acceleration of the sensor frame relative to the simulation root frame appropriate bias, noise, and rate limiting, with gravity removed The "perfect" output acceleration produced by the accelerometer describing the acceleration of the sensor frame relative to the simulation root frame without error sources, with gravity removed. This is an informational parameter. The measured output acceleration produced by the accelerometer describing the acceleration of the sensor frame relative to the simulation root frame with error sources, with gravity included. (meters/second^2) The "perfect" output acceleration produced by the accelerometer describing the acceleration of the sensor frame relative to the simulation root frame without error sources, with gravity included. This is an informational parameter The measured output angular velocity produced by the gyro describing the angular velocity of the sensor frame relative to the simulation root frame appropriate bias, noise, and rate limiting The "perfect" output angular velocity produced by the gyro describing the angular velocity of the sensor frame (incl. misalignment) relative to the simulation root frame without bias and noise. This is an informational parameter. Boolean value to notify if the output measurement is valid (i.e. boolean for blackout-zones). True = not in blackout-zone, False = in blackout-zone. Boolean value to notify if the output measurement is valid (i.e. boolean for blackout-zones). True = not in blackout-zone, False = in blackout-zone. Power draw of the accelerometer. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts) Power draw of the gyroscope. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts) The bias of the gyroscope. (rad/s) The bias of the accelerometer. (m/s^2)

Function to access the internal accelerometer model

Returns
Handle to the accelerometer model

◆ MODEL() [2/4]

warptwin::MODEL ( MSISAtmosphereModel )

High fidelity atmosphere model utilizing the NRL MSIS implementation.

The MSIS atmosphere model is derived from the c-based MSIS implementation posted at https://git.smce.nasa.gov/ccmc-share/modelwebarchive/-/tree/main/MSIS/NRLMSIS00/nrlmsis00_c_version

It runs in the start step model call and generally takes detic latitude, longitude, and altitude wrt Earth as inputs and outputs density, temperature, and ideal gas pressure. 81 day average, centered on input time, of F10.7 solar activity index Daily F10.7 solar activity for previous day Daily Ap geomagnetic activity index Our R value for ideal gas pressure calculation. Default is for air The detic latitude to query, in radians The longitude to query, in radians The detic altitude above ground level to query, in meters The day of the year (1 to 366) The universal time, in seconds, in the current day. Up to 86400.0 The total atmospheric mass density in kg/m^3 The temperature at the query point in degrees K The ideal gas P=rho*R*T atmospheric pressure at the query point in N/m^2. Derived from MSIS – applicability will vary due to ideal gas assumption.

Set delayed output on MSIS model

Parameters
num_stepsThe number of steps to delay until starting calculation

◆ MODEL() [3/4]

warptwin::MODEL ( PressureSensor )

Accessor for the internal noise model.

The minimum pressure that the sensor can record. (Pascals) The maximum pressure that the sensor can record. (Pascals) The measurement resolution. The output value will be some multiple of this value. If the value is left at zero, an infinite resolution will be assumed, i.e. no data loss/quantinization. From a data sheet, this value can be computed as (measurement range) / 2^(bits per measurement) . (Pascals) The rate at which the sensor generates an output, in hertz. This value must be some positive (non-zero) integer. (Hz) Value to seed the internal RNG for this model. Latency of the pressure sensor, millisecond value for the amount of delay in sim time for the correct values to be reflected in the outputs. Must be set before executive startup. Defaults to no delay. (milliseconds) Power draw of the pressure sensor. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Mass of the pressure sensor. (kg) Local pressure from an atmosphere model, no incorporated noise. (Pascals) The bias in measurement output described as a double. Default is no bias. This value can change with an external model, i.e. temperature effects. (Pascals) The one-sigma gaussian noise in measurement output described as a double. Default is no noise. This value can change with en external model, i.e. modeling temperature effects. (Pascals) The one-sigma scale percent increase/decrease of the measurement. Default is no scaling. Output time tied to measurements. Output time is exactly the navigation time (see SimTimeManager for configuration), without latency (instantaneous) but but with a rate that mirrors output rate The measured output pressure produced by the pressure sensor describing the local pressure of the sensor frame through the configured atmospheric model. Appropiate bias, noise, scaling, rate limiting, deadzoning, and resolution applied. The model outputs zero when in the blackout zone. (Pascals) The measured output pressure produced by the pressure sensor describing the local pressure of the sensor frame through the configured atmospheric model. Appropiate bias, noise, scaling, rate limiting, deadzoning, and resolution applied. The model outputs zero when in the blackout zone. (mbar) Boolean value to notify if the output measurement is valid (i.e. boolean for blackout-zones). True = not in blackout-zone, False = in blackout-zone. Power draw of the sensor. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts)

Returns
Pointer to the internal noise model

◆ MODEL() [4/4]

warptwin::MODEL ( TimedImpulsiveBurnModel )

Model which applies a fixed impulse to a vehicle at a set sim or UTC time.

This model is used for mission planning to program an impulsive burn to occur at a specific time and in a specific frame. The model internally uses a time trigger monitor, ImpulseModel, and node to apply a force to a specific body in the simulation.

Once triggered, the impulsive burn model will not trigger again until reset.

Author: Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m..tech The body frame of the spacecraft which will be performing the burn The frame in which the burn will be executed. If not set, will execute in the body frame The time of ignition of the burn. This may be in simulation time or ephemeris time, depending on which source the Time input is connected to. The impulsive burn vector, in m/s, to be executed at the time of ignition. This vector will be as represented in the Burn Frame The current time in the same timescale as the parameterized TIG

Function to get a handle to the time trigger monitor contained within this model

Returns
Pointer to the time trigger monitor

◆ msisModel()

warptwin::MSISAtmosphereModel * warptwin::msisModel ( )

Function to get a handle to the MSIS atmosphere model contained within this model.

Returns
Pointer to the MSIS atmosphere model
Note
Returns nullptr if MSIS atmosphere model is not active

◆ muStar()

double warptwin::muStar ( double m1,
double m2 )

Function to return the characteristic mass for CR3BP.

Parameters
m1The mass of the primary body
m2The mass of the secondary body
Returns
The characteristic mass

◆ muWMM()

double warptwin::muWMM ( double input)

Unary functional input to the associated Legendre function specific to the WMM model. This is typically denoted as mu or t in literature such as Winch et al. 2005 or Heiskanen and Moritz 1967, respectively.

For the WMM model, this is defined as:

μ = sin(φ')

Where φ' is the geocentric latitude

Parameters
[in]inputInput to the unary function
Returns
Output to the unary function

◆ neumannNormalization()

void warptwin::neumannNormalization ( double cbar[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1],
double sbar[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1],
double c[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1],
double s[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1] )

Applies Neumann normalization to spherical harmonic coefficients.

This function transforms spherical harmonic coefficients from their original format (typically EGM96 style normalization) to Neumann normalization. The input matrices cbar and sbar contain the cosine and sine coefficients, which are normalized and stored in the output matrices c and s for use in gravitational calculations.

The Neumann normalization ensures that the coefficients are scaled to a standard that provides orthonormality and consistency across spherical harmonics terms.

Parameters
[in]cbarMatrix of original cosine coefficients.
[in]sbarMatrix of original sine coefficients.
[out]cMatrix to store Neumann-normalized cosine coefficients.
[out]sMatrix to store Neumann-normalized sine coefficients.
Note
This function was adapted from open-source code in the NASA 42 simulation.
Warning
This function assumes the matrices are dimensioned to support up to degree and order NMAX_SPHERICAL_HARMONICS. Applying the normalization to coefficients beyond this range may result in undefined behavior.

◆ occultationModel()

warptwin::OccultationModel * warptwin::occultationModel ( )

Accessor for the internal occultation model.

Returns
Pointer to the occultation model

◆ oddfact()

double warptwin::oddfact ( long n)

Computes the double factorial of an odd integer.

Calculates the product of all odd numbers up to and including the specified integer n. This is used in the Legendre function for terms involving odd factorials.

Parameters
[in]nNon-negative odd integer for which to calculate the double factorial.
Returns
Double factorial of the input integer.
Note
This function was adapted from open-source code in the NASA 42 simulation.

◆ orbitInit()

int warptwin::orbitInit ( Frame & target,
Frame & planet,
double mu,
double a,
double e,
double i,
double RAAN,
double w,
double f )

Function to initialize a body's position and velocity from an orbit.

Parameters
targetThe target frame to initialize
planetThe planet frame our orbit is relative to
muGravitational parameter of the planet
aOrbit semimajor axis, in meters
eOrbit eccentricity
iOrbit inclination, radians
RAANOrbit Right Ascention of the Ascending Node, radians
wOrbit argument of periapsis, radians
fOrbit true anomaly, radians
Returns
Error code corresponding to success/failure

◆ parseDefaultConfigFromJson()

int warptwin::parseDefaultConfigFromJson ( const std::string & class_type,
const std::string & default_name,
nlohmann::json & j )

Parse the default configuration from a JSON file into a PBR JSON object.

Parameters
class_typeThe class type of the model
default_nameThe name of the default configuration
jThe json object to parse into
Returns
Error code corresponding to success/failure

◆ parseLicenseString()

void warptwin::parseLicenseString ( std::string str,
std::string & licensee,
int & year,
int & month,
int & day )

Function to parse license string for relevant data.

Parameters
strThe license string to parse (loaded from file)
licenseeThe licensing organization
yearThe year when the locally stored license expires
monthThe month when the locally stored license expires
dayThe day when the locally stored license expires

◆ pcr2lla()

std::vector< std::vector< double > > warptwin::pcr2lla ( const std::vector< double > & pcr_x,
const std::vector< double > & pcr_y,
const std::vector< double > & pcr_z,
double a = 6378137.0,
double flattening = (1.0/298.257223563) )

Wrapper around pcrDeticToLLA for bulk conversion of x, y, z coordinates.

Parameters
pcr_xVector of x PCR frame values
pcr_yVector of y PCR frame values
pcr_zVector of z PCR frame values
aSemimajor axis of the planet. Defaults to WGS84
flatteningFlattening of the planet. Defaults to WGS84
Returns
Vector of vectors of coordinatess containing lat and lon in radians and altitude
Note
NOT embedded safe! Does not error check.

◆ planetInertialStateSensor()

warptwin::FrameStateSensorModel * warptwin::planetInertialStateSensor ( )

Function to get a handle to the frame state sensor relative to the planet inertial frame.

Returns
Pointer to the planet inertial frame state sensor

◆ planetRelativeModel()

warptwin::PlanetRelativeStatesModel * warptwin::planetRelativeModel ( )

Function to get a handle to the planet relative state model contained within this model.

Returns
Pointer to the planet relative state sensor model

◆ planetRotatingStateSensor()

warptwin::FrameStateSensorModel * warptwin::planetRotatingStateSensor ( )

Function to get a handle to the frame state sensor relative to the planet rotating frame.

Returns
Pointer to the planet rotating frame state sensor

◆ poslin()

template<typename T>
int warptwin::poslin ( T input,
T & output )

This function is a positive linear transfer function that behaves like a linear function only when x > 0, otherwise the function returns zero.

Parameters
inputInput to the unary funciton
outputImplicit return of the output
Returns
Error code, zero if there is no error

◆ printArray()

template<typename T, long unsigned int N>
std::string warptwin::printArray ( const std::array< T, N > & val)

Debug function to print an array.

Parameters
valThe array to print
Returns
String representing the array

◆ programManeuver() [1/2]

warptwin::TimedImpulsiveBurnModel * warptwin::programManeuver ( CartesianVector3 delta_v__f,
double sim_time,
Frame * force_frame_ptr )

Function to program a timed impulsive burn into the spacecraft.

Parameters
delta_v__fThe impulsive burn vector to execute
sim_timeThe time at which the burn should occur
force_frame_ptrThe frame in which the burn should be executed
Returns
Pointer to the impulse model

◆ programManeuver() [2/2]

warptwin::TimedImpulsiveBurnModel * warptwin::programManeuver ( CartesianVector3 delta_v__f,
std::string time_string,
Frame * force_frame_ptr )

Function to program a timed impulsive burn into the spacecraft.

Parameters
delta_v__fThe impulsive burn vector to execute
time_stringTime string in an acceptable SPICE format at which burn should occur
force_frame_ptrThe frame in which the burn should be executed
Returns
Pointer to the impulse model

◆ rangeAzElSensor()

warptwin::RangeAzElSensorModel * warptwin::rangeAzElSensor ( )

◆ rateMonitor()

warptwin::RateMonitor * warptwin::rateMonitor ( )

Accessor for the internal rate monitor model.

Returns
Pointer to the rate monitor model

The initial bias in position measurement output described as a three-element vector in meters. Default is no bias. Must be set before model startup. The initial bias in velocity measurement output described as a three-element vector in meters/second. Default is no bias. Must be set before model startup. The vehicle frame relative to which the sensor is mounted and aligned. This is most typically the body frame of a spacecraft or other vehicle. mount_position__mf and mount_alignment_mf are described relative to this frame. The position of the sensor in the mount frame, represented in the default simulation unit (meters by default. pretty much always meters) The rate at which the sensor generates an output, in hertz. This value must be some positive (non-zero) integer. (Hz) Value to seed the internal RNG for this model. The frame in which the GPS measurements are given relative to. This is the primary planets rotating frame (e.g. ECEF). For now, this must be Earth's rotating frame. Maximum altitude above the WGS84 ellipsoid that the GPS will work. Defaults to 18,000 meters, the maximum altitude set by CoCom for civilian GPS devices. (meters) Minimum altitude above the WGS84 ellipsoid that the GPS will work. (meters) Maximum speed with respect to the rotating primary that the GPS will work. Defaults to 1900 km/hr, the maximum speed set by CoCom for civilian GPS devices. (meters/second) Latency of the gps sensor, millisecond value for the amount of delay in sim time for the correct values to be reflected in the outputs. Must be set before executive startup. Defaults to no delay. (milliseconds) Power draw of the GPS. This value may or may not be the peak power draw provided by most data sheets. This value is the expected power draw of a sensor when operational. (Watts) Mass of the GPS. (kg) The one-sigma Gaussian noise in position measurement output described as a three-element vector in meters. Default is no noise. The one-sigma Gaussian noise in velocity measurement output described as a three-element vector in meters/second. Default is no noise. The one-sigma Gaussian noise in the position bias drift described as a three-element vector in meters/sqrt(second). Default is no walking-bias drift. The one-sigma Gaussian noise in the velocity bias drift described as a three-element vector in meters/second/sqrt(second). Default is no walking-bias drift. Output time tied to measurements. Output time is exactly the navigation time (see SimTimeManager for configuration), without latency (instantaneous) but but with a rate that mirrors output rate The measured output position of the GPS sensor frame with respect to the PCR frame. This is not the position of the body but instead the position of the GPS sensor. This value includes noise, bias, and blackout-zones. The "perfect" output position of the GPS sensor with respect to the PCR frame. This is not the position of the body but instead the position of the GPS sensor. This value does not include noise, bias, or blackout-zones. This is an informational parameter and is not subject to latency. The measured output velocity of the GPS sensor frame with respect to the PCR frame. This is not the velocity of the body but instead the velocity of the GPS sensor. This value includes noise, bias, and blackout-zones. The "perfect" output velocity of the GPS sensor frame with respect to the PCR frame. This is not the velocity of the body but instead the velocity of the GPS sensor. This value does not include noise, bias, or blackout-zones. This is an informational parameter and is not subject to latency. The detic longitude of the GPS sensor frame. Does include sensor noise, bias, and blackout-zones. (rad) The detic latitude of the GPS sensor frame. Does include sensor noise, bias, and blackout-zones. (rad) The detic altitude of the GPS sensor frame. Does include sensor noise, bias, and blackout-zones. (meters) Boolean value to notify if the output measurement is valid (i.e. boolean for blackout-zones). True = not in blackout-zone, False = in blackout-zone. Power draw of the sensor. This value is populated when the model is active, and zero when the model is deactive. Allows the user to create duty cycles and power budgets. (Watts)

Returns
Pointer to the rate monitor model

◆ readFileBinarySize()

void warptwin::readFileBinarySize ( char buffer[MAX_SIZE_CHAR],
char * size_actual,
const std::string & filename )

Function to read a buffer of bytes from a file.

Parameters
bufferThe buffer of data to read from – max size is the max value of a char
buffer_sizeThe size of the buffer to be written
filenameThe name of the file to write to

◆ readGravityCoefficientsFile()

int warptwin::readGravityCoefficientsFile ( const std::string & filename,
double cbar[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1],
double sbar[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1],
long int & n,
long int & m )

Reads gravitational coefficients from a file and stores them in provided matrices.

This function opens a specified file containing spherical harmonic gravitational coefficients and populates the provided matrices cbar and sbar with these values up to degree and order NMAX_SPHERICAL_HARMONICS. The function checks for the file's existence before attempting to read from it. This code is derived from the open-source NASA 42 simulation.

Parameters
[in]filenamePath to the file containing the gravitational coefficients.
[out]cbarMatrix to store cosine harmonic coefficients.
[out]sbarMatrix to store sine harmonic coefficients.
[out]nMax degree loaded from egm96 file.
[out]mMax order loaded from egm96 file.
Returns
Status code indicating success or failure.
Return values
NO_ERRORIf the file is successfully read and coefficients are loaded.
ERROR_FILE_NOT_FOUNDIf the specified file does not exist.
Note
This function was adapted from open-source code in the NASA 42 simulation.
Warning
The function assumes that the file format matches the expected format with columns for degree, order, and the respective coefficients. Incorrect file formatting may lead to unexpected results.

◆ readTxtFile()

int warptwin::readTxtFile ( const std::string & filename,
std::vector< std::vector< double > > & data,
const std::string & header_end_mark = "!",
const std::string & delimeter = " ",
unsigned int num_cols = 10 )

Reads a text file and populates a 2D vector with column-based numerical data.

This function opens the specified file, searches for the first line that begins with header_end_mark, and then starts parsing each subsequent line into num_cols columns. Each column is stored in the corresponding sub-vector of data. Lines are split using the given delimiter, and all extracted tokens are validated and converted to double.

The function returns integer codes to indicate success or various error conditions.

Parameters
filenamePath to the file containing tabular data.
header_end_markString indicating the end of the file header. The first line beginning with this string marks where data reading begins.
delimiterThe token used to split each data line into columns.
num_colsThe expected number of columns per data row.
dataA reference to a 2D vector of double where parsed data are stored. The function places each column in a corresponding data[i].
Returns
  • NO_ERROR (e.g., 0) on success
  • ERROR_NOT_FOUND if the file cannot be opened or found
  • ERROR_DIMENSIONS if a data line does not match the expected number of columns
  • ERROR_CANNOT_CONVERT_STRING if any token is not valid for conversion to double
Note
  • The function depends on fileExist, splitString, and isValidNumber for file checking, string splitting, and numeric validation, respectively.
  • The file is read line by line. All lines before the header_end_mark are ignored.
  • If the file is successfully opened but no valid data lines appear after the header_end_mark, data remains empty.

◆ readWMMCoefficientsFile()

int warptwin::readWMMCoefficientsFile ( const std::string & filename,
double g[NUMBER_OF_READ_COEFFICIENTS],
double h[NUMBER_OF_READ_COEFFICIENTS],
double gdot[NUMBER_OF_READ_COEFFICIENTS],
double hdot[NUMBER_OF_READ_COEFFICIENTS],
double & epoch )

Reads magnetic field coefficients for WMM from a file and stores them in provided matrices.

This function opens a specified file containing spherical harmonic magnetic (WMM) coefficients and populates the provided arrays g, h, 'gdot', and 'hdot' with these values up to degree and order 'MAX_HARMONIC_COEFFICIENTS'. The function checks for the file's existence before attempting to read from it.

Parameters
[in]filenamePath to the file containing the gravitational coefficients.
[out]gReturn by reference array to store g Guass coefficients. (nT)
[out]hReturn by reference array to store h Gauss coefficients. (nT)
[out]gdotReturn by reference array to store g Guass coefficients time derivative. (nT/year)
[out]hdotReturn by reference array to store h Gauss coefficients time derivative. (nT/year)
[out]epochDecimal year that the WMM input data is associated to. (decimal year)
Template Parameters
NDegree and order of the Legendre polynomials.
Returns
Status code indicating success or failure.
Return values
NO_ERRORIf the file is successfully read and coefficients are loaded.
ERROR_FILE_NOT_FOUNDIf the specified file does not exist.
Warning
The function assumes that the file format matches the expected format with columns for degree, order, and the respective coefficients. Incorrect file formatting may lead to unexpected results. You can download coefficiant files from ncei.noaa.gov

◆ registerApp()

virtual int16 warptwin::registerApp ( warpos::App & app,
int16 slot )
virtual

Function to register apps with the table scheduler.

Parameters
appThe app to register
slotThe slot to register the app to
Returns
Error code corresponding to success/failure

◆ rv2coe()

int warptwin::rv2coe ( const CartesianVector3 & pos,
const CartesianVector3 & vel,
double mu,
CartesianVector6 & elements )

Function to convert cartesian xyz pos/vel to orbital elements.

Parameters
posThe x, y, z position of the reference object
velThe x, y, z velocity of the reference object
muThe gravitational parameter of the reference planet
elementsThe orbital elements returned as {a, e, i, W, w, f} – angles in radians
Returns
Error code corresponding to success/failure
Note
Overloaded for float and double
Automatically rounds 0 values for circular and zero-inclined orbits to a minimum tolerance. Some values for orbits in circular and zero-inclined orbits may not be valid.
Automatically rounds 0 values for circular and zero-inclined orbits to a minimum tolerance. Some values for orbits in circular and zero-inclined orbits may not be valid.

◆ satlin()

template<typename T>
int warptwin::satlin ( T input,
T & output,
T limit = 1.0 )

This function is a saturated linear function that behaves like a linear function in the range of [0, limit], everywhere else the function is 0th order and piecewise continuous.

Parameters
inputInput to the unary function.
outputImplicit return of the output
limit(OPTIONAL) Limit to the linear region, defaults to 1.0
Returns
Error code, zero if there is no error

◆ satlins()

template<typename T>
int warptwin::satlins ( T input,
T & output,
T limit = 1.0 )

This function is a symmetric saturated linear function that behaves like a linear function in the range of [-limit, limit], everywhere else the function is 0th order and piecewise continuous.

Parameters
inputInput to the unary function
outputImplicit return of the output
limit(OPTIONAL) Limit to the linear region, defaults to 1.0
Returns
Error code, zero if there is no error

◆ schmidtSemiNormLegendreSingularityWMM()

int warptwin::schmidtSemiNormLegendreSingularityWMM ( int N,
double x,
double * PcupS )

Computes the Schmidt Semi-Normalized Legendre function outputs provided the maximum degree (N) as a positive integer when the position is at a singularity. The formula's require that N > 0, and abs(input) <= 1.0.

Parameters
[in]Ndegree of the Legendre function
[in]xinput to the Legendre function : cos(colatitude_centric) or sin(latitude_centric)
[out]PcupSimplicit output a vector of all the associated polynomials evaluated at input up to N
Returns
Error code, zero if there is no error
Note
In geomagnetism, the derivatives of ALF are usually found with respect to the colatitudes. Here the derivatives are found with respect to the latitude. The difference is a sign reversal for the derivative of the Associated Legendre Functions.

◆ schmidtSemiNormLegendreWMM()

int warptwin::schmidtSemiNormLegendreWMM ( int N,
double x,
double * Pcup,
double * dPcup )

Computes the Schmidt Semi-Normalized Legendre function outputs provided the maximum degree (N) as a positive integer. The formula's require that N > 0, and abs(input) <= 1.0.

Parameters
[in]Ndegree of the Legendre function
[in]xinput to the Legendre function : cos(colatitude_centric) or sin(latitude_centric)
[out]Pcupimplicit output a vector of all the associated polynomials evaluated at input up to N
[out]dPcupderivative of Pcup(x) with respcet to latitude
Returns
Error code, zero if there is no error
Note
In geomagnetism, the derivatives of ALF are usually found with respect to the colatitudes. Here the derivatives are found with respect to the latitude. The difference is a sign reversal for the derivative of the Associated Legendre Functions.

◆ setArrayFromString()

template<typename T, long unsigned int N>
int warptwin::setArrayFromString ( const std::string & s,
std::array< T, N > & retval )

Set a std::array from a string.

Parameters
sThe string to set our array from. Function assumes a bracket start/end and comma separated values [1.2,3.4,...]
retvalThe array to set from string
Returns
Error code corresponding to success/failure

◆ setVectorFromString()

template<typename T>
int warptwin::setVectorFromString ( const std::string & s,
std::vector< T > & retval )

Set a std::array from a string.

Parameters
sThe string to set our array from. Function assumes a bracket start/end and comma separated values [1.2,3.4,...]
retvalThe vector to set from string
Returns
Error code corresponding to success/failure

◆ SIGNAL() [1/5]

warptwin::SIGNAL ( _eq_radius ,
double ,
warpos::earth_wgs84. eq_radius )
protected

◆ SIGNAL() [2/5]

warptwin::SIGNAL ( _flattening ,
double ,
warpos::earth_wgs84. flattening )
protected

◆ SIGNAL() [3/5]

warptwin::SIGNAL ( _J2 ,
double ,
warpos::earth_wgs84. J2 )
protected

◆ SIGNAL() [4/5]

warptwin::SIGNAL ( _J3 ,
double ,
warpos::earth_wgs84. J3 )
protected

◆ SIGNAL() [5/5]

warptwin::SIGNAL ( _mu ,
double ,
warpos::earth_wgs84. mu )
protected

◆ signum()

template<typename T>
int warptwin::signum ( T input,
T & output )

This function is the signum function (typically denoted sgn). Described simply, it outputs the sign (e.g. negative one, positive one, or zero) or the input.

Parameters
inputInput to the unary function
outputImplicit return of the output
Returns
Error code, zero if there is no error

◆ simpleDecrypt()

void warptwin::simpleDecrypt ( char * encrypted,
char * unencrypted,
char size,
const std::string & key )

Function to decrypt a buffer of data – companion to simpleEncrypt.

Parameters
unencryptedThe encrypted buffer to decrypt
encryptedThe unencrypted buffer result
sizeThe size of the buffer
keyThe encryption key to use for the buffer

◆ simpleEncrypt()

void warptwin::simpleEncrypt ( char * unencrypted,
char * encrypted,
char size,
const std::string & key )

Function to perform a simple encryption of a buffer of data.

Parameters
unencryptedThe unencrypted buffer to encrypt
encryptedThe encrypted buffer result
sizeThe size of the buffer
keyThe encryption key to use for the buffer

◆ sphericalHarmGravityModel()

warptwin::SphericalHarmonicsGravityModel * warptwin::sphericalHarmGravityModel ( )

Function to get a handle to the spherical harmonics gravity model contained within this model.

Returns
Pointer to the spherical harmonics gravity model
Note
Returns nullptr if spherical harmonic gravity is not the active gravity model

◆ sphericalHarmonics()

int warptwin::sphericalHarmonics ( long N,
long M,
double r,
double phi,
double theta,
double Re,
double K,
double C[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1],
double S[NMAX_SPHERICAL_HARMONICS+1][NMAX_SPHERICAL_HARMONICS+1],
clockwerk::CartesianVector< 3 > & grad_v )

Computes the gradient of the gravitational potential using spherical harmonics.

This function calculates the radial, latitudinal, and longitudinal components of the gravitational potential gradient up to degree N and order M using normalized Legendre coefficients. The result is stored in gradV. The maximum size is 18x18

Parameters
[in]NMaximum degree of spherical harmonics.
[in]MMaximum order of spherical harmonics.
[in]rRadial distance from planet's center.
[in]phiLongitude (angle from prime meridian in radians).
[in]thetaColatitude (angle from the north pole in radians).
[in]ReReference radius, typically planet's radius in meters.
[in]KScaling constant, typically planet's gravitational parameter divided by Re.
[in]CNormalized Legendre coefficients (cosine terms).
[in]SNormalized Legendre coefficients (sine terms).
[out]grad_vGradient of the gravitational potential [radial, latitudinal, longitudinal].
Returns
Error code corresponding to success/failure
Note
This function was adapted from open-source code in the NASA 42 simulation.

◆ splitString()

int warptwin::splitString ( const std::string & text,
const std::string & delimiter,
std::vector< std::string > & tokens )

Splits a string into a vector of substrings based on a specified string delimiter.

This function searches the input string text for each occurrence of the substring delimiter. For each delimiter occurrence, the substring before the delimiter is extracted and stored in the return vector. The search then continues from just after the end of the last found delimiter. If the delimiter is not found anymore, the final substring from the last search position to the end of the string is appended.

If delimiter is empty, the entire text is returned as a single token (this behavior can be adjusted as needed).

Parameters
textThe input string to be split.
delimiterThe string delimiter used for splitting text.
tokensImplicit return of all strings separated by delimeter

◆ start()

int16 warptwin::start ( )
overrideprotected

Class to execute logging.

Simulated model of spacecraft communications including losses and gains with comm links.

Simple thruster model.

This event executes logging in the specified logger whenever triggered. The triggering events will be determined by the selected monitor. Our trigger – this is the flag set and unset by the monitor as its ultimate output, and should be used downstream by events, etc.

Set the sim logger run by this event

Parameters
loggerThe sim logger to tie to this event

Function to set up and start our logger

This is a simple model of a thruster which applies a thrust force according to mass flow and the specific impulse of the thruster. Force is applied to a node attached to the referenced body frame. The force applied by the thruster will produce a force and moment to the body as determined by the WarpTwin dynamics.

Noise is applied as a gaussian noise which is updated every time the thruster command toggles from off to on.

Author
Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m..tech The body which will be controlled by this model. The thruster force will be applied to a node aligned to this body, and WarpTwin will translate to force and torque at the body The thruster location relative to the provided body in the body frame The thruster pointing vector in the body frame. This vector is the PLUME DIRECTION, so the actual force applied by the thruster is in the opposite direction of this vector. The bias in the thruster which is applied to every firing. The standard deviation of thruster noise which is applied firing to firing. A new noise draw is taken every time command toggles off to on. The Earth gravity in the units system of choice for the thruster (used in Isp calculation). Default is Metric. Value to seed the internal RNG for this model. The mass flow rate through the thruster at the current time. The specific impulse of the thruster at the current time. The thrust applied by the thruster at its location on the spacecraft body The force applied by the thruster as a vector value in the body frame. This is an informational output. Force is automatically applied to the node.

This model is used to calculate and manage data related to communications systems in a simulation. It provides a structure for handling various parameters, inputs, and outputs related to communications, such as the losses and gains associated with any communication link.

IMPORTANT: Though loss is generally expressed as a negative gain, this model assumes that loses are positive and will subtract accordingly. For example, suppose your receiver system has poor circuitry and you expect the power received to decrease by half. This would be a gain of -3 dB, however this model expects the user to input a loss of positive 3 dB. In general, loss = -gain.

Author: Daniel Krobath Email: danie.nosp@m.l.kr.nosp@m.obath.nosp@m.@att.nosp@m.x.tec.nosp@m.h Revised: James Tabony james.nosp@m..tab.nosp@m.ony@a.nosp@m.ttx..nosp@m.tech The transmitter carrier frequency in hertz (Hz) The bandwidth of transmission (Hz) The bit rate in bits per second (bps) The transmit power in Watts (W) Return loss of the transmitter, this value describes ratio of power that is reflected back into the system. Should be input as positive but is normally negative. (dB) The transmit antenna gain in decibels relative to isotropic (dBi) The total transmit system loss in decibels (dB). This is the accumulation of transmitter pointing loss, and transmitter circuit loss. Inputting zero assumes that there is no return loss (despite this actually being 100% return loss). The receive antenna gain in decibels relative to isotropic (dBi) The noise temperature in Kelvin (K). This value is realted to the system noise density by Boltzmann*noise_temp and system noise power by the equation band_width*noise_density. The total receive system loss in decibels (dB). This is the accumulation of receiver side loss such as pointing loss, radome loss, polarization loss, and atmospheric loss. The cross polarization loss in decibels (dB). General rule of thumb, if both RX and TX have same-hand circular or linear (0dB), if there is a circular to linear match (3dB), but a right vs left circular mismatch can result in 20 to 30 dB loss. The energy per bit to noise ratio required in dB. Based on various modulation schemes for a desired bit error rate. For BPSK an Eb/N0 required of about 11 allows for a bit error rate around 1e-6. This is the range of the input object to the frame in meters. Will be zero if masked. This is the mask flag for the ground station. True for masked, False for visible The free space path loss in decibels (FSPL) (dB) The effective isotropic radiated power (EIRP) in decibel-milliWatts (dBm) The receive power in decibel-milliWatts (dBm) The system noise figure (NF) in decibel-milliWatts/Hz (dBm/Hz) The signal-to-noise density ratio (SNR) in decibel (dB) The energy per bit to noise ratio in in decibels (dB) The link margin in decibels (dB)

Compute the receiver gain based based on system parameters

Parameters
antenna_diameterThe receive antenna diameter in meters
antenna_efficiencyThe receive antenna efficiency as a percentage (0 to 100)
frequencyThe transmitter frequency in hertz (Hz)
Returns
The receive antenna gain in decibels relative to isotropic (dBi) - Direct param of model

◆ stdev()

template<typename T>
int warptwin::stdev ( T * array,
unsigned int size,
T & result )

◆ stringReplace()

std::string warptwin::stringReplace ( const std::string & source,
const std::string & orig_str,
const std::string & new_str )

Replace the first element of a source string with a new element.

Parameters
sourceThe target string
origThe original string to find and replace
newThe replacement for orig
Returns
The new string with a single replacement

◆ strip()

std::string warptwin::strip ( const std::string & input)

Removes leading and trailing whitespace characters from a string.

This function mimics the behavior of Python's str.strip() method. It removes all whitespace characters (such as spaces, tabs, newlines) from both the beginning and the end of the input string, leaving the content in between unchanged.

Parameters
inputThe string to be stripped of leading and trailing whitespace.
Returns
A new string with leading and trailing whitespace removed.
Note
This function does not modify the original input string. It returns a new string with the whitespace removed.

◆ toLower()

std::string warptwin::toLower ( const std::string & input)

Function to convert a string to all lower case.

Parameters
inputString to be converted
Returns
String converted to all lower case

◆ toUpper()

std::string warptwin::toUpper ( const std::string & input)

Function to convert a string to all upper case.

Parameters
inputString to be converted
Returns
String converted to all upper case

◆ trim()

std::string warptwin::trim ( const std::string & str,
const std::string & whitespace = " \t" )

Function to trim leading and trailing whitespace from string.

Parameters
strThe string to trim
whitespaceThe whitespace we're looking to trim off. Defaults to " \t"
Returns
The trimmed string

◆ true2eccentric() [1/2]

double warptwin::true2eccentric ( double true_anomaly)

Convert true anomaly to eccentric anomaly.

Parameters
true_anomalyThe true anomaly, in radians
Returns
Eccentric anomaly, in radians

◆ true2eccentric() [2/2]

int warptwin::true2eccentric ( double true_anomaly,
double eccentricity,
double & eccentric_anomaly )

Function to convert true anomaly to eccentric anomaly.

Parameters
true_anomaly
eccentricityThe orbit eccentricity
eccentric_anomaly
Returns
Error code corresponding to success/failure

◆ tStar()

double warptwin::tStar ( double r,
double mu )

Function to return the characteristic time for the CR3BP.

Parameters
rThe circular orbit radius of the secondary body about the first
muThe mass of the primary body
Returns
The characteristic time

◆ twoBodyPropagate()

int warptwin::twoBodyPropagate ( double time,
double mu,
clockwerk::CartesianVector< 3 > pos_initial,
clockwerk::CartesianVector< 3 > vel_initial,
clockwerk::CartesianVector< 3 > & pos_final,
clockwerk::CartesianVector< 3 > & vel_final )

Function to propagate a body between two points in time using a keplerian orbit.

Parameters
timeThe time for which the orbit should be propagated
muThe gravitational parameter for the central planet
pos_initialThe initial position of the body
vel_initialThe initial velocity of the body
pos_finalThe position of the body after propagation
vel_finalThe velocity of the body after propagation
Returns
Error code corresponding to success/failure

◆ variance()

template<typename T>
int warptwin::variance ( T * array,
unsigned int size,
T & result )

◆ writeFileBinarySize()

void warptwin::writeFileBinarySize ( char * buffer,
char buffer_size,
const std::string & filename )

Function to write a buffer of bytes to a file, along with their size.

Parameters
bufferThe buffer of data to write to file
buffer_sizeThe size of the buffer to be written
filenameThe name of the file to write to

◆ writeKmlFile()

void warptwin::writeKmlFile ( const std::string & file,
const std::vector< std::vector< double > > & lat,
const std::vector< std::vector< double > > & lon,
const std::vector< std::vector< double > > & alt,
const std::vector< std::string > & colors,
bool project_to_ground = true )

Function to write a full KML file from trajectory data.

Parameters
fileThe file to write kml data to
latA vector of doubles corresponding to latitude
lonA vector of doubles corresponding to longitude
altA vector of doubles corresponding to altitude
colorsA vector of
project_to_groundA bolean indicating whether the trajectory should be projected to the ground

◆ writeTrajectory()

std::string warptwin::writeTrajectory ( const std::vector< double > & lat,
const std::vector< double > & lon,
const std::vector< double > & alt,
bool project_to_ground = true,
const std::string & color = "7f00ffff" )

Function to write a trajectory into a KML file.

Parameters
latA vector of doubles corresponding to latitude
lonA vector of doubles corresponding to longitude
altA vector of doubles corresponding to altitude
project_to_groundA bolean indicating whether the trajectory should be projected to the ground
Returns
A string to be written with all trajectory data

Variable Documentation

◆ _a_i

MODEL (OccultationModel) public double warptwin::_a_i

Occultation model using spherical representations of objects.

This model calculates the occultation fraction of a source from the perspective of an observer using spherical representations of the occulting object and source. The position of the observer in the reference frame f The position of the occulting object in the reference frame f The position of the source object in the reference frame f Fraction of two spherical representations of objects that are visible from the point of view of the observer. 0 is fully occulted, 1 is not occulted, 0-1 is visible fraction of observed object.

◆ _accel_grav__spherical

CartesianVector3 warptwin::_accel_grav__spherical

◆ _accelerometer

warptwin::Accelerometer warptwin::_accelerometer
protected

The IMU accelerometer model.

◆ _alt

double warptwin::_alt

◆ _alt_km

double warptwin::_alt_km

◆ _altitude_feet

double warptwin::_altitude_feet

◆ _altitude_true

double warptwin::_altitude_true

◆ _app_record

std::vector<warpos::App*> warptwin::_app_record
protected

Record of mapped apps.

◆ _asp_ptr

AsphericalGravityModel* warptwin::_asp_ptr = nullptr
protected

◆ _at_singularity

bool warptwin::_at_singularity
protected

◆ _atmos_drag

FlatPlateDragModel warptwin::_atmos_drag
protected

◆ _atmos_table

std::vector<std::vector<double> > warptwin::_atmos_table

◆ _azimuth

double warptwin::_azimuth

◆ _bias

double warptwin::_bias
protected

Internal variable for holding the bias and its deviations from the initial value.

◆ _bias_drift

double warptwin::_bias_drift
protected

◆ _body

Body warptwin::_body
protected

◆ _c

◆ _cmd_state

int warptwin::_cmd_state = OFF
protected

Value to hold last thrust command.

◆ _coil_node

Node warptwin::_coil_node
protected

The torque coil node.

◆ _colatitude

double warptwin::_colatitude

◆ _cos_m_lon

double warptwin::_cos_m_lon
protected

◆ _cph

double warptwin::_cph

◆ _cth

double warptwin::_cth

◆ _current_bias_noise

BiasNoiseModel warptwin::_current_bias_noise
protected

The bias and noise model for current.

◆ _current_capacity

double warptwin::_current_capacity

◆ _d

double warptwin::_d

◆ _d_1

double warptwin::_d_1

◆ _d_2

double warptwin::_d_2

◆ _d_e

double warptwin::_d_e

◆ _d_i

double warptwin::_d_i

◆ _d_o

double warptwin::_d_o

◆ _DCM_Body_Mag

clockwerk::DCM warptwin::_DCM_Body_Mag
protected

Temporary DCM for quaternion calculation.

◆ _DCM_directMeanWindFrame_to_meanWindFrame

clockwerk::DCM warptwin::_DCM_directMeanWindFrame_to_meanWindFrame

Internal variable for the rotation from the direct mean wind frame to the mean wind vector representation frame.

◆ _dcm_sf_root

clockwerk::DCM warptwin::_dcm_sf_root
protected

A DCM relating our sensor frame to root.

◆ _dcm_tmp

clockwerk::DCM warptwin::_dcm_tmp

◆ _dist_wind__comp

CartesianVector3 warptwin::_dist_wind__comp

◆ _dot_product_normal_solar

double warptwin::_dot_product_normal_solar

Temporary variable to hold the result of the dot product between the normal vector and solar vector.

◆ _dP

double * warptwin::_dP
protected

◆ _drag_node

Node warptwin::_drag_node
protected

◆ _dummy

double warptwin::_dummy
protected

Dummy variables for ignoring unneeded function implicit returns.

◆ _dynamics

CR3BPDynamics warptwin::_dynamics

◆ _end_time

std::chrono::time_point<std::chrono::high_resolution_clock> warptwin::_end_time
protected

◆ _enu_frame

Frame warptwin::_enu_frame
protected

The ENU frame created for the GS by this model.

◆ _epoch

double warptwin::_epoch
protected

◆ _err

int warptwin::_err

◆ _error

MODEL (LlaDeticStateInit) public int warptwin::_error

Model to produce position/velocity vector from a set of detic latitude, longitude, altitude coordinates.

Note
THIS MODEL ASSUMES EARTH STATIONARY AT SIMULATION STARTUP Equatorial radius of the planet, in meters. Default is Earth R per WGS84, in meters. This value is set to point to the defaults identified in clockwerk/planetdefaults. Flattening for the planet. Default is WGS84 flattening. This value is set to point to the defaults identified in clockwerk/planetdefaults. The detic latitude of the object. (radians) The longitude of the object. (radians) The detic altitude of the object. (meters) The position of the object in a generic planet centered rotating frame

◆ _esa

EffectiveSolarAreaModel warptwin::_esa

◆ _evec

CartesianVector3 warptwin::_evec
protected

◆ _face_normal_vector__body

MODEL (EffectiveSolarAreaModel) public CartesianVector3 warptwin::_face_normal_vector__body

Effective Solar Area model.

This model defines simple solar area of a flat surface. This is computed by taking the dot product of the normal vector of the surface and the solar vector. This value is expected to be negative if the panel is illuminated. If the value is positive, then the value is set to zero. If the value is negative, then the value is negated to become positive. This value is then multiplied by the area of the surface.

Author: Alex Jackson Email: alex..nosp@m.jack.nosp@m.son@a.nosp@m.ttx..nosp@m.tech The solar vector in the solar frame (Sun to spacecraft) The normal vector pointing out of the surface in the body frame The area of the surface The quaternion relating the body frame to the solar frame The effective solar area

Temp variable to hold normalized vector on body

◆ _face_normal_vector__sun

CartesianVector3 warptwin::_face_normal_vector__sun

Temporary variable to hold the vector that is normal to the surface after converting to the solar frame.

◆ _fe

CartesianVector3 warptwin::_fe

◆ _first_run

bool warptwin::_first_run = true
protected

◆ _flags

nrlmsise_flags warptwin::_flags
protected

◆ _force_node

Node warptwin::_force_node
protected

◆ _fss

FrameStateSensorModel warptwin::_fss

◆ _fss_enu

FrameStateSensorModel warptwin::_fss_enu
protected

The frame state sensor for relative states to the ENU frame.

◆ _fss_gs_pci

FrameStateSensorModel warptwin::_fss_gs_pci
protected

The frame state sensor for GS state in the PCI frame.

◆ _fss_sc_s

FrameStateSensorModel warptwin::_fss_sc_s

◆ _g

double warptwin::_g[NUMBER_OF_READ_COEFFICIENTS]
protected

Implicit returns form the read coefficients function in magneticFieldUtils.h.

Parameters
_gGauss coefficients g (nT)
_hGauss coefficients h (nT)
_gdotTime derivative of Gauss coefficients g (nT/year)
_hdotTime derivative of Gauss coefficients h (nT/year)
_epochDecimal year of the associated data

◆ _g_n_m

double warptwin::_g_n_m
protected

◆ _gdot

double warptwin::_gdot[NUMBER_OF_READ_COEFFICIENTS]
protected

◆ _ggTorque

CartesianVector3 warptwin::_ggTorque

◆ _grav_force__planet

CartesianVector3 warptwin::_grav_force__planet

◆ _gravity__sensor

CartesianVector3 warptwin::_gravity__sensor
protected

The gravity vector as represented in the sensor frame.

◆ _gravity_gradient

GravityGradientModel warptwin::_gravity_gradient
protected

◆ _gravity_node

Node warptwin::_gravity_node
protected

◆ _gs

GroundStationModel warptwin::_gs

◆ _gust_wind__comp

CartesianVector3 warptwin::_gust_wind__comp

◆ _gyro

warptwin::Gyroscope warptwin::_gyro
protected

The IMU gyro model.

◆ _h

double warptwin::_h[NUMBER_OF_READ_COEFFICIENTS]
protected

◆ _h_n_m

double warptwin::_h_n_m
protected

◆ _hdot

double warptwin::_hdot[NUMBER_OF_READ_COEFFICIENTS]
protected

◆ _image_set

std::vector<double> warptwin::_image_set

◆ _impulse

ImpulseModel warptwin::_impulse
protected

◆ _in_deadzone

std::array< bool, 3 > warptwin::_in_deadzone
protected

Temporary variable for checking if sensor is in deadzone. Each element of vector corresponds to an axis.

◆ _index

int warptwin::_index
protected

◆ _input

nrlmsise_input warptwin::_input
protected

◆ _input_states

std::array<double, 6> warptwin::_input_states

◆ _internal_pos

clockwerk::CartesianVector<3> warptwin::_internal_pos

◆ _internal_vel

clockwerk::CartesianVector<3> warptwin::_internal_vel

◆ _interp_density

Interpolate2D warptwin::_interp_density

◆ _interp_pressure

Interpolate2D warptwin::_interp_pressure

◆ _interp_temperature

Interpolate2D warptwin::_interp_temperature

◆ _interp_thrust

Interpolate2D warptwin::_interp_thrust

◆ _interpolate2D_model

Interpolate2D warptwin::_interpolate2D_model

◆ _K

double warptwin::_K

◆ _l_star

double warptwin::_l_star

◆ _last_output

_sunsensor_output_struct warptwin::_last_output
protected

Temporary variable for the latest recorded output added to latency model and dummy output for stepping though latency.

◆ _last_sch_step

int16 warptwin::_last_sch_step = 0
protected

◆ _lat

double warptwin::_lat

◆ _lat_centric

double warptwin::_lat_centric
protected

◆ _lat_detic

double warptwin::_lat_detic
protected

◆ _latency_model

LatencyUtil< _sunsensor_output_struct > warptwin::_latency_model
protected

The latency model for servo angle output.

Internal latency model, templated to the sensor output struct.

◆ _latency_return

_sunsensor_output_struct warptwin::_latency_return
protected

Temporary value for the return of the latency value.

◆ _logger

clockwerk::SimLogger* warptwin::_logger = nullptr
protected

Handle to our logger object.

◆ _lon

double warptwin::_lon

◆ _lvlh_ang_vel__lvlh

CartesianVector3 warptwin::_lvlh_ang_vel__lvlh

Temporary variable to hold LVLH angular velociyt in lvlh frame.

◆ _lvlh_attitude__r

clockwerk::DCM warptwin::_lvlh_attitude__r

Temporary variable to hold lvlh attitude.

◆ _lvlh_frame

Frame warptwin::_lvlh_frame = Frame("lvlh_frame")

This is the actual LVLH frame.

◆ _lvlh_frame_manager

LvlhFrameManagerModel warptwin::_lvlh_frame_manager
protected

◆ _mag_dipole__PCR

CartesianVector3 warptwin::_mag_dipole__PCR

◆ _mag_field__PCR

CartesianVector3 warptwin::_mag_field__PCR

◆ _mag_field_vec_body

CartesianVector3 warptwin::_mag_field_vec_body
protected

Temporary DCM for magnetic field transformation.

◆ _magnitude

double warptwin::_magnitude

◆ _max_altitude_km

double warptwin::_max_altitude_km

◆ _max_time_s

double warptwin::_max_time_s

◆ _max_turn_amount

double warptwin::_max_turn_amount
protected

The maximum amount that the servo can spin in the time of a single simulation step.

◆ _max_warned

bool warptwin::_max_warned = false

◆ _mean_wind__comp

CartesianVector3 warptwin::_mean_wind__comp

Internal variables for rotated vectors.

◆ _mean_wind_rot_angle

double warptwin::_mean_wind_rot_angle

Internal variable for the mean wind frame rotation angle.

◆ _meas_pres

double warptwin::_meas_pres
protected

Temporary variable to hold the measured pressure before bound checks and reolution quantinization.

◆ _min_altitude_km

double warptwin::_min_altitude_km

◆ _min_time_s

double warptwin::_min_time_s

◆ _min_warned

bool warptwin::_min_warned = false

◆ _misalignment_x

double warptwin::_misalignment_x = 0.0
protected

Misalignment angle.

◆ _misalignment_y

double warptwin::_misalignment_y = 0.0
protected

◆ _misalignment_z

double warptwin::_misalignment_z = 0.0
protected

◆ _mom_inertia_tensor

Matrix3 warptwin::_mom_inertia_tensor

Matrix to hold the moment of inertia tensor of the wheel.

◆ _msis_ptr

MSISAtmosphereModel* warptwin::_msis_ptr = nullptr
protected

◆ _mu_star

double warptwin::_mu_star

◆ _multiplier

double warptwin::_multiplier

◆ _N

int warptwin::_N
protected

◆ _names

std::vector<std::string> warptwin::_names
protected

◆ _next_step_start

clockwerk::Time warptwin::_next_step_start
protected

◆ _noise

double warptwin::_noise
protected

◆ _noise_model

BiasNoiseModel warptwin::_noise_model
protected

The bias and noise model for servo angle output.

◆ _nominal_thrust

double warptwin::_nominal_thrust = 0.0
protected

Our nominal thrust calculation from Isp and the like.

◆ _normal_random

NormalRandom<double>* warptwin::_normal_random

◆ _oc

OccultationModel warptwin::_oc

◆ _occult

OccultationModel warptwin::_occult
protected

Occultation model.

◆ _orbital_elements

MODEL (OrbitalElementsStateInit) public CartesianVector6 warptwin::_orbital_elements

Model for sensing the instantaneous orbital elements of a vehicle given its position and velocity.

Model to produce position/velocity vector from orbital elements.

This model takes the xyz cartesian state of a spacecraft and outputs it as keplerian orbital elements This is the gravitational parameter of our parent planet. Defaults to Earth's gravitational parameter for ease of use The position of the spacecraft in a generic inertial frame The velocity of the spacecraft in a generic inertial frame The semimajor axis of the spacecraft orbit, in meters The orbit eccentricity The orbit inclination, in radians The orbit RAAN, in radians The orbit argument of periapsis The true anomaly, in radians

This model produces the xyz cartesian state of a spacecraft from orbital elements for state initialization. This is the gravitational parameter of our parent planet. Defaults to Earth's gravitational parameter for ease of use The semimajor axis of the spacecraft orbit, in meters. Default is arbitrary 500 km alt orbit at Earth The orbit eccentricity. Default is arbitrary nearly circular orbit. The orbit inclination, in radians. Default is arbitrary 45 degree inclination The orbit RAAN, in radians The orbit argument of periapsis The true anomaly, in radians The position of the spacecraft in a generic inertial frame The velocity of the spacecraft in a generic inertial frame

◆ _out_of_range

bool warptwin::_out_of_range

◆ _output

nrlmsise_output warptwin::_output
protected

◆ _output_alt

double warptwin::_output_alt
protected

◆ _output_lat

double warptwin::_output_lat
protected

◆ _output_lon

double warptwin::_output_lon
protected

Internal variables for function implicit returns.

◆ _P

double* warptwin::_P
protected

◆ _P_n_m

double warptwin::_P_n_m
protected

◆ _PcupS

double * warptwin::_PcupS
protected

◆ _peak_system_voltage

double warptwin::_peak_system_voltage

◆ _perturbation

double warptwin::_perturbation = 0.0
protected

Value to hold perturbation to current command.

◆ _perturbed_accel

CartesianVector3 warptwin::_perturbed_accel
protected

Temporary variable to hold the perturbed acceleration with and without gravity.

◆ _perturbed_accel_no_grav

CartesianVector3 warptwin::_perturbed_accel_no_grav
protected

◆ _perturbed_ang_vel

CartesianVector3 warptwin::_perturbed_ang_vel
protected

Temporary variable to hold the perturbed ang vel.

◆ _perturbed_mag

CartesianVector3 warptwin::_perturbed_mag
protected

Temporary variable to hold the perturbed acceleration with and without gravity.

◆ _perturbed_pos

CartesianVector3 warptwin::_perturbed_pos
protected

Internal variables for the perturbed position and velocity.

◆ _perturbed_vel

CartesianVector3 warptwin::_perturbed_vel
protected

◆ _planet_inertial

MODEL (CustomPlanet) public Frame warptwin::_planet_inertial = Frame("planet_inertial_frame")

Custom planet consisting of inertial and rotating frame which can be configured with custom rotation rate.

The simple planet model is a simple model of a planet with configurable parameters for initial attitude, angular rate, and the items defined in planet defaults for gravitational parameter, J2, J3, equatorial radius,

Author: Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m..tech The angular velocity of the planet rotating frame relative to the inertial frame. Defaults to Earth's rotation rate The angular velocity of the planet rotating frame relative to the inertial frame. Defaults to Earth's rotation rate. Mirrored on the output value. Equatorial radius of the planet, in meters. Default is Earth R per WGS84, in meters. This value is set to reflect user input values. Mirrored on the output value. Flattening for the planet. Default is WGS84 flattening. This value is set to reflect user input values. Mirrored on the output value. Gravitational parameter for planet. Default is WGS84 value, in m^3/s^2. This value is set to reflect user input values. Mirrored on the output value. J2 parameter for planet. Default is derived from WGS84 but inexact. This value is set to reflect user input values. Mirrored on the output value. J3 parameter for planet. Default is derived from WGS84 but inexact. This value is set to reflect user input values. Mirrored on the output value. Mean angular velocity of the planet. Assumes rotation about Z axis. Default is WGS84 Earth in rad/s. This value is set to reflect user input values. Mirrored on the output value. A pointer to the custom planet object itself for easy passing to other models. Is a void pointer and must be cast in downstream model. Nullptr is set to self in constructor. Accessor to the inertial frame of the planet. Set to point to _planet_inertial in constructor. Accessor to the rotating frame of the planet. Set to point to _planet_inertial in constructor. Equatorial radius of the planet, in meters. Default is Earth R per WGS84, in meters. This value is set to reflect user input values. Flattening for the planet. Default is WGS84 flattening. This value is set to reflect user input values. Gravitational parameter for planet. Default is WGS84 value, in m^3/s^2. This value is set to reflect user input values. J2 parameter for planet. Default is derived from WGS84 but inexact. This value is set to reflect user input values. J3 parameter for planet. Default is derived from WGS84 but inexact. This value is set to reflect user input values. Mean angular velocity of the planet. Assumes rotation about Z axis. Default is WGS84 Earth in rad/s. This value is set to reflect user input values.

◆ _planet_inertial_state_sensor

FrameStateSensorModel warptwin::_planet_inertial_state_sensor
protected

◆ _planet_name

std::string warptwin::_planet_name = "earth"
protected

◆ _planet_relative

PlanetRelativeStatesModel warptwin::_planet_relative
protected

◆ _planet_rotating

Frame warptwin::_planet_rotating = Frame("planet_rotating_frame")

◆ _planet_rotating_state_sensor

FrameStateSensorModel warptwin::_planet_rotating_state_sensor
protected

◆ _planned_burn_ptrs

std::vector<TimedImpulsiveBurnModel*> warptwin::_planned_burn_ptrs
protected

◆ _polar_radius

double warptwin::_polar_radius

◆ _pos

CartesianVector3 warptwin::_pos

◆ _pos__pcr

CartesianVector3 warptwin::_pos__pcr

◆ _pos_body_pci__body

MODEL (GravityGradientModel) public CartesianVector3 warptwin::_pos_body_pci__body

Gravity Gradient Model.

This model calculates the gravity gradient torque force resulting from differences in axial inertia on a spacecraft. The equations used for this calculation come from "Analytical Mechanics of Space Systems (Fourth Edition), by Hanspeter Schaub and John L. Junkins", page 226 (eq. 4.158). The gravity gradient torque calculation is done in the body frame (Body frame position and inertia).

Author: Sam Matez Email: sam.m.nosp@m.atez.nosp@m.@attx.nosp@m..tec.nosp@m.h This is the gravitational parameter of our parent planet. Defaults to Earth's gravitational parameter for ease of use The position of the body with respect to PCI frame, expressed in PCI coordinates The attitude of the body with respect ot the PCI frame, in quaternions The inertia tensor expressed in the body frame The tourque vector acting on the body due to gravity gradient effects wrt to the body frame

◆ _pos_PCI_ss__ss

CartesianVector3 warptwin::_pos_PCI_ss__ss
protected

Internal variable for the position of the primary orbiter with respect to the sun sensor represented in sun sensor frame coordinates.

◆ _pos_SCI_ss__ss

CartesianVector3 warptwin::_pos_SCI_ss__ss
protected

Internal variable for the position of the Sun with respect to the sun sensor represented in sun sensor frame coordinates.

◆ _pos_SCI_ss__ss_unit

CartesianVector3 warptwin::_pos_SCI_ss__ss_unit
protected

◆ _pos_ss_ss__ss

CartesianVector3 warptwin::_pos_ss_ss__ss = CartesianVector3({0.0, 0.0, 0.0})
protected

Internal variable for the position of the sun sensor with respect to the sun sensor represented in sun sensor frame coordinates. Zero vector always.

◆ _pos_tgt_mount__mount

CartesianVector3 warptwin::_pos_tgt_mount__mount
protected

◆ _pow_a_by_r

double warptwin::_pow_a_by_r
protected

◆ _power_load_ptrs

std::vector<clockwerk::DataIO<double>*> warptwin::_power_load_ptrs
protected

◆ _power_reflected_W

double warptwin::_power_reflected_W
protected

Power reflected back into the system in Watts.

◆ _power_source_ptrs

std::vector<clockwerk::DataIO<double>*> warptwin::_power_source_ptrs
protected

◆ _power_TX_dBm

double warptwin::_power_TX_dBm
protected

Power leaving the transmitter in decibel-milliWats.

◆ _prev_cmd

int warptwin::_prev_cmd = OFF
protected

◆ _prev_com

bool warptwin::_prev_com = false

Boolean to store the previous operational state.

◆ _previous_bias

CartesianVector3 warptwin::_previous_bias
protected

Temporary variable to hold the bias vector at last function call.

◆ _previous_pos_bias

CartesianVector3 warptwin::_previous_pos_bias
protected

Internal variables for the previous bias of the position and velocity measurements.

◆ _previous_vel_bias

CartesianVector3 warptwin::_previous_vel_bias
protected

◆ _primary_orbiter_relative_state

FrameStateSensorModel warptwin::_primary_orbiter_relative_state
protected

Model to compute the position of the primary orbiter relative to the sun sensor frame.

◆ _q

clockwerk::Quaternion warptwin::_q
protected

Temporary quaternion used for random rotations.

◆ _r

MODEL (SolarRadiationPressureModel) public double warptwin::_r

Point mass gravity model.

Solar Radiation Pressure Model.

This model generates forces acting on a body under the influence of a simple point mass gravity field. This is the gravitational parameter of our parent planet. Defaults to Earth's gravitational parameter for ease of use This is the mass of the body, which will be multiplied by our force to get the force calculation... TODO to replace this with accel methods The position of the object body in the reference frame f This is the acceleration due to gravity calculated in the same reference frame as pos_body__f

This model calculates the solar radiation pressure perturbation that acts on a body in orbit. The methods and calculations in this model come from https://freeflyer.com/_help_Files/spherical_srp.htm

Author: Sam Matez Email: sam.m.nosp@m.atez.nosp@m.@attx.nosp@m..tec.nosp@m.h The solar flux , defaults to the mean solar flux at one astronomical unit (W/m^2) The body coefficient of reflectivity () The area of the body subject to solar radiation (the mean area that faces the sun). Defaults to 1 m^2 The body position wrt the Sun in any generic frame. Defaults to 1 AU in meters with sun in X direction The current solar intensity on a scale of 0 to 1 where 0 is eclipse and 1 is direct sunlight The force acting on the body due to solar radiation pressure (N) in the smae generic frame as the input

◆ _r_pos

double warptwin::_r_pos

◆ _rad

double warptwin::_rad
protected

◆ _radius

double warptwin::_radius

The radius set by the enum centric_by.

◆ _range_az_el_sensor

RangeAzElSensorModel warptwin::_range_az_el_sensor
protected

The range az el sensor for our actual ground station.

◆ _rate_monitor

RateMonitor warptwin::_rate_monitor
protected

Rate monitor to control the rate at which the sensor runs.

◆ _rates

std::array<double, 6> warptwin::_rates

◆ _registries

std::vector<std::pair<warpos::App*, int16> > warptwin::_registries
protected

◆ _rel_position

MODEL (ProximityMonitor) public CartesianVector3 warptwin::_rel_position

The time trigger monitor is a simple implementation of the monitor that triggers continuously after a set time. The time is set upon construction, but may be changed during run via function. This is the variable at what difference between deputy and chief the monitor should trigger Take chief position (position 1) Take deputy position (position 2) The range between the chief and deputy Our trigger – this is the flag set and unset by the monitor as its ultimate output, and should be used downstream by events, etc.

◆ _rng

NormalRandom< double > * warptwin::_rng = nullptr

RNG to produce our distribution.

◆ _rps_to_rpm

double warptwin::_rps_to_rpm = 60.0/(2*M_PI)

Conversion between radians per second and revolutions per minute.

◆ _rx_com_analysis_model

SimpleComAnalysisModel warptwin::_rx_com_analysis_model

◆ _s

◆ _s_ob_vec

CartesianVector3 warptwin::_s_ob_vec

◆ _safesqrtresult

double warptwin::_safesqrtresult

◆ _sc_pos_tmp__root

CartesianVector3 warptwin::_sc_pos_tmp__root

◆ _sc_pos_tmp__sc

CartesianVector3 warptwin::_sc_pos_tmp__sc

◆ _sc_quat_tmp_root

clockwerk::Quaternion warptwin::_sc_quat_tmp_root

◆ _sc_vel_tmp__root

CartesianVector3 warptwin::_sc_vel_tmp__root

◆ _sc_vel_tmp__sc

CartesianVector3 warptwin::_sc_vel_tmp__sc

◆ _scale_factor

double warptwin::_scale_factor
protected

Internal variables for the different noise sources.

◆ _scale_length_u

double warptwin::_scale_length_u

◆ _scale_length_v

double warptwin::_scale_length_v

◆ _scale_length_w

double warptwin::_scale_length_w

◆ _scaling_factor

double warptwin::_scaling_factor

◆ _schedule_mapping

std::vector<int> warptwin::_schedule_mapping
protected

Map schedule indices to timing vector.

◆ _seen_last_step

bool warptwin::_seen_last_step

◆ _sensor_bias_noise

BiasNoiseModel warptwin::_sensor_bias_noise
protected

The bias and noise model for sensor output.

◆ _sensor_frame

Frame warptwin::_sensor_frame
protected

The sensor frame in which all measurements will be taken.

◆ _sensor_noise_model

BiasNoiseModel warptwin::_sensor_noise_model
protected

The bias and noise model for sensor output.

◆ _servo_angle_actual

double warptwin::_servo_angle_actual
protected

Temporary value that has perturbations acted upon it.

◆ _sin_m_lon

double warptwin::_sin_m_lon
protected

◆ _sph

double warptwin::_sph

◆ _sph_ptr

SphericalHarmonicsGravityModel* warptwin::_sph_ptr = nullptr
protected

◆ _spp

SolarPanelPowerModel warptwin::_spp

◆ _sqrt_time_step

double warptwin::_sqrt_time_step
protected

Internal variable for 1/sqrt(Hz).

◆ _start_run

unsigned int warptwin::_start_run = 0
protected

◆ _start_time

std::chrono::time_point<std::chrono::high_resolution_clock> warptwin::_start_time
protected

◆ _state_GPS_PCR

FrameStateSensorModel warptwin::_state_GPS_PCR
protected

Frame state sensor model of the GPS frame relative to the PCR frame.

◆ _step_counter

unsigned int warptwin::_step_counter = 0
protected

◆ _step_end_sys_time

clockwerk::Time warptwin::_step_end_sys_time
protected

◆ _sth

double warptwin::_sth

◆ _sun_relative_state

FrameStateSensorModel warptwin::_sun_relative_state
protected

Model to compute the position of the sun relative to the sun sensor frame.

◆ _system_shutoff_capacity

double warptwin::_system_shutoff_capacity

◆ _t_star

double warptwin::_t_star

◆ _temp_NED_ECEF

clockwerk::DCM warptwin::_temp_NED_ECEF
protected

◆ _tempQuat

clockwerk::Quaternion warptwin::_tempQuat
protected

Temporary quaternion for misalignment calculation.

◆ _theta

double warptwin::_theta = 0.0
protected

Misalignment angle magnitude and unit vector.

Temporary angle used for random rotations.

◆ _thrust_perturbation

double warptwin::_thrust_perturbation = 0.0
protected

Value to hold perturbation to thrust.

◆ _thrust_table

std::vector<std::vector<double> > warptwin::_thrust_table

◆ _thruster_bias_noise

BiasNoiseModel warptwin::_thruster_bias_noise
protected

The bias and noise model for thrust output.

◆ _thruster_node

Node warptwin::_thruster_node
protected

The node at which thrust is applied.

◆ _time_per_slot

clockwerk::Time warptwin::_time_per_slot
protected

◆ _time_trigger

TimeTriggerMonitor warptwin::_time_trigger
protected

◆ _timing_values_micros

std::vector<std::vector<double> > warptwin::_timing_values_micros
protected

The number of microseconds per app to run.

◆ _tmp

double warptwin::_tmp

◆ _tmp1

double warptwin::_tmp1

◆ _tmp2

double warptwin::_tmp2

◆ _tmp3

double warptwin::_tmp3

◆ _tmp4

double warptwin::_tmp4

◆ _tmp5

double warptwin::_tmp5

◆ _tmp_dcm

clockwerk::DCM warptwin::_tmp_dcm
protected

◆ _tmp_tgt

CartesianVector3 warptwin::_tmp_tgt

◆ _tmpvec

CartesianVector3 warptwin::_tmpvec

◆ _torque_bias_noise

BiasNoiseModel warptwin::_torque_bias_noise

The bias and noise model for torque output.

◆ _torque_perturbation

double warptwin::_torque_perturbation = 0.0

Value to hold perturbation to torque.

◆ _torque_vec

CartesianVector3 warptwin::_torque_vec
protected

Value to hold total torque calculation.

◆ _total_error

clockwerk::Euler321 warptwin::_total_error
protected

Temporary variable to hold total error for gyro.

◆ _total_slots

int warptwin::_total_slots = 0
protected

◆ _total_system_capacity

double warptwin::_total_system_capacity

◆ _total_thrust

double warptwin::_total_thrust = 0.0
protected

Value to hold total thrust calculation.

◆ _total_torque

double warptwin::_total_torque = 0.0

Value to hold total torque calculation.

◆ _triggered

bool warptwin::_triggered = false
protected

◆ _truth_altitude

double warptwin::_truth_altitude
protected

Truth altitude used for dead-zone determination.

◆ _truth_mag_field__mag

CartesianVector3 warptwin::_truth_mag_field__mag
protected

Temporary variable to hold the truth magnetic field vector in the sensor frame.

◆ _truth_speed

double warptwin::_truth_speed
protected

Truth speed used for dead-zone determination.

◆ _ts_10

warpos::TableScheduler<10>* warptwin::_ts_10 = nullptr
protected

Pointers to table schedulers. These are initialized based on the parameterized table schedule rate value and only one is allocated

◆ _ts_100

warpos::TableScheduler<100>* warptwin::_ts_100 = nullptr
protected

◆ _ts_1000

warpos::TableScheduler<1000>* warptwin::_ts_1000 = nullptr
protected

◆ _ts_200

warpos::TableScheduler<200>* warptwin::_ts_200 = nullptr
protected

◆ _ts_50

warpos::TableScheduler<50>* warptwin::_ts_50 = nullptr
protected

◆ _turb_intensity_u

double warptwin::_turb_intensity_u

◆ _turb_intensity_v

double warptwin::_turb_intensity_v

◆ _turb_intensity_w

double warptwin::_turb_intensity_w

◆ _turn_direction

double warptwin::_turn_direction
protected

The turn direction of the servo for this time step.

◆ _tx_com_analysis_model

SimpleComAnalysisModel warptwin::_tx_com_analysis_model

◆ _uniform_random

UniformRandom<double> warptwin::_uniform_random

◆ _uniform_random_model

UniformRandom<double>* warptwin::_uniform_random_model = nullptr
protected

Interal model for generating a uniform random number.

◆ _unitpos_body_sun_f

CartesianVector3 warptwin::_unitpos_body_sun_f

◆ _v_obj__aero

CartesianVector3 warptwin::_v_obj__aero

◆ _v_wind__aero

CartesianVector3 warptwin::_v_wind__aero

◆ _vel

CartesianVector3 warptwin::_vel

◆ _voltage_interp_table

Interpolate2D warptwin::_voltage_interp_table

◆ _w

CartesianVector3 warptwin::_w
protected

Temporary vector used for random rotations.

◆ _WARN_BAD_FILE_EPOCH

bool warptwin::_WARN_BAD_FILE_EPOCH
protected

◆ _WARN_CANT_CHANGE_N

bool warptwin::_WARN_CANT_CHANGE_N
protected

◆ _wheel_node

Node warptwin::_wheel_node

The reaction wheel node.

◆ _wind_u_feet

double warptwin::_wind_u_feet

◆ _wind_v_feet

double warptwin::_wind_v_feet

◆ _wind_w_feet

double warptwin::_wind_w_feet

◆ _Xprime

double warptwin::_Xprime
protected

◆ _Yprime

double warptwin::_Yprime
protected

◆ _z_axis

CartesianVector3 warptwin::_z_axis
protected

Vector to hold temporary axes during orientation calculation.

◆ _Zprime

double warptwin::_Zprime
protected

◆ ALIAS_END

const std::string warptwin::ALIAS_END = "]"

◆ ALIAS_START

const std::string warptwin::ALIAS_START = "["

◆ ALTITUDE_INTERPOLATE

const std::vector<double> warptwin::ALTITUDE_INTERPOLATE = {2000.0, 11000.0, 44000.0, 200000.0}

◆ ARG_INDICATOR

const std::string warptwin::ARG_INDICATOR = "--"

◆ AUTHOR_EMAIL_END

const std::string warptwin::AUTHOR_EMAIL_END = "> "

◆ AUTHOR_EMAIL_START

const std::string warptwin::AUTHOR_EMAIL_START = " <"

◆ body

clockwerk::DataIO<Body*> warptwin::body = clockwerk::DataIO<Body*>(this, "body", &_body)

◆ CODE_LITERAL

const std::string warptwin::CODE_LITERAL = "```"

◆ CZML_DESCRIPTION

const std::string warptwin::CZML_DESCRIPTION = "<<DESCRIPTION>>"

◆ CZML_END_INTERVAL

const std::string warptwin::CZML_END_INTERVAL = "<<END_INTERVAL>>"

◆ CZML_FACILITY_LINK_TEMPLATE

const std::string warptwin::CZML_FACILITY_LINK_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "facilitylink.txt"

◆ CZML_FACILITY_NAME

const std::string warptwin::CZML_FACILITY_NAME = "<<FACILITY_NAME>>"

◆ CZML_FACILITY_TEMPLATE

const std::string warptwin::CZML_FACILITY_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "facility.txt"

◆ CZML_FILE_TEMPLATE

const std::string warptwin::CZML_FILE_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "template.txt"

◆ CZML_GS_STRINGS

const std::string warptwin::CZML_GS_STRINGS = "<<GS_STRINGS>>"

◆ CZML_IS_CONNECTED

const std::string warptwin::CZML_IS_CONNECTED = "<<IS_CONNECTED>>"

◆ CZML_LEAD_TIME

const std::string warptwin::CZML_LEAD_TIME = "<<LEAD_TIME>>"

◆ CZML_LINK_INTERVALS

const std::string warptwin::CZML_LINK_INTERVALS = "<<LINK_INTERVALS>>"

◆ CZML_LINK_STRINGS

const std::string warptwin::CZML_LINK_STRINGS = "<<LINK_STRINGS>>"

◆ CZML_LINK_TEMPLATE

const std::string warptwin::CZML_LINK_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "link.txt"

◆ CZML_MODEL_END

const std::string warptwin::CZML_MODEL_END = "<<MODEL_END>>"

◆ CZML_MODEL_FILE_NAME

const std::string warptwin::CZML_MODEL_FILE_NAME = "<<MODEL_FILE_NAME>>"

◆ CZML_MODEL_START

const std::string warptwin::CZML_MODEL_START = "<<MODEL_START>>"

◆ CZML_PRIMARY_SPACECRAFT_NAME

const std::string warptwin::CZML_PRIMARY_SPACECRAFT_NAME = "<<PRIMARY_SPACECRAFT_NAME>>"

◆ CZML_SATELLITE_STRINGS

const std::string warptwin::CZML_SATELLITE_STRINGS = "<<SAT_STRINGS>>"

◆ CZML_SATELLITE_TEMPLATE

const std::string warptwin::CZML_SATELLITE_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "satellite.txt"

◆ CZML_SECONDARY_SPACECRAFT_NAME

const std::string warptwin::CZML_SECONDARY_SPACECRAFT_NAME = "<<SECONDARY_SPACECRAFT_NAME>>"

◆ CZML_SPACECRAFT_ATTITUDE

const std::string warptwin::CZML_SPACECRAFT_ATTITUDE = "<<SPACECRAFT_ATTITUDE>>"

◆ CZML_SPACECRAFT_LINK_STRINGS

const std::string warptwin::CZML_SPACECRAFT_LINK_STRINGS = "<<SPACECRAFT_LINK_STRINGS>>"

◆ CZML_SPACECRAFT_LINK_TEMPLATE

const std::string warptwin::CZML_SPACECRAFT_LINK_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "spacecraftlink.txt"

◆ CZML_SPACECRAFT_NAME

const std::string warptwin::CZML_SPACECRAFT_NAME = "<<SPACECRAFT_NAME>>"

◆ CZML_SPACECRAFT_POSITION

const std::string warptwin::CZML_SPACECRAFT_POSITION = "<<SPACECRAFT_POSITION>>"

◆ CZML_START_INTERVAL

const std::string warptwin::CZML_START_INTERVAL = "<<START_INTERVAL>>"

◆ CZML_TRAIL_TIME

const std::string warptwin::CZML_TRAIL_TIME = "<<TRAIL_TIME>>"

◆ CZML_VISIBLE_INTERVALS

const std::string warptwin::CZML_VISIBLE_INTERVALS = "<<VISIBLE_INTERVALS>>"

◆ DATASOCK_IO_BUFFER_SIZE

const int warptwin::DATASOCK_IO_BUFFER_SIZE = 1000

◆ DAYS_BEFORE_MONTH

const int warptwin::DAYS_BEFORE_MONTH[12]
Initial value:
= {
0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
}

◆ DEFAULT_MAX_MSG

const unsigned int warptwin::DEFAULT_MAX_MSG = 280

Define some standard messages for writing to file.

◆ DEFAULT_SIMULATION_TIME

const std::string warptwin::DEFAULT_SIMULATION_TIME = "2023 September 26, 12:00:00 MDT"

This is the default simulation time.

◆ DOC_REF_START

const std::string warptwin::DOC_REF_START = "xref:"

◆ dt

double warptwin::dt
protected

◆ ERROR_LICENSE

const int warptwin::ERROR_LICENSE = 300

◆ FACTORIAL_CACHE

const std::map<int, double> warptwin::FACTORIAL_CACHE
Initial value:
= {
{ 0, 1.0},
{ 5, 120.0},
{10, 3628800.0},
{15, 1307674368000.0},
{20, 2432902008176640000.0},
{25, 15511210043330985984000000.0},
{30, 265252859812191058636308480000000.0},
}

◆ FRAME_MAXIMUM_NUM_CHILDREN

uint32 warptwin::FRAME_MAXIMUM_NUM_CHILDREN = 100
constexpr

◆ GPS_TO_J2000_ET_OFFSET

const double warptwin::GPS_TO_J2000_ET_OFFSET = 630763200.0

This is the offset between the GPS and J2000 epochs for calculation of GPS time The GPS epoch is January 6, 1980.

◆ grav_force__planet

CartesianVector3 warptwin::grav_force__planet

◆ HASH_ADDER

const int warptwin::HASH_ADDER = 3

◆ HASH_MULTIPLIER

const int warptwin::HASH_MULTIPLIER = 37

◆ HEADER_ONE

const std::string warptwin::HEADER_ONE = "== "

◆ HEADER_TWO

const std::string warptwin::HEADER_TWO = "=== "

◆ IMAGE_START

const std::string warptwin::IMAGE_START = "image::"

◆ INPUT_CONN_TYPES

const std::vector<std::pair<connection_type_e, std::string> > warptwin::INPUT_CONN_TYPES
Initial value:
= {
@ INPUT
Definition Connection.h:31
@ PARAM
Definition Connection.h:30

Hold all connection type enum values to loop through.

◆ inputs

Inputs warptwin::inputs = Inputs(this, "inputs")

◆ KEY

const std::string warptwin::KEY = "kodasandymoosebuddy"

◆ LINK_END

const std::string warptwin::LINK_END = "++"

◆ LINK_START

const std::string warptwin::LINK_START = "link:++"

◆ lvlh

clockwerk::DataIO<Body*> warptwin::lvlh = clockwerk::DataIO<Body*>(this, "lvlh", nullptr)

◆ MAX_HARMONIC_COEFFICIENTS

const int warptwin::MAX_HARMONIC_COEFFICIENTS = 12

◆ MAX_ITER

const int warptwin::MAX_ITER = 5

◆ MAX_SIZE_CHAR

const int warptwin::MAX_SIZE_CHAR = 0xFF

◆ MAX_SPICE_NAME_LENGTH

const int warptwin::MAX_SPICE_NAME_LENGTH = 33

◆ MONTH_MAP

const std::map<std::string, int> warptwin::MONTH_MAP
Initial value:
{
{"JAN", 1}, {"FEB", 2}, {"MAR", 3}, {"APR", 4},
{"MAY", 5}, {"JUN", 6}, {"JUL", 7}, {"AUG", 8},
{"SEP", 9}, {"OCT", 10}, {"NOV", 11}, {"DEC", 12}
}

◆ NEGATIVE_ELEVEN_OVER_SIX

const double warptwin::NEGATIVE_ELEVEN_OVER_SIX = -11.0/6.0

◆ NEGATIVE_FIVE_OVER_SIX

const double warptwin::NEGATIVE_FIVE_OVER_SIX = -5.0/6.0

◆ NMAX_SPHERICAL_HARMONICS

const int warptwin::NMAX_SPHERICAL_HARMONICS = 18

◆ NO_ERROR

const int warptwin::NO_ERROR = 0

◆ NODE_CATEGORIES

const std::vector<std::string> warptwin::NODE_CATEGORIES
Initial value:
= {
"Dynamics", "GN&C", "Assemblies", "Environment", "Power", "Sensors", "Actuators", "Initial States", "Visuals", "Logging", "Custom"}

◆ NUM_0P00823

const double warptwin::NUM_0P00823 = 0.00823

◆ NUM_0P177

const double warptwin::NUM_0P177 = 0.177

◆ NUM_1P339

const double warptwin::NUM_1P339 = 1.339

◆ NUM_2P678

const double warptwin::NUM_2P678 = 2.678

◆ NUM_CR3BP_STATES

const unsigned int warptwin::NUM_CR3BP_STATES = 6

◆ NUMBER_OF_READ_COEFFICIENTS

const int warptwin::NUMBER_OF_READ_COEFFICIENTS = (MAX_HARMONIC_COEFFICIENTS*(MAX_HARMONIC_COEFFICIENTS+1))/2 + MAX_HARMONIC_COEFFICIENTS

◆ NUMBER_OF_SET_POINTS

const int warptwin::NUMBER_OF_SET_POINTS = 16

◆ ON_STATE

const double warptwin::ON_STATE = 1e-15

◆ ORBIT_DOUBLE_TOL

const double warptwin::ORBIT_DOUBLE_TOL = 1e-12

◆ outputs

Outputs warptwin::outputs = Outputs(this, "outputs")

◆ params

MODEL (SimTableScheduleModel) public Params warptwin::params = Params(this, "params")

Model of simulated table schedule for flight software emulation.

This model is a simulated version of the table scheduler for running flight software with appropriate timing in WarpTwin. It internally maintains a table schedule model, which it steps in sequence internally within every simulation step.

To schedule apps, the table schedule model should have its registerApp called (as with the real table scheduler).

Author
Alex Reynolds alex..nosp@m.reyn.nosp@m.olds@.nosp@m.attx.nosp@m..tech

◆ PC_15_2

const double warptwin::PC_15_2 = 0.5*15.0

◆ PC_35_2

const double warptwin::PC_35_2 = 0.5*35

◆ PC_3_2

const double warptwin::PC_3_2 = 0.5*3.0

◆ precalc_j2

double warptwin::precalc_j2

◆ precalc_j3

double warptwin::precalc_j3

◆ PREIMAGE_SET

const std::vector<double> warptwin::PREIMAGE_SET = {0.0, 1000.0, 2000.0, 3000.0, 4000.0, 5000.0, 6000.0, 7000.0, 8000.0, 9000.0, 10000.0, 20000.0, 30000.0, 40000.0, 50000.0, 100000.0}

◆ r

double warptwin::r

◆ SHMEM_STRING_ALLOC_SIZE

const int warptwin::SHMEM_STRING_ALLOC_SIZE = 1000

Amount of space reserved for strings in shmem.

◆ SOCKET_TEMPLATE

const std::string warptwin::SOCKET_TEMPLATE = warptwinDir() + slash() + "data" + slash() + "czml" + slash() + "template_socket_update.txt"

◆ TABLE_HEADER_END

const std::string warptwin::TABLE_HEADER_END = "*]\n"

◆ TABLE_HEADER_START

const std::string warptwin::TABLE_HEADER_START = "[\%header,cols="

◆ TABLE_LINE_START

const std::string warptwin::TABLE_LINE_START = "|"

◆ TABLE_MARKER

const std::string warptwin::TABLE_MARKER = "|===\n"

◆ TITLE

const std::string warptwin::TITLE = "= "

◆ TURBULENCE_INTERPOLATE

const std::vector<double> warptwin::TURBULENCE_INTERPOLATE = { 10.0, 10.0, 4.0, 4.0}

◆ VISUALS_APP_ADDR

const std::string warptwin::VISUALS_APP_ADDR = warptwinDir() + slash() + "CesiumViz" + slash() + "runVisualsApp.py"

◆ VISUALS_FILE_LOC_NAME

const std::string warptwin::VISUALS_FILE_LOC_NAME = warptwinDir() + slash() + "CesiumViz" + slash() + "tmp-data" + slash() + "ms-visuals.czml"

◆ WMM_EARTH_RADIUS

const double warptwin::WMM_EARTH_RADIUS = 6371200.0