JSBSim Flight Dynamics Model 1.0 (23 February 2013)
An Open Source Flight Dynamics and Control Software Library in C++

FGPropagate Class Reference

Models the EOM and integration/propagation of state. More...

#include <FGPropagate.h>

Inheritance diagram for FGPropagate:
Collaboration diagram for FGPropagate:

List of all members.

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, eNone = 0, eRectEuler, eTrapezoidal,
  eAdamsBashforth2, eAdamsBashforth3, eAdamsBashforth4
}
 

These define the indices use to select the various integrators.


enum  eIntegrateType {
  eNone = 0, eRectEuler, eTrapezoidal, eAdamsBashforth2,
  eAdamsBashforth3, eAdamsBashforth4, eBuss1, eBuss2,
  eLocalLinearization, eNone = 0, eRectEuler, eTrapezoidal,
  eAdamsBashforth2, eAdamsBashforth3, eAdamsBashforth4
}
 

These define the indices use to select the various integrators.


Public Member Functions

 FGPropagate (FGFDMExec *Executive)
 Constructor.
 FGPropagate (FGFDMExec *Executive)
 Constructor.
 ~FGPropagate ()
 Destructor.
 ~FGPropagate ()
 Destructor.
void DumpState (void)
void DumpState (void)
double GetAltitudeASL (void) const
 Returns the current altitude above sea level.
double GetAltitudeASL (void) const
 Returns the current altitude above sea level.
double GetAltitudeASLmeters (void) const
 Returns the current altitude above sea level.
double GetAltitudeASLmeters (void) const
 Returns the current altitude above sea level.
double GetCosEuler (int idx) const
 Retrieves the cosine of a vehicle Euler angle component.
double GetCosEuler (int idx) const
 Retrieves the cosine of a vehicle Euler angle component.
double GetDistanceAGL (void) const
double GetDistanceAGL (void) const
double GetEarthPositionAngle (void) const
double GetEarthPositionAngleDeg (void) const
FGColumnVector3 GetECEFVelocity (void) const
 Calculates and retrieves the velocity vector relative to the earth centered earth fixed (ECEF) frame.
const 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.
const FGColumnVector3GetEuler (void) const
 Retrieves the Euler angles that define the vehicle orientation.
const FGColumnVector3GetEuler (void) const
 Retrieves the Euler angles that define the vehicle orientation.
double GetEuler (int axis) const
 Retrieves a vehicle Euler angle component.
double GetGeodeticAltitude (void) const
double GetGeodeticAltitude (void) const
double GetGeodLatitudeDeg (void) const
double GetGeodLatitudeDeg (void) const
double GetGeodLatitudeRad (void) const
double GetGeodLatitudeRad (void) const
double Gethdot (void) const
 Returns the current altitude rate.
double Gethdot (void) const
 Returns the current altitude rate.
const FGColumnVector3GetInertialPosition (void) const
 Retrieves the inertial position vector.
const FGColumnVector3GetInertialPosition (void) const
 Retrieves the inertial position vector.
const FGColumnVector3GetInertialVelocity (void) const
 Retrieves the inertial velocity vector in ft/sec.
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 GetInertialVelocityMagnitude (void) const
 Retrieves the total inertial velocity in ft/sec.
double GetLatitude (void) const
double GetLatitude (void) const
double GetLatitudeDeg (void) const
double GetLatitudeDeg (void) const
double GetLocalTerrainRadius (void) const
 Returns the "constant" LocalTerrainRadius.
double GetLocalTerrainRadius (void) const
 Returns the "constant" LocalTerrainRadius.
const FGLocationGetLocation (void) const
const FGLocationGetLocation (void) const
double GetLongitude (void) const
double GetLongitude (void) const
double GetLongitudeDeg (void) const
double GetLongitudeDeg (void) const
const FGColumnVector3GetPQR (void) const
 Retrieves the body angular rates vector, relative to the ECEF frame.
double GetPQR (int axis) const
 Retrieves a body frame angular velocity component relative to the ECEF frame.
const FGColumnVector3GetPQR (void) const
 Retrieves the body angular rates vector, relative to the ECEF frame.
double GetPQR (int axis) const
 Retrieves a body frame angular velocity component relative to the ECEF frame.
const FGColumnVector3GetPQRi (void) const
 Retrieves the body angular rates vector, relative to the ECI (inertial) frame.
