JSBSim Flight Dynamics Model  1.2.0 (05 Nov 2023)
An Open Source Flight Dynamics and Control Software Library in C++
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:389
std::shared_ptr< FGPropagate > GetPropagate(void) const
Returns the FGPropagate pointer.
Definition: FGFDMExec.cpp:278
bool Run(void)
This function executes each scheduled model in succession.
Definition: FGFDMExec.cpp:413
bool RunIC(void)
Initializes the sim from the initial condition object and executes each scheduled model without integ...
Definition: FGFDMExec.cpp:643
FGInitialCondition(FGFDMExec *fdmex)
Constructor.

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

FGInitialCondition* fgic = FDMExec->GetIC();
fgic->Load(IC_file);

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. More...
 
double GetAlphaRadIC (void) const
 Gets the initial angle of attack. More...
 
double GetAltitudeAGLFtIC (void) const
 Gets the initial altitude above ground level. More...
 
double GetAltitudeASLFtIC (void) const
 Gets the initial altitude above sea level. More...
 
double GetBetaDegIC (void) const
 Gets the initial sideslip angle. More...
 
double GetBetaRadIC (void) const
 Gets the initial angle of sideslip. More...
 
double GetClimbRateFpmIC (void) const
 Gets the initial climb rate. More...
 
double GetClimbRateFpsIC (void) const
 Gets the initial climb rate. More...
 
double GetEarthPositionAngleIC (void) const
 Gets the initial Earth position angle. More...
 
double GetFlightPathAngleDegIC (void) const
 Gets the initial flight path angle. More...
 
double GetFlightPathAngleRadIC (void) const
 Gets the initial flight path angle. More...
 
double GetGeodLatitudeDegIC (void) const
 Gets the initial geodetic latitude. More...
 
double GetGeodLatitudeRadIC (void) const
 Gets the initial geodetic latitude. More...
 
double GetLatitudeDegIC (void) const
 Gets the initial latitude. More...
 
double GetLatitudeRadIC (void) const
 Gets the initial latitude. More...
 
double GetLongitudeDegIC (void) const
 Gets the initial longitude. More...
 
double GetLongitudeRadIC (void) const
 Gets the initial longitude. More...
 
double GetMachIC (void) const
 Gets the initial mach. More...
 
const FGQuaternionGetOrientation (void) const
 Gets the initial orientation. More...
 
double GetPhiDegIC (void) const
 Gets the initial roll angle. More...
 
double GetPhiRadIC (void) const
 Gets the initial roll angle. More...
 
const FGLocationGetPosition (void) const
 Gets the initial position. More...
 
const FGColumnVector3 GetPQRRadpsIC (void) const
 Gets the initial body rotation rate. More...
 
double GetPRadpsIC () const
 Gets the initial body axis roll rate. More...
 
double GetPsiDegIC (void) const
 Gets the initial heading angle. More...
 
double GetPsiRadIC (void) const
 Gets the initial heading angle. More...
 
double GetQRadpsIC () const
 Gets the initial body axis pitch rate. More...
 
double GetRRadpsIC () const
 Gets the initial body axis yaw rate. More...
 
speedset GetSpeedSet (void) const
 Gets the initial speedset. More...
 
double GetTargetNlfIC (void) const
 Gets the target normal load factor set from IC. More...
 
double GetTerrainElevationFtIC (void) const
 Gets the initial terrain elevation. More...
 
double GetThetaDegIC (void) const
 Gets the initial pitch angle. More...
 
double GetThetaRadIC (void) const
 Gets the initial pitch angle. More...
 
double GetUBodyFpsIC (void) const
 Gets the initial body axis X velocity. More...
 
const FGColumnVector3 GetUVWFpsIC (void) const
 Gets the initial body velocity. More...
 
double GetVBodyFpsIC (void) const
 Gets the initial body axis Y velocity. More...
 
double GetVcalibratedKtsIC (void) const
 Gets the initial calibrated airspeed. More...
 
double GetVDownFpsIC (void) const
 Gets the initial local frame Z (Down) velocity. More...
 
double GetVEastFpsIC (void) const
 Gets the initial local frame Y (East) velocity. More...
 
double GetVequivalentKtsIC (void) const
 Gets the initial equivalent airspeed. More...
 
double GetVgroundFpsIC (void) const
 Gets the initial ground velocity. More...
 
double GetVgroundKtsIC (void) const
 Gets the initial ground speed. More...
 
double GetVNorthFpsIC (void) const
 Gets the initial local frame X (North) velocity. More...
 
double GetVtrueFpsIC (void) const
 Gets the initial true velocity. More...
 
double GetVtrueKtsIC (void) const
 Gets the initial true velocity. More...
 
double GetWBodyFpsIC (void) const
 Gets the initial body axis Z velocity. More...
 
double GetWindDFpsIC (void) const
 Gets the initial wind velocity in local frame. More...
 
double GetWindDirDegIC (void) const
 Gets the initial wind direction. More...
 
double GetWindEFpsIC (void) const
 Gets the initial wind velocity in local frame. More...
 
double GetWindFpsIC (void) const
 Gets the initial total wind velocity in feet/sec. More...
 
FGColumnVector3 GetWindNEDFpsIC (void) const
 Gets the initial wind velocity in the NED local frame. More...
 
