Gravity Engine 2 9.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. More...
 

Public Types

enum  Guidance {
  LINEAR_TANGENT_EC , MANUAL_VEC , MANUAL_PITCH , PITCH_TABLE ,
  GRAVITY_TURN , PEG_2D , PEG2D_GT , UNUSED
}
 
enum  PEG2DMode { GRAVITY_TURN_S0 , SLEW_TO_PEG , PEG , PEG_FROM_START }
 

Static Public Member Functions

static int ActiveStageReadback (double3[] data)
 
static double3[] Allocate (Guidance guidance, int numStages, GEBodyState bodyStateSI, double dtSec, double mu_SI, double tStartSec, int pitchTableSize=0)
 
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 double BurnTimeForStage (double3[] data, int stage)
 
static void EnabledSet (double3[] data, bool enabled)
 Set the ENABLED flag in the data block.
 
static int double3 double3 v EvolveSelfIntegrated (ref ExternalAccel.EAStateData eaState, int extAccelId, double tGE, double dt, ref GEPhysicsCore.GEPhysicsJob gePhysJob)
 
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[] GravityTurnSetup (double3[] data, double vStart, double pitchKickDeg, double pitchRateDegPerSec)
 
static void LinearTangentECSetup (double3[] data, double linTan_a, double linTan_b, double tStartSec, double tEndSec)
 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 void ManualPitchSetup (double pitchRad, double3[] data)
 Allocate a data block with numStages that will use a manual pitch value for ascent guidance.
 
static void ManualVecSetThrustDir (double3[] data, double3 thrustDir)
 Full manual control with acceleration explicitly specified.
 
static double MassAtTime (double3[] data, double t)
 
static void PayloadCompute (double3[] data)
 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 void Peg2DSetup (double3[] data, PEG2DMode pegMode, double gt_at_vel, double gt_pitch_kick, double pitch_rate, double target_altitude, double target_vz, double burnTimeSec)
 Setup PEG2D params. Call after Booster.Allocate() and Booster.StageSetup().
 
static double PitchFromTable (NativeArray< double3 > data, double t, int guid_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 void PitchTableSetup (double3[] data, double tStartSec, double tEndSec, double3[] pitchTable)
 
static bool bool stopSelfIntegrating SelfIntegratingStatusActions (int status)
 
static int double fuel_used StageNumFuelAtTime (double3[] data, double t)
 
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 string StatusString (int status)
 
static void SteeringPlaneSet (double3[] data, double3 orbitCenter, double3 orbitNormal)
 
static void ThrottleSet (double3[] data, double throttle)
 
static double ThrustAtTime (double3[] data, double t)
 
static double TotalBurnTime (double3[] data)
 Total burn time for the booster extracted from a copy of the data[] block with 0 offset.
 

Static Public Attributes

const int AUTO_STAGE = 1 << 1
 
const int COPY_FROM_BODY = 1 << 3
 
const int ENABLED = 1 << 0
 
const int FUEL_OUT = 1 << 0
 
static int double3 r
 
static bool remove
 
const int SEND_EVENTS = 1 << 2
 
static int stage
 
const int STAGED = 1 << 1
 
static int status
 Dedicated history-dependent evolution of the booster. This is called by RunStep() in GEPhysicsCore. Typically the timescale of NBody evolution is much larger than the typical timescale of a rocket launch or powered descent. This routine does simple integration using a guidance model with updates typically on the order of 0.1 seconds. This is an appropriate timestep for e.g. a gravity turn.
 
const int STATUS_CUTOFF = 3
 
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. Booster also provides a set of methods to assist in determining the launch trajewctory and end state without being used as part of GEPhysicsCore. This allows tuning of booster parameters ahead of launch.

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 guidance laws for the direction of the thrust: LINEAR_TANGENT_EC: linear tangent to the steering plane MANUAL_VEC: manual vector thrust direction MANUAL_PITCH: manual pitch in a target plane PITCH_TABLE: pitch from a table of pitch angle vs time GRAVITY_TURN: gravity turn to a target altitude PEG_2D: 2D PEG guidance PEG2D_GT: 2D PEG guidance with gravity turn at start

Booster setup allocates a block of double3[] to hold the state information required for the stages and guidance. This ensures it can be run within the Job system and can be Burst compiled.

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

◆ LinearTangentECSetup()

static void GravityEngine2.Booster.LinearTangentECSetup ( double3[] data,
double linTan_a,
double linTan_b,
double tStartSec,
double tEndSec )
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] (linTan_a, linTan_b, 0)

Parameters
theta0Deg
t_final
Returns

◆ ManualPitchSetup()

static void GravityEngine2.Booster.ManualPitchSetup ( double pitchRad,
double3[] data )
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

◆ ManualVecSetThrustDir()

static void GravityEngine2.Booster.ManualVecSetThrustDir ( double3[] data,
double3 thrustDir )
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)
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

◆ Peg2DSetup()

static void GravityEngine2.Booster.Peg2DSetup ( double3[] data,
PEG2DMode pegMode,
double gt_at_vel,
double gt_pitch_kick,
double pitch_rate,
double target_altitude,
double target_vz,
double burnTimeSec )
static

Setup PEG2D params. Call after Booster.Allocate() and Booster.StageSetup().

data[guid_base] = new double3((int)Guidance.PEG_2D, 0, 0);
data[guid_base + PEG2D_MODE_OFFSET] = new double3((int)pegMode, gt_at_vel, gt_pitch_kick);
data[guid_base + PEG2D_TARGET_ALTITUDE_OFFSET] = new double3(pitch_rate, target_altitude, target_vz);
data[guid_base + PEG2D_PEG_A_OFFSET] = double3.zero;
data[guid_base + PEG2D_PEG_T_OFFSET] = double3.zero;
data[guid_base + PEG2D_PITCH_LOCK_OFFSET] = new double3(0, 0, math.radians(90.0));
Parameters
data
pegMode
gt_at_vel
gt_pitch_kick
pitch_rate
target_altitude
target_vz

◆ PitchFromTable()

static double GravityEngine2.Booster.PitchFromTable ( NativeArray< double3 > data,
double t,
int guid_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.

Angles in the pitch table are angles from the horizontal in radians. Need to convert to angle from the vertical in radians.

(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 shadow_ea_desc_index is used to indicate that this stage is shadowed by a GSBody that will track its motion once it has burned out. When staging occurs the current R, V, t values are copied to the shadow GSBody. Otherwise these values are updated at the end of the self-integrating evolution.

Parameters
data
stageNum
stage
shadow_ea_desc_index

◆ TotalBurnTime()

static double GravityEngine2.Booster.TotalBurnTime ( double3[] data)
static

Total burn time for the booster extracted from a copy of the data[] block with 0 offset.

Parameters
data
Returns
burn time (sec.)

Member Data Documentation

◆ status

int GravityEngine2.Booster.status
static

Dedicated history-dependent evolution of the booster. This is called by RunStep() in GEPhysicsCore. Typically the timescale of NBody evolution is much larger than the typical timescale of a rocket launch or powered descent. This routine does simple integration using a guidance model with updates typically on the order of 0.1 seconds. This is an appropriate timestep for e.g. a gravity turn.

A copy of (r, v, t) state is maintained in the EAStateData block to reduce conversion inaccuracy.
Time is the time since launch start in seconds.

Parameters
eaState
eaDesc
t_untiltime to integrate to
dtGEPhysicsCore dt (in GE units)
data
scaleTtoSec
scaleLtoKm
Returns

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