double GetPQRi (int axis) const
 Retrieves a body frame angular velocity component relative to the ECI (inertial) frame.
const FGColumnVector3GetPQRi (void) const
 Retrieves the body angular rates vector, relative to the ECI (inertial) frame.
double GetPQRi (int axis) const
 Retrieves a body frame angular velocity component relative to the ECI (inertial) frame.
const FGQuaternion GetQuaternion (void) const
const FGQuaternion GetQuaternion (void) const
 Returns the quaternion that goes from Local to Body.
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 GetRadius (void) const
double GetSinEuler (int idx) const
 Retrieves the sine of a vehicle Euler angle component.
double GetSinEuler (int idx) const
 Retrieves the sine of a vehicle Euler angle component.
const FGMatrix33GetTb2ec (void) const
 Retrieves the body-to-ECEF transformation matrix.
const FGMatrix33GetTb2ec (void) const
 Retrieves the body-to-ECEF transformation matrix.
const FGMatrix33GetTb2i (void) const
 Retrieves the body-to-ECI transformation matrix.
const FGMatrix33GetTb2i (void) const
 Retrieves the body-to-ECI transformation matrix.
const FGMatrix33GetTb2l (void) const
 Retrieves the body-to-local transformation matrix.
const FGMatrix33GetTb2l (void) const
 Retrieves the body-to-local transformation matrix.
const FGMatrix33GetTec2b (void) const
 Retrieves the ECEF-to-body transformation matrix.
const FGMatrix33GetTec2b (void) const
 Retrieves the ECEF-to-body transformation matrix.
const FGMatrix33GetTec2i (void) const
 Retrieves the ECEF-to-ECI transformation matrix.
const FGMatrix33GetTec2i (void) const
 Retrieves the ECEF-to-ECI transformation matrix.
const FGMatrix33GetTec2l (void) const
 Retrieves the ECEF-to-local transformation matrix.
const FGMatrix33GetTec2l (void) const
 Retrieves the ECEF-to-local transformation matrix.
const FGColumnVector3GetTerrainAngularVelocity (void) const
double GetTerrainElevation (void) const
double GetTerrainElevation (void) const
const FGColumnVector3GetTerrainVelocity (void) const
const FGMatrix33GetTi2b (void) const
 Retrieves the ECI-to-body transformation matrix.
const FGMatrix33GetTi2b (void) const
 Retrieves the ECI-to-body transformation matrix.
const FGMatrix33GetTi2ec (void) const
 Retrieves the ECI-to-ECEF transformation matrix.
const FGMatrix33GetTi2ec (void) const
 Retrieves the ECI-to-ECEF transformation matrix.
const FGMatrix33GetTi2l (void) const
 Retrieves the inertial-to-local transformation matrix.
const FGMatrix33GetTi2l (void) const
 Retrieves the inertial-to-local transformation matrix.
const FGMatrix33GetTl2b (void) const
 Retrieves the local-to-body transformation matrix.
const FGMatrix33GetTl2b (void) const
 Retrieves the local-to-body transformation matrix.
const FGMatrix33GetTl2ec (void) const
 Retrieves the local-to-ECEF transformation matrix.
const FGMatrix33GetTl2ec (void) const
 Retrieves the local-to-ECEF transformation matrix.
const FGMatrix33GetTl2i (void) const
 Retrieves the local-to-inertial transformation matrix.
const FGMatrix33GetTl2i (void) const
 Retrieves the local-to-inertial transformation matrix.
double GetUVW (int idx) const
 Retrieves a body frame velocity component.
const FGColumnVector3GetUVW (void) const
 Retrieves the body frame vehicle velocity vector.
double GetUVW (int idx) const
 Retrieves a body frame velocity component.
const FGColumnVector3GetUVW (void) const
 Retrieves the body frame vehicle velocity vector.
const FGColumnVector3GetVel (void) const
 Retrieves the velocity vector.
double GetVel (int idx) const
 Retrieves a Local frame velocity component.
double GetVel (int idx) const
 Retrieves a Local frame velocity component.
const FGColumnVector3GetVel (void) const
 Retrieves the velocity vector.
const VehicleStateGetVState (void) const
const VehicleStateGetVState (void) const
void InitializeDerivatives ()
bool InitModel (void)
 Initializes the FGPropagate class after instantiation and prior to first execution.
