JSBSim Flight Dynamics Model  1.2.0 (05 Nov 2023)
An Open Source Flight Dynamics and Control Software Library in C++
FGPropagate Class Reference

Detailed Description

Models the EOM and integration/propagation of state.

The Equations of Motion (EOM) for JSBSim are integrated to propagate the state of the vehicle given the forces and moments that act on it. The integration accounts for a rotating Earth.

Integration of rotational and translation position and rate can be customized as needed or frozen by the selection of no integrator. The selection of which integrator to use is done through the setting of the associated property. There are four properties which can be set:

simulation/integrator/rate/rotational
simulation/integrator/rate/translational
simulation/integrator/position/rotational
simulation/integrator/position/translational

Each of the integrators listed above can be set to one of the following values:

0: No integrator (Freeze)
1: Rectangular Euler
2: Trapezoidal
3: Adams Bashforth 2
4: Adams Bashforth 3
5: Adams Bashforth 4
Author
Jon S. Berndt, Mathias Froehlich, Bertrand Coconnier

Definition at line 95 of file FGPropagate.h.

#include <FGPropagate.h>

+ Inheritance diagram for FGPropagate:
+ Collaboration diagram for FGPropagate:

Classes

struct  Inputs
 
struct  VehicleState
 The current vehicle state vector structure contains the translational and angular position, and the translational and angular velocity. More...
 

Public Types

enum  eIntegrateType {
  eNone = 0 , eRectEuler , eTrapezoidal , eAdamsBashforth2 ,
  eAdamsBashforth3 , eAdamsBashforth4 , eBuss1 , eBuss2 ,
  eLocalLinearization , eAdamsBashforth5
}
 These define the indices use to select the various integrators.
 
- Public Types inherited from FGJSBBase
enum  { eL = 1 , eM , eN }
 Moments L, M, N.
 
enum  { eP = 1 , eQ , eR }
 Rates P, Q, R.
 
enum  { eU = 1 , eV , eW }
 Velocities U, V, W.
 
enum  { eX = 1 , eY , eZ }
 Positions X, Y, Z.
 
enum  { ePhi = 1 , eTht , ePsi }
 Euler angles Phi, Theta, Psi.
 
enum  { eDrag = 1 , eSide , eLift }
 Stability axis forces, Drag, Side force, Lift.
 
enum  { eRoll = 1 , ePitch , eYaw }
 Local frame orientation Roll, Pitch, Yaw.
 
enum  { eNorth = 1 , eEast , eDown }
 Local frame position North, East, Down.
 
enum  { eLat = 1 , eLong , eRad }
 Locations Radius, Latitude, Longitude.
 
enum  {
  inNone = 0 , inDegrees , inRadians , inMeters ,
  inFeet
}
 Conversion specifiers.
 

Public Member Functions

 FGPropagate (FGFDMExec *Executive)
 Constructor. More...
 
 ~FGPropagate ()
 Destructor.
 
void DumpState (void)
 
double GetAltitudeASL (void) const
 Returns the current altitude above sea level. More...
 
double GetAltitudeASLmeters (void) const
 Returns the current altitude above sea level. More...
 
double GetCosEuler (int idx) const
 Retrieves the cosine of a vehicle Euler angle component. More...
 
double GetDistanceAGL (void) const
 
double GetDistanceAGLKm (void) const
 
double GetEarthPositionAngle (void) const
 Returns the Earth position angle. More...
 
double GetEarthPositionAngleDeg (void) const
 Returns the Earth position angle in degrees. More...
 
double GetECEFVelocity (int idx) const
 Calculates and retrieves the velocity vector relative to the earth centered earth fixed (ECEF) frame for a particular axis.
 
FGColumnVector3 GetECEFVelocity (void) const
 Calculates and retrieves the velocity vector relative to the earth centered earth fixed (ECEF) frame.
 
double GetEuler (int axis) const
 Retrieves a vehicle Euler angle component. More...
 
const FGColumnVector3GetEuler (void) const
 Retrieves the Euler angles that define the vehicle orientation. More...
 
double GetEulerDeg (int axis) const
 Retrieves a vehicle Euler angle component in degrees. More...
 
FGColumnVector3 GetEulerDeg (void) const
 Retrieves the Euler angles (in degrees) that define the vehicle orientation. More...
 
double GetGeodeticAltitude (void) const
 
double GetGeodeticAltitudeKm (void) const
 
double GetGeodLatitudeDeg (void) const
 
double GetGeodLatitudeRad (void) const
 
double Gethdot (void) const
 Returns the current altitude rate. More...
 
double GetInertialPosition (int i) const
 
const FGColumnVector3GetInertialPosition (void) const
 Retrieves the inertial position vector.
 
double GetInertialVelocity (int i) const
 
const FGColumnVector3GetInertialVelocity (void) const
 Retrieves the inertial velocity vector in ft/sec.
 
double GetInertialVelocityMagnitude (void) const
 Retrieves the total inertial velocity in ft/sec.
 
double GetLatitude (void) const
 
double GetLatitudeDeg (void) const
 
double GetLocalTerrainRadius (void) const
 Returns the "constant" LocalTerrainRadius. More...
 
double GetLocation (int i) const
 
const FGLocationGetLocation (void) const
 
double GetLongitude (void) const
 
double GetLongitudeDeg (void) const
 
double GetNEDVelocityMagnitude (void) const
 Retrieves the total local NED velocity in ft/sec.
 
