Gravity Engine 2 3.0
Loading...
Searching...
No Matches
GravityEngine2.Booster Class Reference

Booster External Acceleration. More...

Classes

class  Stage
 Utility class to bundle together the attributes for a rocket stage. Some redundancy (payload and dry mass). More...
 

Public Types

enum  Steering {
  LINEAR_TANGENT_EC , MANUAL_VEC , MANUAL_PITCH , PITCH_TABLE ,
  UNUSED
}
 

Static Public Member Functions

static int ActiveStageReadback (double3[] data)
 
static void AutoStageSet (double3[] data, bool enabled)
 Set the auto-stage control bit in the booster data block to indicated the value of the enabled parameter.
 
static void EnabledSet (double3[] data, bool enabled)
 Set the ENABLED flag in the data block.
 
static double FuelReadout (double3[] data, int stageReq=-1)
 Get fuel for the designated stage. If the stage is -1, this is a request for the active stage.
 
static double3[] LinearTangentECAlloc (double theta0Deg, int numStages)
 Create data[] array for a linear tangent steering law of the form tan(theta) = (1-t/t_f) tan(theta0) as found in (6.59) of "Design of Rockets and Launch Vehicles", Edberg & Cpsta, AIAA Press.
 
static double3[] ManualPitchAlloc (double pitchRad, int numStages)
 Allocate a data block with numStages that will use a manual pitch value for ascent guidance.
 
static void ManualPitchUpdate (double pitchRad, double3[] data)
 
static double3[] ManualVecAlloc (double3 thrustDir, int numStages)
 Full manual control with acceleration explicitly specified.
 
static void ManualVecSetThrustDir (double3[] data, double3 thrustDir)
 
static void PayloadCompute (double3[] data, double payloadMassKg)
 Compute and configure the per stage payload values for each stage in a multi-stage booster. e.g. 3 stages: 0, 1, 2 Stage 2 has a payload mass of payloadMassKg. Stage 1 has a payload mass of playloadMassKg + stage2 (fuel + dry mass) Stage 0 has a payload mass of stage 1 payload mass + stage1 (fuel + dry mass)
 
static double PayloadReadout (double3[] data, int stageNum)
 
static double PitchFromTable (NativeArray< double3 > data, double t, int steering_base)
 Look up the entry in the pitch table. Assume the pitch table might not be regular and that since we're integrating time will advance forward monotonically. Just walk the table to find an entry but keep track of where we were.
 
static double PitchReadback (double3[] data)
 
static double3[] PitchTableAlloc (double3[] pitchTable, int numStages)
 
static void StageSetup (double3[] data, int stageNum, Stage stage)
 Add a stage to the Booster. This assumes data[] has been created with the correct number of total stages, prior to using this method to fill in the details.
 
static void SteeringPlaneSet (double3[] data, double3 orbitCenter, double3 orbitNormal)
 
static void SteeringTimesSet (double3[] data, double tStartSec, double tEndSec)
 
static void ThrottleSet (double3[] data, double throttle)
 
static int ThrustAndSteering (ref ExternalAccel.EAStateData eaState, ref ExternalAccel.EADesc eaDesc, double t, double dt, double3 a_in, NativeArray< double3 > data, out double3 a_out, double scaleTtoSec, double scaleAccelSitoGE)
 Static method to run the thrust and do steering calculations for a multi-stage booster. The operational parameters for the engine are contained in the the data[] block. This is interpreted based on the type of booster and steering law configured when initializing the data block.
 

Static Public Attributes

const int AUTO_STAGE = 1 << 1
 
const int ENABLED = 1 << 0
 
const int FUEL_OUT = 1 << 0
 
const int SEND_EVENTS = 1 << 2
 
const int STAGED = 1 << 1
 
const int STATUS_FUEL_OUT = 1
 
const int STATUS_STAGED = 2
 

Detailed Description

Booster External Acceleration.

This class provides the external acceleration of a multi-stage booster. It will be called for each timestep in the numerical integration.

This implementation supports:

  • multiple stages that (may) reduce the mass of the booster as time goes on (i.e. rocket equation stuff)
  • a choice of steering laws for the direction of the thrust: manual vector, manual pitch in a target plane, tangent steering in target plance etc.

Booster setup allocates a block of double3[] to hold the state information required for the stages and steering.