bool InitModel (void)
 Initializes the FGPropagate class after instantiation and prior to first execution.
void NudgeBodyLocation (FGColumnVector3 deltaLoc)
void NudgeBodyLocation (const FGColumnVector3 &deltaLoc)
void RecomputeLocalTerrainRadius (void)
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.
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.
void SetAltitudeASL (double altASL)
void SetAltitudeASL (double altASL)
void SetAltitudeASLmeters (double altASL)
void SetAltitudeASLmeters (double altASL)
void SetDistanceAGL (double tt)
void SetDistanceAGL (double tt)
void SetEarthPositionAngle (double epa)
void SetInertialOrientation (FGQuaternion Qi)
void SetInertialOrientation (const FGQuaternion &Qi)
void SetInertialRates (FGColumnVector3 vRates)
void SetInertialRates (const FGColumnVector3 &vRates)
void SetInertialVelocity (const FGColumnVector3 &Vi)
void SetInertialVelocity (FGColumnVector3 Vi)
void SetInitialState (const FGInitialCondition *)
void SetInitialState (const FGInitialCondition *)
void SetLatitude (double lat)
void SetLatitude (double lat)
void SetLatitudeDeg (double lat)
void SetLatitudeDeg (double lat)
void SetLocation (const FGColumnVector3 &lv)
void SetLocation (const FGLocation &l)
void SetLocation (const FGLocation &l)
void SetLocation (const FGColumnVector3 &lv)
void SetLongitude (double lon)
void SetLongitude (double lon)
void SetLongitudeDeg (double lon)
void SetLongitudeDeg (double lon)
void SetPosition (const double Lon, const double Lat, const double Radius)
void SetPosition (const double Lon, const double Lat, const double Radius)
void SetPQR (unsigned int i, double val)
void SetPQR (unsigned int i, double val)
void SetRadius (double r)
void SetRadius (double r)
void SetSeaLevelRadius (double tt)
void SetSeaLevelRadius (double tt)
void SetTerrainElevation (double tt)
void SetTerrainElevation (double tt)
void SetUVW (unsigned int i, double val)
void SetUVW (unsigned int i, double val)
void SetVState (const VehicleState &vstate)
void SetVState (const VehicleState &vstate)

Public Attributes

struct JSBSim::FGPropagate::Inputs in

Detailed Description

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
Version:
Id:
FGPropagate.h,v 1.74 2013/01/19 13:49:37 bcoconni Exp

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
Version:
Id:
FGPropagate.h,v 1.60 2011/07/10 20:18:14 jberndt Exp

Definition at line 103 of file FGPropagate.h.


Constructor & Destructor Documentation

FGPropagate ( FGFDMExec Executive)

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.

These define the indices use to select the various integrators.

Definition at line 87 of file FGPropagate.cpp.

  : FGModel(fdmex),
    VehicleRadius(0)
{
  Debug(0);
  Name = "FGPropagate";

  // eNone = 0, eRectEuler, eTrapezoidal, eAdamsBashforth2, eAdamsBashforth3, eAdamsBashforth4};

  integrator_rotational_rate = eRectEuler;
  integrator_translational_rate = eAdamsBashforth2;
  integrator_rotational_position = eRectEuler;
  integrator_translational_position = eAdamsBashforth3;

  VState.dqPQRidot.resize(4, FGColumnVector3(0.0,0.0,0.0));
  VState.dqUVWidot.resize(4, FGColumnVector3(0.0,0.0,0.0));
  VState.dqInertialVelocity.resize(4, FGColumnVector3(0.0,0.0,0.0));
  VState.dqQtrndot.resize(4, FGQuaternion(0.0,0.0,0.0));

  bind();
  Debug(0);
}
FGPropagate ( FGFDMExec Executive)

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

Member Function Documentation

double GetAltitudeASL ( void  ) const [inline]

This function returns the altitude above sea level. units ft

Returns:
The current altitude above sea level in feet.

Definition at line 297 of file FGPropagate.h.

References FGLocation::GetAltitudeASL(), and FGPropagate::VehicleState::vLocation.

Referenced by FGPropagate::GetAltitudeASLmeters(), FGOutputSocket::Print(), and MSIS::Run().

{ return VState.vLocation.GetAltitudeASL(); }

Here is the call graph for this function:

Here is the caller graph for this function:

double GetAltitudeASL ( void  ) const [inline]

This function returns the altitude above sea level. units ft

Returns:
The current altitude above sea level in feet.

Definition at line 294 of file FGPropagate2.h.

References FGLocation::GetRadius(), and FGPropagate::VehicleState::vLocation.

{ return VState.vLocation.GetRadius() - SeaLevelRadius; }

Here is the call graph for this function:

double GetAltitudeASLmeters ( void  ) const [inline]

This function returns the altitude above sea level. units meters

Returns:
The current altitude above sea level in meters.

Definition at line 304 of file FGPropagate.h.

References FGPropagate::GetAltitudeASL().

{ return GetAltitudeASL()*fttom;}

Here is the call graph for this function:

double GetAltitudeASLmeters ( void  ) const [inline]

This function returns the altitude above sea level. units meters

Returns:
The current altitude above sea level in meters.

Definition at line 301 of file FGPropagate2.h.

References FGPropagate::GetAltitudeASL().

{ return GetAltitudeASL()*fttom;}

Here is the call graph for this function:

double GetCosEuler ( int  idx) const [inline]

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 354 of file FGPropagate.h.

References FGQuaternion::GetCosEuler(), and FGPropagate::VehicleState::qAttitudeLocal.

Referenced by FGTrimAnalysisControl::SetPhiOnGround(), and FGTrimAnalysisControl::SetThetaOnGround().

{ return VState.qAttitudeLocal.GetCosEuler(idx); }

Here is the call graph for this function:

Here is the caller graph for this function:

double GetCosEuler ( int  idx) const [inline]

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 351 of file FGPropagate2.h.

References FGQuaternion::GetCosEuler(), and FGPropagate::VehicleState::qAttitudeLocal.

{ return VState.qAttitudeLocal.GetCosEuler(idx); }

Here is the call graph for this function:

double GetEuler ( int  axis) const [inline]

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 342 of file FGPropagate.h.

References FGQuaternion::GetEuler(), and FGPropagate::VehicleState::qAttitudeLocal.

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

Here is the call graph for this function:

const FGColumnVector3& GetEuler ( void  ) const [inline]

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 245 of file FGPropagate2.h.

References FGQuaternion::GetEuler(), and FGPropagate::VehicleState::qAttitudeLocal.

{ return VState.qAttitudeLocal.GetEuler(); }

Here is the call graph for this function:

double GetEuler ( int  axis) const [inline]

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 339 of file FGPropagate2.h.

References FGQuaternion::GetEuler(), and FGPropagate::VehicleState::qAttitudeLocal.

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

Here is the call graph for this function:

const FGColumnVector3& GetEuler ( void  ) const [inline]

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 248 of file FGPropagate.h.

References FGQuaternion::GetEuler(), and FGPropagate::VehicleState::qAttitudeLocal.

Referenced by FGTrimAnalysisControl::FGTrimAnalysisControl(), FGTrimAnalysisControl::initTheta(), and FGOutputSocket::Print().

{ return VState.qAttitudeLocal.GetEuler(); }

Here is the call graph for this function:

Here is the caller graph for this function:

double Gethdot ( void  ) const [inline]

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

Returns:
The current rate of change in altitude.

Definition at line 373 of file FGPropagate.h.

{ return -vVel(eDown); }
double Gethdot ( void  ) const [inline]

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

Returns:
The current rate of change in altitude.

Definition at line 370 of file FGPropagate2.h.

{ return -vVel(eDown); }
double GetLocalTerrainRadius ( void  ) const

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 498 of file FGPropagate.cpp.

References FGFDMExec::GetSimTime(), FGLocation::GetTerrainRadius(), and FGPropagate::VehicleState::vLocation.

{
  return VState.vLocation.GetTerrainRadius(FDMExec->GetSimTime());
}

Here is the call graph for this function:

double GetLocalTerrainRadius ( void  ) const [inline]

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 378 of file FGPropagate2.h.

{ return LocalTerrainRadius; }
double GetPQR ( int  axis) const [inline]

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 317 of file FGPropagate.h.

References FGPropagate::VehicleState::vPQR.

{return VState.vPQR(axis);}
const FGColumnVector3& GetPQR ( void  ) const [inline]

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 angular rates in rad/sec.

Definition at line 214 of file FGPropagate2.h.