double GetPQR (int axis) const
 Retrieves a body frame angular velocity component relative to the ECEF frame. More...
 
const FGColumnVector3GetPQR (void) const
 Retrieves the body angular rates vector, relative to the ECEF frame. More...
 
double GetPQRi (int axis) const
 Retrieves a body frame angular velocity component relative to the ECI (inertial) frame. More...
 
const FGColumnVector3GetPQRi (void) const
 Retrieves the body angular rates vector, relative to the ECI (inertial) frame. More...
 
const FGQuaternion GetQuaternion (void) const
 Returns the quaternion that goes from Local to Body.
 
const FGQuaternionGetQuaterniondot (void) const
 Retrieves the time derivative of the body orientation quaternion. More...
 
const FGQuaternion GetQuaternionECEF (void) const
 Returns the quaternion that goes from ECEF to Body.
 
const FGQuaternion GetQuaternionECI (void) const
 Returns the quaternion that goes from ECI to Body.
 
double GetRadius (void) const
 
double GetSinEuler (int idx) const
 Retrieves the sine of a vehicle Euler angle component. More...
 
const FGMatrix33GetTb2ec (void) const
 Retrieves the body-to-ECEF transformation matrix. More...
 
const FGMatrix33GetTb2i (void) const
 Retrieves the body-to-ECI transformation matrix. More...
 
const FGMatrix33GetTb2l (void) const
 Retrieves the body-to-local transformation matrix. More...
 
const FGMatrix33GetTec2b (void) const
 Retrieves the ECEF-to-body transformation matrix. More...
 
const FGMatrix33GetTec2i (void) const
 Retrieves the ECEF-to-ECI transformation matrix. More...
 
const FGMatrix33GetTec2l (void) const
 Retrieves the ECEF-to-local transformation matrix. More...
 
const FGColumnVector3GetTerrainAngularVelocity (void) const
 
double GetTerrainElevation (void) const
 
const FGColumnVector3GetTerrainVelocity (void) const
 
const FGMatrix33GetTi2b (void) const
 Retrieves the ECI-to-body transformation matrix. More...
 
const FGMatrix33GetTi2ec (void) const
 Retrieves the ECI-to-ECEF transformation matrix. More...
 
const FGMatrix33GetTi2l (void) const
 Retrieves the inertial-to-local transformation matrix. More...
 
const FGMatrix33GetTl2b (void) const
 Retrieves the local-to-body transformation matrix. More...
 
const FGMatrix33GetTl2ec (void) const
 Retrieves the local-to-ECEF transformation matrix. More...
 
const FGMatrix33GetTl2i (void) const
 Retrieves the local-to-inertial transformation matrix. More...
 
double GetUVW (int idx) const
 Retrieves a body frame velocity component. More...
 
const FGColumnVector3GetUVW (void) const
 Retrieves the body frame vehicle velocity vector. More...
 
double GetVel (int idx) const
 Retrieves a Local frame velocity component. More...
 
const FGColumnVector3GetVel (void) const
 Retrieves the velocity vector. More...
 
const VehicleStateGetVState (void) const
 
void InitializeDerivatives ()
 
bool InitModel (void)
 Initializes the FGPropagate class after instantiation and prior to first execution. More...
 
void NudgeBodyLocation (const FGColumnVector3 &deltaLoc)
 
void RecomputeLocalTerrainVelocity ()
 
bool Run (bool Holding)
 Runs the state propagation model; called by the Executive Can pass in a value indicating if the executive is directing the simulation to Hold. More...
 
void SetAltitudeASL (double altASL)
 
void SetAltitudeASLmeters (double altASL)
 
void SetDistanceAGL (double tt)
 
void SetDistanceAGLKm (double tt)
 
void SetEarthPositionAngle (double EPA)
 Sets the Earth position angle. More...
 
void SetHoldDown (bool hd)
 Sets the property forces/hold-down. More...
 
void SetInertialOrientation (const FGQuaternion &Qi)
 
void SetInertialRates (const FGColumnVector3 &vRates)
 
void SetInertialVelocity (const FGColumnVector3 &Vi)
 
void SetInitialState (const FGInitialCondition *)
 
void SetLatitude (double lat)
 
void SetLatitudeDeg (double lat)
 
void SetLocation (const FGColumnVector3 &lv)
 
void SetLocation (const FGLocation &l)
 
void SetLongitude (double lon)
 
void SetLongitudeDeg (double lon)
 
void SetPosition (const double Lon, const double Lat, const double Radius)
 
void SetPQR (unsigned int i, double val)
 
void SetRadius (double r)
 
void SetTerrainElevation (double tt)
 
void SetUVW (unsigned int i, double val)
 
void SetVState (const VehicleState &vstate)
 
- Public Member Functions inherited from FGModel
 FGModel (FGFDMExec *)
 Constructor.
 
 ~FGModel () override
 Destructor.
 
virtual SGPath FindFullPathName (const SGPath &path) const
 
FGFDMExecGetExec (void)
 
const std::string & GetName (void)
 
unsigned int GetRate (void)
 Get the output rate for the model in frames.
 
virtual bool Load (Element *el)
 
void SetPropertyManager (std::shared_ptr< FGPropertyManager > fgpm)
 
void SetRate (unsigned int tt)
 Set the ouput rate for the model in frames.
 
- Public Member Functions inherited from FGModelFunctions
std::string GetFunctionStrings (const std::string &delimeter) const
 Gets the strings for the current set of functions. More...
 