Member Function Documentation

◆ AutoStageSet()

static void GravityEngine2.Booster.AutoStageSet ( double3[] data,
bool enabled )
static

Set the auto-stage control bit in the booster data block to indicated the value of the enabled parameter.

Parameters
data
enabled

◆ EnabledSet()

static void GravityEngine2.Booster.EnabledSet ( double3[] data,
bool enabled )
static

Set the ENABLED flag in the data block.

Parameters
data
enabled

◆ FuelReadout()

static double GravityEngine2.Booster.FuelReadout ( double3[] data,
int stageReq = -1 )
static

Get fuel for the designated stage. If the stage is -1, this is a request for the active stage.

Parameters
data
stage0 based stage number
Returns

◆ LinearTangentECAlloc()

static double3[] GravityEngine2.Booster.LinearTangentECAlloc ( double theta0Deg,
int numStages )
static

Create data[] array for a linear tangent steering law of the form tan(theta) = (1-t/t_f) tan(theta0) as found in (6.59) of "Design of Rockets and Launch Vehicles", Edberg & Cpsta, AIAA Press.

This uses a standard rocket equation data block but note that if the engine is throttled down the algorithm will still assume the same t_burn and compute the guidance accordingly.

SB = Steering Base [SB0] (law, t_start, t_end) start/end are for overall flight path for steering laws that use this [SB1] center [SB2] plane [SB3] (tan(theta0), 0, pitch_readback)

Parameters
theta0Deg
t_final
Returns

◆ ManualPitchAlloc()

static double3[] GravityEngine2.Booster.ManualPitchAlloc ( double pitchRad,
int numStages )
static

Allocate a data block with numStages that will use a manual pitch value for ascent guidance.

This adds a single double3 to the standard header + stages that contains: (SE = end of stage block + 1) data[SE+0].x = manual pitch value

Parameters
pitchRad
numStages
Returns

◆ ManualVecAlloc()

static double3[] GravityEngine2.Booster.ManualVecAlloc ( double3 thrustDir,
int numStages )
static

Full manual control with acceleration explicitly specified.

Atypical since does not have any stages or standard steering plane info. [SB0] (law, 0, 0) [SB1] thrustDir

Parameters
thrustDirthrust direction vector (normalized)
Returns

◆ PayloadCompute()

static void GravityEngine2.Booster.PayloadCompute ( double3[] data,
double payloadMassKg )
static

Compute and configure the per stage payload values for each stage in a multi-stage booster. e.g. 3 stages: 0, 1, 2 Stage 2 has a payload mass of payloadMassKg. Stage 1 has a payload mass of playloadMassKg + stage2 (fuel + dry mass) Stage 0 has a payload mass of stage 1 payload mass + stage1 (fuel + dry mass)

Parameters
data
payloadMassKg

◆ PitchFromTable()

static double GravityEngine2.Booster.PitchFromTable ( NativeArray< double3 > data,
double t,
int steering_base )
static

Look up the entry in the pitch table. Assume the pitch table might not be regular and that since we're integrating time will advance forward monotonically. Just walk the table to find an entry but keep track of where we were.

(Public so Unit tests can find it)

Parameters
data
t
b
Returns

◆ StageSetup()

static void GravityEngine2.Booster.StageSetup ( double3[] data,
int stageNum,
Stage stage )
static

Add a stage to the Booster. This assumes data[] has been created with the correct number of total stages, prior to using this method to fill in the details.

The mass of the payload should include the mass of all higher stages + fuel. This can be calculated automatically by using the utility PayloadCompute().

Parameters
datadata block for the booster
stageNumnumber of this stage (0 based)
stagestruct with details of this stage
throttlethrottle value

◆ ThrustAndSteering()

static int GravityEngine2.Booster.ThrustAndSteering ( ref ExternalAccel::EAStateData eaState,
ref ExternalAccel::EADesc eaDesc,
double t,
double dt,
double3 a_in,
NativeArray< double3 > data,
out double3 a_out,
double scaleTtoSec,
double scaleAccelSitoGE )
static

Static method to run the thrust and do steering calculations for a multi-stage booster. The operational parameters for the engine are contained in the the data[] block. This is interpreted based on the type of booster and steering law configured when initializing the data block.

Parameters
eaState
eaDesc
t
dt
a_in
data
a_out
Returns

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