JSBSim Flight Dynamics Model  1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
FGInitialCondition Class Reference

Initializes the simulation run. More...

#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 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...
 
const 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...
 
bool IsEngineRunning (unsigned int n) const
 Is an engine running ? More...
 
bool Load (const SGPath &rstname, bool useStoredPath=true)
 Loads the initial conditions. More...
 
bool NeedTrim (void) const
 Does initialization file call for trim ? 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 SetSeaLevelRadiusFtIC (double slr)
 Sets the initial sea level radius from planet center. 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...
 
- Public Member Functions inherited from FGJSBBase
 FGJSBBase ()
 Constructor for FGJSBBase.
 
virtual ~FGJSBBase ()
 Destructor for FGJSBBase.
 
void disableHighLighting (void)
 Disables highlighting in the console output.
 
std::string GetVersion (void)
 Returns the version number of JSBSim. More...
 
void PutMessage (const Message &msg)
 Places a Message structure on the Message queue. More...
 
void PutMessage (const std::string &text)
 Creates a message with the given text and places it on the queue. More...
 
void PutMessage (const std::string &text, bool bVal)
 Creates a message with the given text and boolean value and places it on the queue. More...
 
void PutMessage (const std::string &text, int iVal)
 Creates a message with the given text and integer value and places it on the queue. More...
 
void PutMessage (const std::string &text, double dVal)
 Creates a message with the given text and double value and places it on the queue. More...
 
int SomeMessages (void)
 Reads the message on the queue (but does not delete it). More...
 
void ProcessMessage (void)
 Reads the message on the queue and removes it from the queue. More...
 
MessageProcessNextMessage (void)
 Reads the next message on the queue and removes it from the queue. More...
 

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 double CelsiusToFahrenheit (double celsius)
 Converts from degrees Celsius to degrees Fahrenheit. More...
 
static double CelsiusToKelvin (double celsius)
 Converts from degrees Celsius to degrees Kelvin. More...
 
static double CelsiusToRankine (double celsius)
 Converts from degrees Celsius to degrees Rankine. More...
 
static double Constrain (double min, double value, double max)
 Constrain a value between a minimum and a maximum value.
 
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 double FahrenheitToCelsius (double fahrenheit)
 Converts from degrees Fahrenheit to degrees Celsius. More...
 
static double FeetToMeters (double measure)
 Converts from feet to meters. More...
 
static double GaussianRandomNumber (void)
 
static double KelvinToCelsius (double kelvin)
 Converts from degrees Kelvin to degrees Celsius. More...
 
static double KelvinToFahrenheit (double kelvin)
 Converts from degrees Kelvin to degrees Fahrenheit. More...
 
static double KelvinToRankine (double kelvin)
 Converts from degrees Kelvin to degrees Rankine. More...
 
static double MachFromVcalibrated (double vcas, double p, double psl, double rhosl)
 Calculate the Mach number from the calibrated airspeed. More...
 
static double PitotTotalPressure (double mach, double p)
 Compute the total pressure in front of the Pitot tube. More...
 
static double RankineToCelsius (double rankine)
 Converts from degrees Rankine to degrees Celsius. More...
 
static double RankineToKelvin (double rankine)
 Converts from degrees Rankine to degrees Kelvin. More...
 
static double sign (double num)
 
static double VcalibratedFromMach (double mach, double p, double psl, double rhosl)
 Calculate the calibrated airspeed from the Mach number. More...
 
- Static Public Attributes inherited from FGJSBBase
static short debug_lvl = 1
 
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
 
- Protected Member Functions inherited from FGJSBBase
void Debug (int)
 
- Static Protected Member Functions inherited from FGJSBBase
static std::string CreateIndexedPropertyName (const std::string &Property, int index)
 
- Static Protected Attributes inherited from FGJSBBase
static const double degtorad = 0.017453292519943295769236907684886
 
static const double fpstokts = 1.0/ktstofps
 
static const double fttom = 0.3048
 
static int gaussian_random_number_phase = 0
 
static const double hptoftlbssec = 550.0
 
static const double in3tom3 = 1.638706E-5
 
static const double inchtoft = 0.08333333
 
static const double inhgtopa = 3386.38
 
static const std::string JSBSim_version = "1.0 " __DATE__ " " __TIME__
 
static const double kgtolb = 2.20462
 
static const double kgtoslug = 0.06852168
 
static const double ktstofps = 1.68781
 
static const double lbtoslug = 1.0/slugtolb
 
static Message localMsg
 
static const double m3toft3 = 1.0/(fttom*fttom*fttom)
 
static double Mair = 28.9645
 
static unsigned int messageId = 0
 
static std::queue< MessageMessages
 
static const std::string needed_cfg_version = "2.0"
 
static const double psftoinhg = 0.014138
 
static const double psftopa = 47.88
 
static const double radtodeg = 57.295779513082320876798154814105
 
static double Reng = 1716.56
 
static double Rstar = 1545.348
 
static const double SHRatio = 1.40
 
static const double slugtolb = 32.174049
 

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();

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)
  • running (-1 for all engines, 0 for no engines, 1 ... n for specific engines)
  • trim (0 for no trim, 1 for ground trim)

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
Version
"$Id: FGInitialCondition.h,v 1.48 2017/02/25 14:23:18 bcoconni Exp $"

Definition at line 231 of file FGInitialCondition.h.

Member Function Documentation

◆ GetAlphaDegIC()

double GetAlphaDegIC ( void  ) const
inline

Gets the initial angle of attack.

Returns
Initial alpha in degrees

Definition at line 358 of file FGInitialCondition.h.

358 { return alpha*radtodeg; }
+ Here is the caller graph for this function:

◆ GetAlphaRadIC()

double GetAlphaRadIC ( void  ) const
inline

Gets the initial angle of attack.

Returns
Initial alpha in radians

Definition at line 630 of file FGInitialCondition.h.

630 { return alpha; }
+ Here is the caller graph for this function:

◆ GetAltitudeAGLFtIC()

double GetAltitudeAGLFtIC ( void  ) const

Gets the initial altitude above ground level.

Returns
Initial altitude AGL in feet

Definition at line 667 of file FGInitialCondition.cpp.

668 {
669  return position.GetAltitudeAGL();
670 }
double GetAltitudeAGL(void) const
Get the altitude above ground level.
Definition: FGLocation.h:365
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAltitudeASLFtIC()

double GetAltitudeASLFtIC ( void  ) const
inline

Gets the initial altitude above sea level.

Returns
Initial altitude in feet.

Definition at line 391 of file FGInitialCondition.h.

391 { return position.GetAltitudeASL(); }
double GetAltitudeASL(void) const
Get the altitude above sea level.
Definition: FGLocation.h:359
+ 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 362 of file FGInitialCondition.h.

362 { return beta*radtodeg; }
+ Here is the caller graph for this function:

◆ GetBetaRadIC()

double GetBetaRadIC ( void  ) const
inline

Gets the initial angle of sideslip.

Returns
Initial sideslip angle in radians

Definition at line 634 of file FGInitialCondition.h.

634 { return beta; }
+ Here is the caller graph for this function:

◆ GetClimbRateFpmIC()

double GetClimbRateFpmIC ( void  ) const
inline

Gets the initial climb rate.

Returns
Initial climb rate in feet/minute

Definition at line 348 of file FGInitialCondition.h.

349  { return GetClimbRateFpsIC()*60; }
double GetClimbRateFpsIC(void) const
Gets the initial climb rate.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetClimbRateFpsIC()

double GetClimbRateFpsIC ( void  ) const
inline

Gets the initial climb rate.

Returns
Initial rate of climb in feet/second

Definition at line 525 of file FGInitialCondition.h.

526  {
527  const FGMatrix33& Tb2l = orientation.GetTInv();
528  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
529  return _vt_NED(eW);
530  }
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetFlightPathAngleDegIC()

double GetFlightPathAngleDegIC ( void  ) const
inline

Gets the initial flight path angle.

Returns
Initial flight path angle in degrees

Definition at line 353 of file FGInitialCondition.h.

354  { return GetFlightPathAngleRadIC()*radtodeg; }
double GetFlightPathAngleRadIC(void) const
Gets the initial flight path angle.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

626  { return (vt == 0.0)?0.0:asin(GetClimbRateFpsIC() / vt); }
double GetClimbRateFpsIC(void) const
Gets the initial climb rate.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetGeodLatitudeDegIC()

double GetGeodLatitudeDegIC ( void  ) const
inline

Gets the initial geodetic latitude.

Returns
Initial geodetic latitude in degrees

Definition at line 382 of file FGInitialCondition.h.

383  { return position.GetGeodLatitudeDeg(); }
double GetGeodLatitudeDeg(void) const
Get the geodetic latitude in degrees.
Definition: FGLocation.h:290
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetGeodLatitudeRadIC()

double GetGeodLatitudeRadIC ( void  ) const
inline

Gets the initial geodetic latitude.

Returns
Initial geodetic latitude in radians

Definition at line 646 of file FGInitialCondition.h.

647  { return position.GetGeodLatitudeRad(); }
double GetGeodLatitudeRad(void) const
Get the geodetic latitude.
Definition: FGLocation.h:278
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLatitudeDegIC()

double GetLatitudeDegIC ( void  ) const
inline

Gets the initial latitude.

Returns
Initial geocentric latitude in degrees

Definition at line 378 of file FGInitialCondition.h.

378 { return position.GetLatitudeDeg(); }
double GetLatitudeDeg() const
Get the latitude.
Definition: FGLocation.h:284
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLatitudeRadIC()

double GetLatitudeRadIC ( void  ) const
inline

Gets the initial latitude.

Returns
Initial latitude in radians

Definition at line 642 of file FGInitialCondition.h.

642 { return position.GetLatitude(); }
double GetLatitude() const
Get the latitude.
Definition: FGLocation.h:272
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLongitudeDegIC()

double GetLongitudeDegIC ( void  ) const
inline

Gets the initial longitude.

Returns
Initial longitude in degrees

Definition at line 387 of file FGInitialCondition.h.

387 { return position.GetLongitudeDeg(); }
double GetLongitudeDeg() const
Get the longitude.
Definition: FGLocation.h:260
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLongitudeRadIC()

double GetLongitudeRadIC ( void  ) const
inline

Gets the initial longitude.

Returns
Initial longitude in radians

Definition at line 651 of file FGInitialCondition.h.

651 { return position.GetLongitude(); }
double GetLongitude() const
Get the longitude.
Definition: FGLocation.h:254
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetMachIC()

double GetMachIC ( void  ) const

Gets the initial mach.

Returns
Initial mach number

Definition at line 864 of file FGInitialCondition.cpp.

865 {
866  double altitudeASL = position.GetAltitudeASL();
867  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
868  return vt / soundSpeed;
869 }
double GetAltitudeASL(void) const
Get the altitude above sea level.
Definition: FGLocation.h:359
virtual double GetSoundSpeed(void) const
Returns the speed of sound in ft/sec.
Definition: FGAtmosphere.h:191
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetOrientation()

const FGQuaternion& GetOrientation ( void  ) const
inline

Gets the initial orientation.

Returns
Initial orientation

Definition at line 655 of file FGInitialCondition.h.

655 { return orientation; }
+ Here is the caller graph for this function:

◆ GetPhiDegIC()

double GetPhiDegIC ( void  ) const
inline

Gets the initial roll angle.

Returns
Initial phi in degrees

Definition at line 370 of file FGInitialCondition.h.

370 { return orientation.GetEulerDeg(ePhi); }
double GetEulerDeg(int i) const
Retrieves the Euler angles.
Definition: FGQuaternion.h:226
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPhiRadIC()

double GetPhiRadIC ( void  ) const
inline

Gets the initial roll angle.

Returns
Initial roll angle in radians

Definition at line 659 of file FGInitialCondition.h.

659 { return orientation.GetEuler(ePhi); }
const FGColumnVector3 & GetEuler(void) const
Retrieves the Euler angles.
Definition: FGQuaternion.h:205
+ Here is the call graph for this function:
+ 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 638 of file FGInitialCondition.h.

638 { return position; }
+ Here is the caller graph for this function:

◆ GetPQRRadpsIC()

const FGColumnVector3 GetPQRRadpsIC ( void  ) const
inline

Gets the initial body rotation rate.

Returns
Initial body rotation rate in radians/second

Definition at line 565 of file FGInitialCondition.h.

565 { return vPQR_body; }
+ Here is the caller graph for this function:

◆ GetPRadpsIC()

double GetPRadpsIC ( ) const
inline

Gets the initial body axis roll rate.

Returns
Initial body axis roll rate in radians/second

Definition at line 569 of file FGInitialCondition.h.

569 { return vPQR_body(eP); }
+ Here is the caller graph for this function:

◆ GetPsiDegIC()

double GetPsiDegIC ( void  ) const
inline

Gets the initial heading angle.

Returns
Initial psi in degrees

Definition at line 374 of file FGInitialCondition.h.

374 { return orientation.GetEulerDeg(ePsi); }
double GetEulerDeg(int i) const
Retrieves the Euler angles.
Definition: FGQuaternion.h:226
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPsiRadIC()

double GetPsiRadIC ( void  ) const
inline

Gets the initial heading angle.

Returns
Initial heading angle in radians

Definition at line 667 of file FGInitialCondition.h.

667 { return orientation.GetEuler(ePsi); }
const FGColumnVector3 & GetEuler(void) const
Retrieves the Euler angles.
Definition: FGQuaternion.h:205
+ Here is the call graph for this function:
+ 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 573 of file FGInitialCondition.h.