References FGPropagate::VehicleState::vPQR.

{return VState.vPQR;}
const FGColumnVector3& GetPQR ( void  ) const [inline]

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 angular rates in rad/sec.

Definition at line 217 of file FGPropagate.h.

References FGPropagate::VehicleState::vPQR.

Referenced by FGOutputSocket::Print().

{return VState.vPQR;}

Here is the caller graph for this function:

double GetPQR ( int  axis) const [inline]

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 314 of file FGPropagate2.h.

References FGPropagate::VehicleState::vPQR.

{return VState.vPQR(axis);}
double GetPQRi ( int  axis) const [inline]

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 330 of file FGPropagate.h.

References FGPropagate::VehicleState::vPQRi.

{return VState.vPQRi(axis);}
const FGColumnVector3& GetPQRi ( void  ) const [inline]

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 228 of file FGPropagate2.h.

References FGPropagate::VehicleState::vPQRi.

{return VState.vPQRi;}
double GetPQRi ( int  axis) const [inline]

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 327 of file FGPropagate2.h.

References FGPropagate::VehicleState::vPQRi.

{return VState.vPQRi(axis);}
const FGColumnVector3& GetPQRi ( void  ) const [inline]

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 231 of file FGPropagate.h.

References FGPropagate::VehicleState::vPQRi.

{return VState.vPQRi;}
const FGQuaternion GetQuaternion ( void  ) const [inline]

Definition at line 476 of file FGPropagate.h.

References FGPropagate::VehicleState::qAttitudeLocal.

{ return VState.qAttitudeLocal; }
const FGQuaternion GetQuaternionECEF ( void  ) const [inline]

Definition at line 482 of file FGPropagate.h.

{ return Qec2b; }
const FGQuaternion GetQuaternionECI ( void  ) const [inline]

Definition at line 479 of file FGPropagate.h.

References FGPropagate::VehicleState::qAttitudeECI.

{ return VState.qAttitudeECI; }
double GetSinEuler ( int  idx) const [inline]

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 366 of file FGPropagate.h.

References FGQuaternion::GetSinEuler(), and FGPropagate::VehicleState::qAttitudeLocal.

Referenced by FGTrimAnalysisControl::SetPhiOnGround(), and FGTrimAnalysisControl::SetThetaOnGround().

{ return VState.qAttitudeLocal.GetSinEuler(idx); }

Here is the call graph for this function:

Here is the caller graph for this function:

double GetSinEuler ( int  idx) const [inline]

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 363 of file FGPropagate2.h.

References FGQuaternion::GetSinEuler(), and FGPropagate::VehicleState::qAttitudeLocal.

{ return VState.qAttitudeLocal.GetSinEuler(idx); }

Here is the call graph for this function:

const FGMatrix33& GetTb2ec ( void  ) const [inline]
Returns:
a reference to the body-to-ECEF matrix.

Definition at line 427 of file FGPropagate.h.

{ return Tb2ec; }
const FGMatrix33& GetTb2ec ( void  ) const [inline]
Returns:
a reference to the body-to-ECEF matrix.

Definition at line 416 of file FGPropagate2.h.

{ return Tb2ec; }
const FGMatrix33& GetTb2i ( void  ) const [inline]
Returns:
a reference to the body-to-ECI matrix.

Definition at line 435 of file FGPropagate.h.

{ return Tb2i; }
const FGMatrix33& GetTb2i ( void  ) const [inline]
Returns:
a reference to the body-to-ECI matrix.

Definition at line 424 of file FGPropagate2.h.

{ return Tb2i; }
const FGMatrix33& GetTb2l ( void  ) const [inline]

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 419 of file FGPropagate.h.

{ return Tb2l; }
const FGMatrix33& GetTb2l ( void  ) const [inline]

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 408 of file FGPropagate2.h.

{ return Tb2l; }
const FGMatrix33& GetTec2b ( void  ) const [inline]
Returns:
a reference to the ECEF-to-body transformation matrix.

Definition at line 423 of file FGPropagate.h.

{ return Tec2b; }
const FGMatrix33& GetTec2b ( void  ) const [inline]
Returns:
a reference to the ECEF-to-body transformation matrix.

Definition at line 412 of file FGPropagate2.h.

{ return Tec2b; }
const FGMatrix33& GetTec2i ( void  ) const [inline]
Returns:
a reference to the ECEF-to-ECI transformation matrix.

