JSBSim Flight Dynamics Model  1.1.11 (13 Feb 2022)
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();

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 224 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...
 
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...
 
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 useStoredPath=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 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) const
 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...
 
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 double PitotTotalPressure (double mach, double p)
 Compute the total pressure in front of the Pitot tube. More...
 
static double MachFromImpactPressure (double qc, double p)
 Compute the Mach number from the differential pressure (qc) and the static pressure. More...
 
static double VcalibratedFromMach (double mach, double p)
 Calculate the calibrated airspeed from the Mach number. More...
 
static double MachFromVcalibrated (double vcas, double p)
 Calculate the Mach number from the calibrated airspeed.Based on the formulas in the US Air Force Aircraft Performance Flight Testing Manual (AFFTC-TIH-99-01). 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 double GaussianRandomNumber (void)
 
- 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 Message localMsg
 
static std::queue< MessageMessages
 
static unsigned int messageId = 0
 
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 ktstofps = 1.68781
 
static constexpr double fpstokts = 1.0 / ktstofps
 
static constexpr double inchtoft = 1.0/12.0
 
static constexpr double fttom = 0.3048
 
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__
 
static int gaussian_random_number_phase = 0
 

Member Function Documentation

◆ GetAlphaDegIC()

double GetAlphaDegIC ( void  ) const
inline

Gets the initial angle of attack.

Returns
Initial alpha in degrees

Definition at line 347 of file FGInitialCondition.h.

347 { return alpha*radtodeg; }

◆ GetAlphaRadIC()

double GetAlphaRadIC ( void  ) const
inline

Gets the initial angle of attack.

Returns
Initial alpha in radians

Definition at line 623 of file FGInitialCondition.h.

623 { return alpha; }

◆ GetAltitudeAGLFtIC()

double GetAltitudeAGLFtIC ( void  ) const

Gets the initial altitude above ground level.

Returns
Initial altitude AGL in feet

Definition at line 656 of file FGInitialCondition.cpp.

657 {
658  return fdmex->GetInertial()->GetAltitudeAGL(position);
659 }
+ 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 649 of file FGInitialCondition.cpp.

650 {
651  return position.GetRadius() - position.GetSeaLevelRadius();
652 }
+ 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 351 of file FGInitialCondition.h.

351 { return beta*radtodeg; }

◆ GetBetaRadIC()

double GetBetaRadIC ( void  ) const
inline

Gets the initial angle of sideslip.

Returns
Initial sideslip angle in radians

Definition at line 627 of file FGInitialCondition.h.

627 { return beta; }

◆ GetClimbRateFpmIC()

double GetClimbRateFpmIC ( void  ) const
inline

Gets the initial climb rate.

Returns
Initial climb rate in feet/minute

Definition at line 337 of file FGInitialCondition.h.

338  { return GetClimbRateFpsIC()*60; }
+ Here is the call 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 518 of file FGInitialCondition.h.

