![]() |
JSBSim Flight Dynamics Model 1.0 (23 February 2013)
An Open Source Flight Dynamics and Control Software Library in C++
|
Handles the calculation of accelerations. More...
#include <FGAccelerations.h>
Inheritance diagram for FGAccelerations:
Collaboration diagram for FGAccelerations:Classes | |
| struct | Inputs |
Public Types | |
| enum | eGravType { gtStandard, gtWGS84 } |
These define the indices use to select the gravitation models. More... | |
Public Member Functions | |
| FGAccelerations (FGFDMExec *Executive) | |
| Constructor. | |
| ~FGAccelerations () | |
| Destructor. | |
| const FGColumnVector3 & | GetBodyAccel (void) const |
| Retrieves the acceleration resulting from the applied forces. | |
| double | GetBodyAccel (int idx) const |
| Retrieves a component of the acceleration resulting from the applied forces. | |
| double | GetForces (int idx) const |
| Retrieves the total forces applied on the body. | |
| const FGColumnVector3 & | GetGravAccel (void) const |
| double | GetGroundForces (int idx) const |
| Retrieves the ground forces applied on the body. | |
| double | GetGroundMoments (int idx) const |
| Retrieves the ground moments applied on the body. | |
| int | GetHoldDown (void) const |
| Gets the value of the property forces/hold-down. | |
| double | GetMoments (int idx) const |
| Retrieves a component of the total moments applied on the body. | |
| const FGColumnVector3 & | GetPQRdot (void) const |
| Retrieves the body axis angular acceleration vector. | |
| double | GetPQRdot (int axis) const |
| Retrieves a body frame angular acceleration component. | |
| const FGColumnVector3 & | GetPQRidot (void) const |
| Retrieves the axis angular acceleration vector in the ECI frame. | |
| const FGQuaternion & | GetQuaterniondot (void) const |
| Retrieves the time derivative of the body orientation quaternion. | |
| double | GetUVWdot (int idx) const |
| Retrieves a body frame acceleration component. | |
| const FGColumnVector3 & | GetUVWdot (void) const |
| Retrieves the body axis acceleration. | |
| const FGColumnVector3 & | GetUVWidot (void) const |
| Retrieves the body axis acceleration in the ECI frame. | |
| void | InitializeDerivatives (void) |
| Initializes the FGAccelerations class prior to a new execution. | |
| bool | InitModel (void) |
| Initializes the FGAccelerations class after instantiation and prior to first execution. | |
| 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 | SetHoldDown (int hd) |
| Sets the property forces/hold-down. | |
Public Attributes | |
|
struct JSBSim::FGAccelerations::Inputs | in |
This class is collecting all the forces and the moments acting on the body to calculate the corresponding accelerations according to Newton's second law. This is also where the friction forces related to the ground reactions are evaluated.
JSBSim provides several ways to calculate the influence of the gravity on the vehicle. The different options can be selected via the following properties :
Special care is taken in the calculations to obtain maximum fidelity in JSBSim results. In FGAccelerations, this is obtained by avoiding as much as possible the transformations from one frame to another. As a consequence, the frames in which the accelerations are primarily evaluated are dictated by the frames in which FGPropagate resolves the equations of movement (the ECI frame for the translations and the body frame for the rotations).
Definition at line 107 of file FGAccelerations.h.
| enum eGravType |
| gtStandard |
Evaluate gravity using Newton's classical formula assuming the Earth is spherical. |
| gtWGS84 |
Evaluate gravity using WGS84 formulas that take the Earth oblateness into account. |
Definition at line 117 of file FGAccelerations.h.
{
gtStandard,
gtWGS84
};
| FGAccelerations | ( | FGFDMExec * | Executive | ) |
| Executive | a pointer to the parent executive object |
Definition at line 70 of file FGAccelerations.cpp.
References FGAccelerations::gtWGS84.
| const FGColumnVector3& GetBodyAccel | ( | void | ) | const [inline] |
Retrieves the ratio of the sum of all forces applied on the craft to its mass. This does include the friction forces but not the gravity. The vector returned is represented by an FGColumnVector3 reference. The vector for the acceleration in Body frame is organized (Ax, Ay, Az). The vector is 1-based, so that the first element can be retrieved using the "()" operator. In other words, vBodyAccel(1) is Ax. 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^2
Definition at line 234 of file FGAccelerations.h.
{ return vBodyAccel; }
| double GetBodyAccel | ( | int | idx | ) | const [inline] |
Retrieves a component of the ratio between the sum of all forces applied on the craft to its mass. The value returned is extracted from the vBodyAccel vector (an FGColumnVector3). The vector for the acceleration in Body frame is organized (Ax, Ay, Az). The vector is 1-based. In other words, GetBodyAccel(1) returns Ax. 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^2
| idx | the index of the acceleration component desired (1-based). |
Definition at line 250 of file FGAccelerations.h.
{ return vBodyAccel(idx); }
| double GetForces | ( | int | idx | ) | const [inline] |
Retrieves the total forces applied on the body. This does include the friction forces but not the gravity. The vector for the total forces in the body frame is organized (Fx, Fy , Fz). The vector is 1-based. In other words, GetForces(1) returns Fx. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the forces returned by this call are, eX=1, eY=2, eZ=3. units lbs
| idx | the index of the forces component desired (1-based). |
Definition at line 291 of file FGAccelerations.h.
References FGAccelerations::Inputs::Force.
{ return in.Force(idx) + vFrictionForces(idx); }
| double GetGroundForces | ( | int | idx | ) | const [inline] |
Retrieves the ground forces applied on the body. This does include the ground normal reaction and friction forces. The vector for the total moments in the body frame is organized (Fx, Fy , Fz). The vector is 1-based. In other words, GetGroundForces(1) returns Fx. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the forces returned by this call are, eX=1, eY=2, eZ=3. units lbs
| idx | the index of the forces component desired (1-based). |
Definition at line 317 of file FGAccelerations.h.
References FGAccelerations::Inputs::GroundForce.
{ return in.GroundForce(idx) + vFrictionForces(idx); }
| double GetGroundMoments | ( | int | idx | ) | const [inline] |
Retrieves the ground moments applied on the body. This does include the ground normal reaction and friction moments. The vector for the ground moments in the body frame is organized (Mx, My , Mz). The vector is 1-based. In other words, GetGroundMoments(1) returns Mx. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the moments returned by this call are, eX=1, eY=2, eZ=3. units lbs*ft
| idx | the index of the moments component desired (1-based). |
Definition at line 304 of file FGAccelerations.h.
References FGAccelerations::Inputs::GroundMoment.
{ return in.GroundMoment(idx) + vFrictionMoments(idx); }
| int GetHoldDown | ( | void | ) | const [inline] |
Definition at line 333 of file FGAccelerations.h.
{return HoldDown;}
| double GetMoments | ( | int | idx | ) | const [inline] |
Retrieves a component of the total moments applied on the body. This does include the moments generated by friction forces and the gravitational torque (if the property simulation/gravitational-torque is set to true). The vector for the total moments in the body frame is organized (Mx, My , Mz). The vector is 1-based. In other words, GetMoments(1) returns Mx. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the moments returned by this call are, eX=1, eY=2, eZ=3. units lbs*ft
| idx | the index of the moments component desired (1-based). |
Definition at line 278 of file FGAccelerations.h.
References FGAccelerations::Inputs::Moment.
{ return in.Moment(idx) + vFrictionMoments(idx); }
| const FGColumnVector3& GetPQRdot | ( | void | ) | const [inline] |
Retrieves the body axis angular acceleration vector in rad/sec^2. The angular acceleration vector is determined from the applied moments and accounts for a rotating frame. The vector returned is represented by an FGColumnVector3 reference. The vector for the angular acceleration in Body frame is organized (Pdot, Qdot, Rdot). The vector is 1-based, so that the first element can be retrieved using the "()" operator. In other words, vPQRdot(1) is Pdot. 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^2
Definition at line 192 of file FGAccelerations.h.
Referenced by FGOutputSocket::Print().
{return vPQRdot;}
Here is the caller graph for this function:| double GetPQRdot | ( | int | axis | ) | const [inline] |
Retrieves a body frame angular acceleration component. The angular acceleration returned is extracted from the vPQRdot vector (an FGColumnVector3). The vector for the angular acceleration in Body frame is organized (Pdot, Qdot, Rdot). The vector is 1-based. In other words, GetPQRdot(1) returns Pdot (roll acceleration). Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the angular acceleration returned by this call are, eP=1, eQ=2, eR=3. units rad/sec^2
| axis | the index of the angular acceleration component desired (1-based). |
Definition at line 264 of file FGAccelerations.h.
{return vPQRdot(axis);}
| const FGColumnVector3& GetPQRidot | ( | void | ) | const [inline] |
Retrieves the body axis angular acceleration vector measured in the ECI frame and expressed in the body frame. The angular acceleration vector is determined from the applied moments. The vector returned is represented by an FGColumnVector3 reference. The vector for the angular acceleration in Body frame is organized (Pidot, Qidot, Ridot). The vector is 1-based, so that the first element can be retrieved using the "()" operator. In other words, vPQRidot(1) is Pidot. 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^2
Definition at line 207 of file FGAccelerations.h.
{return vPQRidot;}
| const FGQuaternion& GetQuaterniondot | ( | void | ) | const [inline] |
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
Definition at line 147 of file FGAccelerations.h.
{return vQtrndot;}
| const FGColumnVector3& GetUVWdot | ( | void | ) | const [inline] |
Retrieves the computed body axis accelerations based on the applied forces and accounting for a rotating body frame. The vector returned is represented by an FGColumnVector3 reference. The vector for the acceleration in Body frame is organized (Ax, Ay, Az). The vector is 1-based, so that the first element can be retrieved using the "()" operator. In other words, vUVWdot(1) is Ax. 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^2
Definition at line 161 of file FGAccelerations.h.
{ return vUVWdot; }
| double GetUVWdot | ( | int | idx | ) | const [inline] |
Retrieves a body frame acceleration component. The acceleration returned is extracted from the vUVWdot vector (an FGColumnVector3). The vector for the acceleration in Body frame is organized (Ax, Ay, Az). The vector is 1-based. In other words, GetUVWdot(1) returns Ax. Various convenience enumerators are defined in FGJSBBase. The relevant enumerators for the acceleration returned by this call are, eX=1, eY=2, eZ=3. units ft/sec^2
| idx | the index of the acceleration component desired (1-based). |
Definition at line 220 of file FGAccelerations.h.
{ return vUVWdot(idx); }
| const FGColumnVector3& GetUVWidot | ( | void | ) | const [inline] |
Retrieves the computed body axis accelerations based on the applied forces. The ECI frame being an inertial frame this vector does not contain the Coriolis and centripetal accelerations. The vector is expressed in the Body frame. The vector returned is represented by an FGColumnVector3 reference. The vector for the acceleration in Body frame is organized (Aix, Aiy, Aiz). The vector is 1-based, so that the first element can be retrieved using the "()" operator. In other words, vUVWidot(1) is Aix. 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^2
Definition at line 177 of file FGAccelerations.h.
{ return vUVWidot; }
| void InitializeDerivatives | ( | void | ) |
Initializes the class prior to a new execution when the input data stored in the Inputs structure have been set to their initial values.
Definition at line 344 of file FGAccelerations.cpp.
{
// Make an initial run and set past values
CalculatePQRdot(); // Angular rate derivative
CalculateUVWdot(); // Translational rate derivative
CalculateQuatdot(); // Angular orientation derivative
ResolveFrictionForces(0.); // Update rate derivatives with friction forces
}
| 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 98 of file FGAccelerations.cpp.
{
vPQRidot.InitMatrix();
vUVWidot.InitMatrix();
vGravAccel.InitMatrix();
vBodyAccel.InitMatrix();
vQtrndot = FGQuaternion(0,0,0);
return true;
}
| bool Run | ( | bool | Holding | ) | [virtual] |
| Holding | if 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. |
Reimplemented from FGModel.
Definition at line 114 of file FGAccelerations.cpp.
References FGAccelerations::Inputs::DeltaT, and FGModel::Run().
Referenced by FGFDMExec::Initialize().
{
if (FGModel::Run(Holding)) return true; // Fast return if we have nothing to do ...
if (Holding) return false;
CalculatePQRdot(); // Angular rate derivative
CalculateUVWdot(); // Translational rate derivative
CalculateQuatdot(); // Angular orientation derivative
ResolveFrictionForces(in.DeltaT * rate); // Update rate derivatives with friction forces
Debug(2);
return false;
}
Here is the call graph for this function:
Here is the caller graph for this function:| void SetHoldDown | ( | int | hd | ) | [inline] |
This allows to do hard 'hold-down' such as for rockets on a launch pad with engines ignited.
| hd | enables the 'hold-down' function if non-zero |
Definition at line 329 of file FGAccelerations.h.
{HoldDown = hd;}