double GetWindNFpsIC (void) const
 Gets the initial wind velocity in local frame. More...
 
double GetWindUFpsIC (void) const
 Gets the initial body axis X wind velocity. More...
 
double GetWindVFpsIC (void) const
 Gets the initial body axis Y wind velocity. More...
 
double GetWindWFpsIC (void) const
 Gets the initial body axis Z wind velocity. More...
 
void InitializeIC (void)
 Initialize the initial conditions to default values.
 
bool IsEngineRunning (unsigned int n) const
 Is an engine running ? More...
 
bool Load (const SGPath &rstname, bool useAircraftPath=true)
 Loads the initial conditions. More...
 
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. More...
 
void SetAlphaDegIC (double a)
 Sets angle of attack initial condition in degrees. More...
 
void SetAlphaRadIC (double alpha)
 Sets the initial angle of attack. More...
 
void SetAltitudeAGLFtIC (double agl)
 Sets the initial Altitude above ground level. More...
 
void SetAltitudeASLFtIC (double altitudeASL)
 Sets the altitude above sea level initial condition in feet. More...
 
void SetBetaDegIC (double b)
 Sets angle of sideslip initial condition in degrees. More...
 
void SetBetaRadIC (double beta)
 Sets the initial sideslip angle. More...
 
void SetClimbRateFpmIC (double roc)
 Sets the climb rate initial condition in feet/minute. More...
 
void SetClimbRateFpsIC (double roc)
 Sets the initial climb rate. More...
 
void SetCrossWindKtsIC (double cross)
 Sets the initial crosswind speed. More...
 
void SetFlightPathAngleDegIC (double gamma)
 Sets the flight path angle initial condition in degrees. More...
 
void SetFlightPathAngleRadIC (double gamma)
 Sets the initial flight path angle. More...
 
void SetGeodLatitudeDegIC (double glat)
 Sets the initial geodetic latitude. More...
 
void SetGeodLatitudeRadIC (double glat)
 Sets the initial geodetic latitude. More...
 
void SetHeadWindKtsIC (double head)
 Sets the initial headwind velocity. More...
 
void SetLatitudeDegIC (double lat)
 Sets the initial latitude. More...
 
void SetLatitudeRadIC (double lat)
 Sets the initial latitude. More...
 
void SetLongitudeDegIC (double lon)
 Sets the initial longitude. More...
 
void SetLongitudeRadIC (double lon)
 Sets the initial longitude. More...
 
void SetMachIC (double mach)
 Set mach initial condition. More...
 
void SetPhiDegIC (double phi)
 Sets the roll angle initial condition in degrees. More...
 
void SetPhiRadIC (double phi)
 Sets the initial roll angle. More...
 
void SetPRadpsIC (double P)
 Sets the initial body axis roll rate. More...
 
void SetPsiDegIC (double psi)
 Sets the heading angle initial condition in degrees. More...
 
void SetPsiRadIC (double psi)
 Sets the initial heading angle. More...
 
void SetQRadpsIC (double Q)
 Sets the initial body axis pitch rate. More...
 
void SetRRadpsIC (double R)
 Sets the initial body axis yaw rate. More...
 
void SetTargetNlfIC (double nlf)
 Sets the target normal load factor. More...
 
void SetTerrainElevationFtIC (double elev)
 Sets the initial terrain elevation. More...
 
void SetThetaDegIC (double theta)
 Sets pitch angle initial condition in degrees. More...
 
void SetThetaRadIC (double theta)
 Sets the initial pitch angle. More...
 
void SetUBodyFpsIC (double ubody)
 Sets the initial body axis X velocity. More...
 
void SetVBodyFpsIC (double vbody)
 Sets the initial body axis Y velocity. More...
 
void SetVcalibratedKtsIC (double vc)
 Set calibrated airspeed initial condition in knots. More...
 
void SetVDownFpsIC (double vd)
 Sets the initial local axis down velocity. More...
 
void SetVEastFpsIC (double ve)
 Sets the initial local axis east velocity. More...
 
void SetVequivalentKtsIC (double ve)
 Set equivalent airspeed initial condition in knots. More...
 
void SetVgroundFpsIC (double vg)
 Sets the initial ground speed. More...
 
void SetVgroundKtsIC (double vg)
 Set ground speed initial condition in knots. More...
 
void SetVNorthFpsIC (double vn)
 Sets the initial local axis north velocity. More...
 
void SetVtrueFpsIC (double vt)
 Sets the initial true airspeed. More...
 
void SetVtrueKtsIC (double vtrue)
 Set true airspeed initial condition in knots. More...
 
void SetWBodyFpsIC (double wbody)
 Sets the initial body axis Z velocity. More...
 
void SetWindDirDegIC (double dir)
 Sets the initial wind direction. More...
 
void SetWindDownKtsIC (double wD)
 Sets the initial wind downward speed. More...
 
void SetWindMagKtsIC (double mag)
 Sets the initial total wind speed. More...
 
void SetWindNEDFpsIC (double wN, double wE, double wD)
 Sets the initial wind velocity. More...
 
int TrimRequested (void) const
 Does initialization file call for trim ? More...
 
- 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.
 