519  {
520  const FGMatrix33& Tb2l = orientation.GetTInv();
521  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
522  return -_vt_NED(eW);
523  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetEarthPositionAngleIC()

double GetEarthPositionAngleIC ( void  ) const
inline

Gets the initial Earth position angle.

Returns
Initial Earth position angle in radians.

Definition at line 392 of file FGInitialCondition.h.

392 { return epa; }

◆ GetFlightPathAngleDegIC()

double GetFlightPathAngleDegIC ( void  ) const
inline

Gets the initial flight path angle.

Returns
Initial flight path angle in degrees

Definition at line 342 of file FGInitialCondition.h.

343  { return GetFlightPathAngleRadIC()*radtodeg; }
+ Here is the call 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 618 of file FGInitialCondition.h.

619  { return (vt == 0.0)?0.0:asin(GetClimbRateFpsIC() / vt); }
+ 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 371 of file FGInitialCondition.h.

372  { return position.GetGeodLatitudeDeg(); }
+ Here is the call graph for this function:

◆ GetGeodLatitudeRadIC()

double GetGeodLatitudeRadIC ( void  ) const
inline

Gets the initial geodetic latitude.

Returns
Initial geodetic latitude in radians

Definition at line 639 of file FGInitialCondition.h.

640  { return position.GetGeodLatitudeRad(); }
+ Here is the call graph for this function:

◆ GetLatitudeDegIC()

double GetLatitudeDegIC ( void  ) const
inline

Gets the initial latitude.

Returns
Initial geocentric latitude in degrees

Definition at line 367 of file FGInitialCondition.h.

367 { return position.GetLatitudeDeg(); }
+ Here is the call graph for this function:

◆ GetLatitudeRadIC()

double GetLatitudeRadIC ( void  ) const
inline

Gets the initial latitude.

Returns
Initial latitude in radians

Definition at line 635 of file FGInitialCondition.h.

635 { return position.GetLatitude(); }
+ Here is the call graph for this function:

◆ GetLongitudeDegIC()

double GetLongitudeDegIC ( void  ) const
inline

Gets the initial longitude.

Returns
Initial longitude in degrees

Definition at line 376 of file FGInitialCondition.h.

376 { return position.GetLongitudeDeg(); }
+ Here is the call graph for this function:

◆ GetLongitudeRadIC()

double GetLongitudeRadIC ( void  ) const
inline

Gets the initial longitude.

Returns
Initial longitude in radians

Definition at line 644 of file FGInitialCondition.h.

644 { return position.GetLongitude(); }
+ Here is the call graph for this function:

◆ GetMachIC()

double GetMachIC ( void  ) const

Gets the initial mach.

Returns
Initial mach number

Definition at line 983 of file FGInitialCondition.cpp.

984 {
985  double altitudeASL = GetAltitudeASLFtIC();
986  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
987  return vt / soundSpeed;
988 }
+ 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 648 of file FGInitialCondition.h.

648 { return orientation; }

◆ GetPhiDegIC()

double GetPhiDegIC ( void  ) const
inline

Gets the initial roll angle.

Returns
Initial phi in degrees

Definition at line 359 of file FGInitialCondition.h.

359 { return orientation.GetEulerDeg(ePhi); }
+ Here is the call graph for this function:

◆ GetPhiRadIC()

double GetPhiRadIC ( void  ) const
inline

Gets the initial roll angle.

Returns
Initial roll angle in radians

Definition at line 652 of file FGInitialCondition.h.

652 { return orientation.GetEuler(ePhi); }
+ 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 631 of file FGInitialCondition.h.

631 { 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 558 of file FGInitialCondition.h.

558 { 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 562 of file FGInitialCondition.h.

562 { return vPQR_body(eP); }

◆ GetPsiDegIC()

double GetPsiDegIC ( void  ) const
inline

Gets the initial heading angle.

Returns
Initial psi in degrees

Definition at line 363 of file FGInitialCondition.h.

363 { return orientation.GetEulerDeg(ePsi); }
+ Here is the call graph for this function:

◆ GetPsiRadIC()

double GetPsiRadIC ( void  ) const
inline

Gets the initial heading angle.

Returns
Initial heading angle in radians

Definition at line 660 of file FGInitialCondition.h.

660 { return orientation.GetEuler(ePsi); }
+ 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 566 of file FGInitialCondition.h.

566 { 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 570 of file FGInitialCondition.h.

570 { return vPQR_body(eR); }

◆ GetSpeedSet()

speedset GetSpeedSet ( void  ) const
inline

Gets the initial speedset.

Returns
Initial speedset

Definition at line 664 of file FGInitialCondition.h.

664 { 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 668 of file FGInitialCondition.h.

668 { 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 663 of file FGInitialCondition.cpp.

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

355 { return orientation.GetEulerDeg(eTht); }
+ Here is the call graph for this function:

◆ GetThetaRadIC()

double GetThetaRadIC ( void  ) const
inline

Gets the initial pitch angle.

Returns
Initial pitch angle in radians

Definition at line 656 of file FGInitialCondition.h.

656 { return orientation.GetEuler(eTht); }
+ 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 534 of file FGInitialCondition.h.

534 { 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 527 of file FGInitialCondition.h.

527  {
528  const FGMatrix33& Tl2b = orientation.GetT();
529  return Tl2b * vUVW_NED;
530  }
+ Here is the call 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 538 of file FGInitialCondition.h.

538 { return GetBodyVelFpsIC(eV); }

◆ GetVcalibratedKtsIC()

double GetVcalibratedKtsIC ( void  ) const

Gets the initial calibrated airspeed.

Returns
Initial calibrated airspeed in knots

Definition at line 961 of file FGInitialCondition.cpp.

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

554 { 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 550 of file FGInitialCondition.h.

550 { return vUVW_NED(eV); }

◆ GetVequivalentKtsIC()

double GetVequivalentKtsIC ( void  ) const

Gets the initial equivalent airspeed.

Returns
Initial equivalent airspeed in knots

Definition at line 973 of file FGInitialCondition.cpp.

974 {
975  double altitudeASL = GetAltitudeASLFtIC();
976  double rho = Atmosphere->GetDensity(altitudeASL);
977  double rhoSL = Atmosphere->GetDensitySL();
978  return fpstokts * vt * sqrt(rho/rhoSL);
979 }
+ 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 470 of file FGInitialCondition.h.

470 { return vUVW_NED.Magnitude(eU, eV); }
+ 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 325 of file FGInitialCondition.h.

325 { return GetVgroundFpsIC() * fpstokts; }
+ Here is the call 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 546 of file FGInitialCondition.h.

546 { 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 474 of file FGInitialCondition.h.

474 { return vt; }

◆ GetVtrueKtsIC()

double GetVtrueKtsIC ( void  ) const
inline

Gets the initial true velocity.

Returns
Initial true airspeed in knots.

Definition at line 329 of file FGInitialCondition.h.

329 { 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 542 of file FGInitialCondition.h.

542 { 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 506 of file FGInitialCondition.h.

506 { return GetNEDWindFpsIC(eZ); }

◆ GetWindDirDegIC()

double GetWindDirDegIC ( void  ) const

Gets the initial wind direction.

Returns
Initial wind direction in feet/second

Definition at line 915 of file FGInitialCondition.cpp.

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

502 { return GetNEDWindFpsIC(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 938 of file FGInitialCondition.cpp.

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

490  {
491  const FGMatrix33& Tb2l = orientation.GetTInv();
492  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
493  return _vt_NED - vUVW_NED;
494  }
+ 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 498 of file FGInitialCondition.h.

498 { return GetNEDWindFpsIC(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 478 of file FGInitialCondition.h.

478 { 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 482 of file FGInitialCondition.h.

482 { 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 486 of file FGInitialCondition.h.

486 { 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 679 of file FGInitialCondition.h.

679 { 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 1002 of file FGInitialCondition.cpp.

1003 {
1004  SGPath init_file_name;
1005  if(useStoredPath && rstfile.isRelative()) {
1006  init_file_name = fdmex->GetFullAircraftPath()/rstfile.utf8Str();
1007  } else {
1008  init_file_name = rstfile;
1009  }
1010 
1011  FGXMLFileRead XMLFileRead;
1012  Element* document = XMLFileRead.LoadXMLDocument(init_file_name);
1013 
1014  // Make sure that the document is valid
1015  if (!document) {
1016  stringstream s;
1017  s << "File: " << init_file_name << " could not be read.";
1018  cerr << s.str() << endl;
1019  throw BaseException(s.str());
1020  }
1021 
1022  if (document->GetName() != string("initialize")) {
1023  stringstream s;
1024  s << "File: " << init_file_name << " is not a reset file.";
1025  cerr << s.str() << endl;
1026  throw BaseException(s.str());
1027  }
1028 
1029  double version = HUGE_VAL;
1030  bool result = false;
1031 
1032  if (document->HasAttribute("version"))
1033  version = document->GetAttributeValueAsNumber("version");
1034 
1035  if (version == HUGE_VAL) {
1036  result = Load_v1(document); // Default to the old version
1037  } else if (version >= 3.0) {
1038  const string s("Only initialization file formats 1 and 2 are currently supported");
1039  cerr << document->ReadFrom() << endl << s << endl;
1040  throw BaseException(s);
1041  } else if (version >= 2.0) {
1042  result = Load_v2(document);
1043  } else if (version >= 1.0) {
1044  result = Load_v1(document);
1045  }
1046 
1047  // Check to see if any engines are specified to be initialized in a running state
1048  Element* running_elements = document->FindElement("running");
1049  while (running_elements) {
1050  int engineNumber = int(running_elements->GetDataAsNumber());
1051  enginesRunning |= engineNumber == -1 ? engineNumber : 1 << engineNumber;
1052  running_elements = document->FindNextElement("running");
1053  }
1054 
1055  return result;
1056 }
+ Here is the call graph for this function:
+ Here is the caller 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 83 of file FGInitialCondition.cpp.

89 {
90  double calpha = cos(alpha0), cbeta = cos(beta0);
91  double salpha = sin(alpha0), sbeta = sin(beta0);
92 
93  InitializeIC();
94 
95  vPQR_body = {p0, q0, r0};
96  alpha = alpha0; beta = beta0;
97 
98  position.SetLongitude(lonRad0);
99  position.SetLatitude(latRad0);
100  fdmex->GetInertial()->SetAltitudeAGL(position, altAGLFt0);
101  lastLatitudeSet = setgeoc;
102  lastAltitudeSet = setagl;
103 
104  orientation = FGQuaternion(phi0, theta0, psi0);
105  const FGMatrix33& Tb2l = orientation.GetTInv();
106 
107  vUVW_NED = Tb2l * FGColumnVector3(u0, v0, w0);
108  vt = vUVW_NED.Magnitude();
109  lastSpeedSet = setuvw;
110 
111  Tw2b = { calpha*cbeta, -calpha*sbeta, -salpha,
112  sbeta, cbeta, 0.0,
113  salpha*cbeta, -salpha*sbeta, calpha };
114  Tb2w = Tw2b.Transposed();
115 
116  SetFlightPathAngleRadIC(gamma0);
117 }
+ 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 254 of file FGInitialCondition.h.

254 { SetAlphaRadIC(a*degtorad); }
+ Here is the call 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 312 of file FGInitialCondition.cpp.

313 {
314  const FGMatrix33& Tb2l = orientation.GetTInv();
315  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
316  calcThetaBeta(alfa, _vt_NED);
317 }
+ 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 676 of file FGInitialCondition.cpp.

677 {
678  double altitudeASL = GetAltitudeASLFtIC();
679  double pressure = Atmosphere->GetPressure(altitudeASL);
680  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
681  double rho = Atmosphere->GetDensity(altitudeASL);
682  double rhoSL = Atmosphere->GetDensitySL();
683 
684  double mach0 = vt / soundSpeed;
685  double vc0 = VcalibratedFromMach(mach0, pressure);
686  double ve0 = vt * sqrt(rho/rhoSL);
687 
688  switch(lastLatitudeSet) {
689  case setgeod:
690  fdmex->GetInertial()->SetAltitudeAGL(position, agl);
691  break;
692  case setgeoc:
693  {
694  double a = fdmex->GetInertial()->GetSemimajor();
695  double b = fdmex->GetInertial()->GetSemiminor();
696  double e2 = 1.0-b*b/(a*a);
697  double tanlat = tan(position.GetLatitude());
698  double n = e2;
699  double prev_n = 1.0;
700  int iter = 0;
701  double longitude = position.GetLongitude();
702  double alt = position.GetGeodAltitude();
703  double h = -2.0*max(a,b);
704  double geodLat;
705  while ((fabs(n-prev_n) > 1E-15 || fabs(h-agl) > 1E-10) && iter < 10) {
706  geodLat = atan(tanlat/(1-n));
707  position.SetPositionGeodetic(longitude, geodLat, alt);
708  h = GetAltitudeAGLFtIC();
709  alt += agl-h;
710  double sinGeodLat = sin(geodLat);
711  double N = a/sqrt(1-e2*sinGeodLat*sinGeodLat);
712  prev_n = n;
713  n = e2*N/(N+alt);
714  iter++;
715  }
716  }
717  break;
718  }
719 
720  altitudeASL = GetAltitudeASLFtIC();
721  soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
722  rho = Atmosphere->GetDensity(altitudeASL);
723  pressure = Atmosphere->GetPressure(altitudeASL);
724 
725  switch(lastSpeedSet) {
726  case setvc:
727  mach0 = MachFromVcalibrated(vc0, pressure);
728  SetVtrueFpsIC(mach0 * soundSpeed);
729  break;
730  case setmach:
731  SetVtrueFpsIC(mach0 * soundSpeed);
732  break;
733  case setve:
734  SetVtrueFpsIC(ve0 * sqrt(rhoSL/rho));
735  break;
736  default: // Make the compiler stop complaining about missing enums
737  break;
738  }
739 
740  lastAltitudeSet = setagl;
741 }
+ 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 748 of file FGInitialCondition.cpp.

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

258 { SetBetaRadIC(b*degtorad);}
+ Here is the call graph for this function:

◆ SetBetaRadIC()

void SetBetaRadIC ( double  beta)

Sets the initial sideslip angle.

Parameters
betaInitial angle of sideslip in radians.

Definition at line 397 of file FGInitialCondition.cpp.

398 {
399  const FGMatrix33& Tb2l = orientation.GetTInv();
400  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
401  FGColumnVector3 vOrient = orientation.GetEuler();
402 
403  beta = bta;
404  double calpha = cos(alpha), salpha = sin(alpha);
405  double cbeta = cos(beta), sbeta = sin(beta);
406  double cphi = orientation.GetCosEuler(ePhi), sphi = orientation.GetSinEuler(ePhi);
407  FGMatrix33 TphiInv(1., 0., 0.,
408  0., cphi,-sphi,
409  0., sphi, cphi);
410 
411  Tw2b = { calpha*cbeta, -calpha*sbeta, -salpha,
412  sbeta, cbeta, 0.0,
413  salpha*cbeta, -salpha*sbeta, calpha };
414  Tb2w = Tw2b.Transposed();
415 
416  FGColumnVector3 vf = TphiInv * Tw2b * FGColumnVector3(vt, 0., 0.);
417  FGColumnVector3 v0xy(_vt_NED(eX), _vt_NED(eY), 0.);
418  FGColumnVector3 v1xy(sqrt(v0xy(eX)*v0xy(eX)+v0xy(eY)*v0xy(eY)-vf(eY)*vf(eY)),vf(eY),0.);
419  v0xy.Normalize();
420  v1xy.Normalize();
421 
422  if (vf(eX) < 0.) v0xy(eX) *= -1.0;
423 
424  double sinPsi = (v1xy * v0xy)(eZ);
425  double cosPsi = DotProduct(v0xy, v1xy);
426  vOrient(ePsi) = atan2(sinPsi, cosPsi);
427  FGMatrix33 Tpsi( cosPsi, sinPsi, 0.,
428  -sinPsi, cosPsi, 0.,
429  0., 0., 1.);
430 
431  FGColumnVector3 v2xz = Tpsi * _vt_NED;
432  FGColumnVector3 vfxz = vf;
433  v2xz(eV) = vfxz(eV) = 0.0;
434  v2xz.Normalize();
435  vfxz.Normalize();
436  double sinTheta = (v2xz * vfxz)(eY);
437  vOrient(eTht) = -asin(sinTheta);
438 
439  orientation = FGQuaternion(vOrient);
440 }
+ 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 281 of file FGInitialCondition.h.

281 { SetClimbRateFpsIC(roc/60.0); }
+ Here is the call 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 283 of file FGInitialCondition.cpp.

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

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

286  { SetClimbRateFpsIC(vt*sin(gamma*degtorad)); }
+ Here is the call 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 574 of file FGInitialCondition.h.

575  { SetClimbRateFpsIC(vt*sin(gamma)); }
+ 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 308 of file FGInitialCondition.h.

309  { SetGeodLatitudeRadIC(glat*degtorad); }
+ Here is the call 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 849 of file FGInitialCondition.cpp.

850 {
851  double lon = position.GetLongitude();
852  lastLatitudeSet = setgeod;
853 
854  switch (lastAltitudeSet)
855  {
856  case setagl:
857  {
858  double agl = GetAltitudeAGLFtIC();
859  position.SetPositionGeodetic(lon, geodLatitude, 0.);
860  fdmex->GetInertial()->SetAltitudeAGL(position, agl);
861  }
862  break;
863  case setasl:
864  {
865  double asl = GetAltitudeASLFtIC();
866  position.SetPositionGeodetic(lon, geodLatitude, 0.);
867  SetAltitudeASLFtIC(asl);
868  }
869  break;
870  }
871 }
+ 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 550 of file FGInitialCondition.cpp.

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

302 { SetLatitudeRadIC(lat*degtorad); }
+ Here is the call graph for this function:

◆ SetLatitudeRadIC()

void SetLatitudeRadIC ( double  lat)

Sets the initial latitude.

Parameters
latInitial latitude in radians

Definition at line 875 of file FGInitialCondition.cpp.

876 {
877  double altitude;
878 
879  lastLatitudeSet = setgeoc;
880 
881  switch(lastAltitudeSet) {
882  case setagl:
883  altitude = GetAltitudeAGLFtIC();
884  position.SetLatitude(lat);
885  SetAltitudeAGLFtIC(altitude);
886  break;
887  default:
888  altitude = GetAltitudeASLFtIC();
889  position.SetLatitude(lat);
890  SetAltitudeASLFtIC(altitude);
891  break;
892  }
893 }
+ 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 313 of file FGInitialCondition.h.

313 { SetLongitudeRadIC(lon*degtorad); }
+ Here is the call graph for this function:

◆ SetLongitudeRadIC()

void SetLongitudeRadIC ( double  lon)

Sets the initial longitude.

Parameters
lonInitial longitude in radians

Definition at line 897 of file FGInitialCondition.cpp.

898 {
899  double altitude;
900 
901  switch(lastAltitudeSet) {
902  case setagl:
903  altitude = GetAltitudeAGLFtIC();
904  position.SetLongitude(lon);
905  SetAltitudeAGLFtIC(altitude);
906  break;
907  default:
908  position.SetLongitude(lon);
909  break;
910  }
911 }
+ 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 163 of file FGInitialCondition.cpp.

164 {
165  double altitudeASL = GetAltitudeASLFtIC();
166  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
167  SetVtrueFpsIC(mach*soundSpeed);
168  lastSpeedSet = setmach;
169 }
+ 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 273 of file FGInitialCondition.h.

273 { SetPhiRadIC(phi*degtorad);}
+ Here is the call graph for this function:

◆ SetPhiRadIC()

void SetPhiRadIC ( double  phi)
inline

Sets the initial roll angle.

Parameters
phiInitial roll angle in radians

Definition at line 587 of file FGInitialCondition.h.

587 { 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 428 of file FGInitialCondition.h.

428 { 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 277 of file FGInitialCondition.h.

277 { SetPsiRadIC(psi*degtorad); }
+ Here is the call graph for this function:

◆ SetPsiRadIC()

void SetPsiRadIC ( double  psi)
inline

Sets the initial heading angle.

Parameters
psiInitial heading angle in radians

Definition at line 595 of file FGInitialCondition.h.

595 { SetEulerAngleRadIC(ePsi, psi); }
+ 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 432 of file FGInitialCondition.h.

432 { 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 436 of file FGInitialCondition.h.

436 { 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 613 of file FGInitialCondition.h.

613 { targetNlfIC=nlf; }

◆ SetTerrainElevationFtIC()

void SetTerrainElevationFtIC ( double  elev)

Sets the initial terrain elevation.

Parameters
elevInitial terrain elevation in feet

Definition at line 638 of file FGInitialCondition.cpp.

639 {
640  double agl = GetAltitudeAGLFtIC();
641  fdmex->GetInertial()->SetTerrainElevation(elev);
642 
643  if (lastAltitudeSet == setagl)
644  SetAltitudeAGLFtIC(agl);
645 }
+ 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 262 of file FGInitialCondition.h.

262 { SetThetaRadIC(theta*degtorad); }
+ Here is the call graph for this function:

◆ SetThetaRadIC()

void SetThetaRadIC ( double  theta)
inline

Sets the initial pitch angle.

Parameters
thetaInitial pitch angle in radians

Definition at line 591 of file FGInitialCondition.h.

591 { 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 404 of file FGInitialCondition.h.

404 { 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 408 of file FGInitialCondition.h.

408 { SetBodyVelFpsIC(eV, vbody); }

◆ SetVcalibratedKtsIC()

void SetVcalibratedKtsIC ( double  vc)

Set calibrated airspeed initial condition in knots.

Parameters
vcCalibrated airspeed in knots

Definition at line 173 of file FGInitialCondition.cpp.

174 {
175  double altitudeASL = GetAltitudeASLFtIC();
176  double pressure = Atmosphere->GetPressure(altitudeASL);
177  double mach = MachFromVcalibrated(fabs(vcas)*ktstofps, pressure);
178  double soundSpeed = Atmosphere->GetSoundSpeed(altitudeASL);
179 
180  SetVtrueFpsIC(mach * soundSpeed);
181  lastSpeedSet = setvc;
182 }
+ 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 424 of file FGInitialCondition.h.

424 { 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 420 of file FGInitialCondition.h.

420 { SetNEDVelFpsIC(eV, ve); }

◆ SetVequivalentKtsIC()

void SetVequivalentKtsIC ( double  ve)

Set equivalent airspeed initial condition in knots.

Parameters
veEquivalent airspeed in knots

Definition at line 152 of file FGInitialCondition.cpp.

153 {
154  double altitudeASL = GetAltitudeASLFtIC();
155  double rho = Atmosphere->GetDensity(altitudeASL);
156  double rhoSL = Atmosphere->GetDensitySL();
157  SetVtrueFpsIC(ve*ktstofps*sqrt(rhoSL/rho));
158  lastSpeedSet = setve;
159 }
+ 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 235 of file FGInitialCondition.cpp.

236 {
237  const FGMatrix33& Tb2l = orientation.GetTInv();
238  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
239  FGColumnVector3 _vWIND_NED = _vt_NED - vUVW_NED;
240 
241  vUVW_NED(eU) = vg * orientation.GetCosEuler(ePsi);
242  vUVW_NED(eV) = vg * orientation.GetSinEuler(ePsi);
243  vUVW_NED(eW) = 0.;
244  _vt_NED = vUVW_NED + _vWIND_NED;
245  vt = _vt_NED.Magnitude();
246 
247  calcAeroAngles(_vt_NED);
248 
249  lastSpeedSet = setvg;
250 }
+ 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 246 of file FGInitialCondition.h.

246 { SetVgroundFpsIC(vg*ktstofps); }
+ Here is the call 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 416 of file FGInitialCondition.h.

416 { SetNEDVelFpsIC(eU, vn); }

◆ SetVtrueFpsIC()

void SetVtrueFpsIC ( double  vt)

Sets the initial true airspeed.

Parameters
vtInitial true airspeed in feet/second

Definition at line 259 of file FGInitialCondition.cpp.

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

242 { SetVtrueFpsIC(vtrue*ktstofps); }
+ Here is the call 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 412 of file FGInitialCondition.h.

412 { 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 620 of file FGInitialCondition.cpp.

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

579 {
580  const FGMatrix33& Tb2l = orientation.GetTInv();
581  FGColumnVector3 _vt_NED = Tb2l * Tw2b * FGColumnVector3(vt, 0., 0.);
582 
583  _vt_NED(eW) = vUVW_NED(eW) + wD;
584  vt = _vt_NED.Magnitude();
585 
586  calcAeroAngles(_vt_NED);
587 }
+ 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 594 of file FGInitialCondition.cpp.

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

515 {
516  FGColumnVector3 _vt_NED = vUVW_NED + FGColumnVector3(wN, wE, wD);
517  vt = _vt_NED.Magnitude();
518 
519  calcAeroAngles(_vt_NED);
520 }
+ 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 683 of file FGInitialCondition.h.

683 { return trimRequested; }

The documentation for this class was generated from the following files:
JSBSim::FGLocation::GetLongitudeDeg
double GetLongitudeDeg() const
Get the longitude.
Definition: FGLocation.h:240
JSBSim::FGInitialCondition::SetVgroundFpsIC
void SetVgroundFpsIC(double vg)
Sets the initial ground speed.
Definition: FGInitialCondition.cpp:235
JSBSim::FGLocation::GetLatitudeDeg
double GetLatitudeDeg() const
Get the GEOCENTRIC latitude in degrees.
Definition: FGLocation.h:267
JSBSim::FGInitialCondition::Load
bool Load(const SGPath &rstname, bool useStoredPath=true)
Loads the initial conditions.
Definition: FGInitialCondition.cpp:1002
JSBSim::FGAtmosphere::GetPressure
virtual double GetPressure(void) const
Returns the pressure in psf.
Definition: FGAtmosphere.h:144
JSBSim::FGFDMExec::GetIC
FGInitialCondition * GetIC(void)
Returns a pointer to the FGInitialCondition object.
Definition: FGFDMExec.h:387
JSBSim::FGInitialCondition::SetAltitudeAGLFtIC
void SetAltitudeAGLFtIC(double agl)
Sets the initial Altitude above ground level.
Definition: FGInitialCondition.cpp:676
JSBSim::FGFDMExec::GetInertial
FGInertial * GetInertial(void)
Returns the FGInertial pointer.
Definition: FGFDMExec.h:367
JSBSim::FGLocation::SetRadius
void SetRadius(double radius)
Set the distance from the center of the earth.
Definition: FGLocation.cpp:212
JSBSim::FGQuaternion::GetCosEuler
double GetCosEuler(int i) const
Retrieves cosine of the given euler angle.
Definition: FGQuaternion.h:245
JSBSim::FGLocation::GetLongitude
double GetLongitude() const
Get the longitude.
Definition: FGLocation.h:234
JSBSim::FGJSBBase::VcalibratedFromMach
static double VcalibratedFromMach(double mach, double p)
Calculate the calibrated airspeed from the Mach number.
Definition: FGJSBBase.cpp:289
JSBSim::FGInitialCondition::SetAlphaRadIC
void SetAlphaRadIC(double alpha)
Sets the initial angle of attack.
Definition: FGInitialCondition.cpp:312
JSBSim::FGInitialCondition::InitializeIC
void InitializeIC(void)
Initialize the initial conditions to default values.
Definition: FGInitialCondition.cpp:121
JSBSim::FGLocation::GetGeodLatitudeRad
double GetGeodLatitudeRad(void) const
Get the GEODETIC latitude in radians.
Definition: FGLocation.h:258
JSBSim::FGLocation::GetGeodLatitudeDeg
double GetGeodLatitudeDeg(void) const
Get the GEODETIC latitude in degrees.
Definition: FGLocation.h:273
JSBSim::FGLocation::GetRadius
double GetRadius() const
Get the distance from the center of the earth in feet.
Definition: FGLocation.h:291
JSBSim::FGInitialCondition::SetLongitudeRadIC
void SetLongitudeRadIC(double lon)
Sets the initial longitude.
Definition: FGInitialCondition.cpp:897
JSBSim::FGLocation::GetLatitude
double GetLatitude() const
Get the GEOCENTRIC latitude in radians.
Definition: FGLocation.h:252
JSBSim::FGInitialCondition::SetAltitudeASLFtIC
void SetAltitudeASLFtIC(double altitudeASL)
Sets the altitude above sea level initial condition in feet.
Definition: FGInitialCondition.cpp:748
JSBSim::FGInitialCondition::SetPsiRadIC
void SetPsiRadIC(double psi)
Sets the initial heading angle.
Definition: FGInitialCondition.h:595
JSBSim::FGColumnVector3::Magnitude
double Magnitude(void) const
Length of the vector.
Definition: FGColumnVector3.cpp:109
JSBSim::FGAtmosphere::GetDensitySL
virtual double GetDensitySL(void) const
Returns the sea level density in slugs/ft^3.
Definition: FGAtmosphere.h:173
JSBSim::FGInitialCondition::SetBetaRadIC
void SetBetaRadIC(double beta)
Sets the initial sideslip angle.
Definition: FGInitialCondition.cpp:397
JSBSim::FGInertial::SetTerrainElevation
void SetTerrainElevation(double h)
Set the terrain elevation above sea level.
Definition: FGInertial.h:130
JSBSim::FGJSBBase::MachFromVcalibrated
static double MachFromVcalibrated(double vcas, double p)
Calculate the Mach number from the calibrated airspeed.Based on the formulas in the US Air Force Airc...
Definition: FGJSBBase.cpp:300
JSBSim::FGLocation::SetPositionGeodetic
void SetPositionGeodetic(double lon, double lat, double height)
Sets the longitude, latitude and the distance above the reference spheroid.
Definition: FGLocation.cpp:241
JSBSim::FGFDMExec::GetPropagate
FGPropagate * GetPropagate(void)
Returns the FGPropagate pointer.
Definition: FGFDMExec.h:377
JSBSim::FGInitialCondition::SetThetaRadIC
void SetThetaRadIC(double theta)
Sets the initial pitch angle.
Definition: FGInitialCondition.h:591
JSBSim::FGQuaternion::GetEuler
const FGColumnVector3 & GetEuler(void) const
Retrieves the Euler angles.
Definition: FGQuaternion.h:199
JSBSim::FGInitialCondition::GetVgroundFpsIC
double GetVgroundFpsIC(void) const
Gets the initial ground velocity.
Definition: FGInitialCondition.h:470
JSBSim::FGInitialCondition::GetAltitudeASLFtIC
double GetAltitudeASLFtIC(void) const
Gets the initial altitude above sea level.
Definition: FGInitialCondition.cpp:649
JSBSim::FGMatrix33::Transposed
FGMatrix33 Transposed(void) const
Transposed matrix.
Definition: FGMatrix33.h:221
JSBSim::FGInitialCondition::GetClimbRateFpsIC
double GetClimbRateFpsIC(void) const
Gets the initial climb rate.
Definition: FGInitialCondition.h:518
JSBSim::FGAtmosphere::GetSoundSpeed
virtual double GetSoundSpeed(void) const
Returns the speed of sound in ft/sec.
Definition: FGAtmosphere.h:183
JSBSim::FGInitialCondition::GetFlightPathAngleRadIC
double GetFlightPathAngleRadIC(void) const
Gets the initial flight path angle.
Definition: FGInitialCondition.h:618
JSBSim::FGInitialCondition::FGInitialCondition
FGInitialCondition(FGFDMExec *fdmex)
Constructor.
Definition: FGInitialCondition.cpp:60
JSBSim::FGQuaternion::GetT
const FGMatrix33 & GetT(void) const
Transformation matrix.
Definition: FGQuaternion.h:188
JSBSim::FGInitialCondition::SetLatitudeRadIC
void SetLatitudeRadIC(double lat)
Sets the initial latitude.
Definition: FGInitialCondition.cpp:875
JSBSim::FGQuaternion::GetEulerDeg
double GetEulerDeg(int i) const
Retrieves the Euler angles.
Definition: FGQuaternion.h:220
JSBSim::FGLocation::SetLongitude
void SetLongitude(double longitude)
Set the longitude.
Definition: FGLocation.cpp:168
JSBSim::FGInertial::GetAltitudeAGL
double GetAltitudeAGL(const FGLocation &location) const
Get the altitude above ground level.
Definition: FGInertial.h:114
JSBSim::FGLocation::SetLatitude
void SetLatitude(double latitude)
Set the GEOCENTRIC latitude.
Definition: FGLocation.cpp:188
JSBSim::FGInitialCondition::SetVtrueFpsIC
void SetVtrueFpsIC(double vt)
Sets the initial true airspeed.
Definition: FGInitialCondition.cpp:259
JSBSim::FGInitialCondition::GetAltitudeAGLFtIC
double GetAltitudeAGLFtIC(void) const
Gets the initial altitude above ground level.
Definition: FGInitialCondition.cpp:656
JSBSim::FGInertial::SetAltitudeAGL
void SetAltitudeAGL(FGLocation &location, double altitudeAGL)
Set the altitude above ground level.
Definition: FGInertial.cpp:216
JSBSim::FGFDMExec::RunIC
bool RunIC(void)
Initializes the sim from the initial condition object and executes each scheduled model without integ...
Definition: FGFDMExec.cpp:560
JSBSim::FGInitialCondition::SetPhiRadIC
void SetPhiRadIC(double phi)
Sets the initial roll angle.
Definition: FGInitialCondition.h:587
JSBSim::FGQuaternion::GetSinEuler
double GetSinEuler(int i) const
Retrieves sine of the given euler angle.
Definition: FGQuaternion.h:237
JSBSim::FGLocation::GetGeodAltitude
double GetGeodAltitude(void) const
Gets the geodetic altitude in feet.
Definition: FGLocation.h:279
JSBSim::FGInitialCondition::SetClimbRateFpsIC
void SetClimbRateFpsIC(double roc)
Sets the initial climb rate.
Definition: FGInitialCondition.cpp:283
JSBSim::FGLocation::GetSeaLevelRadius
double GetSeaLevelRadius(void) const
Get the sea level radius in feet below the current location.
Definition: FGLocation.cpp:271
JSBSim::FGInitialCondition::SetGeodLatitudeRadIC
void SetGeodLatitudeRadIC(double glat)
Sets the initial geodetic latitude.
Definition: FGInitialCondition.cpp:849
JSBSim::FGQuaternion::GetTInv
const FGMatrix33 & GetTInv(void) const
Backward transformation matrix.
Definition: FGQuaternion.h:193
JSBSim::FGInertial::GetContactPoint
double GetContactPoint(const FGLocation &location, FGLocation &contact, FGColumnVector3 &normal, FGColumnVector3 &velocity, FGColumnVector3 &ang_velocity) const
Get terrain contact point information below the current location.
Definition: FGInertial.h:103
JSBSim::FGAtmosphere::GetDensity
virtual double GetDensity(void) const
Returns the density in slugs/ft^3.
Definition: FGAtmosphere.h:167
JSBSim::FGFDMExec::GetFullAircraftPath
const SGPath & GetFullAircraftPath(void)
Retrieves the full aircraft path name.
Definition: FGFDMExec.h:399
JSBSim::FGInitialCondition::SetFlightPathAngleRadIC
void SetFlightPathAngleRadIC(double gamma)
Sets the initial flight path angle.
Definition: FGInitialCondition.h:574
JSBSim::FGFDMExec::Run
bool Run(void)
This function executes each scheduled model in succession.
Definition: FGFDMExec.cpp:325