std::string GetFunctionValues (const std::string &delimeter) const
 Gets the function values. More...
 
std::shared_ptr< FGFunctionGetPreFunction (const std::string &name)
 Get one of the "pre" function. More...
 
bool Load (Element *el, FGFDMExec *fdmex, std::string prefix="")
 
void PostLoad (Element *el, FGFDMExec *fdmex, std::string prefix="")
 
void PreLoad (Element *el, FGFDMExec *fdmex, std::string prefix="")
 
void RunPostFunctions (void)
 
void RunPreFunctions (void)
 
- Public Member Functions inherited from FGJSBBase
 FGJSBBase ()
 Constructor for FGJSBBase.
 
virtual ~FGJSBBase ()
 Destructor for FGJSBBase.
 
void disableHighLighting (void)
 Disables highlighting in the console output.
 

Public Attributes

struct JSBSim::FGPropagate::Inputs in
 

Additional Inherited Members

- Static Public Member Functions inherited from FGJSBBase
static const std::string & GetVersion (void)
 Returns the version number of JSBSim. More...
 
static constexpr double KelvinToFahrenheit (double kelvin)
 Converts from degrees Kelvin to degrees Fahrenheit. More...
 
static constexpr double CelsiusToRankine (double celsius)
 Converts from degrees Celsius to degrees Rankine. More...
 
static constexpr double RankineToCelsius (double rankine)
 Converts from degrees Rankine to degrees Celsius. More...
 
static constexpr double KelvinToRankine (double kelvin)
 Converts from degrees Kelvin to degrees Rankine. More...
 
static constexpr double RankineToKelvin (double rankine)
 Converts from degrees Rankine to degrees Kelvin. More...
 
static constexpr double FahrenheitToCelsius (double fahrenheit)
 Converts from degrees Fahrenheit to degrees Celsius. More...
 
static constexpr double CelsiusToFahrenheit (double celsius)
 Converts from degrees Celsius to degrees Fahrenheit. More...
 
static constexpr double CelsiusToKelvin (double celsius)
 Converts from degrees Celsius to degrees Kelvin. More...
 
static constexpr double KelvinToCelsius (double kelvin)
 Converts from degrees Kelvin to degrees Celsius. More...
 
static constexpr double FeetToMeters (double measure)
 Converts from feet to meters. More...
 