enum  { eP = 1 , eQ , eR }
 Rates P, Q, R.
 
enum  { eU = 1 , eV , eW }
 Velocities U, V, W.
 
enum  { eX = 1 , eY , eZ }
 Positions X, Y, Z.
 
enum  { ePhi = 1 , eTht , ePsi }
 Euler angles Phi, Theta, Psi.
 
enum  { eDrag = 1 , eSide , eLift }
 Stability axis forces, Drag, Side force, Lift.
 
enum  { eRoll = 1 , ePitch , eYaw }
 Local frame orientation Roll, Pitch, Yaw.
 
enum  { eNorth = 1 , eEast , eDown }
 Local frame position North, East, Down.
 
enum  { eLat = 1 , eLong , eRad }
 Locations Radius, Latitude, Longitude.
 
enum  {
  inNone = 0 , inDegrees , inRadians , inMeters ,
  inFeet
}
 Conversion specifiers.
 
- Static Public Member Functions inherited from FGJSBBase
static const std::string & GetVersion (void)
 Returns the version number of JSBSim. More...
 
static constexpr double KelvinToFahrenheit (double kelvin)
 Converts from degrees Kelvin to degrees Fahrenheit. More...
 
static constexpr double CelsiusToRankine (double celsius)
 Converts from degrees Celsius to degrees Rankine. More...
 
static constexpr double RankineToCelsius (double rankine)
 Converts from degrees Rankine to degrees Celsius. More...
 
static constexpr double KelvinToRankine (double kelvin)
 Converts from degrees Kelvin to degrees Rankine. More...
 
static constexpr double RankineToKelvin (double rankine)
 Converts from degrees Rankine to degrees Kelvin. More...
 
static constexpr double FahrenheitToCelsius (double fahrenheit)
 Converts from degrees Fahrenheit to degrees Celsius. More...
 
static constexpr double CelsiusToFahrenheit (double celsius)
 Converts from degrees Celsius to degrees Fahrenheit. More...
 
static constexpr double CelsiusToKelvin (double celsius)
 Converts from degrees Celsius to degrees Kelvin. More...
 
static constexpr double KelvinToCelsius (double kelvin)
 Converts from degrees Kelvin to degrees Celsius. More...
 
static constexpr double FeetToMeters (double measure)
 Converts from feet to meters. More...
 
