JSBSim Flight Dynamics Model 1.3.0 (09 Apr 2026)
An Open Source Flight Dynamics and Control Software Library in C++
Loading...
Searching...
No Matches
FGInitialCondition Class Reference

Detailed Description

Initializes the simulation run.

Takes a set of initial conditions (IC) and provide a kinematically consistent set of body axis velocity components, euler angles, and altitude. This class does not attempt to trim the model i.e. the sim will most likely start in a very dynamic state (unless, of course, you have chosen your IC's wisely, or started on the ground) even after setting it up with this class.

Usage Notes

With a valid object of FGFDMExec and an aircraft model loaded:

FGInitialCondition* fgic = FDMExec->GetIC();
// Reset the initial conditions and set VCAS and altitude
fgic->InitializeIC();
fgic->SetVcalibratedKtsIC(vcas);
fgic->SetAltitudeAGLFtIC(altitude);
// directly into Run
FDMExec->GetPropagate()->SetInitialState(fgic);
delete fgic;
FDMExec->Run();
//or to loop the sim w/o integrating
FDMExec->RunIC();
std::shared_ptr< FGInitialCondition > GetIC(void) const
Returns a pointer to the FGInitialCondition object.
Definition FGFDMExec.h:390
std::shared_ptr< FGPropagate > GetPropagate(void) const
Returns the FGPropagate pointer.
bool Run(void)
This function executes each scheduled model in succession.
bool RunIC(void)
Initializes the sim from the initial condition object and executes each scheduled model without integ...
Initializes the simulation run.
void InitializeIC(void)
Initialize the initial conditions to default values.
void SetAltitudeAGLFtIC(double agl)
Sets the initial Altitude above ground level.
void SetVcalibratedKtsIC(double vc)
Set calibrated airspeed initial condition in knots.

Alternatively, you can load initial conditions from an XML file:

FGInitialCondition* fgic = FDMExec->GetIC();
fgic->Load(IC_file);
bool Load(const SGPath &rstname, bool useAircraftPath=true)
Loads the initial conditions.

Speed

Since vc, ve, vt, and mach all represent speed, the remaining three are recalculated each time one of them is set (using the current altitude). The most recent speed set is remembered so that if and when altitude is reset, the last set speed is used to recalculate the remaining three. Setting any of the body components forces a recalculation of vt and vt then becomes the most recent speed set.

Alpha,Gamma, and Theta

This class assumes that it will be used to set up the sim for a steady, zero pitch rate condition. Since any two of those angles specifies the third gamma (flight path angle) is favored when setting alpha and theta and alpha is favored when setting gamma. i.e.

  • set alpha : recalculate theta using gamma as currently set
  • set theta : recalculate alpha using gamma as currently set
  • set gamma : recalculate theta using alpha as currently set

The idea being that gamma is most interesting to pilots (since it is indicative of climb rate).

Setting climb rate is, for the purpose of this discussion, considered equivalent to setting gamma.

These are the items that can be set in an initialization file:

  • ubody (velocity, ft/sec)
  • vbody (velocity, ft/sec)
  • wbody (velocity, ft/sec)
  • vnorth (velocity, ft/sec)
  • veast (velocity, ft/sec)
  • vdown (velocity, ft/sec)
  • latitude (position, degrees)
  • longitude (position, degrees)
  • phi (orientation, degrees)
  • theta (orientation, degrees)
  • psi (orientation, degrees)
  • alpha (angle, degrees)
  • beta (angle, degrees)
  • gamma (angle, degrees)
  • roc (vertical velocity, ft/sec)
  • elevation (local terrain elevation, ft)
  • altitude (altitude AGL, ft)
  • altitudeAGL (altitude AGL, ft)
  • altitudeMSL (altitude MSL, ft)
  • winddir (wind from-angle, degrees)
  • vwind (magnitude wind speed, ft/sec)
  • hwind (headwind speed, knots)
  • xwind (crosswind speed, knots)
  • vc (calibrated airspeed, ft/sec)
  • mach (mach)
  • vground (ground speed, ft/sec)
  • trim (0 for no trim, 1 for ground trim, 'Longitudinal', 'Full', 'Ground', 'Pullup', 'Custom', 'Turn')
  • running (-1 for all engines, 0 ... n-1 for specific engines)

Properties

  • ic/vc-kts (read/write) Calibrated airspeed initial condition in knots
  • ic/ve-kts (read/write) Knots equivalent airspeed initial condition
  • ic/vg-kts (read/write) Ground speed initial condition in knots
  • ic/vt-kts (read/write) True airspeed initial condition in knots
  • ic/mach (read/write) Mach initial condition
  • ic/roc-fpm (read/write) Rate of climb initial condition in feet/minute
  • ic/gamma-deg (read/write) Flightpath angle initial condition in degrees
  • ic/alpha-deg (read/write) Angle of attack initial condition in degrees
  • ic/beta-deg (read/write) Angle of sideslip initial condition in degrees
  • ic/theta-deg (read/write) Pitch angle initial condition in degrees
  • ic/phi-deg (read/write) Roll angle initial condition in degrees
  • ic/psi-true-deg (read/write) Heading angle initial condition in degrees
  • ic/lat-gc-deg (read/write) Latitude initial condition in degrees
  • ic/long-gc-deg (read/write) Longitude initial condition in degrees
  • ic/h-sl-ft (read/write) Height above sea level initial condition in feet
  • ic/h-agl-ft (read/write) Height above ground level initial condition in feet
  • ic/sea-level-radius-ft (read/write) Radius of planet at sea level in feet
  • ic/terrain-elevation-ft (read/write) Terrain elevation above sea level in feet
  • ic/vg-fps (read/write) Ground speed initial condition in feet/second
  • ic/vt-fps (read/write) True airspeed initial condition in feet/second
  • ic/vw-bx-fps (read/write) Wind velocity initial condition in Body X frame in feet/second
  • ic/vw-by-fps (read/write) Wind velocity initial condition in Body Y frame in feet/second
  • ic/vw-bz-fps (read/write) Wind velocity initial condition in Body Z frame in feet/second
  • ic/vw-north-fps (read/write) Wind northward velocity initial condition in feet/second
  • ic/vw-east-fps (read/write) Wind eastward velocity initial condition in feet/second
  • ic/vw-down-fps (read/write) Wind downward velocity initial condition in feet/second
  • ic/vw-mag-fps (read/write) Wind velocity magnitude initial condition in feet/sec.
  • ic/vw-dir-deg (read/write) Wind direction initial condition, in degrees from north
  • ic/roc-fps (read/write) Rate of climb initial condition, in feet/second
  • ic/u-fps (read/write) Body frame x-axis velocity initial condition in feet/second
  • ic/v-fps (read/write) Body frame y-axis velocity initial condition in feet/second
  • ic/w-fps (read/write) Body frame z-axis velocity initial condition in feet/second
  • ic/vn-fps (read/write) Local frame x-axis (north) velocity initial condition in feet/second
  • ic/ve-fps (read/write) Local frame y-axis (east) velocity initial condition in feet/second
  • ic/vd-fps (read/write) Local frame z-axis (down) velocity initial condition in feet/second
  • ic/gamma-rad (read/write) Flight path angle initial condition in radians
  • ic/alpha-rad (read/write) Angle of attack initial condition in radians
  • ic/theta-rad (read/write) Pitch angle initial condition in radians
  • ic/beta-rad (read/write) Angle of sideslip initial condition in radians
  • ic/phi-rad (read/write) Roll angle initial condition in radians
  • ic/psi-true-rad (read/write) Heading angle initial condition in radians
  • ic/lat-gc-rad (read/write) Geocentric latitude initial condition in radians
  • ic/long-gc-rad (read/write) Longitude initial condition in radians
  • ic/p-rad_sec (read/write) Roll rate initial condition in radians/second
  • ic/q-rad_sec (read/write) Pitch rate initial condition in radians/second
  • ic/r-rad_sec (read/write) Yaw rate initial condition in radians/second
Author
Tony Peden

Definition at line 226 of file FGInitialCondition.h.

#include <FGInitialCondition.h>

+ Inheritance diagram for FGInitialCondition:
+ Collaboration diagram for FGInitialCondition:

Public Member Functions

 FGInitialCondition (FGFDMExec *fdmex)
 Constructor.
 
 ~FGInitialCondition ()
 Destructor.
 
void bind (FGPropertyManager *pm)
 
double GetAlphaDegIC (void) const
 Gets the initial angle of attack.
 
double GetAlphaRadIC (void) const
 Gets the initial angle of attack.
 
double GetAltitudeAGLFtIC (void) const
 Gets the initial altitude above ground level.
 
double GetAltitudeASLFtIC (void) const
 Gets the initial altitude above sea level.
 
double GetBetaDegIC (void) const
 Gets the initial sideslip angle.
 
double GetBetaRadIC (void) const
 Gets the initial angle of sideslip.
 
double GetClimbRateFpmIC (void) const
 Gets the initial climb rate.
 
double GetClimbRateFpsIC (void) const
 Gets the initial climb rate.
 
double GetEarthPositionAngleIC (void) const
 Gets the initial Earth position angle.
 
double GetFlightPathAngleDegIC (void) const
 Gets the initial flight path angle.
 
double GetFlightPathAngleRadIC (void) const
 Gets the initial flight path angle.
 
double GetGeodLatitudeDegIC (void) const
 Gets the initial geodetic latitude.
 
double GetGeodLatitudeRadIC (void) const
 Gets the initial geodetic latitude.
 
double GetLatitudeDegIC (void) const
 Gets the initial latitude.
 
double GetLatitudeRadIC (void) const
 Gets the initial latitude.
 
double GetLongitudeDegIC (void) const
 Gets the initial longitude.
 
double GetLongitudeRadIC (void) const
 Gets the initial longitude.
 
double GetMachIC (void) const
 Gets the initial mach.
 
const FGQuaternionGetOrientation (void) const
 Gets the initial orientation.
 
double GetPhiDegIC (void) const
 Gets the initial roll angle.
 
double GetPhiRadIC (void) const
 Gets the initial roll angle.
 
const FGLocationGetPosition (void) const
 Gets the initial position.
 
const FGColumnVector3 GetPQRRadpsIC (void) const
 Gets the initial body rotation rate.
 
double GetPRadpsIC () const
 Gets the initial body axis roll rate.
 
double GetPsiDegIC (void) const
 Gets the initial heading angle.
 
double GetPsiRadIC (void) const
 Gets the initial heading angle.
 
double GetQRadpsIC () const
 Gets the initial body axis pitch rate.
 
double GetRRadpsIC () const
 Gets the initial body axis yaw rate.
 
speedset GetSpeedSet (void) const
 Gets the initial speedset.
 
double GetTargetNlfIC (void) const
 Gets the target normal load factor set from IC.
 
double GetTerrainElevationFtIC (void) const
 Gets the initial terrain elevation.
 
double GetThetaDegIC (void) const
 Gets the initial pitch angle.
 
double GetThetaRadIC (void) const
 Gets the initial pitch angle.
 
double GetUBodyFpsIC (void) const
 Gets the initial body axis X velocity.
 
const FGColumnVector3 GetUVWFpsIC (void) const
 Gets the initial body velocity.
 
double GetVBodyFpsIC (void) const
 Gets the initial body axis Y velocity.
 
double GetVcalibratedKtsIC (void) const
 Gets the initial calibrated airspeed.
 
double GetVDownFpsIC (void) const
 Gets the initial local frame Z (Down) velocity.
 
double GetVEastFpsIC (void) const
 Gets the initial local frame Y (East) velocity.
 
double GetVequivalentKtsIC (void) const
 Gets the initial equivalent airspeed.
 
double GetVgroundFpsIC (void) const
 Gets the initial ground velocity.
 
double GetVgroundKtsIC (void) const
 Gets the initial ground speed.
 
double GetVNorthFpsIC (void) const
 Gets the initial local frame X (North) velocity.
 
double GetVtrueFpsIC (void) const
 Gets the initial true velocity.
 
double GetVtrueKtsIC (void) const
 Gets the initial true velocity.
 
double GetWBodyFpsIC (void) const
 Gets the initial body axis Z velocity.
 
double GetWindDFpsIC (void) const
 Gets the initial wind velocity in local frame.
 
double GetWindDirDegIC (void) const
 Gets the initial wind direction.
 
double GetWindEFpsIC (void) const
 Gets the initial wind velocity in local frame.
 
double GetWindMagFpsIC (void) const
 Gets the initial total wind velocity in feet/sec.
 
FGColumnVector3 GetWindNEDFpsIC (void) const
 Gets the initial wind velocity in the NED local frame.
 
double GetWindNFpsIC (void) const
 Gets the initial wind velocity in local frame.
 
double GetWindUFpsIC (void) const
 Gets the initial body axis X wind velocity.
 
double GetWindVFpsIC (void) const
 Gets the initial body axis Y wind velocity.
 
double GetWindWFpsIC (void) const
 Gets the initial body axis Z wind velocity.
 
void InitializeIC (void)
 Initialize the initial conditions to default values.
 
bool IsEngineRunning (unsigned int n) const
 Is an engine running ?
 
bool Load (const SGPath &rstname, bool useAircraftPath=true)
 Loads the initial conditions.
 
void ResetIC (double u0, double v0, double w0, double p0, double q0, double r0, double alpha0, double beta0, double phi0, double theta0, double psi0, double latitudeRad0, double longitudeRad0, double altitudeAGL0, double gamma0)
 Resets the IC data structure to new values.
 
void SetAlphaDegIC (double a)
 Sets angle of attack initial condition in degrees.
 
void SetAlphaRadIC (double alpha)
 Sets the initial angle of attack.
 
void SetAltitudeAGLFtIC (double agl)
 Sets the initial Altitude above ground level.
 
void SetAltitudeASLFtIC (double altitudeASL)
 Sets the altitude above sea level initial condition in feet.
 
void SetBetaDegIC (double b)
 Sets angle of sideslip initial condition in degrees.
 
void SetBetaRadIC (double beta)
 Sets the initial sideslip angle.
 
void SetClimbRateFpmIC (double roc)
 Sets the climb rate initial condition in feet/minute.
 
void SetClimbRateFpsIC (double roc)
 Sets the initial climb rate.
 
void SetCrossWindKtsIC (double cross)
 Sets the initial crosswind speed.
 
void SetFlightPathAngleDegIC (double gamma)
 Sets the flight path angle initial condition in degrees.
 
void SetFlightPathAngleRadIC (double gamma)
 Sets the initial flight path angle.
 
void SetGeodLatitudeDegIC (double glat)
 Sets the initial geodetic latitude.
 
void SetGeodLatitudeRadIC (double glat)
 Sets the initial geodetic latitude.
 
void SetHeadWindKtsIC (double head)
 Sets the initial headwind velocity.
 
void SetLatitudeDegIC (double lat)
 Sets the initial latitude.
 
void SetLatitudeRadIC (double lat)
 Sets the initial latitude.
 
void SetLongitudeDegIC (double lon)
 Sets the initial longitude.
 
void SetLongitudeRadIC (double lon)
 Sets the initial longitude.
 
void SetMachIC (double mach)
 Set mach initial condition.
 
void SetPhiDegIC (double phi)
 Sets the roll angle initial condition in degrees.
 
void SetPhiRadIC (double phi)
 Sets the initial roll angle.
 
void SetPRadpsIC (double P)
 Sets the initial body axis roll rate.
 
void SetPsiDegIC (double psi)
 Sets the heading angle initial condition in degrees.
 
void SetPsiRadIC (double psi)
 Sets the initial heading angle.
 
void SetQRadpsIC (double Q)
 Sets the initial body axis pitch rate.
 
void SetRRadpsIC (double R)
 Sets the initial body axis yaw rate.
 
void SetTargetNlfIC (double nlf)
 Sets the target normal load factor.
 
void SetTerrainElevationFtIC (double elev)
 Sets the initial terrain elevation.
 
void SetThetaDegIC (double theta)
 Sets pitch angle initial condition in degrees.
 
void SetThetaRadIC (double theta)
 Sets the initial pitch angle.
 
void SetUBodyFpsIC (double ubody)
 Sets the initial body axis X velocity.
 
void SetVBodyFpsIC (double vbody)
 Sets the initial body axis Y velocity.
 
void SetVcalibratedKtsIC (double vc)
 Set calibrated airspeed initial condition in knots.
 
void SetVDownFpsIC (double vd)
 Sets the initial local axis down velocity.
 
void SetVEastFpsIC (double ve)
 Sets the initial local axis east velocity.
 
void SetVequivalentKtsIC (double ve)
 Set equivalent airspeed initial condition in knots.
 
void SetVgroundFpsIC (double vg)
 Sets the initial ground speed.
 
void SetVgroundKtsIC (double vg)
 Set ground speed initial condition in knots.
 
void SetVNorthFpsIC (double vn)
 Sets the initial local axis north velocity.
 
void SetVtrueFpsIC (double vt)
 Sets the initial true airspeed.
 
void SetVtrueKtsIC (double vtrue)
 Set true airspeed initial condition in knots.
 
void SetWBodyFpsIC (double wbody)
 Sets the initial body axis Z velocity.
 
void SetWindDirDegIC (double dir)
 Sets the initial wind direction.
 
void SetWindDownKtsIC (double wD)
 Sets the initial wind downward speed.
 
void SetWindMagFpsIC (double mag)
 Sets the initial total wind speed.
 
void SetWindMagKtsIC (double mag)
 Sets the initial total wind speed.
 
void SetWindNEDFpsIC (double wN, double wE, double wD)
 Sets the initial wind velocity.
 
int TrimRequested (void) const
 Does initialization file call for trim ?
 
- Public Member Functions inherited from FGJSBBase
 FGJSBBase ()
 Constructor for FGJSBBase.
 
virtual ~FGJSBBase ()
 Destructor for FGJSBBase.
 
void disableHighLighting (void)
 Disables highlighting in the console output.
 

Additional Inherited Members

- Public Types inherited from FGJSBBase
enum  { eL = 1 , eM , eN }
 Moments L, M, N. More...
 
enum  { eP = 1 , eQ , eR }
 Rates P, Q, R. More...
 
enum  { eU = 1 , eV , eW }
 Velocities U, V, W. More...
 
enum  { eX = 1 , eY , eZ }
 Positions X, Y, Z. More...
 
enum  { ePhi = 1 , eTht , ePsi }
 Euler angles Phi, Theta, Psi. More...
 
enum  { eDrag = 1 , eSide , eLift }
 Stability axis forces, Drag, Side force, Lift. More...
 
enum  { eRoll = 1 , ePitch , eYaw }
 Local frame orientation Roll, Pitch, Yaw. More...
 
enum  { eNorth = 1 , eEast , eDown }
 Local frame position North, East, Down. More...
 
enum  { eLat = 1 , eLong , eRad }
 Locations Radius, Latitude, Longitude. More...
 
enum  {
  inNone = 0 , inDegrees , inRadians , inMeters ,
  inFeet
}
 Conversion specifiers. More...
 
- Static Public Member Functions inherited from FGJSBBase
static const std::string & GetVersion (void)
 Returns the version number of JSBSim.
 
static constexpr double KelvinToFahrenheit (double kelvin)
 Converts from degrees Kelvin to degrees Fahrenheit.
 
static constexpr double CelsiusToRankine (double celsius)
 Converts from degrees Celsius to degrees Rankine.
 
static constexpr double RankineToCelsius (double rankine)
 Converts from degrees Rankine to degrees Celsius.
 
static constexpr double KelvinToRankine (double kelvin)
 Converts from degrees Kelvin to degrees Rankine.
 
static constexpr double RankineToKelvin (double rankine)
 Converts from degrees Rankine to degrees Kelvin.
 
static constexpr double FahrenheitToCelsius (double fahrenheit)
 Converts from degrees Fahrenheit to degrees Celsius.
 
static constexpr double CelsiusToFahrenheit (double celsius)
 Converts from degrees Celsius to degrees Fahrenheit.
 
static constexpr double CelsiusToKelvin (double celsius)
 Converts from degrees Celsius to degrees Kelvin.
 
static constexpr double KelvinToCelsius (double kelvin)
 Converts from degrees Kelvin to degrees Celsius.
 
static constexpr double FeetToMeters (double measure)
 Converts from feet to meters.
 
static bool EqualToRoundoff (double a, double b)
 Finite precision comparison.
 
static bool EqualToRoundoff (float a, float b)
 Finite precision comparison.
 
static bool EqualToRoundoff (float a, double b)
 Finite precision comparison.
 
static bool EqualToRoundoff (double a, float b)
 Finite precision comparison.
 
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
 
- Static Protected Member Functions inherited from FGJSBBase
static std::string CreateIndexedPropertyName (const std::string &Property, int index)
 
- 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.
 
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

◆ FGInitialCondition()

FGInitialCondition ( FGFDMExec fdmex)
explicit

Constructor.

Definition at line 64 of file FGInitialCondition.cpp.

64 : fdmex(FDMExec)
65{
67
68 if(FDMExec) {
69 Aircraft=fdmex->GetAircraft();
70 Auxiliary=fdmex->GetAuxiliary();
71 } else {
72 throw BaseException("FGInitialCondition: This class requires a pointer to a valid FGFDMExec object");
73 }
74
75 Debug(0);
76}
std::shared_ptr< FGAircraft > GetAircraft(void) const
Returns the FGAircraft pointer.
std::shared_ptr< FGAuxiliary > GetAuxiliary(void) const
Returns the FGAuxiliary pointer.
+ Here is the call graph for this function:

◆ ~FGInitialCondition()

Destructor.

Definition at line 80 of file FGInitialCondition.cpp.

81{
82 Debug(1);
83}

Member Function Documentation

◆ bind()

void bind ( FGPropertyManager *  pm)

Definition at line 1453 of file FGInitialCondition.cpp.

1454{
1455 PropertyManager->Tie("ic/vc-kts", this,
1458 PropertyManager->Tie("ic/ve-kts", this,
1461 PropertyManager->Tie("ic/vg-kts", this,
1464 PropertyManager->Tie("ic/vt-kts", this,
1467 PropertyManager->Tie("ic/mach", this,
1470 PropertyManager->Tie("ic/roc-fpm", this,
1473 PropertyManager->Tie("ic/gamma-deg", this,
1476 PropertyManager->Tie("ic/alpha-deg", this,
1479 PropertyManager->Tie("ic/beta-deg", this,
1482 PropertyManager->Tie("ic/theta-deg", this,
1485 PropertyManager->Tie("ic/phi-deg", this,
1488 PropertyManager->Tie("ic/psi-true-deg", this,
1491 PropertyManager->Tie("ic/lat-gc-deg", this,
1494 PropertyManager->Tie("ic/long-gc-deg", this,
1497 PropertyManager->Tie("ic/h-sl-ft", this,
1500 PropertyManager->Tie("ic/h-agl-ft", this,
1503 PropertyManager->Tie("ic/terrain-elevation-ft", this,
1506 PropertyManager->Tie("ic/vg-fps", this,
1509 PropertyManager->Tie("ic/vt-fps", this,
1512 PropertyManager->Tie("ic/vw-bx-fps", this,
1514 PropertyManager->Tie("ic/vw-by-fps", this,
1516 PropertyManager->Tie("ic/vw-bz-fps", this,
1518 PropertyManager->Tie("ic/vw-north-fps", this,
1520 PropertyManager->Tie("ic/vw-east-fps", this,
1522 PropertyManager->Tie("ic/vw-down-fps", this,
1524 PropertyManager->Tie("ic/vw-mag-fps", this,
1527 PropertyManager->Tie("ic/vw-dir-deg", this,
1530
1531 PropertyManager->Tie("ic/roc-fps", this,
1534 PropertyManager->Tie("ic/u-fps", this,
1537 PropertyManager->Tie("ic/v-fps", this,
1540 PropertyManager->Tie("ic/w-fps", this,
1543 PropertyManager->Tie("ic/vn-fps", this,
1546 PropertyManager->Tie("ic/ve-fps", this,
1549 PropertyManager->Tie("ic/vd-fps", this,
1552 PropertyManager->Tie("ic/gamma-rad", this,
1555 PropertyManager->Tie("ic/alpha-rad", this,
1558 PropertyManager->Tie("ic/theta-rad", this,
1561 PropertyManager->Tie("ic/beta-rad", this,
1564 PropertyManager->Tie("ic/phi-rad", this,
1567 PropertyManager->Tie("ic/psi-true-rad", this,
1570 PropertyManager->Tie("ic/lat-gc-rad", this,
1573 PropertyManager->Tie("ic/long-gc-rad", this,
1576 PropertyManager->Tie("ic/p-rad_sec", this,
1579 PropertyManager->Tie("ic/q-rad_sec", this,
1582 PropertyManager->Tie("ic/r-rad_sec", this,
1585 PropertyManager->Tie("ic/lat-geod-rad", this,
1588 PropertyManager->Tie("ic/lat-geod-deg", this,
1591 PropertyManager->Tie("ic/geod-alt-ft", &position,
1593
1594 PropertyManager->Tie("ic/targetNlf", this,
1597}
void SetPsiRadIC(double psi)
Sets the initial heading angle.
double GetPRadpsIC() const
Gets the initial body axis roll rate.
double GetVNorthFpsIC(void) const
Gets the initial local frame X (North) velocity.
void SetThetaDegIC(double theta)
Sets pitch angle initial condition in degrees.
void SetVequivalentKtsIC(double ve)
Set equivalent airspeed initial condition in knots.
double GetPhiRadIC(void) const
Gets the initial roll angle.
double GetVBodyFpsIC(void) const
Gets the initial body axis Y velocity.
double GetVEastFpsIC(void) const
Gets the initial local frame Y (East) velocity.
double GetLatitudeDegIC(void) const
Gets the initial latitude.
double GetVgroundFpsIC(void) const
Gets the initial ground velocity.
double GetLongitudeRadIC(void) const
Gets the initial longitude.
double GetFlightPathAngleDegIC(void) const
Gets the initial flight path angle.
double GetThetaDegIC(void) const
Gets the initial pitch angle.
double GetVgroundKtsIC(void) const
Gets the initial ground speed.
void SetUBodyFpsIC(double ubody)
Sets the initial body axis X velocity.
double GetPhiDegIC(void) const
Gets the initial roll angle.
double GetAltitudeASLFtIC(void) const
Gets the initial altitude above sea level.
void SetClimbRateFpmIC(double roc)
Sets the climb rate initial condition in feet/minute.
double GetWindNFpsIC(void) const
Gets the initial wind velocity in local frame.
void SetFlightPathAngleRadIC(double gamma)
Sets the initial flight path angle.
void SetWBodyFpsIC(double wbody)
Sets the initial body axis Z velocity.
double GetTargetNlfIC(void) const
Gets the target normal load factor set from IC.
void SetMachIC(double mach)
Set mach initial condition.
void SetVtrueKtsIC(double vtrue)
Set true airspeed initial condition in knots.
void SetBetaRadIC(double beta)
Sets the initial sideslip angle.
double GetWindEFpsIC(void) const
Gets the initial wind velocity in local frame.
double GetTerrainElevationFtIC(void) const
Gets the initial terrain elevation.
void SetVBodyFpsIC(double vbody)
Sets the initial body axis Y velocity.
void SetLongitudeRadIC(double lon)
Sets the initial longitude.
void SetAlphaDegIC(double a)
Sets angle of attack initial condition in degrees.
void SetPRadpsIC(double P)
Sets the initial body axis roll rate.
double GetVDownFpsIC(void) const
Gets the initial local frame Z (Down) velocity.
double GetVcalibratedKtsIC(void) const
Gets the initial calibrated airspeed.
double GetWindDirDegIC(void) const
Gets the initial wind direction.
void SetFlightPathAngleDegIC(double gamma)
Sets the flight path angle initial condition in degrees.
double GetWBodyFpsIC(void) const
Gets the initial body axis Z velocity.
double GetBetaDegIC(void) const
Gets the initial sideslip angle.
void SetVgroundKtsIC(double vg)
Set ground speed initial condition in knots.
void SetLongitudeDegIC(double lon)
Sets the initial longitude.
double GetClimbRateFpsIC(void) const
Gets the initial climb rate.
void SetGeodLatitudeRadIC(double glat)
Sets the initial geodetic latitude.
double GetWindMagFpsIC(void) const
Gets the initial total wind velocity in feet/sec.
double GetAltitudeAGLFtIC(void) const
Gets the initial altitude above ground level.
double GetMachIC(void) const
Gets the initial mach.
void SetThetaRadIC(double theta)
Sets the initial pitch angle.
double GetVtrueFpsIC(void) const
Gets the initial true velocity.
double GetGeodLatitudeDegIC(void) const
Gets the initial geodetic latitude.
void SetTerrainElevationFtIC(double elev)
Sets the initial terrain elevation.
double GetRRadpsIC() const
Gets the initial body axis yaw rate.
double GetAlphaRadIC(void) const
Gets the initial angle of attack.
double GetAlphaDegIC(void) const
Gets the initial angle of attack.
void SetClimbRateFpsIC(double roc)
Sets the initial climb rate.
void SetTargetNlfIC(double nlf)
Sets the target normal load factor.
void SetVtrueFpsIC(double vt)
Sets the initial true airspeed.
void SetPsiDegIC(double psi)
Sets the heading angle initial condition in degrees.
void SetAlphaRadIC(double alpha)
Sets the initial angle of attack.
double GetGeodLatitudeRadIC(void) const
Gets the initial geodetic latitude.
void SetRRadpsIC(double R)
Sets the initial body axis yaw rate.
void SetQRadpsIC(double Q)
Sets the initial body axis pitch rate.
double GetUBodyFpsIC(void) const
Gets the initial body axis X velocity.
double GetQRadpsIC() const
Gets the initial body axis pitch rate.
void SetVDownFpsIC(double vd)
Sets the initial local axis down velocity.
void SetLatitudeRadIC(double lat)
Sets the initial latitude.
void SetGeodLatitudeDegIC(double glat)
Sets the initial geodetic latitude.
double GetVequivalentKtsIC(void) const
Gets the initial equivalent airspeed.
void SetPhiDegIC(double phi)
Sets the roll angle initial condition in degrees.
void SetBetaDegIC(double b)
Sets angle of sideslip initial condition in degrees.
double GetFlightPathAngleRadIC(void) const
Gets the initial flight path angle.
double GetPsiRadIC(void) const
Gets the initial heading angle.
void SetWindDirDegIC(double dir)
Sets the initial wind direction.
double GetClimbRateFpmIC(void) const
Gets the initial climb rate.
double GetThetaRadIC(void) const
Gets the initial pitch angle.
void SetVNorthFpsIC(double vn)
Sets the initial local axis north velocity.
void SetPhiRadIC(double phi)
Sets the initial roll angle.
double GetWindUFpsIC(void) const
Gets the initial body axis X wind velocity.
void SetLatitudeDegIC(double lat)
Sets the initial latitude.
double GetWindVFpsIC(void) const
Gets the initial body axis Y wind velocity.
void SetAltitudeASLFtIC(double altitudeASL)
Sets the altitude above sea level initial condition in feet.
void SetWindMagFpsIC(double mag)
Sets the initial total wind speed.
double GetVtrueKtsIC(void) const
Gets the initial true velocity.
double GetPsiDegIC(void) const
Gets the initial heading angle.
double GetLatitudeRadIC(void) const
Gets the initial latitude.
double GetWindDFpsIC(void) const
Gets the initial wind velocity in local frame.
void SetVEastFpsIC(double ve)
Sets the initial local axis east velocity.
void SetVgroundFpsIC(double vg)
Sets the initial ground speed.
double GetWindWFpsIC(void) const
Gets the initial body axis Z wind velocity.
double GetBetaRadIC(void) const
Gets the initial angle of sideslip.
double GetLongitudeDegIC(void) const
Gets the initial longitude.
double GetGeodAltitude(void) const
Gets the geodetic altitude in feet.
Definition FGLocation.h:279

◆ GetAlphaDegIC()

double GetAlphaDegIC ( void  ) const
inline

Gets the initial angle of attack.

Returns
Initial alpha in degrees

Definition at line 349 of file FGInitialCondition.h.

349{ return alpha*radtodeg; }

◆ GetAlphaRadIC()

double GetAlphaRadIC ( void  ) const
inline

Gets the initial angle of attack.

Returns
Initial alpha in radians

Definition at line 625 of file FGInitialCondition.h.

625{ return alpha; }

◆ GetAltitudeAGLFtIC()

double GetAltitudeAGLFtIC ( void  ) const

Gets the initial altitude above ground level.

Returns
Initial altitude AGL in feet

Definition at line 664 of file FGInitialCondition.cpp.

665{
666 return fdmex->GetInertial()->GetAltitudeAGL(position);
667}
std::shared_ptr< FGInertial > GetInertial(void) const
Returns the FGInertial pointer.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAltitudeASLFtIC()

double GetAltitudeASLFtIC ( void  ) const

Gets the initial altitude above sea level.

Returns
Initial altitude in feet.

Definition at line 657 of file FGInitialCondition.cpp.

658{
659 return position.GetRadius() - position.GetSeaLevelRadius();
660}
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetBetaDegIC()

double GetBetaDegIC ( void  ) const
inline

Gets the initial sideslip angle.

Returns
Initial beta in degrees

Definition at line 353 of file FGInitialCondition.h.

353{ return beta*radtodeg; }

◆ GetBetaRadIC()

double GetBetaRadIC ( void  ) const
inline

Gets the initial angle of sideslip.

Returns
Initial sideslip angle in radians

Definition at line 629 of file FGInitialCondition.h.

629{ return beta; }

◆ GetClimbRateFpmIC()

double GetClimbRateFpmIC ( void  ) const
inline

Gets the initial climb rate.

Returns
Initial climb rate in feet/minute

Definition at line 339 of file FGInitialCondition.h.

340 { return GetClimbRateFpsIC()*60; }

◆ GetClimbRateFpsIC()

double GetClimbRateFpsIC ( void  ) const
inline

Gets the initial climb rate.

Returns
Initial rate of climb in feet/second

Definition at line 520 of file FGInitialCondition.h.

521 {
522 const FGMatrix33& Tb2l = orientation.GetTInv();
523 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
524 return -_vt_NED(eW);
525 }
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.

◆ GetEarthPositionAngleIC()

double GetEarthPositionAngleIC ( void  ) const
inline

Gets the initial Earth position angle.

Returns
Initial Earth position angle in radians.

Definition at line 394 of file FGInitialCondition.h.

394{ return epa; }

◆ GetFlightPathAngleDegIC()

double GetFlightPathAngleDegIC ( void  ) const
inline

Gets the initial flight path angle.

Returns
Initial flight path angle in degrees

Definition at line 344 of file FGInitialCondition.h.

345 { return GetFlightPathAngleRadIC()*radtodeg; }

◆ GetFlightPathAngleRadIC()

double GetFlightPathAngleRadIC ( void  ) const
inline

Gets the initial flight path angle.

If total velocity is zero, this function returns zero.

Returns
Initial flight path angle in radians

Definition at line 620 of file FGInitialCondition.h.

621 { return (vt == 0.0)?0.0:asin(GetClimbRateFpsIC() / vt); }

◆ GetGeodLatitudeDegIC()

double GetGeodLatitudeDegIC ( void  ) const
inline

Gets the initial geodetic latitude.

Returns
Initial geodetic latitude in degrees

Definition at line 373 of file FGInitialCondition.h.

374 { return position.GetGeodLatitudeDeg(); }
double GetGeodLatitudeDeg(void) const
Get the GEODETIC latitude in degrees.
Definition FGLocation.h:273

◆ GetGeodLatitudeRadIC()

double GetGeodLatitudeRadIC ( void  ) const
inline

Gets the initial geodetic latitude.

Returns
Initial geodetic latitude in radians

Definition at line 641 of file FGInitialCondition.h.

642 { return position.GetGeodLatitudeRad(); }
double GetGeodLatitudeRad(void) const
Get the GEODETIC latitude in radians.
Definition FGLocation.h:258

◆ GetLatitudeDegIC()

double GetLatitudeDegIC ( void  ) const
inline

Gets the initial latitude.

Returns
Initial geocentric latitude in degrees

Definition at line 369 of file FGInitialCondition.h.

369{ return position.GetLatitudeDeg(); }
double GetLatitudeDeg() const
Get the GEOCENTRIC latitude in degrees.
Definition FGLocation.h:267

◆ GetLatitudeRadIC()

double GetLatitudeRadIC ( void  ) const
inline

Gets the initial latitude.

Returns
Initial latitude in radians

Definition at line 637 of file FGInitialCondition.h.

637{ return position.GetLatitude(); }
double GetLatitude() const
Get the GEOCENTRIC latitude in radians.
Definition FGLocation.h:252

◆ GetLongitudeDegIC()

double GetLongitudeDegIC ( void  ) const
inline

Gets the initial longitude.

Returns
Initial longitude in degrees

Definition at line 378 of file FGInitialCondition.h.

378{ return position.GetLongitudeDeg(); }
double GetLongitudeDeg() const
Get the longitude.
Definition FGLocation.h:240

◆ GetLongitudeRadIC()

double GetLongitudeRadIC ( void  ) const
inline

Gets the initial longitude.

Returns
Initial longitude in radians

Definition at line 646 of file FGInitialCondition.h.

646{ return position.GetLongitude(); }
double GetLongitude() const
Get the longitude.
Definition FGLocation.h:234

◆ GetMachIC()

double GetMachIC ( void  ) const

Gets the initial mach.

Returns
Initial mach number

Definition at line 989 of file FGInitialCondition.cpp.

990{
991 const auto Atmosphere = fdmex->GetAtmosphere();
992 double altitudeASL = GetAltitudeASLFtIC();
993 double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
994 return vt / soundSpeed;
995}
+ Here is the call graph for this function:

◆ GetOrientation()

const FGQuaternion & GetOrientation ( void  ) const
inline

Gets the initial orientation.

Returns
Initial orientation

Definition at line 650 of file FGInitialCondition.h.

650{ return orientation; }

◆ GetPhiDegIC()

double GetPhiDegIC ( void  ) const
inline

Gets the initial roll angle.

Returns
Initial phi in degrees

Definition at line 361 of file FGInitialCondition.h.

361{ return orientation.GetEulerDeg(ePhi); }
double GetEulerDeg(int i) const
Retrieves the Euler angles.

◆ GetPhiRadIC()

double GetPhiRadIC ( void  ) const
inline

Gets the initial roll angle.

Returns
Initial roll angle in radians

Definition at line 654 of file FGInitialCondition.h.

654{ return orientation.GetEuler(ePhi); }
const FGColumnVector3 & GetEuler(void) const
Retrieves the Euler angles.
+ Here is the caller graph for this function:

◆ GetPosition()

const FGLocation & GetPosition ( void  ) const
inline

Gets the initial position.

Returns
Initial location

Definition at line 633 of file FGInitialCondition.h.

633{ return position; }

◆ GetPQRRadpsIC()

const FGColumnVector3 GetPQRRadpsIC ( void  ) const
inline

Gets the initial body rotation rate.

Returns
Initial body rotation rate in radians/second

Definition at line 560 of file FGInitialCondition.h.

560{ return vPQR_body; }

◆ GetPRadpsIC()

double GetPRadpsIC ( ) const
inline

Gets the initial body axis roll rate.

Returns
Initial body axis roll rate in radians/second

Definition at line 564 of file FGInitialCondition.h.

564{ return vPQR_body(eP); }

◆ GetPsiDegIC()

double GetPsiDegIC ( void  ) const
inline

Gets the initial heading angle.

Returns
Initial psi in degrees

Definition at line 365 of file FGInitialCondition.h.

365{ return orientation.GetEulerDeg(ePsi); }

◆ GetPsiRadIC()

double GetPsiRadIC ( void  ) const
inline

Gets the initial heading angle.

Returns
Initial heading angle in radians

Definition at line 662 of file FGInitialCondition.h.

662{ return orientation.GetEuler(ePsi); }
+ Here is the caller graph for this function:

◆ GetQRadpsIC()

double GetQRadpsIC ( ) const
inline

Gets the initial body axis pitch rate.

Returns
Initial body axis pitch rate in radians/second

Definition at line 568 of file FGInitialCondition.h.

568{ return vPQR_body(eQ); }

◆ GetRRadpsIC()

double GetRRadpsIC ( ) const
inline

Gets the initial body axis yaw rate.

Returns
Initial body axis yaw rate in radians/second

Definition at line 572 of file FGInitialCondition.h.

572{ return vPQR_body(eR); }

◆ GetSpeedSet()

speedset GetSpeedSet ( void  ) const
inline

Gets the initial speedset.

Returns
Initial speedset

Definition at line 666 of file FGInitialCondition.h.

666{ return lastSpeedSet; }

◆ GetTargetNlfIC()

double GetTargetNlfIC ( void  ) const
inline

Gets the target normal load factor set from IC.

Returns
target normal load factor set from IC

Definition at line 670 of file FGInitialCondition.h.

670{ return targetNlfIC; }
+ Here is the caller graph for this function:

◆ GetTerrainElevationFtIC()

double GetTerrainElevationFtIC ( void  ) const

Gets the initial terrain elevation.

Returns
Initial terrain elevation in feet

Definition at line 671 of file FGInitialCondition.cpp.

672{
673 FGColumnVector3 normal, v, w;
674 FGLocation contact;
675 double a = fdmex->GetInertial()->GetSemimajor();
676 double b = fdmex->GetInertial()->GetSemiminor();
677 contact.SetEllipse(a, b);
678 fdmex->GetInertial()->GetContactPoint(position, contact, normal, v, w);
679 return contact.GetGeodAltitude();
680}
+ Here is the call graph for this function:

◆ GetThetaDegIC()

double GetThetaDegIC ( void  ) const
inline

Gets the initial pitch angle.

Returns
Initial pitch angle in degrees

Definition at line 357 of file FGInitialCondition.h.

357{ return orientation.GetEulerDeg(eTht); }

◆ GetThetaRadIC()

double GetThetaRadIC ( void  ) const
inline

Gets the initial pitch angle.

Returns
Initial pitch angle in radians

Definition at line 658 of file FGInitialCondition.h.

658{ return orientation.GetEuler(eTht); }
+ Here is the caller graph for this function:

◆ GetUBodyFpsIC()

double GetUBodyFpsIC ( void  ) const
inline

Gets the initial body axis X velocity.

Returns
Initial body axis X velocity in feet/second.

Definition at line 536 of file FGInitialCondition.h.

536{ return GetBodyVelFpsIC(eU); }

◆ GetUVWFpsIC()

const FGColumnVector3 GetUVWFpsIC ( void  ) const
inline

Gets the initial body velocity.

Returns
Initial body velocity in feet/second.

Definition at line 529 of file FGInitialCondition.h.

529 {
530 const FGMatrix33& Tl2b = orientation.GetT();
531 return Tl2b * vUVW_NED;
532 }
const FGMatrix33 & GetT(void) const
Transformation matrix.

◆ GetVBodyFpsIC()

double GetVBodyFpsIC ( void  ) const
inline

Gets the initial body axis Y velocity.

Returns
Initial body axis Y velocity in feet/second.

Definition at line 540 of file FGInitialCondition.h.

540{ return GetBodyVelFpsIC(eV); }

◆ GetVcalibratedKtsIC()

double GetVcalibratedKtsIC ( void  ) const

Gets the initial calibrated airspeed.

Returns
Initial calibrated airspeed in knots

Definition at line 966 of file FGInitialCondition.cpp.

967{
968 const auto Atmosphere = fdmex->GetAtmosphere();
969 double altitudeASL = GetAltitudeASLFtIC();
970 double pressure = Atmosphere->GetPressure(altitudeASL);
971 double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
972 double mach = vt / soundSpeed;
973
974 return fpstokts * Auxiliary->VcalibratedFromMach(mach, pressure);
975}
+ Here is the call graph for this function:

◆ GetVDownFpsIC()

double GetVDownFpsIC ( void  ) const
inline

Gets the initial local frame Z (Down) velocity.

Returns
Initial local frame Z (Down) axis velocity in feet/second.

Definition at line 556 of file FGInitialCondition.h.

556{ return vUVW_NED(eW); }

◆ GetVEastFpsIC()

double GetVEastFpsIC ( void  ) const
inline

Gets the initial local frame Y (East) velocity.

Returns
Initial local frame Y (East) axis velocity in feet/second.

Definition at line 552 of file FGInitialCondition.h.

552{ return vUVW_NED(eV); }

◆ GetVequivalentKtsIC()

double GetVequivalentKtsIC ( void  ) const

Gets the initial equivalent airspeed.

Returns
Initial equivalent airspeed in knots

Definition at line 979 of file FGInitialCondition.cpp.

980{
981 const auto Atmosphere = fdmex->GetAtmosphere();
982 double altitudeASL = GetAltitudeASLFtIC();
983 double rho = Atmosphere->GetDensity(altitudeASL);
984 return fpstokts * vt * sqrt(rho/FGAtmosphere::StdDaySLdensity);
985}
+ Here is the call graph for this function:

◆ GetVgroundFpsIC()

double GetVgroundFpsIC ( void  ) const
inline

Gets the initial ground velocity.

Returns
Initial ground velocity in feet/second

Definition at line 476 of file FGInitialCondition.h.

476{ return vUVW_NED.Magnitude(eU, eV); }
double Magnitude(void) const
Length of the vector.

◆ GetVgroundKtsIC()

double GetVgroundKtsIC ( void  ) const
inline

Gets the initial ground speed.

Returns
Initial ground speed in knots

Definition at line 327 of file FGInitialCondition.h.

327{ return GetVgroundFpsIC() * fpstokts; }

◆ GetVNorthFpsIC()

double GetVNorthFpsIC ( void  ) const
inline

Gets the initial local frame X (North) velocity.

Returns
Initial local frame X (North) axis velocity in feet/second.

Definition at line 548 of file FGInitialCondition.h.

548{ return vUVW_NED(eU); }

◆ GetVtrueFpsIC()

double GetVtrueFpsIC ( void  ) const
inline

Gets the initial true velocity.

Returns
Initial true velocity in feet/second

Definition at line 480 of file FGInitialCondition.h.

480{ return vt; }

◆ GetVtrueKtsIC()

double GetVtrueKtsIC ( void  ) const
inline

Gets the initial true velocity.

Returns
Initial true airspeed in knots.

Definition at line 331 of file FGInitialCondition.h.

331{ return vt*fpstokts; }

◆ GetWBodyFpsIC()

double GetWBodyFpsIC ( void  ) const
inline

Gets the initial body axis Z velocity.

Returns
Initial body axis Z velocity in feet/second.

Definition at line 544 of file FGInitialCondition.h.

544{ return GetBodyVelFpsIC(eW); }

◆ GetWindDFpsIC()

double GetWindDFpsIC ( void  ) const
inline

Gets the initial wind velocity in local frame.

Returns
Initial wind velocity downwards in feet/second

Definition at line 508 of file FGInitialCondition.h.

508{ return GetWindNEDFpsIC()(eZ); }
FGColumnVector3 GetWindNEDFpsIC(void) const
Gets the initial wind velocity in the NED local frame.

◆ GetWindDirDegIC()

double GetWindDirDegIC ( void  ) const

Gets the initial wind direction.

Returns
Initial wind direction in feet/second

Definition at line 923 of file FGInitialCondition.cpp.

924{
925 const FGMatrix33& Tb2l = orientation.GetTInv();
926 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
927 FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
928
929 return _vWIND_NED.Magnitude(eU, eV) == 0.0 ? 0.0
930 : atan2(_vWIND_NED(eV), _vWIND_NED(eU))*radtodeg;
931}
+ Here is the call graph for this function:

◆ GetWindEFpsIC()

double GetWindEFpsIC ( void  ) const
inline

Gets the initial wind velocity in local frame.

Returns
Initial wind velocity eastwards in feet/second

Definition at line 504 of file FGInitialCondition.h.

504{ return GetWindNEDFpsIC()(eY); }

◆ GetWindMagFpsIC()

double GetWindMagFpsIC ( void  ) const

Gets the initial total wind velocity in feet/sec.

Returns
Initial wind velocity in feet/second

Definition at line 943 of file FGInitialCondition.cpp.

944{
945 const FGMatrix33& Tb2l = orientation.GetTInv();
946 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
947 FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
948
949 return _vWIND_NED.Magnitude(eU, eV);
950}
+ Here is the call graph for this function:

◆ GetWindNEDFpsIC()

FGColumnVector3 GetWindNEDFpsIC ( void  ) const

Gets the initial wind velocity in the NED local frame.

Returns
Initial wind velocity in NED frame in feet/second

Definition at line 935 of file FGInitialCondition.cpp.

935 {
936 const FGMatrix33& Tb2l = orientation.GetTInv();
937 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
938 return _vt_NED - vUVW_NED;
939}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetWindNFpsIC()

double GetWindNFpsIC ( void  ) const
inline

Gets the initial wind velocity in local frame.

Returns
Initial wind velocity toward north in feet/second

Definition at line 500 of file FGInitialCondition.h.

500{ return GetWindNEDFpsIC()(eX); }

◆ GetWindUFpsIC()

double GetWindUFpsIC ( void  ) const
inline

Gets the initial body axis X wind velocity.

Returns
Initial body axis X wind velocity in feet/second

Definition at line 484 of file FGInitialCondition.h.

484{ return GetBodyWindFpsIC(eU); }

◆ GetWindVFpsIC()

double GetWindVFpsIC ( void  ) const
inline

Gets the initial body axis Y wind velocity.

Returns
Initial body axis Y wind velocity in feet/second

Definition at line 488 of file FGInitialCondition.h.

488{ return GetBodyWindFpsIC(eV); }

◆ GetWindWFpsIC()

double GetWindWFpsIC ( void  ) const
inline

Gets the initial body axis Z wind velocity.

Returns
Initial body axis Z wind velocity in feet/second

Definition at line 492 of file FGInitialCondition.h.

492{ return GetBodyWindFpsIC(eW); }

◆ InitializeIC()

void InitializeIC ( void  )

Initialize the initial conditions to default values.

Definition at line 125 of file FGInitialCondition.cpp.

126{
127 alpha = beta = 0.0;
128 epa = 0.0;
129
130 double a = fdmex->GetInertial()->GetSemimajor();
131 double b = fdmex->GetInertial()->GetSemiminor();
132
133 position.SetEllipse(a, b);
134
135 position.SetPositionGeodetic(0.0, 0.0, 0.0);
136
137 orientation = FGQuaternion(0.0, 0.0, 0.0);
138 vUVW_NED.InitMatrix();
139 vPQR_body.InitMatrix();
140 vt=0;
141
142 targetNlfIC = 1.0;
143
144 Tw2b = { 1., 0., 0., 0., 1., 0., 0., 0., 1. };
145 Tb2w = { 1., 0., 0., 0., 1., 0., 0., 0., 1. };
146
147 lastSpeedSet = setvt;
148 lastAltitudeSet = setasl;
149 lastLatitudeSet = setgeoc;
150 enginesRunning = 0;
151 trimRequested = TrimMode::tNone;
152}
void SetEllipse(double semimajor, double semiminor)
Sets the semimajor and semiminor axis lengths for this planet.
void SetPositionGeodetic(double lon, double lat, double height)
Sets the longitude, latitude and the distance above the reference spheroid.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsEngineRunning()

bool IsEngineRunning ( unsigned int  n) const
inline

Is an engine running ?

Parameters
indexof the engine to be checked
Returns
true if the engine is running.

Definition at line 681 of file FGInitialCondition.h.

681{ return (enginesRunning & (1 << n)) != 0; }

◆ Load()

bool Load ( const SGPath &  rstname,
bool  useAircraftPath = true 
)

Loads the initial conditions.

Parameters
rstnameThe name of an initial conditions file
useAircraftPathtrue if path is given relative to the aircraft path.
Returns
true if successful

Definition at line 1009 of file FGInitialCondition.cpp.

1010{
1011 SGPath init_file_name;
1012 if(useAircraftPath && rstfile.isRelative()) {
1013 init_file_name = fdmex->GetFullAircraftPath()/rstfile.utf8Str();
1014 } else {
1015 init_file_name = rstfile;
1016 }
1017
1018 FGXMLFileRead XMLFileRead;
1019 Element* document = XMLFileRead.LoadXMLDocument(init_file_name);
1020
1021 // Make sure that the document is valid
1022 if (!document) {
1023 LogException err;
1024 err << "File: " << init_file_name << " could not be read.\n";
1025 throw err;
1026 }
1027
1028 if (document->GetName() != "initialize") {
1029 LogException err;
1030 err << "File: " << init_file_name << " is not a reset file.\n";
1031 throw err;
1032 }
1033
1034 bool result = false;
1035
1036 // If doc has an version, check it. Otherwise fall back to legacy.
1037 if (document->HasAttribute("version")) {
1038 double version = document->GetAttributeValueAsNumber("version");
1039
1040 if (version >= 3.0) {
1041 XMLLogException err(document);
1042 err << "Only initialization file formats 1 and 2 are currently supported\n";
1043 throw err;
1044 } else if (version >= 2.0) {
1045 result = Load_v2(document);
1046 } else if (version >= 1.0) {
1047 result = Load_v1(document);
1048 }
1049
1050 } else {
1051 result = Load_v1(document);
1052 }
1053
1054 // Check to see if any engines are specified to be initialized in a running state
1055 Element* running_elements = document->FindElement("running");
1056 while (running_elements) {
1057 int engineNumber = int(running_elements->GetDataAsNumber());
1058 enginesRunning |= engineNumber == -1 ? engineNumber : 1 << engineNumber;
1059 running_elements = document->FindNextElement("running");
1060 }
1061
1062 return result;
1063}
const SGPath & GetFullAircraftPath(void)
Retrieves the full aircraft path name.
Definition FGFDMExec.h:402
+ Here is the call graph for this function:

◆ ResetIC()

void ResetIC ( double  u0,
double  v0,
double  w0,
double  p0,
double  q0,
double  r0,
double  alpha0,
double  beta0,
double  phi0,
double  theta0,
double  psi0,
double  latitudeRad0,
double  longitudeRad0,
double  altitudeAGL0,
double  gamma0 
)

Resets the IC data structure to new values.

Parameters
u,v,w,...

Definition at line 87 of file FGInitialCondition.cpp.

93{
94 double calpha = cos(alpha0), cbeta = cos(beta0);
95 double salpha = sin(alpha0), sbeta = sin(beta0);
96
98
99 vPQR_body = {p0, q0, r0};
100 alpha = alpha0; beta = beta0;
101
102 position.SetLongitude(lonRad0);
103 position.SetLatitude(latRad0);
104 fdmex->GetInertial()->SetAltitudeAGL(position, altAGLFt0);
105 lastLatitudeSet = setgeoc;
106 lastAltitudeSet = setagl;
107
108 orientation = FGQuaternion(phi0, theta0, psi0);
109 const FGMatrix33& Tb2l = orientation.GetTInv();
110
111 vUVW_NED = Tb2l * FGColumnVector3(u0, v0, w0);
112 vt = vUVW_NED.Magnitude();
113 lastSpeedSet = setuvw;
114
115 Tw2b = { calpha*cbeta, -calpha*sbeta, -salpha,
116 sbeta, cbeta, 0.0,
117 salpha*cbeta, -salpha*sbeta, calpha };
118 Tb2w = Tw2b.Transposed();
119
121}
void SetLongitude(double longitude)
Set the longitude.
void SetLatitude(double latitude)
Set the GEOCENTRIC latitude.
FGMatrix33 Transposed(void) const
Transposed matrix.
Definition FGMatrix33.h:221
+ Here is the call graph for this function:

◆ SetAlphaDegIC()

void SetAlphaDegIC ( double  a)
inline

Sets angle of attack initial condition in degrees.

Parameters
aAlpha in degrees

Definition at line 256 of file FGInitialCondition.h.

256{ SetAlphaRadIC(a*degtorad); }

◆ SetAlphaRadIC()

void SetAlphaRadIC ( double  alpha)

Sets the initial angle of attack.

Parameters
alphaInitial angle of attack in radians

Definition at line 319 of file FGInitialCondition.cpp.

320{
321 const FGMatrix33& Tb2l = orientation.GetTInv();
322 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
323 calcThetaBeta(alfa, _vt_NED);
324}
+ Here is the call graph for this function:

◆ SetAltitudeAGLFtIC()

void SetAltitudeAGLFtIC ( double  agl)

Sets the initial Altitude above ground level.

Parameters
aglAltitude above ground level in feet

Definition at line 684 of file FGInitialCondition.cpp.

685{
686 const auto Atmosphere = fdmex->GetAtmosphere();
687 double altitudeASL = GetAltitudeASLFtIC();
688 double pressure = Atmosphere->GetPressure(altitudeASL);
689 double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
690 double rho = Atmosphere->GetDensity(altitudeASL);
691
692 double mach0 = vt / soundSpeed;
693 double vc0 = Auxiliary->VcalibratedFromMach(mach0, pressure);
694 double ve0 = vt * sqrt(rho/FGAtmosphere::StdDaySLdensity);
695
696 switch(lastLatitudeSet) {
697 case setgeod:
698 fdmex->GetInertial()->SetAltitudeAGL(position, agl);
699 break;
700 case setgeoc:
701 {
702 double a = fdmex->GetInertial()->GetSemimajor();
703 double b = fdmex->GetInertial()->GetSemiminor();
704 double e2 = 1.0-b*b/(a*a);
705 double tanlat = tan(position.GetLatitude());
706 double n = e2;
707 double prev_n = 1.0;
708 int iter = 0;
709 double longitude = position.GetLongitude();
710 double alt = position.GetGeodAltitude();
711 double h = -2.0*max(a,b);
712 double geodLat;
713 while ((fabs(n-prev_n) > 1E-15 || fabs(h-agl) > 1E-10) && iter < 10) {
714 geodLat = atan(tanlat/(1-n));
715 position.SetPositionGeodetic(longitude, geodLat, alt);
716 h = GetAltitudeAGLFtIC();
717 alt += agl-h;
718 double sinGeodLat = sin(geodLat);
719 double N = a/sqrt(1-e2*sinGeodLat*sinGeodLat);
720 prev_n = n;
721 n = e2*N/(N+alt);
722 iter++;
723 }
724 }
725 break;
726 }
727
728 altitudeASL = GetAltitudeASLFtIC();
729 soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
730 rho = Atmosphere->GetDensity(altitudeASL);
731 pressure = Atmosphere->GetPressure(altitudeASL);
732
733 switch(lastSpeedSet) {
734 case setvc:
735 mach0 = Auxiliary->MachFromVcalibrated(vc0, pressure);
736 SetVtrueFpsIC(mach0 * soundSpeed);
737 break;
738 case setmach:
739 SetVtrueFpsIC(mach0 * soundSpeed);
740 break;
741 case setve:
742 SetVtrueFpsIC(ve0 * sqrt(FGAtmosphere::StdDaySLdensity/rho));
743 break;
744 default: // Make the compiler stop complaining about missing enums
745 break;
746 }
747
748 lastAltitudeSet = setagl;
749}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetAltitudeASLFtIC()

void SetAltitudeASLFtIC ( double  altitudeASL)

Sets the altitude above sea level initial condition in feet.

Parameters
altitudeASLAltitude above sea level in feet

Definition at line 756 of file FGInitialCondition.cpp.

757{
758 const auto Atmosphere = fdmex->GetAtmosphere();
759 double altitudeASL = GetAltitudeASLFtIC();
760 double pressure = Atmosphere->GetPressure(altitudeASL);
761 double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
762 double rho = Atmosphere->GetDensity(altitudeASL);
763
764 double mach0 = vt / soundSpeed;
765 double vc0 = Auxiliary->VcalibratedFromMach(mach0, pressure);
766 double ve0 = vt * sqrt(rho/FGAtmosphere::StdDaySLdensity);
767
768 switch(lastLatitudeSet) {
769 case setgeod:
770 {
771 // Given an altitude above the mean sea level (or a position radius which
772 // is the same) and a geodetic latitude, compute the geodetic altitude.
773 double a = fdmex->GetInertial()->GetSemimajor();
774 double b = fdmex->GetInertial()->GetSemiminor();
775 double e2 = 1.0-b*b/(a*a);
776 double geodLatitude = position.GetGeodLatitudeRad();
777 double cosGeodLat = cos(geodLatitude);
778 double sinGeodLat = sin(geodLatitude);
779 double N = a/sqrt(1-e2*sinGeodLat*sinGeodLat);
780 double geodAlt = 0.0;
781 double n = e2;
782 double prev_n = 1.0;
783 int iter = 0;
784 // Use tan or cotan to solve the geodetic altitude to avoid floating point
785 // exceptions.
786 if (cosGeodLat > fabs(sinGeodLat)) { // tan() can safely be used.
787 double tanGeodLat = sinGeodLat/cosGeodLat;
788 double x0 = N*e2*cosGeodLat;
789 double x = 0.0;
790 while (fabs(n-prev_n) > 1E-15 && iter < 10) {
791 double tanLat = (1-n)*tanGeodLat; // See Stevens & Lewis 1.6-14
792 double cos2Lat = 1./(1.+tanLat*tanLat);
793 double slr = b/sqrt(1.-e2*cos2Lat);
794 double R = slr + alt;
795 x = R*sqrt(cos2Lat); // OK, cos(latitude) is always positive.
796 prev_n = n;
797 n = x0/x;
798 iter++;
799 }
800 geodAlt = x/cosGeodLat-N;
801 }
802 else { // better use cotan (i.e. 1./tan())
803 double cotanGeodLat = cosGeodLat/sinGeodLat;
804 double z0 = N*e2*sinGeodLat;
805 double z = 0.0;
806 while (fabs(n-prev_n) > 1E-15 && iter < 10) {
807 double cotanLat = cotanGeodLat/(1-n);
808 double sin2Lat = 1./(1.+cotanLat*cotanLat);
809 double cos2Lat = 1.-sin2Lat;
810 double slr = b/sqrt(1.-e2*cos2Lat);
811 double R = slr + alt;
812 z = R*sign(cotanLat)*sqrt(sin2Lat);
813 prev_n = n;
814 n = z0/(z0+z);
815 iter++;
816 }
817 geodAlt = z/sinGeodLat-N*(1-e2);
818 }
819
820 double longitude = position.GetLongitude();
821 position.SetPositionGeodetic(longitude, geodLatitude, geodAlt);
822 }
823 break;
824 case setgeoc:
825 {
826 double slr = position.GetSeaLevelRadius();
827 position.SetRadius(slr+alt);
828 }
829 break;
830 }
831
832 altitudeASL = position.GetGeodAltitude();
833 soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
834 rho = Atmosphere->GetDensity(altitudeASL);
835 pressure = Atmosphere->GetPressure(altitudeASL);
836
837 switch(lastSpeedSet) {
838 case setvc:
839 mach0 = Auxiliary->MachFromVcalibrated(vc0, pressure);
840 SetVtrueFpsIC(mach0 * soundSpeed);
841 break;
842 case setmach:
843 SetVtrueFpsIC(mach0 * soundSpeed);
844 break;
845 case setve:
846 SetVtrueFpsIC(ve0 * sqrt(FGAtmosphere::StdDaySLdensity/rho));
847 break;
848 default: // Make the compiler stop complaining about missing enums
849 break;
850 }
851
852 lastAltitudeSet = setasl;
853}
void SetRadius(double radius)
Set the distance from the center of the earth.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetBetaDegIC()

void SetBetaDegIC ( double  b)
inline

Sets angle of sideslip initial condition in degrees.

Parameters
BBeta in degrees

Definition at line 260 of file FGInitialCondition.h.

260{ SetBetaRadIC(b*degtorad);}

◆ SetBetaRadIC()

void SetBetaRadIC ( double  beta)

Sets the initial sideslip angle.

Parameters
betaInitial angle of sideslip in radians.

Definition at line 405 of file FGInitialCondition.cpp.

406{
407 const FGMatrix33& Tb2l = orientation.GetTInv();
408 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
409 FGColumnVector3 vOrient = orientation.GetEuler();
410
411 beta = bta;
412 double calpha = cos(alpha), salpha = sin(alpha);
413 double cbeta = cos(beta), sbeta = sin(beta);
414 double cphi = orientation.GetCosEuler(ePhi), sphi = orientation.GetSinEuler(ePhi);
415 FGMatrix33 TphiInv(1., 0., 0.,
416 0., cphi,-sphi,
417 0., sphi, cphi);
418
419 Tw2b = { calpha*cbeta, -calpha*sbeta, -salpha,
420 sbeta, cbeta, 0.0,
421 salpha*cbeta, -salpha*sbeta, calpha };
422 Tb2w = Tw2b.Transposed();
423
424 FGColumnVector3 vf = TphiInv * Tw2b * FGColumnVector3(vt, 0., 0.);
425 FGColumnVector3 v0xy(_vt_NED(eX), _vt_NED(eY), 0.);
426 FGColumnVector3 v1xy(sqrt(v0xy(eX)*v0xy(eX)+v0xy(eY)*v0xy(eY)-vf(eY)*vf(eY)),vf(eY),0.);
427 v0xy.Normalize();
428 v1xy.Normalize();
429
430 if (vf(eX) < 0.) v0xy(eX) *= -1.0;
431
432 double sinPsi = (v1xy * v0xy)(eZ);
433 double cosPsi = DotProduct(v0xy, v1xy);
434 vOrient(ePsi) = atan2(sinPsi, cosPsi);
435 FGMatrix33 Tpsi( cosPsi, sinPsi, 0.,
436 -sinPsi, cosPsi, 0.,
437 0., 0., 1.);
438
439 FGColumnVector3 v2xz = Tpsi * _vt_NED;
440 FGColumnVector3 vfxz = vf;
441 v2xz(eV) = vfxz(eV) = 0.0;
442 v2xz.Normalize();
443 vfxz.Normalize();
444 double sinTheta = (v2xz * vfxz)(eY);
445 vOrient(eTht) = -asin(sinTheta);
446
447 orientation = FGQuaternion(vOrient);
448}
double GetSinEuler(int i) const
Retrieves sine of the given euler angle.
double GetCosEuler(int i) const
Retrieves cosine of the given euler angle.
double DotProduct(const FGColumnVector3 &v1, const FGColumnVector3 &v2)
Dot product of two vectors Compute and return the euclidean dot (or scalar) product of two vectors v1...
+ Here is the call graph for this function:

◆ SetClimbRateFpmIC()

void SetClimbRateFpmIC ( double  roc)
inline

Sets the climb rate initial condition in feet/minute.

Parameters
rocRate of Climb in feet/minute

Definition at line 283 of file FGInitialCondition.h.

283{ SetClimbRateFpsIC(roc/60.0); }

◆ SetClimbRateFpsIC()

void SetClimbRateFpsIC ( double  roc)

Sets the initial climb rate.

Parameters
rocInitial Rate of climb in feet/second

Definition at line 289 of file FGInitialCondition.cpp.

290{
291 if (fabs(hdot) > vt) {
292 FGLogging log(LogLevel::ERROR);
293 log << "The climb rate cannot be higher than the true speed.\n";
294 return;
295 }
296
297 const FGMatrix33& Tb2l = orientation.GetTInv();
298 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
299 FGColumnVector3 _WIND_NED = _vt_NED - vUVW_NED;
300 double hdot0 = -_vt_NED(eW);
301
302 if (fabs(hdot0) < vt) { // Is this check really needed ?
303 double scale = sqrt((vt*vt-hdot*hdot)/(vt*vt-hdot0*hdot0));
304 _vt_NED(eU) *= scale;
305 _vt_NED(eV) *= scale;
306 }
307 _vt_NED(eW) = -hdot;
308 vUVW_NED = _vt_NED - _WIND_NED;
309
310 // Updating the angles theta and beta to keep the true airspeed amplitude
311 calcThetaBeta(alpha, _vt_NED);
312}
+ Here is the call graph for this function:

◆ SetCrossWindKtsIC()

void SetCrossWindKtsIC ( double  cross)

Sets the initial crosswind speed.

Parameters
crossInitial crosswind speed, positive from left to right

Definition at line 535 of file FGInitialCondition.cpp.

536{
537 const FGMatrix33& Tb2l = orientation.GetTInv();
538 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
539 FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
540 FGColumnVector3 _vCROSS(-orientation.GetSinEuler(ePsi), orientation.GetCosEuler(ePsi), 0.);
541
542 // Gram-Schmidt process is used to remove the existing cross wind component
543 _vWIND_NED -= DotProduct(_vWIND_NED, _vCROSS) * _vCROSS;
544 // Which is now replaced by the new value. The input cross wind is expected
545 // in knots, so first convert to fps, which is the internal unit used.
546 _vWIND_NED += (cross * ktstofps) * _vCROSS;
547 _vt_NED = vUVW_NED + _vWIND_NED;
548 vt = _vt_NED.Magnitude();
549
550 calcAeroAngles(_vt_NED);
551}
+ Here is the call graph for this function:

◆ SetFlightPathAngleDegIC()

void SetFlightPathAngleDegIC ( double  gamma)
inline

Sets the flight path angle initial condition in degrees.

Parameters
gammaFlight path angle in degrees

Definition at line 287 of file FGInitialCondition.h.

288 { SetClimbRateFpsIC(vt*sin(gamma*degtorad)); }

◆ SetFlightPathAngleRadIC()

void SetFlightPathAngleRadIC ( double  gamma)
inline

Sets the initial flight path angle.

Parameters
gammaInitial flight path angle in radians

Definition at line 576 of file FGInitialCondition.h.

577 { SetClimbRateFpsIC(vt*sin(gamma)); }
+ Here is the caller graph for this function:

◆ SetGeodLatitudeDegIC()

void SetGeodLatitudeDegIC ( double  glat)
inline

Sets the initial geodetic latitude.

This method modifies the geodetic altitude in order to keep the altitude above sea level unchanged.

Parameters
glatInitial geodetic latitude in degrees

Definition at line 310 of file FGInitialCondition.h.

311 { SetGeodLatitudeRadIC(glat*degtorad); }

◆ SetGeodLatitudeRadIC()

void SetGeodLatitudeRadIC ( double  glat)

Sets the initial geodetic latitude.

This method modifies the geodetic altitude in order to keep the altitude above sea level unchanged.

Parameters
glatInitial geodetic latitude in radians

Definition at line 857 of file FGInitialCondition.cpp.

858{
859 double lon = position.GetLongitude();
860 lastLatitudeSet = setgeod;
861
862 switch (lastAltitudeSet)
863 {
864 case setagl:
865 {
866 double agl = GetAltitudeAGLFtIC();
867 position.SetPositionGeodetic(lon, geodLatitude, 0.);
868 fdmex->GetInertial()->SetAltitudeAGL(position, agl);
869 }
870 break;
871 case setasl:
872 {
873 double asl = GetAltitudeASLFtIC();
874 position.SetPositionGeodetic(lon, geodLatitude, 0.);
876 }
877 break;
878 }
879}
+ Here is the call graph for this function:

◆ SetHeadWindKtsIC()

void SetHeadWindKtsIC ( double  head)

Sets the initial headwind velocity.

Parameters
headInitial headwind speed in knots

Definition at line 558 of file FGInitialCondition.cpp.

559{
560 const FGMatrix33& Tb2l = orientation.GetTInv();
561 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
562 FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
563 // This is a head wind, so the direction vector for the wind
564 // needs to be set opposite to the heading the aircraft
565 // is taking. So, the cos and sin of the heading (psi)
566 // are negated in the line below.
567 FGColumnVector3 _vHEAD(-orientation.GetCosEuler(ePsi), -orientation.GetSinEuler(ePsi), 0.);
568
569 // Gram-Schmidt process is used to remove the existing head wind component
570 _vWIND_NED -= DotProduct(_vWIND_NED, _vHEAD) * _vHEAD;
571 // Which is now replaced by the new value. The input head wind is expected
572 // in knots, so first convert to fps, which is the internal unit used.
573 _vWIND_NED += (head * ktstofps) * _vHEAD;
574 _vt_NED = vUVW_NED + _vWIND_NED;
575
576 vt = _vt_NED.Magnitude();
577
578 calcAeroAngles(_vt_NED);
579}
+ Here is the call graph for this function:

◆ SetLatitudeDegIC()

void SetLatitudeDegIC ( double  lat)
inline

Sets the initial latitude.

Parameters
latInitial latitude in degrees

Definition at line 304 of file FGInitialCondition.h.

304{ SetLatitudeRadIC(lat*degtorad); }

◆ SetLatitudeRadIC()

void SetLatitudeRadIC ( double  lat)

Sets the initial latitude.

Parameters
latInitial latitude in radians

Definition at line 883 of file FGInitialCondition.cpp.

884{
885 double altitude;
886
887 lastLatitudeSet = setgeoc;
888
889 switch(lastAltitudeSet) {
890 case setagl:
891 altitude = GetAltitudeAGLFtIC();
892 position.SetLatitude(lat);
893 SetAltitudeAGLFtIC(altitude);
894 break;
895 default:
896 altitude = GetAltitudeASLFtIC();
897 position.SetLatitude(lat);
898 SetAltitudeASLFtIC(altitude);
899 break;
900 }
901}
+ Here is the call graph for this function:

◆ SetLongitudeDegIC()

void SetLongitudeDegIC ( double  lon)
inline

Sets the initial longitude.

Parameters
lonInitial longitude in degrees

Definition at line 315 of file FGInitialCondition.h.

315{ SetLongitudeRadIC(lon*degtorad); }

◆ SetLongitudeRadIC()

void SetLongitudeRadIC ( double  lon)

Sets the initial longitude.

Parameters
lonInitial longitude in radians

Definition at line 905 of file FGInitialCondition.cpp.

906{
907 double altitude;
908
909 switch(lastAltitudeSet) {
910 case setagl:
911 altitude = GetAltitudeAGLFtIC();
912 position.SetLongitude(lon);
913 SetAltitudeAGLFtIC(altitude);
914 break;
915 default:
916 position.SetLongitude(lon);
917 break;
918 }
919}
+ Here is the call graph for this function:

◆ SetMachIC()

void SetMachIC ( double  mach)

Set mach initial condition.

Parameters
machMach number

Definition at line 167 of file FGInitialCondition.cpp.

168{
169 const auto Atmosphere = fdmex->GetAtmosphere();
170 double altitudeASL = GetAltitudeASLFtIC();
171 double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
172 SetVtrueFpsIC(mach*soundSpeed);
173 lastSpeedSet = setmach;
174}
+ Here is the call graph for this function:

◆ SetPhiDegIC()

void SetPhiDegIC ( double  phi)
inline

Sets the roll angle initial condition in degrees.

Parameters
phiroll angle in degrees

Definition at line 275 of file FGInitialCondition.h.

275{ SetPhiRadIC(phi*degtorad);}

◆ SetPhiRadIC()

void SetPhiRadIC ( double  phi)
inline

Sets the initial roll angle.

Parameters
phiInitial roll angle in radians

Definition at line 589 of file FGInitialCondition.h.

589{ SetEulerAngleRadIC(ePhi, phi); }

◆ SetPRadpsIC()

void SetPRadpsIC ( double  P)
inline

Sets the initial body axis roll rate.

Parameters
PInitial roll rate in radians/second

Definition at line 430 of file FGInitialCondition.h.

430{ vPQR_body(eP) = P; }
+ Here is the caller graph for this function:

◆ SetPsiDegIC()

void SetPsiDegIC ( double  psi)
inline

Sets the heading angle initial condition in degrees.

Parameters
psiHeading angle in degrees

Definition at line 279 of file FGInitialCondition.h.

279{ SetPsiRadIC(psi*degtorad); }

◆ SetPsiRadIC()

void SetPsiRadIC ( double  psi)
inline

Sets the initial heading angle.

Parameters
psiInitial heading angle in radians

Definition at line 597 of file FGInitialCondition.h.

597{ SetEulerAngleRadIC(ePsi, psi); }

◆ SetQRadpsIC()

void SetQRadpsIC ( double  Q)
inline

Sets the initial body axis pitch rate.

Parameters
QInitial pitch rate in radians/second

Definition at line 434 of file FGInitialCondition.h.

434{ vPQR_body(eQ) = Q; }
+ Here is the caller graph for this function:

◆ SetRRadpsIC()

void SetRRadpsIC ( double  R)
inline

Sets the initial body axis yaw rate.

Parameters
Rinitial yaw rate in radians/second

Definition at line 438 of file FGInitialCondition.h.

438{ vPQR_body(eR) = R; }
+ Here is the caller graph for this function:

◆ SetTargetNlfIC()

void SetTargetNlfIC ( double  nlf)
inline

Sets the target normal load factor.

Parameters
nlfNormal load factor

Definition at line 615 of file FGInitialCondition.h.

615{ targetNlfIC=nlf; }

◆ SetTerrainElevationFtIC()

void SetTerrainElevationFtIC ( double  elev)

Sets the initial terrain elevation.

Parameters
elevInitial terrain elevation in feet

Definition at line 646 of file FGInitialCondition.cpp.

647{
648 double agl = GetAltitudeAGLFtIC();
649 fdmex->GetInertial()->SetTerrainElevation(elev);
650
651 if (lastAltitudeSet == setagl)
653}
+ Here is the call graph for this function:

◆ SetThetaDegIC()

void SetThetaDegIC ( double  theta)
inline

Sets pitch angle initial condition in degrees.

Parameters
thetaTheta (pitch) angle in degrees

Definition at line 264 of file FGInitialCondition.h.

264{ SetThetaRadIC(theta*degtorad); }

◆ SetThetaRadIC()

void SetThetaRadIC ( double  theta)
inline

Sets the initial pitch angle.

Parameters
thetaInitial pitch angle in radians

Definition at line 593 of file FGInitialCondition.h.

593{ SetEulerAngleRadIC(eTht, theta); }

◆ SetUBodyFpsIC()

void SetUBodyFpsIC ( double  ubody)
inline

Sets the initial body axis X velocity.

Parameters
ubodyInitial X velocity in feet/second

Definition at line 406 of file FGInitialCondition.h.

406{ SetBodyVelFpsIC(eU, ubody); }

◆ SetVBodyFpsIC()

void SetVBodyFpsIC ( double  vbody)
inline

Sets the initial body axis Y velocity.

Parameters
vbodyInitial Y velocity in feet/second

Definition at line 410 of file FGInitialCondition.h.

410{ SetBodyVelFpsIC(eV, vbody); }

◆ SetVcalibratedKtsIC()

void SetVcalibratedKtsIC ( double  vc)

Set calibrated airspeed initial condition in knots.

Parameters
vcCalibrated airspeed in knots

Definition at line 178 of file FGInitialCondition.cpp.

179{
180 const auto Atmosphere = fdmex->GetAtmosphere();
181 double altitudeASL = GetAltitudeASLFtIC();
182 double pressure = Atmosphere->GetPressure(altitudeASL);
183 double mach = Auxiliary->MachFromVcalibrated(fabs(vcas)*ktstofps, pressure);
184 double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
185
186 SetVtrueFpsIC(mach * soundSpeed);
187 lastSpeedSet = setvc;
188}
+ Here is the call graph for this function:

◆ SetVDownFpsIC()

void SetVDownFpsIC ( double  vd)
inline

Sets the initial local axis down velocity.

Parameters
vdInitial down velocity in feet/second

Definition at line 426 of file FGInitialCondition.h.

426{ SetNEDVelFpsIC(eW, vd); }

◆ SetVEastFpsIC()

void SetVEastFpsIC ( double  ve)
inline

Sets the initial local axis east velocity.

Parameters
veInitial east velocity in feet/second

Definition at line 422 of file FGInitialCondition.h.

422{ SetNEDVelFpsIC(eV, ve); }

◆ SetVequivalentKtsIC()

void SetVequivalentKtsIC ( double  ve)

Set equivalent airspeed initial condition in knots.

Parameters
veEquivalent airspeed in knots

Definition at line 156 of file FGInitialCondition.cpp.

157{
158 const auto Atmosphere = fdmex->GetAtmosphere();
159 double altitudeASL = GetAltitudeASLFtIC();
160 double rho = Atmosphere->GetDensity(altitudeASL);
161 SetVtrueFpsIC(ve*ktstofps*sqrt(FGAtmosphere::StdDaySLdensity/rho));
162 lastSpeedSet = setve;
163}
+ Here is the call graph for this function:

◆ SetVgroundFpsIC()

void SetVgroundFpsIC ( double  vg)

Sets the initial ground speed.

Parameters
vgInitial ground speed in feet/second

Definition at line 241 of file FGInitialCondition.cpp.

242{
243 const FGMatrix33& Tb2l = orientation.GetTInv();
244 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
245 FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
246
247 vUVW_NED(eU) = vg * orientation.GetCosEuler(ePsi);
248 vUVW_NED(eV) = vg * orientation.GetSinEuler(ePsi);
249 vUVW_NED(eW) = 0.;
250 _vt_NED = vUVW_NED + _vWIND_NED;
251 vt = _vt_NED.Magnitude();
252
253 calcAeroAngles(_vt_NED);
254
255 lastSpeedSet = setvg;
256}
+ Here is the call graph for this function:

◆ SetVgroundKtsIC()

void SetVgroundKtsIC ( double  vg)
inline

Set ground speed initial condition in knots.

Parameters
vgGround speed in knots

Definition at line 248 of file FGInitialCondition.h.

248{ SetVgroundFpsIC(vg*ktstofps); }

◆ SetVNorthFpsIC()

void SetVNorthFpsIC ( double  vn)
inline

Sets the initial local axis north velocity.

Parameters
vnInitial north velocity in feet/second

Definition at line 418 of file FGInitialCondition.h.

418{ SetNEDVelFpsIC(eU, vn); }

◆ SetVtrueFpsIC()

void SetVtrueFpsIC ( double  vt)

Sets the initial true airspeed.

Parameters
vtInitial true airspeed in feet/second

Definition at line 265 of file FGInitialCondition.cpp.

266{
267 const FGMatrix33& Tb2l = orientation.GetTInv();
268 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
269 FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
270
271 if (vt > 0.1)
272 _vt_NED *= vtrue / vt;
273 else
274 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vtrue, 0., 0.);
275
276 vt = vtrue;
277 vUVW_NED = _vt_NED - _vWIND_NED;
278
279 calcAeroAngles(_vt_NED);
280
281 lastSpeedSet = setvt;
282}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetVtrueKtsIC()

void SetVtrueKtsIC ( double  vtrue)
inline

Set true airspeed initial condition in knots.

Parameters
vtrueTrue airspeed in knots

Definition at line 244 of file FGInitialCondition.h.

244{ SetVtrueFpsIC(vtrue*ktstofps); }

◆ SetWBodyFpsIC()

void SetWBodyFpsIC ( double  wbody)
inline

Sets the initial body axis Z velocity.

Parameters
wbodyInitial Z velocity in feet/second

Definition at line 414 of file FGInitialCondition.h.

414{ SetBodyVelFpsIC(eW, wbody); }

◆ SetWindDirDegIC()

void SetWindDirDegIC ( double  dir)

Sets the initial wind direction.

Parameters
dirInitial direction wind is coming from in degrees

Definition at line 628 of file FGInitialCondition.cpp.

629{
630 const FGMatrix33& Tb2l = orientation.GetTInv();
631 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
632 FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
633 double mag = _vWIND_NED.Magnitude(eU, eV);
634 FGColumnVector3 _vHEAD(mag*cos(dir*degtorad), mag*sin(dir*degtorad), 0.);
635
636 _vWIND_NED(eU) = _vHEAD(eU);
637 _vWIND_NED(eV) = _vHEAD(eV);
638 _vt_NED = vUVW_NED + _vWIND_NED;
639 vt = _vt_NED.Magnitude();
640
641 calcAeroAngles(_vt_NED);
642}
+ Here is the call graph for this function:

◆ SetWindDownKtsIC()

void SetWindDownKtsIC ( double  wD)

Sets the initial wind downward speed.

Parameters
wDInitial downward wind speed in knots

Definition at line 586 of file FGInitialCondition.cpp.

587{
588 const FGMatrix33& Tb2l = orientation.GetTInv();
589 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
590
591 _vt_NED(eW) = vUVW_NED(eW) + wD * ktstofps;
592 vt = _vt_NED.Magnitude();
593
594 calcAeroAngles(_vt_NED);
595}
+ Here is the call graph for this function:

◆ SetWindMagFpsIC()

void SetWindMagFpsIC ( double  mag)
inline

Sets the initial total wind speed.

Parameters
magInitial wind velocity magnitude in feet/second

Definition at line 448 of file FGInitialCondition.h.

448{ SetWindMagKtsIC(mag * fpstokts); }
void SetWindMagKtsIC(double mag)
Sets the initial total wind speed.

◆ SetWindMagKtsIC()

void SetWindMagKtsIC ( double  mag)

Sets the initial total wind speed.

Parameters
magInitial wind velocity magnitude in knots

Definition at line 602 of file FGInitialCondition.cpp.

603{
604 const FGMatrix33& Tb2l = orientation.GetTInv();
605 FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
606 FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
607 FGColumnVector3 _vHEAD(_vWIND_NED(eU), _vWIND_NED(eV), 0.);
608 double windMag = _vHEAD.Magnitude();
609
610 if (windMag > 0.001)
611 _vHEAD *= (mag*ktstofps) / windMag;
612 else
613 _vHEAD = {mag*ktstofps, 0., 0.};
614
615 _vWIND_NED(eU) = _vHEAD(eU);
616 _vWIND_NED(eV) = _vHEAD(eV);
617 _vt_NED = vUVW_NED + _vWIND_NED;
618 vt = _vt_NED.Magnitude();
619
620 calcAeroAngles(_vt_NED);
621}
+ Here is the call graph for this function:

◆ SetWindNEDFpsIC()

void SetWindNEDFpsIC ( double  wN,
double  wE,
double  wD 
)

Sets the initial wind velocity.

Parameters
wNInitial wind velocity in local north direction, feet/second
wEInitial wind velocity in local east direction, feet/second
wDInitial wind velocity in local down direction, feet/second

Definition at line 522 of file FGInitialCondition.cpp.

523{
524 FGColumnVector3 _vt_NED = vUVW_NED + FGColumnVector3(wN, wE, wD);
525 vt = _vt_NED.Magnitude();
526
527 calcAeroAngles(_vt_NED);
528}
+ Here is the call graph for this function:

◆ TrimRequested()

int TrimRequested ( void  ) const
inline

Does initialization file call for trim ?

Returns
Trim type, if any requested (version 1).

Definition at line 685 of file FGInitialCondition.h.

685{ return trimRequested; }

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