Definition at line 439 of file FGPropagate.h.

{ return Tec2i; }
const FGMatrix33& GetTec2i ( void  ) const [inline]
Returns:
a reference to the ECEF-to-ECI transformation matrix.

Definition at line 428 of file FGPropagate2.h.

{ return Tec2i; }
const FGMatrix33& GetTec2l ( void  ) const [inline]

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 449 of file FGPropagate.h.

{ return Tec2l; }
const FGMatrix33& GetTec2l ( void  ) const [inline]

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 438 of file FGPropagate2.h.

{ return Tec2l; }
const FGMatrix33& GetTi2b ( void  ) const [inline]
Returns:
a reference to the ECI-to-body transformation matrix.

Definition at line 431 of file FGPropagate.h.

{ return Ti2b; }
const FGMatrix33& GetTi2b ( void  ) const [inline]
Returns:
a reference to the ECI-to-body transformation matrix.

Definition at line 420 of file FGPropagate2.h.

{ return Ti2b; }
const FGMatrix33& GetTi2ec ( void  ) const [inline]
Returns:
a reference to the ECI-to-ECEF matrix.

Definition at line 432 of file FGPropagate2.h.

{ return Ti2ec; }
const FGMatrix33& GetTi2ec ( void  ) const [inline]
Returns:
a reference to the ECI-to-ECEF matrix.

Definition at line 443 of file FGPropagate.h.

{ return Ti2ec; }
const FGMatrix33& GetTi2l ( void  ) const [inline]
Returns:
a reference to the inertial-to-local matrix.

Definition at line 463 of file FGPropagate.h.

{ return Ti2l; }
const FGMatrix33& GetTi2l ( void  ) const [inline]
Returns:
a reference to the inertial-to-local matrix.

Definition at line 452 of file FGPropagate2.h.

{ return Ti2l; }
const FGMatrix33& GetTl2b ( void  ) const [inline]

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 413 of file FGPropagate.h.

{ return Tl2b; }
const FGMatrix33& GetTl2b ( void  ) const [inline]

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 402 of file FGPropagate2.h.

{ return Tl2b; }
const FGMatrix33& GetTl2ec ( void  ) const [inline]

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 455 of file FGPropagate.h.

{ return Tl2ec; }
const FGMatrix33& GetTl2ec ( void  ) const [inline]

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 444 of file FGPropagate2.h.

{ return Tl2ec; }
const FGMatrix33& GetTl2i ( void  ) const [inline]
Returns:
a reference to the local-to-inertial transformation matrix.

Definition at line 459 of file FGPropagate.h.

{ return Tl2i; }
const FGMatrix33& GetTl2i ( void  ) const [inline]
Returns:
a reference to the local-to-inertial transformation matrix.

Definition at line 448 of file FGPropagate2.h.

{ return Tl2i; }
double GetUVW ( int  idx) const [inline]

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 261 of file FGPropagate.h.

References FGPropagate::VehicleState::vUVW.

{ return VState.vUVW(idx); }
const FGColumnVector3& GetUVW ( void  ) const [inline]

The vector returned is represented by an FGColumnVector 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 200 of file FGPropagate2.h.

References FGPropagate::VehicleState::vUVW.

{ return VState.vUVW; }
const FGColumnVector3& GetUVW ( void  ) const [inline]

The vector returned is represented by an FGColumnVector 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 203 of file FGPropagate.h.

References FGPropagate::VehicleState::vUVW.

Referenced by FGOutputSocket::Print().

{ return VState.vUVW; }

Here is the caller graph for this function:

double GetUVW ( int  idx) const [inline]

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 258 of file FGPropagate2.h.

References FGPropagate::VehicleState::vUVW.

{ return VState.vUVW(idx); }
const FGColumnVector3& GetVel ( void  ) const [inline]

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 191 of file FGPropagate.h.

Referenced by FGOutputSocket::Print().

{ return vVel; }

Here is the caller graph for this function:

const FGColumnVector3& GetVel ( void  ) const [inline]

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 188 of file FGPropagate2.h.

{ return vVel; }
double GetVel ( int  idx) const [inline]

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 271 of file FGPropagate2.h.

{ return vVel(idx); }
double GetVel ( int  idx) const [inline]

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 274 of file FGPropagate.h.

{ return vVel(idx); }
bool InitModel ( void  ) [virtual]

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

Reimplemented from FGModel.

Definition at line 120 of file FGPropagate.cpp.

References FGFDMExec::GetSimTime(), FGLocation::SetAltitudeAGL(), FGLocation::SetEllipse(), and FGPropagate::VehicleState::vLocation.

{
  // For initialization ONLY:
  VState.vLocation.SetEllipse(in.SemiMajor, in.SemiMinor);
  VState.vLocation.SetAltitudeAGL(4.0, FDMExec->GetSimTime());

  VState.dqPQRidot.resize(4, FGColumnVector3(0.0,0.0,0.0));
  VState.dqUVWidot.resize(4, FGColumnVector3(0.0,0.0,0.0));
  VState.dqInertialVelocity.resize(4, FGColumnVector3(0.0,0.0,0.0));
  VState.dqQtrndot.resize(4, FGColumnVector3(0.0,0.0,0.0));

  integrator_rotational_rate = eRectEuler;
  integrator_translational_rate = eAdamsBashforth2;
  integrator_rotational_position = eRectEuler;
  integrator_translational_position = eAdamsBashforth3;

  return true;
}

Here is the call graph for this function:

bool InitModel ( void  ) [virtual]

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

Reimplemented from FGModel.

bool Run ( bool  Holding) [virtual]
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 215 of file FGPropagate.cpp.

References FGMatrix33::GetQuaternion(), FGLocation::GetTi2ec(), FGLocation::IncrementEarthPositionAngle(), FGPropagate::VehicleState::qAttitudeECI, FGPropagate::VehicleState::qAttitudeLocal, FGModel::Run(), FGMatrix33::Transposed(), FGPropagate::VehicleState::vLocation, FGPropagate::VehicleState::vPQR, FGPropagate::VehicleState::vPQRi, and FGPropagate::VehicleState::vUVW.

{
  if (FGModel::Run(Holding)) return true;  // Fast return if we have nothing to do ...
  if (Holding) return false;

  double dt = in.DeltaT * rate;  // The 'stepsize'

  // Propagate rotational / translational velocity, angular /translational position, respectively.

  Integrate(VState.qAttitudeECI,      in.vQtrndot,          VState.dqQtrndot,          dt, integrator_rotational_position);
  Integrate(VState.vPQRi,             in.vPQRidot,          VState.dqPQRidot,          dt, integrator_rotational_rate);
  Integrate(VState.vInertialPosition, VState.vInertialVelocity, VState.dqInertialVelocity, dt, integrator_translational_position);
  Integrate(VState.vInertialVelocity, in.vUVWidot,          VState.dqUVWidot,          dt, integrator_translational_rate);

  // CAUTION : the order of the operations below is very important to get transformation
  // matrices that are consistent with the new state of the vehicle

  // 1. Update the Earth position angle (EPA)
  VState.vLocation.IncrementEarthPositionAngle(in.vOmegaPlanet(eZ)*(in.DeltaT*rate));

  // 2. Update the Ti2ec and Tec2i transforms from the updated EPA
  Ti2ec = VState.vLocation.GetTi2ec(); // ECI to ECEF transform
  Tec2i = Ti2ec.Transposed();          // ECEF to ECI frame transform

  // 3. Update the location from the updated Ti2ec and inertial position
  VState.vLocation = Ti2ec*VState.vInertialPosition;

  // 4. Update the other "Location-based" transformation matrices from the updated
  //    vLocation vector.
  UpdateLocationMatrices();

  // 5. Update the "Orientation-based" transformation matrices from the updated
  //    orientation quaternion and vLocation vector.
  UpdateBodyMatrices();

  // Translational position derivative (velocities are integrated in the inertial frame)
  CalculateUVW();

  // Set auxilliary state variables
  RecomputeLocalTerrainVelocity();
  VehicleRadius = GetRadius(); // Calculate current aircraft radius from center of planet

  VState.vPQR = VState.vPQRi - Ti2b * in.vOmegaPlanet;

  VState.qAttitudeLocal = Tl2b.GetQuaternion();

  // Compute vehicle velocity wrt ECEF frame, expressed in Local horizontal frame.
  vVel = Tb2l * VState.vUVW;

  Debug(2);
  return false;
}

Here is the call graph for this function:

bool Run ( bool  Holding) [virtual]
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.


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