static bool EqualToRoundoff (double a, double b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (float a, float b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (float a, double b)
 Finite precision comparison. More...
 
static bool EqualToRoundoff (double a, float b)
 Finite precision comparison. More...
 
static constexpr double Constrain (double min, double value, double max)
 Constrain a value between a minimum and a maximum value.
 
static constexpr double sign (double num)
 
- Static Public Attributes inherited from FGJSBBase
static char highint [5] = {27, '[', '1', 'm', '\0' }
 highlights text
 
static char halfint [5] = {27, '[', '2', 'm', '\0' }
 low intensity text
 
static char normint [6] = {27, '[', '2', '2', 'm', '\0' }
 normal intensity text
 
static char reset [5] = {27, '[', '0', 'm', '\0' }
 resets text properties
 
static char underon [5] = {27, '[', '4', 'm', '\0' }
 underlines text
 
static char underoff [6] = {27, '[', '2', '4', 'm', '\0' }
 underline off
 
static char fgblue [6] = {27, '[', '3', '4', 'm', '\0' }
 blue text
 
static char fgcyan [6] = {27, '[', '3', '6', 'm', '\0' }
 cyan text
 
static char fgred [6] = {27, '[', '3', '1', 'm', '\0' }
 red text
 
static char fggreen [6] = {27, '[', '3', '2', 'm', '\0' }
 green text
 
static char fgdef [6] = {27, '[', '3', '9', 'm', '\0' }
 default text
 
static short debug_lvl = 1
 
- 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. More...
 
static constexpr double lbtoslug = 1.0/slugtolb
 
static constexpr double kgtolb = 2.20462
 
static constexpr double kgtoslug = 0.06852168
 
static const std::string needed_cfg_version = "2.0"
 
static const std::string JSBSim_version = JSBSIM_VERSION " " __DATE__ " " __TIME__
 

Member Function Documentation

◆ 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 621 of file FGInitialCondition.h.

621 { return alpha; }

◆ GetAltitudeAGLFtIC()

double GetAltitudeAGLFtIC ( void  ) const

Gets the initial altitude above ground level.

Returns
Initial altitude AGL in feet

Definition at line 660 of file FGInitialCondition.cpp.

661 {
662  return fdmex->GetInertial()->GetAltitudeAGL(position);
663 }
std::shared_ptr< FGInertial > GetInertial(void) const
Returns the FGInertial pointer.
Definition: FGFDMExec.cpp:285
+ 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 653 of file FGInitialCondition.cpp.

654 {
655  return position.GetRadius() - position.GetSeaLevelRadius();
656 }
double GetRadius() const
Get the distance from the center of the earth in feet.
Definition: FGLocation.h:291
double GetSeaLevelRadius(void) const
Get the sea level radius in feet below the current location.
Definition: FGLocation.cpp:273
+ 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 625 of file FGInitialCondition.h.

625 { 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; }
double GetClimbRateFpsIC(void) const
Gets the initial climb rate.

◆ GetClimbRateFpsIC()

double GetClimbRateFpsIC ( void  ) const
inline

Gets the initial climb rate.

Returns
Initial rate of climb in feet/second

Definition at line 516 of file FGInitialCondition.h.

517  {
518  const FGMatrix33& Tb2l = orientation.GetTInv();
519  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
520  return -_vt_NED(eW);
521  }
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:193

◆ 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; }
double GetFlightPathAngleRadIC(void) const
Gets the initial flight path angle.

◆ 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 616 of file FGInitialCondition.h.

617  { 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 637 of file FGInitialCondition.h.

638  { 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 633 of file FGInitialCondition.h.

633 { 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 642 of file FGInitialCondition.h.

642 { 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 985 of file FGInitialCondition.cpp.

986 {
987  const auto Atmosphere = fdmex->GetAtmosphere();
988  double altitudeASL = GetAltitudeASLFtIC();
989  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
990  return vt / soundSpeed;
991 }
double GetAltitudeASLFtIC(void) const
Gets the initial altitude above sea level.
+ 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 646 of file FGInitialCondition.h.

646 { 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.
Definition: FGQuaternion.h:220

◆ GetPhiRadIC()

double GetPhiRadIC ( void  ) const
inline

Gets the initial roll angle.

Returns
Initial roll angle in radians

Definition at line 650 of file FGInitialCondition.h.

650 { return orientation.GetEuler(ePhi); }
const FGColumnVector3 & GetEuler(void) const
Retrieves the Euler angles.
Definition: FGQuaternion.h:199
+ 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 629 of file FGInitialCondition.h.

629 { 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 556 of file FGInitialCondition.h.

556 { 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 560 of file FGInitialCondition.h.

560 { 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 658 of file FGInitialCondition.h.

658 { 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 564 of file FGInitialCondition.h.

564 { 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 568 of file FGInitialCondition.h.

568 { return vPQR_body(eR); }

◆ GetSpeedSet()

speedset GetSpeedSet ( void  ) const
inline

Gets the initial speedset.

Returns
Initial speedset

Definition at line 662 of file FGInitialCondition.h.

662 { 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 666 of file FGInitialCondition.h.

666 { 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 667 of file FGInitialCondition.cpp.

668 {
669  FGColumnVector3 normal, v, w;
670  FGLocation contact;
671  double a = fdmex->GetInertial()->GetSemimajor();
672  double b = fdmex->GetInertial()->GetSemiminor();
673  contact.SetEllipse(a, b);
674  fdmex->GetInertial()->GetContactPoint(position, contact, normal, v, w);
675  return contact.GetGeodAltitude();
676 }
+ 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 654 of file FGInitialCondition.h.

654 { 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 532 of file FGInitialCondition.h.

532 { 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 525 of file FGInitialCondition.h.

525  {
526  const FGMatrix33& Tl2b = orientation.GetT();
527  return Tl2b * vUVW_NED;
528  }
const FGMatrix33 & GetT(void) const
Transformation matrix.
Definition: FGQuaternion.h:188

◆ 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 536 of file FGInitialCondition.h.

536 { return GetBodyVelFpsIC(eV); }

◆ GetVcalibratedKtsIC()

double GetVcalibratedKtsIC ( void  ) const

Gets the initial calibrated airspeed.

Returns
Initial calibrated airspeed in knots

Definition at line 962 of file FGInitialCondition.cpp.

963 {
964  const auto Atmosphere = fdmex->GetAtmosphere();
965  double altitudeASL = GetAltitudeASLFtIC();
966  double pressure = Atmosphere->GetPressure(altitudeASL);
967  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
968  double mach = vt / soundSpeed;
969 
970  return fpstokts * Auxiliary->VcalibratedFromMach(mach, pressure);
971 }
+ 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 552 of file FGInitialCondition.h.

552 { 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 548 of file FGInitialCondition.h.

548 { return vUVW_NED(eV); }

◆ GetVequivalentKtsIC()

double GetVequivalentKtsIC ( void  ) const

Gets the initial equivalent airspeed.

Returns
Initial equivalent airspeed in knots

Definition at line 975 of file FGInitialCondition.cpp.

976 {
977  const auto Atmosphere = fdmex->GetAtmosphere();
978  double altitudeASL = GetAltitudeASLFtIC();
979  double rho = Atmosphere->GetDensity(altitudeASL);
980  return fpstokts * vt * sqrt(rho/FGAtmosphere::StdDaySLdensity);
981 }
+ 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 472 of file FGInitialCondition.h.

472 { 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; }
double GetVgroundFpsIC(void) const
Gets the initial ground velocity.

◆ 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 544 of file FGInitialCondition.h.

544 { 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 476 of file FGInitialCondition.h.

476 { 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 540 of file FGInitialCondition.h.

540 { 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 504 of file FGInitialCondition.h.

504 { 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 919 of file FGInitialCondition.cpp.

920 {
921  const FGMatrix33& Tb2l = orientation.GetTInv();
922  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
923  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
924 
925  return _vWIND_NED.Magnitude(eU, eV) == 0.0 ? 0.0
926  : atan2(_vWIND_NED(eV), _vWIND_NED(eU))*radtodeg;
927 }
+ 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 500 of file FGInitialCondition.h.

500 { return GetWindNEDFpsIC()(eY); }

◆ GetWindFpsIC()

double GetWindFpsIC ( void  ) const

Gets the initial total wind velocity in feet/sec.

Returns
Initial wind velocity in feet/second

Definition at line 939 of file FGInitialCondition.cpp.

940 {
941  const FGMatrix33& Tb2l = orientation.GetTInv();
942  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
943  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
944 
945  return _vWIND_NED.Magnitude(eU, eV);
946 }
+ 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 931 of file FGInitialCondition.cpp.

931  {
932  const FGMatrix33& Tb2l = orientation.GetTInv();
933  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
934  return _vt_NED - vUVW_NED;
935 }
+ 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 496 of file FGInitialCondition.h.

496 { 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 480 of file FGInitialCondition.h.

480 { 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 484 of file FGInitialCondition.h.

484 { 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 488 of file FGInitialCondition.h.

488 { return GetBodyWindFpsIC(eW); }

◆ 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 677 of file FGInitialCondition.h.

677 { 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 1005 of file FGInitialCondition.cpp.

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

91 {
92  double calpha = cos(alpha0), cbeta = cos(beta0);
93  double salpha = sin(alpha0), sbeta = sin(beta0);
94 
95  InitializeIC();
96 
97  vPQR_body = {p0, q0, r0};
98  alpha = alpha0; beta = beta0;
99 
100  position.SetLongitude(lonRad0);
101  position.SetLatitude(latRad0);
102  fdmex->GetInertial()->SetAltitudeAGL(position, altAGLFt0);
103  lastLatitudeSet = setgeoc;
104  lastAltitudeSet = setagl;
105 
106  orientation = FGQuaternion(phi0, theta0, psi0);
107  const FGMatrix33& Tb2l = orientation.GetTInv();
108 
109  vUVW_NED = Tb2l * FGColumnVector3(u0, v0, w0);
110  vt = vUVW_NED.Magnitude();
111  lastSpeedSet = setuvw;
112 
113  Tw2b = { calpha*cbeta, -calpha*sbeta, -salpha,
114  sbeta, cbeta, 0.0,
115  salpha*cbeta, -salpha*sbeta, calpha };
116  Tb2w = Tw2b.Transposed();
117 
118  SetFlightPathAngleRadIC(gamma0);
119 }
void InitializeIC(void)
Initialize the initial conditions to default values.
void SetFlightPathAngleRadIC(double gamma)
Sets the initial flight path angle.
void SetLongitude(double longitude)
Set the longitude.
Definition: FGLocation.cpp:170
void SetLatitude(double latitude)
Set the GEOCENTRIC latitude.
Definition: FGLocation.cpp:190
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); }
void SetAlphaRadIC(double alpha)
Sets the initial angle of attack.

◆ SetAlphaRadIC()

void SetAlphaRadIC ( double  alpha)

Sets the initial angle of attack.

Parameters
alphaInitial angle of attack in radians

Definition at line 316 of file FGInitialCondition.cpp.

317 {
318  const FGMatrix33& Tb2l = orientation.GetTInv();
319  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
320  calcThetaBeta(alfa, _vt_NED);
321 }
+ 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 680 of file FGInitialCondition.cpp.

681 {
682  const auto Atmosphere = fdmex->GetAtmosphere();
683  double altitudeASL = GetAltitudeASLFtIC();
684  double pressure = Atmosphere->GetPressure(altitudeASL);
685  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
686  double rho = Atmosphere->GetDensity(altitudeASL);
687 
688  double mach0 = vt / soundSpeed;
689  double vc0 = Auxiliary->VcalibratedFromMach(mach0, pressure);
690  double ve0 = vt * sqrt(rho/FGAtmosphere::StdDaySLdensity);
691 
692  switch(lastLatitudeSet) {
693  case setgeod:
694  fdmex->GetInertial()->SetAltitudeAGL(position, agl);
695  break;
696  case setgeoc:
697  {
698  double a = fdmex->GetInertial()->GetSemimajor();
699  double b = fdmex->GetInertial()->GetSemiminor();
700  double e2 = 1.0-b*b/(a*a);
701  double tanlat = tan(position.GetLatitude());
702  double n = e2;
703  double prev_n = 1.0;
704  int iter = 0;
705  double longitude = position.GetLongitude();
706  double alt = position.GetGeodAltitude();
707  double h = -2.0*max(a,b);
708  double geodLat;
709  while ((fabs(n-prev_n) > 1E-15 || fabs(h-agl) > 1E-10) && iter < 10) {
710  geodLat = atan(tanlat/(1-n));
711  position.SetPositionGeodetic(longitude, geodLat, alt);
712  h = GetAltitudeAGLFtIC();
713  alt += agl-h;
714  double sinGeodLat = sin(geodLat);
715  double N = a/sqrt(1-e2*sinGeodLat*sinGeodLat);
716  prev_n = n;
717  n = e2*N/(N+alt);
718  iter++;
719  }
720  }
721  break;
722  }
723 
724  altitudeASL = GetAltitudeASLFtIC();
725  soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
726  rho = Atmosphere->GetDensity(altitudeASL);
727  pressure = Atmosphere->GetPressure(altitudeASL);
728 
729  switch(lastSpeedSet) {
730  case setvc:
731  mach0 = Auxiliary->MachFromVcalibrated(vc0, pressure);
732  SetVtrueFpsIC(mach0 * soundSpeed);
733  break;
734  case setmach:
735  SetVtrueFpsIC(mach0 * soundSpeed);
736  break;
737  case setve:
738  SetVtrueFpsIC(ve0 * sqrt(FGAtmosphere::StdDaySLdensity/rho));
739  break;
740  default: // Make the compiler stop complaining about missing enums
741  break;
742  }
743 
744  lastAltitudeSet = setagl;
745 }
double GetAltitudeAGLFtIC(void) const
Gets the initial altitude above ground level.
void SetVtrueFpsIC(double vt)
Sets the initial true airspeed.
double GetGeodAltitude(void) const
Gets the geodetic altitude in feet.
Definition: FGLocation.h:279
void SetPositionGeodetic(double lon, double lat, double height)
Sets the longitude, latitude and the distance above the reference spheroid.
Definition: FGLocation.cpp:243
+ 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 752 of file FGInitialCondition.cpp.

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

◆ SetBetaRadIC()

void SetBetaRadIC ( double  beta)

Sets the initial sideslip angle.

Parameters
betaInitial angle of sideslip in radians.

Definition at line 401 of file FGInitialCondition.cpp.

402 {
403  const FGMatrix33& Tb2l = orientation.GetTInv();
404  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
405  FGColumnVector3 vOrient = orientation.GetEuler();
406 
407  beta = bta;
408  double calpha = cos(alpha), salpha = sin(alpha);
409  double cbeta = cos(beta), sbeta = sin(beta);
410  double cphi = orientation.GetCosEuler(ePhi), sphi = orientation.GetSinEuler(ePhi);
411  FGMatrix33 TphiInv(1., 0., 0.,
412  0., cphi,-sphi,
413  0., sphi, cphi);
414 
415  Tw2b = { calpha*cbeta, -calpha*sbeta, -salpha,
416  sbeta, cbeta, 0.0,
417  salpha*cbeta, -salpha*sbeta, calpha };
418  Tb2w = Tw2b.Transposed();
419 
420  FGColumnVector3 vf = TphiInv * Tw2b * FGColumnVector3(vt, 0., 0.);
421  FGColumnVector3 v0xy(_vt_NED(eX), _vt_NED(eY), 0.);
422  FGColumnVector3 v1xy(sqrt(v0xy(eX)*v0xy(eX)+v0xy(eY)*v0xy(eY)-vf(eY)*vf(eY)),vf(eY),0.);
423  v0xy.Normalize();
424  v1xy.Normalize();
425 
426  if (vf(eX) < 0.) v0xy(eX) *= -1.0;
427 
428  double sinPsi = (v1xy * v0xy)(eZ);
429  double cosPsi = DotProduct(v0xy, v1xy);
430  vOrient(ePsi) = atan2(sinPsi, cosPsi);
431  FGMatrix33 Tpsi( cosPsi, sinPsi, 0.,
432  -sinPsi, cosPsi, 0.,
433  0., 0., 1.);
434 
435  FGColumnVector3 v2xz = Tpsi * _vt_NED;
436  FGColumnVector3 vfxz = vf;
437  v2xz(eV) = vfxz(eV) = 0.0;
438  v2xz.Normalize();
439  vfxz.Normalize();
440  double sinTheta = (v2xz * vfxz)(eY);
441  vOrient(eTht) = -asin(sinTheta);
442 
443  orientation = FGQuaternion(vOrient);
444 }
double GetSinEuler(int i) const
Retrieves sine of the given euler angle.
Definition: FGQuaternion.h:237
double GetCosEuler(int i) const
Retrieves cosine of the given euler angle.
Definition: FGQuaternion.h:245
+ 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); }
void SetClimbRateFpsIC(double roc)
Sets the initial climb rate.

◆ SetClimbRateFpsIC()

void SetClimbRateFpsIC ( double  roc)

Sets the initial climb rate.

Parameters
rocInitial Rate of climb in feet/second

Definition at line 287 of file FGInitialCondition.cpp.

288 {
289  if (fabs(hdot) > vt) {
290  cerr << "The climb rate cannot be higher than the true speed." << endl;
291  return;
292  }
293 
294  const FGMatrix33& Tb2l = orientation.GetTInv();
295  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
296  FGColumnVector3 _WIND_NED = _vt_NED - vUVW_NED;
297  double hdot0 = -_vt_NED(eW);
298 
299  if (fabs(hdot0) < vt) { // Is this check really needed ?
300  double scale = sqrt((vt*vt-hdot*hdot)/(vt*vt-hdot0*hdot0));
301  _vt_NED(eU) *= scale;
302  _vt_NED(eV) *= scale;
303  }
304  _vt_NED(eW) = -hdot;
305  vUVW_NED = _vt_NED - _WIND_NED;
306 
307  // Updating the angles theta and beta to keep the true airspeed amplitude
308  calcThetaBeta(alpha, _vt_NED);
309 }
+ 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 531 of file FGInitialCondition.cpp.

532 {
533  const FGMatrix33& Tb2l = orientation.GetTInv();
534  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
535  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
536  FGColumnVector3 _vCROSS(-orientation.GetSinEuler(ePsi), orientation.GetCosEuler(ePsi), 0.);
537 
538  // Gram-Schmidt process is used to remove the existing cross wind component
539  _vWIND_NED -= DotProduct(_vWIND_NED, _vCROSS) * _vCROSS;
540  // Which is now replaced by the new value. The input cross wind is expected
541  // in knots, so first convert to fps, which is the internal unit used.
542  _vWIND_NED += (cross * ktstofps) * _vCROSS;
543  _vt_NED = vUVW_NED + _vWIND_NED;
544  vt = _vt_NED.Magnitude();
545 
546  calcAeroAngles(_vt_NED);
547 }
+ 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 572 of file FGInitialCondition.h.

573  { 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); }
void SetGeodLatitudeRadIC(double glat)
Sets the initial geodetic latitude.

◆ 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 853 of file FGInitialCondition.cpp.

854 {
855  double lon = position.GetLongitude();
856  lastLatitudeSet = setgeod;
857 
858  switch (lastAltitudeSet)
859  {
860  case setagl:
861  {
862  double agl = GetAltitudeAGLFtIC();
863  position.SetPositionGeodetic(lon, geodLatitude, 0.);
864  fdmex->GetInertial()->SetAltitudeAGL(position, agl);
865  }
866  break;
867  case setasl:
868  {
869  double asl = GetAltitudeASLFtIC();
870  position.SetPositionGeodetic(lon, geodLatitude, 0.);
871  SetAltitudeASLFtIC(asl);
872  }
873  break;
874  }
875 }
void SetAltitudeASLFtIC(double altitudeASL)
Sets the altitude above sea level initial condition in feet.
+ 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 554 of file FGInitialCondition.cpp.

555 {
556  const FGMatrix33& Tb2l = orientation.GetTInv();
557  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
558  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
559  // This is a head wind, so the direction vector for the wind
560  // needs to be set opposite to the heading the aircraft
561  // is taking. So, the cos and sin of the heading (psi)
562  // are negated in the line below.
563  FGColumnVector3 _vHEAD(-orientation.GetCosEuler(ePsi), -orientation.GetSinEuler(ePsi), 0.);
564 
565  // Gram-Schmidt process is used to remove the existing head wind component
566  _vWIND_NED -= DotProduct(_vWIND_NED, _vHEAD) * _vHEAD;
567  // Which is now replaced by the new value. The input head wind is expected
568  // in knots, so first convert to fps, which is the internal unit used.
569  _vWIND_NED += (head * ktstofps) * _vHEAD;
570  _vt_NED = vUVW_NED + _vWIND_NED;
571 
572  vt = _vt_NED.Magnitude();
573 
574  calcAeroAngles(_vt_NED);
575 }
+ 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); }
void SetLatitudeRadIC(double lat)
Sets the initial latitude.

◆ SetLatitudeRadIC()

void SetLatitudeRadIC ( double  lat)

Sets the initial latitude.

Parameters
latInitial latitude in radians

Definition at line 879 of file FGInitialCondition.cpp.

880 {
881  double altitude;
882 
883  lastLatitudeSet = setgeoc;
884 
885  switch(lastAltitudeSet) {
886  case setagl:
887  altitude = GetAltitudeAGLFtIC();
888  position.SetLatitude(lat);
889  SetAltitudeAGLFtIC(altitude);
890  break;
891  default:
892  altitude = GetAltitudeASLFtIC();
893  position.SetLatitude(lat);
894  SetAltitudeASLFtIC(altitude);
895  break;
896  }
897 }
void SetAltitudeAGLFtIC(double agl)
Sets the initial Altitude above ground level.
+ 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); }
void SetLongitudeRadIC(double lon)
Sets the initial longitude.

◆ SetLongitudeRadIC()

void SetLongitudeRadIC ( double  lon)

Sets the initial longitude.

Parameters
lonInitial longitude in radians

Definition at line 901 of file FGInitialCondition.cpp.

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

◆ SetMachIC()

void SetMachIC ( double  mach)

Set mach initial condition.

Parameters
machMach number

Definition at line 165 of file FGInitialCondition.cpp.

166 {
167  const auto Atmosphere = fdmex->GetAtmosphere();
168  double altitudeASL = GetAltitudeASLFtIC();
169  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
170  SetVtrueFpsIC(mach*soundSpeed);
171  lastSpeedSet = setmach;
172 }
+ 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);}
void SetPhiRadIC(double phi)
Sets the initial roll angle.

◆ SetPhiRadIC()

void SetPhiRadIC ( double  phi)
inline

Sets the initial roll angle.

Parameters
phiInitial roll angle in radians

Definition at line 585 of file FGInitialCondition.h.

585 { 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); }
void SetPsiRadIC(double psi)
Sets the initial heading angle.

◆ SetPsiRadIC()

void SetPsiRadIC ( double  psi)
inline

Sets the initial heading angle.

Parameters
psiInitial heading angle in radians

Definition at line 593 of file FGInitialCondition.h.

593 { 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 611 of file FGInitialCondition.h.

611 { targetNlfIC=nlf; }

◆ SetTerrainElevationFtIC()

void SetTerrainElevationFtIC ( double  elev)

Sets the initial terrain elevation.

Parameters
elevInitial terrain elevation in feet

Definition at line 642 of file FGInitialCondition.cpp.

643 {
644  double agl = GetAltitudeAGLFtIC();
645  fdmex->GetInertial()->SetTerrainElevation(elev);
646 
647  if (lastAltitudeSet == setagl)
648  SetAltitudeAGLFtIC(agl);
649 }
+ 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); }
void SetThetaRadIC(double theta)
Sets the initial pitch angle.

◆ SetThetaRadIC()

void SetThetaRadIC ( double  theta)
inline

Sets the initial pitch angle.

Parameters
thetaInitial pitch angle in radians

Definition at line 589 of file FGInitialCondition.h.

589 { 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 176 of file FGInitialCondition.cpp.

177 {
178  const auto Atmosphere = fdmex->GetAtmosphere();
179  double altitudeASL = GetAltitudeASLFtIC();
180  double pressure = Atmosphere->GetPressure(altitudeASL);
181  double mach = Auxiliary->MachFromVcalibrated(fabs(vcas)*ktstofps, pressure);
182  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
183 
184  SetVtrueFpsIC(mach * soundSpeed);
185  lastSpeedSet = setvc;
186 }
+ 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 154 of file FGInitialCondition.cpp.

155 {
156  const auto Atmosphere = fdmex->GetAtmosphere();
157  double altitudeASL = GetAltitudeASLFtIC();
158  double rho = Atmosphere->GetDensity(altitudeASL);
159  SetVtrueFpsIC(ve*ktstofps*sqrt(FGAtmosphere::StdDaySLdensity/rho));
160  lastSpeedSet = setve;
161 }
+ 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 239 of file FGInitialCondition.cpp.

240 {
241  const FGMatrix33& Tb2l = orientation.GetTInv();
242  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
243  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
244 
245  vUVW_NED(eU) = vg * orientation.GetCosEuler(ePsi);
246  vUVW_NED(eV) = vg * orientation.GetSinEuler(ePsi);
247  vUVW_NED(eW) = 0.;
248  _vt_NED = vUVW_NED + _vWIND_NED;
249  vt = _vt_NED.Magnitude();
250 
251  calcAeroAngles(_vt_NED);
252 
253  lastSpeedSet = setvg;
254 }
+ 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); }
void SetVgroundFpsIC(double vg)
Sets the initial ground speed.

◆ 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 263 of file FGInitialCondition.cpp.

264 {
265  const FGMatrix33& Tb2l = orientation.GetTInv();
266  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
267  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
268 
269  if (vt > 0.1)
270  _vt_NED *= vtrue / vt;
271  else
272  _vt_NED = Tb2l * Tw2b * FGColumnVector3(vtrue, 0., 0.);
273 
274  vt = vtrue;
275  vUVW_NED = _vt_NED - _vWIND_NED;
276 
277  calcAeroAngles(_vt_NED);
278 
279  lastSpeedSet = setvt;
280 }
+ 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 624 of file FGInitialCondition.cpp.

625 {
626  const FGMatrix33& Tb2l = orientation.GetTInv();
627  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
628  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
629  double mag = _vWIND_NED.Magnitude(eU, eV);
630  FGColumnVector3 _vHEAD(mag*cos(dir*degtorad), mag*sin(dir*degtorad), 0.);
631 
632  _vWIND_NED(eU) = _vHEAD(eU);
633  _vWIND_NED(eV) = _vHEAD(eV);
634  _vt_NED = vUVW_NED + _vWIND_NED;
635  vt = _vt_NED.Magnitude();
636 
637  calcAeroAngles(_vt_NED);
638 }
+ 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 582 of file FGInitialCondition.cpp.

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

◆ SetWindMagKtsIC()

void SetWindMagKtsIC ( double  mag)

Sets the initial total wind speed.

Parameters
magInitial wind velocity magnitude in knots

Definition at line 598 of file FGInitialCondition.cpp.

599 {
600  const FGMatrix33& Tb2l = orientation.GetTInv();
601  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
602  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
603  FGColumnVector3 _vHEAD(_vWIND_NED(eU), _vWIND_NED(eV), 0.);
604  double windMag = _vHEAD.Magnitude();
605 
606  if (windMag > 0.001)
607  _vHEAD *= (mag*ktstofps) / windMag;
608  else
609  _vHEAD = {mag*ktstofps, 0., 0.};
610 
611  _vWIND_NED(eU) = _vHEAD(eU);
612  _vWIND_NED(eV) = _vHEAD(eV);
613  _vt_NED = vUVW_NED + _vWIND_NED;
614  vt = _vt_NED.Magnitude();
615 
616  calcAeroAngles(_vt_NED);
617 }
+ 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 518 of file FGInitialCondition.cpp.

519 {
520  FGColumnVector3 _vt_NED = vUVW_NED + FGColumnVector3(wN, wE, wD);
521  vt = _vt_NED.Magnitude();
522 
523  calcAeroAngles(_vt_NED);
524 }
+ 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 681 of file FGInitialCondition.h.

681 { return trimRequested; }

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