Spacecraft Models Package 2.0
Spacecraft Models for DSim
Public Member Functions | Protected Attributes | List of all members
gravity_two_solar_system Class Reference

Generates gravity for two solar systems. More...

#include <gravity_two_solar_system.h>

Inherits dsim_model.

Public Member Functions

 gravity_two_solar_system (dsim_model_setup *setup)
 Constructor.
 
 ~gravity_two_solar_system ()
 Destructor.
 
void * describe_setup (void *ds)
 Describe the setup data.
 
bool parse_setup (const char *command, const char *data)
 Parse input setup commands. More...
 
void initialize_data ()
 Initialize the model data. More...
 
void initialization_complete ()
 Finish initialization.
 
void initialize_timestep ()
 Computations done prior to numerical integration. More...
 
void rhs (double t, double jd)
 Right hand side.
 
void complete_timestep ()
 Computations done after numerical integration.
 

Protected Attributes

dsim_variable n_files
 Number of SPK kernel files loaded.
 
dsim_variable accel
 Matrix for storing acceleration.
 
dsim_variable parent_mass
 mass of parent object
 
dsim_variable parent_pos
 position of parent object
 
dsim_variable parent_vel
 velocity of parent object
 
char * frame
 String for SPICE frame, name, i.e. "J2000" or "ECLIPJ2000".
 
int n_targets
 Number of planet targets listed in planet_index.
 
Published

Matrix storing NAIF integer IDs of targets

dsim_variable planet_index
 
dsim_variable positionBody
 Matrix for storing positions of bodies.
 
dsim_variable velocityBody
 Matrix for storing velocities of bodies.
 
dsim_variable radiusBody
 Matrix for storing radii of bodies.
 
dsim_variable rotationMatrixBody
 Matrix for storing rotation of bodies.
 
dsim_variable angularRateVectorBody
 Matrix for storing rotation rate vector of bodies.
 
dsim_variable muBody_dsim
 Matrix for storing mu.
 
dsim_variable observer
 NAIF integer ID of observer, defaults to sun (10)
 

Detailed Description

Generates gravity for two solar systems.

This model computes the gravitational accelerations for the sun's solar system using SPICE and a second solar system.

Member Function Documentation

◆ parse_setup()

bool gravity_two_solar_system::parse_setup ( const char *  command,
const char *  data 
)

Parse input setup commands.

Parses AddBody and AddCenter lines and adds planets to the linked list.

The AddBody command is followed by the planet name or ID, for example

AddBody Sun, AddBody 10

AddCenter Earth, AddCenter 399

AddBody Jupiter

A separate line is required for each planet.

Adding a planet causes a set of published variables to be added to the model, including:

  • Planet_Pos
  • Planet_Vel
  • Planet_Rad
  • Planet_RangeRate
  • Planet_Min_Range

A frame may be selected using SetFrame. The available frames are

  • ECLIPJ2000
  • J2000

References frame, n_files, and observer.

◆ initialize_data()

void gravity_two_solar_system::initialize_data ( )

Initialize the model data.

String for SPICE frame, name, i.e. "J2000" or "ECLIPJ2000"

References accel, angularRateVectorBody, frame, muBody_dsim, n_files, n_targets, observer, positionBody, radiusBody, rotationMatrixBody, and velocityBody.

◆ initialize_timestep()

void gravity_two_solar_system::initialize_timestep ( )

Computations done prior to numerical integration.

Update the ephemeris and the planet rotation.


The documentation for this class was generated from the following files: