 |
JSBSim Flight Dynamics Model
1.1.11 (13 Feb 2022)
An Open Source Flight Dynamics and Control Software Library in C++
|
41 #include "models/FGModel.h"
42 #include "math/FGLocation.h"
43 #include "math/FGQuaternion.h"
51 class FGInitialCondition;
133 std::deque <FGColumnVector3> dqPQRidot;
134 std::deque <FGColumnVector3> dqUVWidot;
135 std::deque <FGColumnVector3> dqInertialVelocity;
136 std::deque <FGQuaternion> dqQtrndot;
154 eAdamsBashforth3, eAdamsBashforth4, eBuss1, eBuss2, eLocalLinearization, eAdamsBashforth5};
161 void InitializeDerivatives();
170 bool Run(
bool Holding);
294 double GetVel(
int idx)
const {
return vVel(idx); }
416 double Gethdot(
void)
const {
return -vVel(eDown); }
436 const FGColumnVector3& GetTerrainVelocity(
void)
const {
return LocalTerrainVelocity; }
437 const FGColumnVector3& GetTerrainAngularVelocity(
void)
const {
return LocalTerrainAngularVelocity; }
438 void RecomputeLocalTerrainVelocity();
440 double GetTerrainElevation(
void)
const;
441 double GetDistanceAGL(
void)
const;
442 double GetDistanceAGLKm(
void)
const;
443 double GetRadius(
void)
const {
458 const FGLocation& GetLocation(
void)
const {
return VState.
vLocation; }
459 double GetLocation(
int i)
const {
return VState.
vLocation(i); }
521 const VehicleState& GetVState(
void)
const {
return VState; }
523 void SetVState(
const VehicleState& vstate);
545 void SetPQR(
unsigned int i,
double val) {
546 VState.
vPQR(i) = val;
547 VState.
vPQRi = VState.
vPQR + Ti2b * in.vOmegaPlanet;
550 void SetUVW(
unsigned int i,
double val) {
551 VState.
vUVW(i) = val;
552 CalculateInertialVelocity();
557 void SetLongitude(
double lon)
560 UpdateVehicleState();
562 void SetLongitudeDeg(
double lon) { SetLongitude(lon*degtorad); }
563 void SetLatitude(
double lat)
566 UpdateVehicleState();
568 void SetLatitudeDeg(
double lat) { SetLatitude(lat*degtorad); }
569 void SetRadius(
double r)
572 VState.vInertialPosition = Tec2i * VState.
vLocation;
575 void SetAltitudeASL(
double altASL);
576 void SetAltitudeASLmeters(
double altASL) { SetAltitudeASL(altASL/fttom); }
578 void SetTerrainElevation(
double tt);
579 void SetDistanceAGL(
double tt);
580 void SetDistanceAGLKm(
double tt);
582 void SetInitialState(
const FGInitialCondition*);
583 void SetLocation(
const FGLocation& l);
584 void SetLocation(
const FGColumnVector3& lv)
586 FGLocation l = FGLocation(lv);
589 void SetPosition(
const double Lon,
const double Lat,
const double Radius)
591 FGLocation l = FGLocation(Lon, Lat, Radius);
595 void NudgeBodyLocation(
const FGColumnVector3& deltaLoc) {
596 VState.vInertialPosition -= Tb2i*deltaLoc;
606 void DumpState(
void);
648 void CalculateInertialVelocity(
void);
649 void CalculateUVW(
void);
650 void CalculateQuatdot(
void);
654 std::deque <FGColumnVector3>& ValDot,
660 std::deque <FGQuaternion>& ValDot,
664 void UpdateLocationMatrices(
void);
665 void UpdateBodyMatrices(
void);
666 void UpdateVehicleState(
void);
668 void WriteStateFile(
int num);
670 void Debug(
int from);
Encapsulates the JSBSim simulation executive.
double GetAltitudeASL(void) const
Returns the current altitude above sea level.
const FGMatrix33 & GetTb2l(void) const
Retrieves the body-to-local transformation matrix.
double GetLongitudeDeg() const
Get the longitude.
The current vehicle state vector structure contains the translational and angular position,...
const FGMatrix33 & GetTi2b(void) const
Retrieves the ECI-to-body transformation matrix.
double GetLatitudeDeg() const
Get the GEOCENTRIC latitude in degrees.
bool InitModel(void)
Initializes the FGPropagate class after instantiation and prior to first execution.
const FGMatrix33 & GetTi2ec(void) const
Retrieves the ECI-to-ECEF transformation matrix.
This class implements a 3 element column vector.
FGLocation holds an arbitrary location in the Earth centered Earth fixed reference frame (ECEF).
Base class for all scheduled JSBSim models.
const FGMatrix33 & GetTb2ec(void) const
Retrieves the body-to-ECEF transformation matrix.
double GetLocalTerrainRadius(void) const
Returns the "constant" LocalTerrainRadius.
void SetRadius(double radius)
Set the distance from the center of the earth.
double GetInertialVelocityMagnitude(void) const
Retrieves the total inertial velocity in ft/sec.
double GetCosEuler(int i) const
Retrieves cosine of the given euler angle.
double GetSinEuler(int idx) const
Retrieves the sine of a vehicle Euler angle component.
const FGQuaternion & GetQuaterniondot(void) const
Retrieves the time derivative of the body orientation quaternion.
double GetLongitude() const
Get the longitude.
const FGColumnVector3 & GetInertialPosition(void) const
Retrieves the inertial position vector.
const FGQuaternion GetQuaternionECEF(void) const
Returns the quaternion that goes from ECEF to Body.
const FGQuaternion GetQuaternion(void) const
Returns the quaternion that goes from Local to Body.
double GetEuler(int axis) const
Retrieves a vehicle Euler angle component.
double GetVel(int idx) const
Retrieves a Local frame velocity component.
const FGMatrix33 & GetTb2i(void) const
Retrieves the body-to-ECI transformation matrix.
double Gethdot(void) const
Returns the current altitude rate.
double GetGeodLatitudeRad(void) const
Get the GEODETIC latitude in radians.
double GetGeodLatitudeDeg(void) const
Get the GEODETIC latitude in degrees.
const FGColumnVector3 & GetPQRi(void) const
Retrieves the body angular rates vector, relative to the ECI (inertial) frame.
double GetRadius() const
Get the distance from the center of the earth in feet.
double GetLatitude() const
Get the GEOCENTRIC latitude in radians.
Handles matrix math operations.
const FGColumnVector3 & GetPQR(void) const
Retrieves the body angular rates vector, relative to the ECEF frame.
FGQuaternion qAttitudeLocal
The current orientation of the vehicle, that is, the orientation of the body frame relative to the lo...
FGLocation vLocation
Represents the current location of the vehicle in Earth centered Earth fixed (ECEF) frame.
double Magnitude(void) const
Length of the vector.
const FGMatrix33 & GetTec2l(void) const
Retrieves the ECEF-to-local transformation matrix.
const FGColumnVector3 & GetVel(void) const
Retrieves the velocity vector.
const FGMatrix33 & GetTl2ec(void) const
Retrieves the local-to-ECEF transformation matrix.
~FGPropagate()
Destructor.
const FGColumnVector3 & GetInertialVelocity(void) const
Retrieves the inertial velocity vector in ft/sec.
const FGColumnVector3 & GetEuler(void) const
Retrieves the Euler angles.
double GetEarthPositionAngleDeg(void) const
Returns the Earth position angle in degrees.
Models the EOM and integration/propagation of state.
FGColumnVector3 vPQR
The angular velocity vector for the vehicle relative to the ECEF frame, expressed in the body frame.
const FGQuaternion GetQuaternionECI(void) const
Returns the quaternion that goes from ECI to Body.
bool Run(bool Holding)
Runs the state propagation model; called by the Executive Can pass in a value indicating if the execu...
double GetPQRi(int axis) const
Retrieves a body frame angular velocity component relative to the ECI (inertial) frame.
void SetLongitude(double longitude)
Set the longitude.
const FGMatrix33 & GetTec2b(void) const
Retrieves the ECEF-to-body transformation matrix.
void SetLatitude(double latitude)
Set the GEOCENTRIC latitude.
double GetAltitudeASLmeters(void) const
Returns the current altitude above sea level.
void SetEarthPositionAngle(double EPA)
Sets the Earth position angle.
const FGMatrix33 & GetTl2i(void) const
Retrieves the local-to-inertial transformation matrix.
void SetHoldDown(bool hd)
Sets the property forces/hold-down.
double GetNEDVelocityMagnitude(void) const
Retrieves the total local NED velocity in ft/sec.
FGQuaternion qAttitudeECI
The current orientation of the vehicle, that is, the orientation of the body frame relative to the in...
const FGColumnVector3 & GetUVW(void) const
Retrieves the body frame vehicle velocity vector.
double GetSinEuler(int i) const
Retrieves sine of the given euler angle.
double GetGeodAltitude(void) const
Gets the geodetic altitude in feet.
double GetEarthPositionAngle(void) const
Returns the Earth position angle.
double GetPQR(int axis) const
Retrieves a body frame angular velocity component relative to the ECEF frame.
Models inertial forces (e.g.
double GetUVW(int idx) const
Retrieves a body frame velocity component.
double GetECEFVelocity(int idx) const
Calculates and retrieves the velocity vector relative to the earth centered earth fixed (ECEF) frame ...
const FGColumnVector3 & GetEuler(void) const
Retrieves the Euler angles that define the vehicle orientation.
Models the Quaternion representation of rotations.
double GetCosEuler(int idx) const
Retrieves the cosine of a vehicle Euler angle component.
const FGMatrix33 & GetTi2l(void) const
Retrieves the inertial-to-local transformation matrix.
FGColumnVector3 vPQRi
The angular velocity vector for the vehicle body frame relative to the ECI frame, expressed in the bo...
FGColumnVector3 GetECEFVelocity(void) const
Calculates and retrieves the velocity vector relative to the earth centered earth fixed (ECEF) frame.
const FGMatrix33 & GetTl2b(void) const
Retrieves the local-to-body transformation matrix.
eIntegrateType
These define the indices use to select the various integrators.
double GetEulerDeg(int axis) const
Retrieves a vehicle Euler angle component in degrees.
const FGMatrix33 & GetTec2i(void) const
Retrieves the ECEF-to-ECI transformation matrix.
FGColumnVector3 GetEulerDeg(void) const
Retrieves the Euler angles (in degrees) that define the vehicle orientation.
FGColumnVector3 vUVW
The velocity vector of the vehicle with respect to the ECEF frame, expressed in the body system.
FGPropagate(FGFDMExec *Executive)
Constructor.