static bool EqualToRoundoff (double a, double b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (float a, float b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (float a, double b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (double a, float b)
 Finite precision comparison. More...
 
static constexpr double Constrain (double min, double value, double max)
 Constrain a value between a minimum and a maximum value.
 
static constexpr double sign (double num)
 
- Static Public Attributes inherited from FGJSBBase
static char highint [5] = {27, '[', '1', 'm', '\0' }
 highlights text
 
static char halfint [5] = {27, '[', '2', 'm', '\0' }
 low intensity text
 
static char normint [6] = {27, '[', '2', '2', 'm', '\0' }
 normal intensity text
 
static char reset [5] = {27, '[', '0', 'm', '\0' }
 resets text properties
 
static char underon [5] = {27, '[', '4', 'm', '\0' }
 underlines text
 
static char underoff [6] = {27, '[', '2', '4', 'm', '\0' }
 underline off
 
static char fgblue [6] = {27, '[', '3', '4', 'm', '\0' }
 blue text
 
static char fgcyan [6] = {27, '[', '3', '6', 'm', '\0' }
 cyan text
 
static char fgred [6] = {27, '[', '3', '1', 'm', '\0' }
 red text
 
static char fggreen [6] = {27, '[', '3', '2', 'm', '\0' }
 green text
 
static char fgdef [6] = {27, '[', '3', '9', 'm', '\0' }
 default text
 
static short debug_lvl = 1
 
- Protected Member Functions inherited from FGModel
bool Upload (Element *el, bool preLoad)
 Uploads this model in memory. More...
 
- Static Protected Member Functions inherited from FGJSBBase
static std::string CreateIndexedPropertyName (const std::string &Property, int index)
 
- Protected Attributes inherited from FGModel
unsigned int exe_ctr
 
FGFDMExecFDMExec
 
std::string Name
 
std::shared_ptr< FGPropertyManagerPropertyManager
 
unsigned int rate
 
- Protected Attributes inherited from FGModelFunctions
FGPropertyReader LocalProperties
 
std::vector< std::shared_ptr< FGFunction > > PostFunctions
 
std::vector< std::shared_ptr< FGFunction > > PreFunctions
 
- Static Protected Attributes inherited from FGJSBBase
static constexpr double radtodeg = 180. / M_PI
 
static constexpr double degtorad = M_PI / 180.
 
static constexpr double hptoftlbssec = 550.0
 
static constexpr double psftoinhg = 0.014138
 
static constexpr double psftopa = 47.88
 
static constexpr double fttom = 0.3048
 
static constexpr double ktstofps = 1852./(3600*fttom)
 
static constexpr double fpstokts = 1.0 / ktstofps
 
static constexpr double inchtoft = 1.0/12.0
 
static constexpr double m3toft3 = 1.0/(fttom*fttom*fttom)
 
static constexpr double in3tom3 = inchtoft*inchtoft*inchtoft/m3toft3
 
static constexpr double inhgtopa = 3386.38
 
static constexpr double slugtolb = 32.174049
 Note that definition of lbtoslug by the inverse of slugtolb and not to a different constant you can also get from some tables will make lbtoslug*slugtolb == 1 up to the magnitude of roundoff. More...
 
static constexpr double lbtoslug = 1.0/slugtolb
 
static constexpr double kgtolb = 2.20462
 
static constexpr double kgtoslug = 0.06852168
 
static const std::string needed_cfg_version = "2.0"
 
static const std::string JSBSim_version = JSBSIM_VERSION " " __DATE__ " " __TIME__
 

Constructor & Destructor Documentation

◆ FGPropagate()

FGPropagate ( FGFDMExec Executive)
explicit

Constructor.

The constructor initializes several variables, and sets the initial set of integrators to use as follows:

  • integrator, rotational rate = Adams Bashforth 2
  • integrator, translational rate = Adams Bashforth 2
  • integrator, rotational position = Trapezoidal
  • integrator, translational position = Trapezoidal
    Parameters
    Executivea pointer to the parent executive object

These define the indices use to select the various integrators.

Definition at line 82 of file FGPropagate.cpp.

83  : FGModel(fdmex)
84 {
85  Debug(0);
86  Name = "FGPropagate";
87 
88  Inertial = FDMExec->GetInertial();
89 
91  // eNone = 0, eRectEuler, eTrapezoidal, eAdamsBashforth2, eAdamsBashforth3, eAdamsBashforth4};
92 
93  integrator_rotational_rate = eRectEuler;
94  integrator_translational_rate = eAdamsBashforth2;
95  integrator_rotational_position = eRectEuler;
96  integrator_translational_position = eAdamsBashforth3;
97 
98  VState.dqPQRidot.resize(5, FGColumnVector3(0.0,0.0,0.0));
99  VState.dqUVWidot.resize(5, FGColumnVector3(0.0,0.0,0.0));
100  VState.dqInertialVelocity.resize(5, FGColumnVector3(0.0,0.0,0.0));
101  VState.dqQtrndot.resize(5, FGQuaternion(0.0,0.0,0.0));
102 
103  epa = 0.0;
104 
105  bind();
106  Debug(0);
107 }
std::shared_ptr< FGInertial > GetInertial(void) const
Returns the FGInertial pointer.
Definition: FGFDMExec.cpp:285
FGModel(FGFDMExec *)
Constructor.
Definition: FGModel.cpp:57
+ Here is the call graph for this function:

Member Function Documentation

◆ GetAltitudeASL()

double GetAltitudeASL ( void  ) const

Returns the current altitude above sea level.

This function returns the altitude above sea level. units ft

Returns
The current altitude above sea level in feet.

Definition at line 573 of file FGPropagate.cpp.

574 {
575  return VState.vLocation.GetRadius() - VState.vLocation.GetSeaLevelRadius();
576 }
double GetRadius() const
Get the distance from the center of the earth in feet.
Definition: FGLocation.h:291
double GetSeaLevelRadius(void) const
Get the sea level radius in feet below the current location.
Definition: FGLocation.cpp:273
FGLocation vLocation
Represents the current location of the vehicle in Earth centered Earth fixed (ECEF) frame.
Definition: FGPropagate.h:104
+ Here is the call graph for this function:

◆ GetAltitudeASLmeters()

double GetAltitudeASLmeters ( void  ) const
inline

Returns the current altitude above sea level.

This function returns the altitude above sea level. units meters

Returns
The current altitude above sea level in meters.

Definition at line 337 of file FGPropagate.h.

337 { return GetAltitudeASL()*fttom;}
double GetAltitudeASL(void) const
Returns the current altitude above sea level.

◆ GetCosEuler()

double GetCosEuler ( int  idx) const
inline

Retrieves the cosine of a vehicle Euler angle component.

Retrieves the cosine of an Euler angle (Phi, Theta, or Psi) from the quaternion that stores the vehicle orientation relative to the Local frame. The order of rotations used is Yaw-Pitch-Roll. The Euler angle with subscript (1) is Phi. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the Euler angle referred to in this call are, ePhi=1, eTht=2, ePsi=3 (e.g. GetCosEuler(eTht) returns cos(theta)). units none

Returns
The cosine of an Euler angle.

Definition at line 399 of file FGPropagate.h.

399 { return VState.qAttitudeLocal.GetCosEuler(idx); }
double GetCosEuler(int i) const
Retrieves cosine of the given euler angle.
Definition: FGQuaternion.h:245
FGQuaternion qAttitudeLocal
The current orientation of the vehicle, that is, the orientation of the body frame relative to the lo...
Definition: FGPropagate.h:123

◆ GetEarthPositionAngle()

double GetEarthPositionAngle ( void  ) const
inline

Returns the Earth position angle.

Returns
Earth position angle in radians.

Definition at line 431 of file FGPropagate.h.

431 { return epa; }

◆ GetEarthPositionAngleDeg()

double GetEarthPositionAngleDeg ( void  ) const
inline

Returns the Earth position angle in degrees.

Returns
Earth position angle in degrees.

Definition at line 436 of file FGPropagate.h.

436 { return epa*radtodeg;}

◆ GetEuler() [1/2]

double GetEuler ( int  axis) const
inline

Retrieves a vehicle Euler angle component.

Retrieves an Euler angle (Phi, Theta, or Psi) from the quaternion that stores the vehicle orientation relative to the Local frame. The order of rotations used is Yaw-Pitch-Roll. The Euler angle with subscript (1) is Phi. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the Euler angle returned by this call are, ePhi=1, eTht=2, ePsi=3 (e.g. GetEuler(eTht) returns Theta). units radians

Returns
An Euler angle.

Definition at line 375 of file FGPropagate.h.

375 { return VState.qAttitudeLocal.GetEuler(axis); }
const FGColumnVector3 & GetEuler(void) const
Retrieves the Euler angles.
Definition: FGQuaternion.h:199

◆ GetEuler() [2/2]

const FGColumnVector3& GetEuler ( void  ) const
inline

Retrieves the Euler angles that define the vehicle orientation.

Extracts the Euler angles from the quaternion that stores the orientation in the Local frame. The order of rotation used is Yaw-Pitch-Roll. The vector returned is represented by an FGColumnVector reference. The vector for the Euler angles is organized (Phi, Theta, Psi). The vector is 1-based, so that the first element can be retrieved using the "()" operator. In other words, the returned vector item with subscript (1) is Phi. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the vector returned by this call are, ePhi=1, eTht=2, ePsi=3. units radians

Returns
The Euler angle vector, where the first item in the vector is the angle about the X axis, the second is the angle about the Y axis, and the third item is the angle about the Z axis (Phi, Theta, Psi).

Definition at line 253 of file FGPropagate.h.

253 { return VState.qAttitudeLocal.GetEuler(); }

◆ GetEulerDeg() [1/2]

double GetEulerDeg ( int  axis) const
inline

Retrieves a vehicle Euler angle component in degrees.

Retrieves an Euler angle (Phi, Theta, or Psi) from the quaternion that stores the vehicle orientation relative to the Local frame. The order of rotations used is Yaw-Pitch-Roll. The Euler angle with subscript (1) is Phi. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the Euler angle returned by this call are, ePhi=1, eTht=2, ePsi=3 (e.g. GetEuler(eTht) returns Theta). units degrees

Returns
An Euler angle in degrees.

Definition at line 387 of file FGPropagate.h.

387 { return VState.qAttitudeLocal.GetEuler(axis) * radtodeg; }

◆ GetEulerDeg() [2/2]

FGColumnVector3 GetEulerDeg ( void  ) const

Retrieves the Euler angles (in degrees) that define the vehicle orientation.

Extracts the Euler angles from the quaternion that stores the orientation in the Local frame. The order of rotation used is Yaw-Pitch-Roll. The vector returned is represented by an FGColumnVector reference. The vector for the Euler angles is organized (Phi, Theta, Psi). The vector is 1-based, so that the first element can be retrieved using the "()" operator. In other words, the returned vector item with subscript (1) is Phi. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the vector returned by this call are, ePhi=1, eTht=2, ePsi=3. units degrees

Returns
The Euler angle vector, where the first item in the vector is the angle about the X axis, the second is the angle about the Y axis, and the third item is the angle about the Z axis (Phi, Theta, Psi).

Definition at line 693 of file FGPropagate.cpp.

694 {
695  return VState.qAttitudeLocal.GetEuler() * radtodeg;
696 }
+ Here is the call graph for this function:

◆ Gethdot()

double Gethdot ( void  ) const
inline

Returns the current altitude rate.

Returns the current altitude rate (rate of climb). units ft/sec

Returns
The current rate of change in altitude.

Definition at line 418 of file FGPropagate.h.

418 { return -vVel(eDown); }

◆ GetLocalTerrainRadius()

double GetLocalTerrainRadius ( void  ) const

Returns the "constant" LocalTerrainRadius.

The LocalTerrainRadius parameter is set by the calling application or set to sea level + terrain elevation if JSBSim is running in standalone mode. units feet

Returns
distance of the local terrain from the center of the earth.

Definition at line 617 of file FGPropagate.cpp.

618 {
619  FGLocation contact;
620  FGColumnVector3 vDummy;
621  Inertial->GetContactPoint(VState.vLocation, contact, vDummy, vDummy, vDummy);
622  return contact.GetRadius();
623 }
+ Here is the call graph for this function:

◆ GetPQR() [1/2]

double GetPQR ( int  axis) const
inline

Retrieves a body frame angular velocity component relative to the ECEF frame.

Retrieves a body frame angular velocity component. The angular velocity returned is extracted from the vPQR vector (an FGColumnVector). The vector for the angular velocity in Body frame is organized (P, Q, R). The vector is 1-based. In other words, GetPQR(1) returns P (roll rate). Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the angular velocity returned by this call are, eP=1, eQ=2, eR=3. units rad/sec

Parameters
axisthe index of the angular velocity component desired (1-based).
Returns
The body frame angular velocity component.

Definition at line 350 of file FGPropagate.h.

350 {return VState.vPQR(axis);}
FGColumnVector3 vPQR
The angular velocity vector for the vehicle relative to the ECEF frame, expressed in the body frame.
Definition: FGPropagate.h:114

◆ GetPQR() [2/2]

const FGColumnVector3& GetPQR ( void  ) const
inline

Retrieves the body angular rates vector, relative to the ECEF frame.

Retrieves the body angular rates (p, q, r), which are calculated by integration of the angular acceleration. The vector returned is represented by an FGColumnVector3 reference. The vector for the angular velocity in Body frame is organized (P, Q, R). The vector is 1-based, so that the first element can be retrieved using the "()" operator. In other words, vPQR(1) is P. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the vector returned by this call are, eP=1, eQ=2, eR=3. units rad/sec

Returns
The body frame angular rates in rad/sec.

Definition at line 211 of file FGPropagate.h.

211 {return VState.vPQR;}

◆ GetPQRi() [1/2]

double GetPQRi ( int  axis) const
inline

Retrieves a body frame angular velocity component relative to the ECI (inertial) frame.

Retrieves a body frame angular velocity component. The angular velocity returned is extracted from the vPQR vector (an FGColumnVector). The vector for the angular velocity in Body frame is organized (P, Q, R). The vector is 1-based. In other words, GetPQR(1) returns P (roll rate). Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the angular velocity returned by this call are, eP=1, eQ=2, eR=3. units rad/sec

Parameters
axisthe index of the angular velocity component desired (1-based).
Returns
The body frame angular velocity component.

Definition at line 363 of file FGPropagate.h.

363 {return VState.vPQRi(axis);}
FGColumnVector3 vPQRi
The angular velocity vector for the vehicle body frame relative to the ECI frame, expressed in the bo...
Definition: FGPropagate.h:119

◆ GetPQRi() [2/2]

const FGColumnVector3& GetPQRi ( void  ) const
inline

Retrieves the body angular rates vector, relative to the ECI (inertial) frame.

Retrieves the body angular rates (p, q, r), which are calculated by integration of the angular acceleration. The vector returned is represented by an FGColumnVector reference. The vector for the angular velocity in Body frame is organized (P, Q, R). The vector is 1-based, so that the first element can be retrieved using the "()" operator. In other words, vPQR(1) is P. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the vector returned by this call are, eP=1, eQ=2, eR=3. units rad/sec

Returns
The body frame inertial angular rates in rad/sec.

Definition at line 225 of file FGPropagate.h.

225 {return VState.vPQRi;}

◆ GetQuaterniondot()

const FGQuaternion& GetQuaterniondot ( void  ) const
inline

Retrieves the time derivative of the body orientation quaternion.

Retrieves the time derivative of the body orientation quaternion based on the rate of change of the orientation between the body and the ECI frame. The quaternion returned is represented by an FGQuaternion reference. The quaternion is 1-based, so that the first element can be retrieved using the "()" operator. units rad/sec^2

Returns
The time derivative of the body orientation quaternion.

Definition at line 236 of file FGPropagate.h.

236 {return VState.vQtrndot;}

◆ GetSinEuler()

double GetSinEuler ( int  idx) const
inline

Retrieves the sine of a vehicle Euler angle component.

Retrieves the sine of an Euler angle (Phi, Theta, or Psi) from the quaternion that stores the vehicle orientation relative to the Local frame. The order of rotations used is Yaw-Pitch-Roll. The Euler angle with subscript (1) is Phi. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the Euler angle referred to in this call are, ePhi=1, eTht=2, ePsi=3 (e.g. GetSinEuler(eTht) returns sin(theta)). units none

Returns
The sine of an Euler angle.

Definition at line 411 of file FGPropagate.h.

411 { return VState.qAttitudeLocal.GetSinEuler(idx); }
double GetSinEuler(int i) const
Retrieves sine of the given euler angle.
Definition: FGQuaternion.h:237

◆ GetTb2ec()

const FGMatrix33& GetTb2ec ( void  ) const
inline

Retrieves the body-to-ECEF transformation matrix.

Returns
a reference to the body-to-ECEF matrix.

Definition at line 481 of file FGPropagate.h.

481 { return Tb2ec; }

◆ GetTb2i()

const FGMatrix33& GetTb2i ( void  ) const
inline

Retrieves the body-to-ECI transformation matrix.

Returns
a reference to the body-to-ECI matrix.

Definition at line 489 of file FGPropagate.h.

489 { return Tb2i; }

◆ GetTb2l()

const FGMatrix33& GetTb2l ( void  ) const
inline

Retrieves the body-to-local transformation matrix.

The quaternion class, being the means by which the orientation of the vehicle is stored, manages the body-to-local transformation matrix.

Returns
a reference to the body-to-local matrix.

Definition at line 473 of file FGPropagate.h.

473 { return Tb2l; }

◆ GetTec2b()

const FGMatrix33& GetTec2b ( void  ) const
inline

Retrieves the ECEF-to-body transformation matrix.

Returns
a reference to the ECEF-to-body transformation matrix.

Definition at line 477 of file FGPropagate.h.

477 { return Tec2b; }

◆ GetTec2i()

const FGMatrix33& GetTec2i ( void  ) const
inline

Retrieves the ECEF-to-ECI transformation matrix.

Returns
a reference to the ECEF-to-ECI transformation matrix.
See also
SetEarthPositionAngle

Definition at line 494 of file FGPropagate.h.

494 { return Tec2i; }

◆ GetTec2l()

const FGMatrix33& GetTec2l ( void  ) const
inline

Retrieves the ECEF-to-local transformation matrix.

Retrieves the ECEF-to-local transformation matrix. Note that the so-called local from is also know as the NED frame (for North, East, Down).

Returns
a reference to the ECEF-to-local matrix.

Definition at line 505 of file FGPropagate.h.

505 { return Tec2l; }

◆ GetTi2b()

const FGMatrix33& GetTi2b ( void  ) const
inline

Retrieves the ECI-to-body transformation matrix.

Returns
a reference to the ECI-to-body transformation matrix.

Definition at line 485 of file FGPropagate.h.

485 { return Ti2b; }

◆ GetTi2ec()

const FGMatrix33& GetTi2ec ( void  ) const
inline

Retrieves the ECI-to-ECEF transformation matrix.

Returns
a reference to the ECI-to-ECEF matrix.
See also
SetEarthPositionAngle

Definition at line 499 of file FGPropagate.h.

499 { return Ti2ec; }

◆ GetTi2l()

const FGMatrix33& GetTi2l ( void  ) const
inline

Retrieves the inertial-to-local transformation matrix.

Returns
a reference to the inertial-to-local matrix.
See also
SetEarthPositionAngle

Definition at line 521 of file FGPropagate.h.

521 { return Ti2l; }

◆ GetTl2b()

const FGMatrix33& GetTl2b ( void  ) const
inline

Retrieves the local-to-body transformation matrix.

The quaternion class, being the means by which the orientation of the vehicle is stored, manages the local-to-body transformation matrix.

Returns
a reference to the local-to-body transformation matrix.

Definition at line 467 of file FGPropagate.h.

467 { return Tl2b; }

◆ GetTl2ec()

const FGMatrix33& GetTl2ec ( void  ) const
inline

Retrieves the local-to-ECEF transformation matrix.

Retrieves the local-to-ECEF transformation matrix. Note that the so-called local from is also know as the NED frame (for North, East, Down).

Returns
a reference to the local-to-ECEF matrix.

Definition at line 511 of file FGPropagate.h.

511 { return Tl2ec; }

◆ GetTl2i()

const FGMatrix33& GetTl2i ( void  ) const
inline

Retrieves the local-to-inertial transformation matrix.

Returns
a reference to the local-to-inertial transformation matrix.
See also
SetEarthPositionAngle

Definition at line 516 of file FGPropagate.h.

516 { return Tl2i; }

◆ GetUVW() [1/2]

double GetUVW ( int  idx) const
inline

Retrieves a body frame velocity component.

Retrieves a body frame velocity component. The velocity returned is extracted from the vUVW vector (an FGColumnVector). The vector for the velocity in Body frame is organized (Vx, Vy, Vz). The vector is 1-based. In other words, GetUVW(1) returns Vx. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the velocity returned by this call are, eX=1, eY=2, eZ=3. units ft/sec

Parameters
idxthe index of the velocity component desired (1-based).
Returns
The body frame velocity component.

Definition at line 283 of file FGPropagate.h.

283 { return VState.vUVW(idx); }
FGColumnVector3 vUVW
The velocity vector of the vehicle with respect to the ECEF frame, expressed in the body system.
Definition: FGPropagate.h:109

◆ GetUVW() [2/2]

const FGColumnVector3& GetUVW ( void  ) const
inline

Retrieves the body frame vehicle velocity vector.

The vector returned is represented by an FGColumnVector3 reference. The vector for the velocity in Body frame is organized (Vx, Vy, Vz). The vector is 1-based, so that the first element can be retrieved using the "()" operator. In other words, vUVW(1) is Vx. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the vector returned by this call are, eX=1, eY=2, eZ=3. units ft/sec

Returns
The body frame vehicle velocity vector in ft/sec.

Definition at line 197 of file FGPropagate.h.

197 { return VState.vUVW; }

◆ GetVel() [1/2]

double GetVel ( int  idx) const
inline

Retrieves a Local frame velocity component.

Retrieves a Local frame velocity component. The velocity returned is extracted from the vVel vector (an FGColumnVector). The vector for the velocity in Local frame is organized (Vnorth, Veast, Vdown). The vector is 1-based. In other words, GetVel(1) returns Vnorth. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the velocity returned by this call are, eNorth=1, eEast=2, eDown=3. units ft/sec

Parameters
idxthe index of the velocity component desired (1-based).
Returns
The body frame velocity component.

Definition at line 296 of file FGPropagate.h.

296 { return vVel(idx); }

◆ GetVel() [2/2]

const FGColumnVector3& GetVel ( void  ) const
inline

Retrieves the velocity vector.

The vector returned is represented by an FGColumnVector reference. The vector for the velocity in Local frame is organized (Vnorth, Veast, Vdown). The vector is 1-based, so that the first element can be retrieved using the "()" operator. In other words, vVel(1) is Vnorth. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the vector returned by this call are, eNorth=1, eEast=2, eDown=3. units ft/sec

Returns
The vehicle velocity vector with respect to the Earth centered frame, expressed in Local horizontal frame.

Definition at line 185 of file FGPropagate.h.

185 { return vVel; }

◆ InitModel()

bool InitModel ( void  )
virtual

Initializes the FGPropagate class after instantiation and prior to first execution.

The base class FGModel::InitModel is called first, initializing pointers to the other FGModel objects (and others).

Reimplemented from FGModel.

Definition at line 118 of file FGPropagate.cpp.

119 {
120  if (!FGModel::InitModel()) return false;
121 
122  // For initialization ONLY:
123  VState.vLocation.SetEllipse(in.SemiMajor, in.SemiMinor);
124  Inertial->SetAltitudeAGL(VState.vLocation, 4.0);
125 
126  VState.dqPQRidot.resize(5, FGColumnVector3(0.0,0.0,0.0));
127  VState.dqUVWidot.resize(5, FGColumnVector3(0.0,0.0,0.0));
128  VState.dqInertialVelocity.resize(5, FGColumnVector3(0.0,0.0,0.0));
129  VState.dqQtrndot.resize(5, FGColumnVector3(0.0,0.0,0.0));
130 
131  integrator_rotational_rate = eRectEuler;
132  integrator_translational_rate = eAdamsBashforth2;
133  integrator_rotational_position = eRectEuler;
134  integrator_translational_position = eAdamsBashforth3;
135 
136  epa = 0.0;
137 
138  return true;
139 }
void SetEllipse(double semimajor, double semiminor)
Sets the semimajor and semiminor axis lengths for this planet.
Definition: FGLocation.cpp:259
+ Here is the call graph for this function:

◆ Run()

bool Run ( bool  Holding)
virtual

Runs the state propagation model; called by the Executive Can pass in a value indicating if the executive is directing the simulation to Hold.

Parameters
Holdingif true, the executive has been directed to hold the sim from advancing time. Some models may ignore this flag, such as the Input model, which may need to be active to listen on a socket for the "Resume" command to be given.
Returns
false if no error

Reimplemented from FGModel.

Definition at line 218 of file FGPropagate.cpp.

219 {
220  if (FGModel::Run(Holding)) return true; // Fast return if we have nothing to do ...
221  if (Holding) return false;
222 
223  double dt = in.DeltaT * rate; // The 'stepsize'
224 
225  // Propagate rotational / translational velocity, angular /translational position, respectively.
226 
227  if (!FDMExec->IntegrationSuspended()) {
228  Integrate(VState.qAttitudeECI, VState.vQtrndot, VState.dqQtrndot, dt, integrator_rotational_position);
229  Integrate(VState.vPQRi, in.vPQRidot, VState.dqPQRidot, dt, integrator_rotational_rate);
230  Integrate(VState.vInertialPosition, VState.vInertialVelocity, VState.dqInertialVelocity, dt, integrator_translational_position);
231  Integrate(VState.vInertialVelocity, in.vUVWidot, VState.dqUVWidot, dt, integrator_translational_rate);
232  }
233 
234  // CAUTION : the order of the operations below is very important to get
235  // transformation matrices that are consistent with the new state of the
236  // vehicle
237 
238  // 1. Update the Earth position angle (EPA)
239  epa += in.vOmegaPlanet(eZ)*dt;
240 
241  // 2. Update the Ti2ec and Tec2i transforms from the updated EPA
242  double cos_epa = cos(epa);
243  double sin_epa = sin(epa);
244  Ti2ec = { cos_epa, sin_epa, 0.0,
245  -sin_epa, cos_epa, 0.0,
246  0.0, 0.0, 1.0 };
247  Tec2i = Ti2ec.Transposed(); // ECEF to ECI frame transform
248 
249  // 3. Update the location from the updated Ti2ec and inertial position
250  VState.vLocation = Ti2ec*VState.vInertialPosition;
251 
252  // 4. Update the other "Location-based" transformation matrices from the
253  // updated vLocation vector.
254  UpdateLocationMatrices();
255 
256  // 5. Update the "Orientation-based" transformation matrices from the updated
257  // orientation quaternion and vLocation vector.
258  UpdateBodyMatrices();
259 
260  // Translational position derivative (velocities are integrated in the
261  // inertial frame)
262  CalculateUVW();
263 
264  // Set auxilliary state variables
265  RecomputeLocalTerrainVelocity();
266 
267  VState.vPQR = VState.vPQRi - Ti2b * in.vOmegaPlanet;
268 
269  // Angular orientation derivative
270  CalculateQuatdot();
271 
272  VState.qAttitudeLocal = Tl2b.GetQuaternion();
273 
274  // Compute vehicle velocity wrt ECEF frame, expressed in Local horizontal
275  // frame.
276  vVel = Tb2l * VState.vUVW;
277 
278  // Compute orbital parameters in the inertial frame
279  ComputeOrbitalParameters();
280 
281  Debug(2);
282  return false;
283 }
bool IntegrationSuspended(void) const
Returns the simulation suspension state.
Definition: FGFDMExec.h:557
FGMatrix33 Transposed(void) const
Transposed matrix.
Definition: FGMatrix33.h:221
FGQuaternion GetQuaternion(void) const
Returns the quaternion associated with this direction cosine (rotation) matrix.
Definition: FGMatrix33.cpp:106
virtual bool Run(bool Holding)
Runs the model; called by the Executive.
Definition: FGModel.cpp:89
FGQuaternion qAttitudeECI
The current orientation of the vehicle, that is, the orientation of the body frame relative to the in...
Definition: FGPropagate.h:127
+ Here is the call graph for this function:

◆ SetEarthPositionAngle()

void SetEarthPositionAngle ( double  EPA)
inline

Sets the Earth position angle.

This is the relative angle around the Z axis of the ECEF frame with respect to the inertial frame.

Parameters
EPAEarth position angle in radians.

Definition at line 532 of file FGPropagate.h.

532 {epa = EPA;}

◆ SetHoldDown()

void SetHoldDown ( bool  hd)

Sets the property forces/hold-down.

This allows to do hard 'hold-down' such as for rockets on a launch pad with engines ignited.

Parameters
hdenables the 'hold-down' function if non-zero

Definition at line 287 of file FGPropagate.cpp.

288 {
289  if (hd) {
290  VState.vUVW.InitMatrix();
291  CalculateInertialVelocity();
292  VState.vPQR.InitMatrix();
293  VState.vPQRi = Ti2b * in.vOmegaPlanet;
294  CalculateQuatdot();
295  InitializeDerivatives();
296  }
297 }
+ Here is the caller graph for this function:

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