573 { return vPQR_body(eQ); }
+ Here is the caller graph for this function:

◆ GetRRadpsIC()

double GetRRadpsIC ( ) const
inline

Gets the initial body axis yaw rate.

Returns
Initial body axis yaw rate in radians/second

Definition at line 577 of file FGInitialCondition.h.

577 { return vPQR_body(eR); }
+ Here is the caller graph for this function:

◆ GetSpeedSet()

speedset GetSpeedSet ( void  ) const
inline

Gets the initial speedset.

Returns
Initial speedset

Definition at line 671 of file FGInitialCondition.h.

671 { 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 675 of file FGInitialCondition.h.

675 { return targetNlfIC; }
+ Here is the call graph for this function:
+ 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 674 of file FGInitialCondition.cpp.

675 {
676  return position.GetTerrainRadius() - position.GetSeaLevelRadius();
677 }
double GetSeaLevelRadius(void) const
Get the local sea level radius.
Definition: FGLocation.h:347
double GetTerrainRadius(void) const
Get the local terrain radius.
Definition: FGLocation.h:353
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetThetaDegIC()

double GetThetaDegIC ( void  ) const
inline

Gets the initial pitch angle.

Returns
Initial pitch angle in degrees

Definition at line 366 of file FGInitialCondition.h.

366 { return orientation.GetEulerDeg(eTht); }
double GetEulerDeg(int i) const
Retrieves the Euler angles.
Definition: FGQuaternion.h:226
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetThetaRadIC()

double GetThetaRadIC ( void  ) const
inline

Gets the initial pitch angle.

Returns
Initial pitch angle in radians

Definition at line 663 of file FGInitialCondition.h.

663 { return orientation.GetEuler(eTht); }
const FGColumnVector3 & GetEuler(void) const
Retrieves the Euler angles.
Definition: FGQuaternion.h:205
+ Here is the call graph for this function:
+ 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 541 of file FGInitialCondition.h.

541 { return GetBodyVelFpsIC(eU); }
+ Here is the caller graph for this function:

◆ GetUVWFpsIC()

const FGColumnVector3 GetUVWFpsIC ( void  ) const
inline

Gets the initial body velocity.

Returns
Initial body velocity in feet/second.

Definition at line 534 of file FGInitialCondition.h.

534  {
535  const FGMatrix33& Tl2b = orientation.GetT();
536  return Tl2b * vUVW_NED;
537  }
const FGMatrix33 & GetT(void) const
Transformation matrix.
Definition: FGQuaternion.h:194
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

545 { return GetBodyVelFpsIC(eV); }
+ Here is the caller graph for this function:

◆ GetVcalibratedKtsIC()

double GetVcalibratedKtsIC ( void  ) const

Gets the initial calibrated airspeed.

Returns
Initial calibrated airspeed in knots

Definition at line 839 of file FGInitialCondition.cpp.

840 {
841  double altitudeASL = position.GetAltitudeASL();
842  double pressure = Atmosphere->GetPressure(altitudeASL);
843  double pressureSL = Atmosphere->GetPressureSL();
844  double rhoSL = Atmosphere->GetDensitySL();
845  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
846  double PitotAngle = Aircraft->GetPitotAngle();
847  double mach = vt * cos(alpha+PitotAngle) * cos(beta) / soundSpeed;
848 
849  return fpstokts * VcalibratedFromMach(mach, pressure, pressureSL, rhoSL);
850 }
double GetAltitudeASL(void) const
Get the altitude above sea level.
Definition: FGLocation.h:359
virtual double GetPressure(void) const
Returns the pressure in psf.
Definition: FGAtmosphere.h:152
static double VcalibratedFromMach(double mach, double p, double psl, double rhosl)
Calculate the calibrated airspeed from the Mach number.
Definition: FGJSBBase.cpp:305
virtual double GetDensitySL(void) const
Returns the sea level density in slugs/ft^3.
Definition: FGAtmosphere.h:181
virtual double GetSoundSpeed(void) const
Returns the speed of sound in ft/sec.
Definition: FGAtmosphere.h:191
+ Here is the call graph for this function:
+ Here is the caller 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 561 of file FGInitialCondition.h.

561 { return vUVW_NED(eW); }
+ Here is the caller graph for this function:

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

557 { return vUVW_NED(eV); }
+ Here is the caller graph for this function:

◆ GetVequivalentKtsIC()

double GetVequivalentKtsIC ( void  ) const

Gets the initial equivalent airspeed.

Returns
Initial equivalent airspeed in knots

Definition at line 854 of file FGInitialCondition.cpp.

855 {
856  double altitudeASL = position.GetAltitudeASL();
857  double rho = Atmosphere->GetDensity(altitudeASL);
858  double rhoSL = Atmosphere->GetDensitySL();
859  return fpstokts * vt * sqrt(rho/rhoSL);
860 }
double GetAltitudeASL(void) const
Get the altitude above sea level.
Definition: FGLocation.h:359
virtual double GetDensitySL(void) const
Returns the sea level density in slugs/ft^3.
Definition: FGAtmosphere.h:181
virtual double GetDensity(void) const
Returns the density in slugs/ft^3.
Definition: FGAtmosphere.h:175
+ Here is the call graph for this function:
+ Here is the caller 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 477 of file FGInitialCondition.h.

477 { return vUVW_NED.Magnitude(eU, eV); }
double Magnitude(void) const
Length of the vector.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetVgroundKtsIC()

double GetVgroundKtsIC ( void  ) const
inline

Gets the initial ground speed.

Returns
Initial ground speed in knots

Definition at line 336 of file FGInitialCondition.h.

336 { return GetVgroundFpsIC() * fpstokts; }
double GetVgroundFpsIC(void) const
Gets the initial ground velocity.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

553 { return vUVW_NED(eU); }
+ Here is the caller graph for this function:

◆ GetVtrueFpsIC()

double GetVtrueFpsIC ( void  ) const
inline

Gets the initial true velocity.

Returns
Initial true velocity in feet/second

Definition at line 481 of file FGInitialCondition.h.

481 { return vt; }
+ Here is the caller graph for this function:

◆ GetVtrueKtsIC()

double GetVtrueKtsIC ( void  ) const
inline

Gets the initial true velocity.

Returns
Initial true airspeed in knots.

Definition at line 340 of file FGInitialCondition.h.

340 { return vt*fpstokts; }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

549 { return GetBodyVelFpsIC(eW); }
+ Here is the caller graph for this function:

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

513 { return GetNEDWindFpsIC(eZ); }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetWindDirDegIC()

double GetWindDirDegIC ( void  ) const

Gets the initial wind direction.

Returns
Initial wind direction in feet/second

Definition at line 793 of file FGInitialCondition.cpp.

794 {
795  const FGMatrix33& Tb2l = orientation.GetTInv();
796  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
797  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
798 
799  return _vWIND_NED(eV) == 0.0 ? 0.0
800  : atan2(_vWIND_NED(eV), _vWIND_NED(eU))*radtodeg;
801 }
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
+ Here is the call graph for this function:
+ Here is the caller 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 509 of file FGInitialCondition.h.

509 { return GetNEDWindFpsIC(eY); }
+ Here is the caller graph for this function:

◆ GetWindFpsIC()

double GetWindFpsIC ( void  ) const

Gets the initial total wind velocity in feet/sec.

Returns
Initial wind velocity in feet/second

Definition at line 816 of file FGInitialCondition.cpp.

817 {
818  const FGMatrix33& Tb2l = orientation.GetTInv();
819  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
820  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
821 
822  return _vWIND_NED.Magnitude(eU, eV);
823 }
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
double Magnitude(void) const
Length of the vector.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetWindNEDFpsIC()

const FGColumnVector3 GetWindNEDFpsIC ( void  ) const
inline

Gets the initial wind velocity in the NED local frame.

Returns
Initial wind velocity in NED frame in feet/second

Definition at line 497 of file FGInitialCondition.h.

497  {
498  const FGMatrix33& Tb2l = orientation.GetTInv();
499  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
500  return _vt_NED - vUVW_NED;
501  }
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
+ 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 505 of file FGInitialCondition.h.

505 { return GetNEDWindFpsIC(eX); }
+ Here is the caller graph for this function:

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

485 { return GetBodyWindFpsIC(eU); }
+ Here is the caller graph for this function:

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

489 { return GetBodyWindFpsIC(eV); }
+ Here is the caller graph for this function:

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

493 { return GetBodyWindFpsIC(eW); }
+ 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 686 of file FGInitialCondition.h.

686 { return (enginesRunning & (1 << n)) != 0; }
+ Here is the caller graph for this function:

◆ Load()

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

Loads the initial conditions.

Parameters
rstnameThe name of an initial conditions file
useStoredPathtrue if the stored path to the IC file should be used
Returns
true if successful

Definition at line 883 of file FGInitialCondition.cpp.

884 {
885  SGPath init_file_name;
886  if(useStoredPath && rstfile.isRelative()) {
887  init_file_name = fdmex->GetFullAircraftPath()/rstfile.utf8Str();
888  } else {
889  init_file_name = rstfile;
890  }
891 
892  FGXMLFileRead XMLFileRead;
893  Element* document = XMLFileRead.LoadXMLDocument(init_file_name);
894 
895  // Make sure that the document is valid
896  if (!document) {
897  cerr << "File: " << init_file_name << " could not be read." << endl;
898  exit(-1);
899  }
900 
901  if (document->GetName() != string("initialize")) {
902  cerr << "File: " << init_file_name << " is not a reset file." << endl;
903  exit(-1);
904  }
905 
906  double version = HUGE_VAL;
907  bool result = false;
908 
909  if (document->HasAttribute("version"))
910  version = document->GetAttributeValueAsNumber("version");
911 
912  if (version == HUGE_VAL) {
913  result = Load_v1(document); // Default to the old version
914  } else if (version >= 3.0) {
915  cerr << "Only initialization file formats 1 and 2 are currently supported" << endl;
916  exit (-1);
917  } else if (version >= 2.0) {
918  result = Load_v2(document);
919  } else if (version >= 1.0) {
920  result = Load_v1(document);
921  }
922 
923  // Check to see if any engines are specified to be initialized in a running state
924  Element* running_elements = document->FindElement("running");
925  while (running_elements) {
926  enginesRunning |= 1 << int(running_elements->GetDataAsNumber());
927  running_elements = document->FindNextElement("running");
928  }
929 
930  return result;
931 }
const SGPath & GetFullAircraftPath(void)
Retrieves the full aircraft path name.
Definition: FGFDMExec.h:397
+ Here is the caller graph for this function:

◆ NeedTrim()

bool NeedTrim ( void  ) const
inline

Does initialization file call for trim ?

Returns
true if initialization file (version 1) called for trim.

Definition at line 690 of file FGInitialCondition.h.

690 { return needTrim == 0 ? false : true; }

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

95 {
96  double calpha = cos(alpha0), cbeta = cos(beta0);
97  double salpha = sin(alpha0), sbeta = sin(beta0);
98 
99  InitializeIC();
100 
101  vPQR_body = FGColumnVector3(p0, q0, r0);
102  alpha = alpha0; beta = beta0;
103 
104  position.SetLongitude(lonRad0);
105  position.SetLatitude(latRad0);
106  position.SetAltitudeAGL(altAGLFt0);
107  lastLatitudeSet = setgeoc;
108  lastAltitudeSet = setagl;
109 
110  orientation = FGQuaternion(phi0, theta0, psi0);
111  const FGMatrix33& Tb2l = orientation.GetTInv();
112 
113  vUVW_NED = Tb2l * FGColumnVector3(u0, v0, w0);
114  vt = vUVW_NED.Magnitude();
115  lastSpeedSet = setuvw;
116 
117  Tw2b = FGMatrix33(calpha*cbeta, -calpha*sbeta, -salpha,
118  sbeta, cbeta, 0.0,
119  salpha*cbeta, -salpha*sbeta, calpha);
120  Tb2w = Tw2b.Transposed();
121 
122  SetFlightPathAngleRadIC(gamma0);
123 }
void SetLongitude(double longitude)
Set the longitude.
Definition: FGLocation.cpp:197
void SetLatitude(double latitude)
Set the latitude.
Definition: FGLocation.cpp:217
void SetAltitudeAGL(double altitudeAGL)
Set the altitude above ground level.
Definition: FGLocation.h:341
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
void SetFlightPathAngleRadIC(double gamma)
Sets the initial flight path angle.
FGMatrix33 Transposed(void) const
Transposed matrix.
Definition: FGMatrix33.h:243
double Magnitude(void) const
Length of the vector.
+ Here is the call graph for this function:
+ Here is the caller 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 261 of file FGInitialCondition.h.

261 { SetAlphaRadIC(a*degtorad); }
void SetAlphaRadIC(double alpha)
Sets the initial angle of attack.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetAlphaRadIC()

void SetAlphaRadIC ( double  alpha)

Sets the initial angle of attack.

Parameters
alphaInitial angle of attack in radians

Definition at line 322 of file FGInitialCondition.cpp.

323 {
324  const FGMatrix33& Tb2l = orientation.GetTInv();
325  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
326  calcThetaBeta(alfa, _vt_NED);
327 }
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
+ Here is the call graph for this function:
+ Here is the caller 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 681 of file FGInitialCondition.cpp.

682 {
683  double terrainElevation = position.GetTerrainRadius()
684  - position.GetSeaLevelRadius();
685  SetAltitudeASLFtIC(agl + terrainElevation);
686  lastAltitudeSet = setagl;
687 }
double GetSeaLevelRadius(void) const
Get the local sea level radius.
Definition: FGLocation.h:347
double GetTerrainRadius(void) const
Get the local terrain radius.
Definition: FGLocation.h:353
void SetAltitudeASLFtIC(double altitudeASL)
Sets the altitude above sea level initial condition in feet.
+ 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 694 of file FGInitialCondition.cpp.

695 {
696  double altitudeASL = position.GetAltitudeASL();
697  double pressure = Atmosphere->GetPressure(altitudeASL);
698  double pressureSL = Atmosphere->GetPressureSL();
699  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
700  double rho = Atmosphere->GetDensity(altitudeASL);
701  double rhoSL = Atmosphere->GetDensitySL();
702 
703  double mach0 = vt / soundSpeed;
704  double vc0 = VcalibratedFromMach(mach0, pressure, pressureSL, rhoSL);
705  double ve0 = vt * sqrt(rho/rhoSL);
706  double PitotAngle = Aircraft->GetPitotAngle();
707 
708  double geodLatitude = position.GetGeodLatitudeRad();
709  altitudeASL=alt;
710  position.SetAltitudeASL(alt);
711 
712  // The call to SetAltitudeASL has most likely modified the geodetic latitude
713  // so we need to restore it to its initial value.
714  if (lastLatitudeSet == setgeod)
715  SetGeodLatitudeRadIC(geodLatitude);
716 
717  soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
718  rho = Atmosphere->GetDensity(altitudeASL);
719  pressure = Atmosphere->GetPressure(altitudeASL);
720 
721  switch(lastSpeedSet) {
722  case setvc:
723  mach0 = MachFromVcalibrated(vc0 * cos(alpha+PitotAngle) * cos(beta),
724  pressure, pressureSL, rhoSL);
725  SetVtrueFpsIC(mach0 * soundSpeed / (cos(alpha+PitotAngle) * cos(beta)));
726  break;
727  case setmach:
728  SetVtrueFpsIC(mach0 * soundSpeed);
729  break;
730  case setve:
731  SetVtrueFpsIC(ve0 * sqrt(rhoSL/rho));
732  break;
733  default: // Make the compiler stop complaining about missing enums
734  break;
735  }
736 
737  lastAltitudeSet = setasl;
738 }
void SetVtrueFpsIC(double vt)
Sets the initial true airspeed.
double GetAltitudeASL(void) const
Get the altitude above sea level.
Definition: FGLocation.h:359
virtual double GetPressure(void) const
Returns the pressure in psf.
Definition: FGAtmosphere.h:152
void SetGeodLatitudeRadIC(double glat)
Sets the initial geodetic latitude.
static double VcalibratedFromMach(double mach, double p, double psl, double rhosl)
Calculate the calibrated airspeed from the Mach number.
Definition: FGJSBBase.cpp:305
static double MachFromVcalibrated(double vcas, double p, double psl, double rhosl)
Calculate the Mach number from the calibrated airspeed.
Definition: FGJSBBase.cpp:315
void SetAltitudeASL(double altitudeASL)
Set the altitude above sea level.
Definition: FGLocation.h:335
virtual double GetDensitySL(void) const
Returns the sea level density in slugs/ft^3.
Definition: FGAtmosphere.h:181
virtual double GetSoundSpeed(void) const
Returns the speed of sound in ft/sec.
Definition: FGAtmosphere.h:191
virtual double GetDensity(void) const
Returns the density in slugs/ft^3.
Definition: FGAtmosphere.h:175
double GetGeodLatitudeRad(void) const
Get the geodetic latitude.
Definition: FGLocation.h:278
+ 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 265 of file FGInitialCondition.h.

265 { SetBetaRadIC(b*degtorad);}
void SetBetaRadIC(double beta)
Sets the initial sideslip angle.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetBetaRadIC()

void SetBetaRadIC ( double  beta)

Sets the initial sideslip angle.

Parameters
betaInitial angle of sideslip in radians.

Definition at line 407 of file FGInitialCondition.cpp.

408 {
409  const FGMatrix33& Tb2l = orientation.GetTInv();
410  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
411  FGColumnVector3 vOrient = orientation.GetEuler();
412 
413  beta = bta;
414  double calpha = cos(alpha), salpha = sin(alpha);
415  double cbeta = cos(beta), sbeta = sin(beta);
416  double cphi = orientation.GetCosEuler(ePhi), sphi = orientation.GetSinEuler(ePhi);
417  FGMatrix33 TphiInv(1., 0., 0.,
418  0., cphi,-sphi,
419  0., sphi, cphi);
420 
421  Tw2b = FGMatrix33(calpha*cbeta, -calpha*sbeta, -salpha,
422  sbeta, cbeta, 0.0,
423  salpha*cbeta, -salpha*sbeta, calpha);
424  Tb2w = Tw2b.Transposed();
425 
426  FGColumnVector3 vf = TphiInv * Tw2b * FGColumnVector3(vt, 0., 0.);
427  FGColumnVector3 v0xy(_vt_NED(eX), _vt_NED(eY), 0.);
428  FGColumnVector3 v1xy(sqrt(v0xy(eX)*v0xy(eX)+v0xy(eY)*v0xy(eY)-vf(eY)*vf(eY)),vf(eY),0.);
429  v0xy.Normalize();
430  v1xy.Normalize();
431 
432  if (vf(eX) < 0.) v0xy(eX) *= -1.0;
433 
434  double sinPsi = (v1xy * v0xy)(eZ);
435  double cosPsi = DotProduct(v0xy, v1xy);
436  vOrient(ePsi) = atan2(sinPsi, cosPsi);
437  FGMatrix33 Tpsi( cosPsi, sinPsi, 0.,
438  -sinPsi, cosPsi, 0.,
439  0., 0., 1.);
440 
441  FGColumnVector3 v2xz = Tpsi * _vt_NED;
442  FGColumnVector3 vfxz = vf;
443  v2xz(eV) = vfxz(eV) = 0.0;
444  v2xz.Normalize();
445  vfxz.Normalize();
446  double sinTheta = (v2xz * vfxz)(eY);
447  vOrient(eTht) = -asin(sinTheta);
448 
449  orientation = FGQuaternion(vOrient);
450 }
double GetSinEuler(int i) const
Retrieves sine of the given euler angle.
Definition: FGQuaternion.h:243
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
double GetCosEuler(int i) const
Retrieves cosine of the given euler angle.
Definition: FGQuaternion.h:251
FGMatrix33 Transposed(void) const
Transposed matrix.
Definition: FGMatrix33.h:243
const FGColumnVector3 & GetEuler(void) const
Retrieves the Euler angles.
Definition: FGQuaternion.h:205
+ Here is the call graph for this function:
+ Here is the caller 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 288 of file FGInitialCondition.h.

288 { SetClimbRateFpsIC(roc/60.0); }
void SetClimbRateFpsIC(double roc)
Sets the initial climb rate.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetClimbRateFpsIC()

void SetClimbRateFpsIC ( double  roc)

Sets the initial climb rate.

Parameters
rocInitial Rate of climb in feet/second

Definition at line 293 of file FGInitialCondition.cpp.

294 {
295  if (fabs(hdot) > vt) {
296  cerr << "The climb rate cannot be higher than the true speed." << endl;
297  return;
298  }
299 
300  const FGMatrix33& Tb2l = orientation.GetTInv();
301  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
302  FGColumnVector3 _WIND_NED = _vt_NED - vUVW_NED;
303  double hdot0 = -_vt_NED(eW);
304 
305  if (fabs(hdot0) < vt) { // Is this check really needed ?
306  double scale = sqrt((vt*vt-hdot*hdot)/(vt*vt-hdot0*hdot0));
307  _vt_NED(eU) *= scale;
308  _vt_NED(eV) *= scale;
309  }
310  _vt_NED(eW) = -hdot;
311  vUVW_NED = _vt_NED - _WIND_NED;
312 
313  // Updating the angles theta and beta to keep the true airspeed amplitude
314  calcThetaBeta(alpha, _vt_NED);
315 }
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
+ Here is the call graph for this function:
+ Here is the caller 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 537 of file FGInitialCondition.cpp.

538 {
539  const FGMatrix33& Tb2l = orientation.GetTInv();
540  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
541  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
542  FGColumnVector3 _vCROSS(-orientation.GetSinEuler(ePsi), orientation.GetCosEuler(ePsi), 0.);
543 
544  // Gram-Schmidt process is used to remove the existing cross wind component
545  _vWIND_NED -= DotProduct(_vWIND_NED, _vCROSS) * _vCROSS;
546  // Which is now replaced by the new value. The input cross wind is expected
547  // in knots, so first convert to fps, which is the internal unit used.
548  _vWIND_NED += (cross * ktstofps) * _vCROSS;
549  _vt_NED = vUVW_NED + _vWIND_NED;
550  vt = _vt_NED.Magnitude();
551 
552  calcAeroAngles(_vt_NED);
553 }
double GetSinEuler(int i) const
Retrieves sine of the given euler angle.
Definition: FGQuaternion.h:243
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
double GetCosEuler(int i) const
Retrieves cosine of the given euler angle.
Definition: FGQuaternion.h:251
+ Here is the call graph for this function:
+ Here is the caller 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 292 of file FGInitialCondition.h.

293  { SetClimbRateFpsIC(vt*sin(gamma*degtorad)); }
void SetClimbRateFpsIC(double roc)
Sets the initial climb rate.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetFlightPathAngleRadIC()

void SetFlightPathAngleRadIC ( double  gamma)
inline

Sets the initial flight path angle.

Parameters
gammaInitial flight path angle in radians

Definition at line 581 of file FGInitialCondition.h.

582  { SetClimbRateFpsIC(vt*sin(gamma)); }
void SetClimbRateFpsIC(double roc)
Sets the initial climb rate.
+ Here is the call graph for this function:
+ 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 319 of file FGInitialCondition.h.

320  { SetGeodLatitudeRadIC(glat*degtorad); }
void SetGeodLatitudeRadIC(double glat)
Sets the initial geodetic latitude.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

743 {
744  double h = ComputeGeodAltitude(geodLatitude);
745  double lon = position.GetLongitude();
746 
747  position.SetPositionGeodetic(lon, geodLatitude, h);
748  lastLatitudeSet = setgeod;
749 }
void SetPositionGeodetic(double lon, double lat, double height)
Sets the longitude, latitude and the distance above the reference ellipsoid.
Definition: FGLocation.cpp:270
double GetLongitude() const
Get the longitude.
Definition: FGLocation.h:254
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetHeadWindKtsIC()

void SetHeadWindKtsIC ( double  head)

Sets the initial headwind velocity.

Parameters
headInitial headwind speed in knots

Definition at line 560 of file FGInitialCondition.cpp.

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

◆ SetLatitudeDegIC()

void SetLatitudeDegIC ( double  lat)
inline

Sets the initial latitude.

Parameters
latInitial latitude in degrees

Definition at line 313 of file FGInitialCondition.h.

313 { SetLatitudeRadIC(lat*degtorad); }
void SetLatitudeRadIC(double lat)
Sets the initial latitude.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetLatitudeRadIC()

void SetLatitudeRadIC ( double  lat)

Sets the initial latitude.

Parameters
latInitial latitude in radians

Definition at line 753 of file FGInitialCondition.cpp.

754 {
755  double altitude;
756 
757  lastLatitudeSet = setgeoc;
758 
759  switch(lastAltitudeSet) {
760  case setagl:
761  altitude = GetAltitudeAGLFtIC();
762  position.SetLatitude(lat);
763  SetAltitudeAGLFtIC(altitude);
764  break;
765  default:
766  position.SetLatitude(lat);
767  break;
768  }
769 }
void SetLatitude(double latitude)
Set the latitude.
Definition: FGLocation.cpp:217
double GetAltitudeAGLFtIC(void) const
Gets the initial altitude above ground level.
void SetAltitudeAGLFtIC(double agl)
Sets the initial Altitude above ground level.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetLongitudeDegIC()

void SetLongitudeDegIC ( double  lon)
inline

Sets the initial longitude.

Parameters
lonInitial longitude in degrees

Definition at line 324 of file FGInitialCondition.h.

324 { SetLongitudeRadIC(lon*degtorad); }
void SetLongitudeRadIC(double lon)
Sets the initial longitude.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetLongitudeRadIC()

void SetLongitudeRadIC ( double  lon)

Sets the initial longitude.

Parameters
lonInitial longitude in radians

Definition at line 773 of file FGInitialCondition.cpp.

774 {
775  double altitude;
776 
777  switch(lastAltitudeSet) {
778  case setagl:
779  altitude = GetAltitudeAGLFtIC();
780  position.SetLongitude(lon);
781  SetAltitudeAGLFtIC(altitude);
782  break;
783  default:
784  altitude = position.GetAltitudeASL();
785  position.SetLongitude(lon);
786  position.SetAltitudeASL(altitude);
787  break;
788  }
789 }
void SetLongitude(double longitude)
Set the longitude.
Definition: FGLocation.cpp:197
double GetAltitudeASL(void) const
Get the altitude above sea level.
Definition: FGLocation.h:359
double GetAltitudeAGLFtIC(void) const
Gets the initial altitude above ground level.
void SetAltitudeASL(double altitudeASL)
Set the altitude above sea level.
Definition: FGLocation.h:335
void SetAltitudeAGLFtIC(double agl)
Sets the initial Altitude above ground level.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetMachIC()

void SetMachIC ( double  mach)

Set mach initial condition.

Parameters
machMach number

Definition at line 170 of file FGInitialCondition.cpp.

171 {
172  double altitudeASL = position.GetAltitudeASL();
173  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
174  SetVtrueFpsIC(mach*soundSpeed);
175  lastSpeedSet = setmach;
176 }
void SetVtrueFpsIC(double vt)
Sets the initial true airspeed.
double GetAltitudeASL(void) const
Get the altitude above sea level.
Definition: FGLocation.h:359
virtual double GetSoundSpeed(void) const
Returns the speed of sound in ft/sec.
Definition: FGAtmosphere.h:191
+ Here is the call graph for this function:
+ Here is the caller 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 280 of file FGInitialCondition.h.

280 { SetPhiRadIC(phi*degtorad);}
void SetPhiRadIC(double phi)
Sets the initial roll angle.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetPhiRadIC()

void SetPhiRadIC ( double  phi)
inline

Sets the initial roll angle.

Parameters
phiInitial roll angle in radians

Definition at line 594 of file FGInitialCondition.h.

594 { SetEulerAngleRadIC(ePhi, phi); }
+ Here is the caller graph for this function:

◆ SetPRadpsIC()

void SetPRadpsIC ( double  P)
inline

Sets the initial body axis roll rate.

Parameters
PInitial roll rate in radians/second

Definition at line 435 of file FGInitialCondition.h.

435 { 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 284 of file FGInitialCondition.h.

284 { SetPsiRadIC(psi*degtorad); }
void SetPsiRadIC(double psi)
Sets the initial heading angle.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetPsiRadIC()

void SetPsiRadIC ( double  psi)
inline

Sets the initial heading angle.

Parameters
psiInitial heading angle in radians

Definition at line 602 of file FGInitialCondition.h.

602 { SetEulerAngleRadIC(ePsi, psi); }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetQRadpsIC()

void SetQRadpsIC ( double  Q)
inline

Sets the initial body axis pitch rate.

Parameters
QInitial pitch rate in radians/second

Definition at line 439 of file FGInitialCondition.h.

439 { 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 443 of file FGInitialCondition.h.

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

◆ SetSeaLevelRadiusFtIC()

void SetSeaLevelRadiusFtIC ( double  slr)

Sets the initial sea level radius from planet center.

Parameters
sl_radsea level radius in feet

Definition at line 648 of file FGInitialCondition.cpp.

649 {
650  fdmex->GetGroundCallback()->SetSeaLevelRadius(slr);
651 }
virtual void SetSeaLevelRadius(double radius)
Set the sea level radius.
FGGroundCallback * GetGroundCallback(void)
Get a pointer to the ground callback currently used.
Definition: FGFDMExec.h:381
+ Here is the call graph for this function:
+ 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 620 of file FGInitialCondition.h.

620 { targetNlfIC=nlf; }
+ Here is the caller graph for this function:

◆ SetTerrainElevationFtIC()

void SetTerrainElevationFtIC ( double  elev)

Sets the initial terrain elevation.

Parameters
elevInitial terrain elevation in feet

Definition at line 655 of file FGInitialCondition.cpp.

656 {
657  double agl = GetAltitudeAGLFtIC();
658 
659  fdmex->GetGroundCallback()->SetTerrainGeoCentRadius(elev + position.GetSeaLevelRadius());
660 
661  if (lastAltitudeSet == setagl)
662  SetAltitudeAGLFtIC(agl);
663 }
double GetSeaLevelRadius(void) const
Get the local sea level radius.
Definition: FGLocation.h:347
double GetAltitudeAGLFtIC(void) const
Gets the initial altitude above ground level.
FGGroundCallback * GetGroundCallback(void)
Get a pointer to the ground callback currently used.
Definition: FGFDMExec.h:381
void SetAltitudeAGLFtIC(double agl)
Sets the initial Altitude above ground level.
virtual void SetTerrainGeoCentRadius(double radius)
Set the local terrain radius.
+ Here is the call graph for this function:
+ Here is the caller 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 269 of file FGInitialCondition.h.

269 { SetThetaRadIC(theta*degtorad); }
void SetThetaRadIC(double theta)
Sets the initial pitch angle.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetThetaRadIC()

void SetThetaRadIC ( double  theta)
inline

Sets the initial pitch angle.

Parameters
thetaInitial pitch angle in radians

Definition at line 598 of file FGInitialCondition.h.

598 { SetEulerAngleRadIC(eTht, theta); }
+ Here is the caller graph for this function:

◆ SetUBodyFpsIC()

void SetUBodyFpsIC ( double  ubody)
inline

Sets the initial body axis X velocity.

Parameters
ubodyInitial X velocity in feet/second

Definition at line 411 of file FGInitialCondition.h.

411 { SetBodyVelFpsIC(eU, ubody); }
+ Here is the caller graph for this function:

◆ SetVBodyFpsIC()

void SetVBodyFpsIC ( double  vbody)
inline

Sets the initial body axis Y velocity.

Parameters
vbodyInitial Y velocity in feet/second

Definition at line 415 of file FGInitialCondition.h.

415 { SetBodyVelFpsIC(eV, vbody); }
+ Here is the caller graph for this function:

◆ SetVcalibratedKtsIC()

void SetVcalibratedKtsIC ( double  vc)

Set calibrated airspeed initial condition in knots.

Parameters
vcCalibrated airspeed in knots

Definition at line 180 of file FGInitialCondition.cpp.

181 {
182  double altitudeASL = position.GetAltitudeASL();
183  double pressure = Atmosphere->GetPressure(altitudeASL);
184  double pressureSL = Atmosphere->GetPressureSL();
185  double rhoSL = Atmosphere->GetDensitySL();
186  double mach = MachFromVcalibrated(fabs(vcas)*ktstofps, pressure, pressureSL, rhoSL);
187  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
188  double PitotAngle = Aircraft->GetPitotAngle();
189 
190  SetVtrueFpsIC(mach * soundSpeed / (cos(alpha+PitotAngle) * cos(beta)));
191  lastSpeedSet = setvc;
192 }
void SetVtrueFpsIC(double vt)
Sets the initial true airspeed.
double GetAltitudeASL(void) const
Get the altitude above sea level.
Definition: FGLocation.h:359
virtual double GetPressure(void) const
Returns the pressure in psf.
Definition: FGAtmosphere.h:152
static double MachFromVcalibrated(double vcas, double p, double psl, double rhosl)
Calculate the Mach number from the calibrated airspeed.
Definition: FGJSBBase.cpp:315
virtual double GetDensitySL(void) const
Returns the sea level density in slugs/ft^3.
Definition: FGAtmosphere.h:181
virtual double GetSoundSpeed(void) const
Returns the speed of sound in ft/sec.
Definition: FGAtmosphere.h:191
+ Here is the call graph for this function:
+ Here is the caller 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 431 of file FGInitialCondition.h.

431 { SetNEDVelFpsIC(eW, vd); }
+ Here is the caller graph for this function:

◆ SetVEastFpsIC()

void SetVEastFpsIC ( double  ve)
inline

Sets the initial local axis east velocity.

Parameters
veInitial east velocity in feet/second

Definition at line 427 of file FGInitialCondition.h.

427 { SetNEDVelFpsIC(eV, ve); }
+ Here is the caller graph for this function:

◆ SetVequivalentKtsIC()

void SetVequivalentKtsIC ( double  ve)

Set equivalent airspeed initial condition in knots.

Parameters
veEquivalent airspeed in knots

Definition at line 159 of file FGInitialCondition.cpp.

160 {
161  double altitudeASL = position.GetAltitudeASL();
162  double rho = Atmosphere->GetDensity(altitudeASL);
163  double rhoSL = Atmosphere->GetDensitySL();
164  SetVtrueFpsIC(ve*ktstofps*sqrt(rhoSL/rho));
165  lastSpeedSet = setve;
166 }
void SetVtrueFpsIC(double vt)
Sets the initial true airspeed.
double GetAltitudeASL(void) const
Get the altitude above sea level.
Definition: FGLocation.h:359
virtual double GetDensitySL(void) const
Returns the sea level density in slugs/ft^3.
Definition: FGAtmosphere.h:181
virtual double GetDensity(void) const
Returns the density in slugs/ft^3.
Definition: FGAtmosphere.h:175
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetVgroundFpsIC()

void SetVgroundFpsIC ( double  vg)

Sets the initial ground speed.

Parameters
vgInitial ground speed in feet/second

Definition at line 245 of file FGInitialCondition.cpp.

246 {
247  const FGMatrix33& Tb2l = orientation.GetTInv();
248  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
249  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
250 
251  vUVW_NED(eU) = vg * orientation.GetCosEuler(ePsi);
252  vUVW_NED(eV) = vg * orientation.GetSinEuler(ePsi);
253  vUVW_NED(eW) = 0.;
254  _vt_NED = vUVW_NED + _vWIND_NED;
255  vt = _vt_NED.Magnitude();
256 
257  calcAeroAngles(_vt_NED);
258 
259  lastSpeedSet = setvg;
260 }
double GetSinEuler(int i) const
Retrieves sine of the given euler angle.
Definition: FGQuaternion.h:243
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
double GetCosEuler(int i) const
Retrieves cosine of the given euler angle.
Definition: FGQuaternion.h:251
+ Here is the call graph for this function:
+ Here is the caller 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 253 of file FGInitialCondition.h.

253 { SetVgroundFpsIC(vg*ktstofps); }
void SetVgroundFpsIC(double vg)
Sets the initial ground speed.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetVNorthFpsIC()

void SetVNorthFpsIC ( double  vn)
inline

Sets the initial local axis north velocity.

Parameters
vnInitial north velocity in feet/second

Definition at line 423 of file FGInitialCondition.h.

423 { SetNEDVelFpsIC(eU, vn); }
+ Here is the caller graph for this function:

◆ SetVtrueFpsIC()

void SetVtrueFpsIC ( double  vt)

Sets the initial true airspeed.

Parameters
vtInitial true airspeed in feet/second

Definition at line 269 of file FGInitialCondition.cpp.

270 {
271  const FGMatrix33& Tb2l = orientation.GetTInv();
272  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
273  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
274 
275  if (vt > 0.1)
276  _vt_NED *= vtrue / vt;
277  else
278  _vt_NED = Tb2l * Tw2b * FGColumnVector3(vtrue, 0., 0.);
279 
280  vt = vtrue;
281  vUVW_NED = _vt_NED - _vWIND_NED;
282 
283  calcAeroAngles(_vt_NED);
284 
285  lastSpeedSet = setvt;
286 }
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
+ 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 249 of file FGInitialCondition.h.

249 { SetVtrueFpsIC(vtrue*ktstofps); }
void SetVtrueFpsIC(double vt)
Sets the initial true airspeed.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetWBodyFpsIC()

void SetWBodyFpsIC ( double  wbody)
inline

Sets the initial body axis Z velocity.

Parameters
wbodyInitial Z velocity in feet/second

Definition at line 419 of file FGInitialCondition.h.

419 { SetBodyVelFpsIC(eW, wbody); }
+ Here is the caller graph for this function:

◆ SetWindDirDegIC()

void SetWindDirDegIC ( double  dir)

Sets the initial wind direction.

Parameters
dirInitial direction wind is coming from in degrees

Definition at line 630 of file FGInitialCondition.cpp.

631 {
632  const FGMatrix33& Tb2l = orientation.GetTInv();
633  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
634  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
635  double mag = _vWIND_NED.Magnitude(eU, eV);
636  FGColumnVector3 _vHEAD(mag*cos(dir*degtorad), mag*sin(dir*degtorad), 0.);
637 
638  _vWIND_NED(eU) = _vHEAD(eU);
639  _vWIND_NED(eV) = _vHEAD(eV);
640  _vt_NED = vUVW_NED + _vWIND_NED;
641  vt = _vt_NED.Magnitude();
642 
643  calcAeroAngles(_vt_NED);
644 }
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
double Magnitude(void) const
Length of the vector.
+ Here is the call graph for this function:
+ Here is the caller 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 588 of file FGInitialCondition.cpp.

589 {
590  const FGMatrix33& Tb2l = orientation.GetTInv();
591  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
592 
593  _vt_NED(eW) = vUVW_NED(eW) + wD;
594  vt = _vt_NED.Magnitude();
595 
596  calcAeroAngles(_vt_NED);
597 }
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
+ Here is the call graph for this function:
+ Here is the caller 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 604 of file FGInitialCondition.cpp.

605 {
606  const FGMatrix33& Tb2l = orientation.GetTInv();
607  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
608  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
609  FGColumnVector3 _vHEAD(_vWIND_NED(eU), _vWIND_NED(eV), 0.);
610  double windMag = _vHEAD.Magnitude();
611 
612  if (windMag > 0.001)
613  _vHEAD *= (mag*ktstofps) / windMag;
614  else
615  _vHEAD = FGColumnVector3((mag*ktstofps), 0., 0.);
616 
617  _vWIND_NED(eU) = _vHEAD(eU);
618  _vWIND_NED(eV) = _vHEAD(eV);
619  _vt_NED = vUVW_NED + _vWIND_NED;
620  vt = _vt_NED.Magnitude();
621 
622  calcAeroAngles(_vt_NED);
623 }
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:199
+ Here is the call graph for this function:
+ Here is the caller 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 524 of file FGInitialCondition.cpp.

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

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