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:
fgic->InitializeIC();
fgic->SetVcalibratedKtsIC(vcas);
fgic->SetAltitudeAGLFtIC(altitude);
delete fgic;
std::shared_ptr< FGInitialCondition > GetIC(void) const
Returns a pointer to the FGInitialCondition object.
std::shared_ptr< FGPropagate > GetPropagate(void) const
Returns the FGPropagate pointer.
bool Run(void)
This function executes each scheduled model in succession.
bool RunIC(void)
Initializes the sim from the initial condition object and executes each scheduled model without integ...
FGInitialCondition(FGFDMExec *fdmex)
Constructor.
Alternatively, you can load initial conditions from an XML file:
Speed
Since vc, ve, vt, and mach all represent speed, the remaining three are recalculated each time one of them is set (using the current altitude). The most recent speed set is remembered so that if and when altitude is reset, the last set speed is used to recalculate the remaining three. Setting any of the body components forces a recalculation of vt and vt then becomes the most recent speed set.
Alpha,Gamma, and Theta
This class assumes that it will be used to set up the sim for a steady, zero pitch rate condition. Since any two of those angles specifies the third gamma (flight path angle) is favored when setting alpha and theta and alpha is favored when setting gamma. i.e.
- set alpha : recalculate theta using gamma as currently set
- set theta : recalculate alpha using gamma as currently set
- set gamma : recalculate theta using alpha as currently set
The idea being that gamma is most interesting to pilots (since it is indicative of climb rate).
Setting climb rate is, for the purpose of this discussion, considered equivalent to setting gamma.
These are the items that can be set in an initialization file:
- ubody (velocity, ft/sec)
- vbody (velocity, ft/sec)
- wbody (velocity, ft/sec)
- vnorth (velocity, ft/sec)
- veast (velocity, ft/sec)
- vdown (velocity, ft/sec)
- latitude (position, degrees)
- longitude (position, degrees)
- phi (orientation, degrees)
- theta (orientation, degrees)
- psi (orientation, degrees)
- alpha (angle, degrees)
- beta (angle, degrees)
- gamma (angle, degrees)
- roc (vertical velocity, ft/sec)
- elevation (local terrain elevation, ft)
- altitude (altitude AGL, ft)
- altitudeAGL (altitude AGL, ft)
- altitudeMSL (altitude MSL, ft)
- winddir (wind from-angle, degrees)
- vwind (magnitude wind speed, ft/sec)
- hwind (headwind speed, knots)
- xwind (crosswind speed, knots)
- vc (calibrated airspeed, ft/sec)
- mach (mach)
- vground (ground speed, ft/sec)
- trim (0 for no trim, 1 for ground trim, 'Longitudinal', 'Full', 'Ground', 'Pullup', 'Custom', 'Turn')
- running (-1 for all engines, 0 ... n-1 for specific engines)
Properties
- ic/vc-kts (read/write) Calibrated airspeed initial condition in knots
- ic/ve-kts (read/write) Knots equivalent airspeed initial condition
- ic/vg-kts (read/write) Ground speed initial condition in knots
- ic/vt-kts (read/write) True airspeed initial condition in knots
- ic/mach (read/write) Mach initial condition
- ic/roc-fpm (read/write) Rate of climb initial condition in feet/minute
- ic/gamma-deg (read/write) Flightpath angle initial condition in degrees
- ic/alpha-deg (read/write) Angle of attack initial condition in degrees
- ic/beta-deg (read/write) Angle of sideslip initial condition in degrees
- ic/theta-deg (read/write) Pitch angle initial condition in degrees
- ic/phi-deg (read/write) Roll angle initial condition in degrees
- ic/psi-true-deg (read/write) Heading angle initial condition in degrees
- ic/lat-gc-deg (read/write) Latitude initial condition in degrees
- ic/long-gc-deg (read/write) Longitude initial condition in degrees
- ic/h-sl-ft (read/write) Height above sea level initial condition in feet
- ic/h-agl-ft (read/write) Height above ground level initial condition in feet
- ic/sea-level-radius-ft (read/write) Radius of planet at sea level in feet
- ic/terrain-elevation-ft (read/write) Terrain elevation above sea level in feet
- ic/vg-fps (read/write) Ground speed initial condition in feet/second
- ic/vt-fps (read/write) True airspeed initial condition in feet/second
- ic/vw-bx-fps (read/write) Wind velocity initial condition in Body X frame in feet/second
- ic/vw-by-fps (read/write) Wind velocity initial condition in Body Y frame in feet/second
- ic/vw-bz-fps (read/write) Wind velocity initial condition in Body Z frame in feet/second
- ic/vw-north-fps (read/write) Wind northward velocity initial condition in feet/second
- ic/vw-east-fps (read/write) Wind eastward velocity initial condition in feet/second
- ic/vw-down-fps (read/write) Wind downward velocity initial condition in feet/second
- ic/vw-mag-fps (read/write) Wind velocity magnitude initial condition in feet/sec.
- ic/vw-dir-deg (read/write) Wind direction initial condition, in degrees from north
- ic/roc-fps (read/write) Rate of climb initial condition, in feet/second
- ic/u-fps (read/write) Body frame x-axis velocity initial condition in feet/second
- ic/v-fps (read/write) Body frame y-axis velocity initial condition in feet/second
- ic/w-fps (read/write) Body frame z-axis velocity initial condition in feet/second
- ic/vn-fps (read/write) Local frame x-axis (north) velocity initial condition in feet/second
- ic/ve-fps (read/write) Local frame y-axis (east) velocity initial condition in feet/second
- ic/vd-fps (read/write) Local frame z-axis (down) velocity initial condition in feet/second
- ic/gamma-rad (read/write) Flight path angle initial condition in radians
- ic/alpha-rad (read/write) Angle of attack initial condition in radians
- ic/theta-rad (read/write) Pitch angle initial condition in radians
- ic/beta-rad (read/write) Angle of sideslip initial condition in radians
- ic/phi-rad (read/write) Roll angle initial condition in radians
- ic/psi-true-rad (read/write) Heading angle initial condition in radians
- ic/lat-gc-rad (read/write) Geocentric latitude initial condition in radians
- ic/long-gc-rad (read/write) Longitude initial condition in radians
- ic/p-rad_sec (read/write) Roll rate initial condition in radians/second
- ic/q-rad_sec (read/write) Pitch rate initial condition in radians/second
- ic/r-rad_sec (read/write) Yaw rate initial condition in radians/second
- Author
- Tony Peden
Definition at line 226 of file FGInitialCondition.h.
|
| 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 FGQuaternion & | GetOrientation (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 FGLocation & | GetPosition (void) const |
| Gets the initial position. More...
|
|
const FGColumnVector3 | GetPQRRadpsIC (void) const |
| Gets the initial body rotation rate. More...
|
|
double | GetPRadpsIC () const |
| Gets the initial body axis roll rate. More...
|
|
double | GetPsiDegIC (void) const |
| Gets the initial heading angle. More...
|
|
double | GetPsiRadIC (void) const |
| Gets the initial heading angle. More...
|
|
double | GetQRadpsIC () const |
| Gets the initial body axis pitch rate. More...
|
|
double | GetRRadpsIC () const |
| Gets the initial body axis yaw rate. More...
|
|
speedset | GetSpeedSet (void) const |
| Gets the initial speedset. More...
|
|
double | GetTargetNlfIC (void) const |
| Gets the target normal load factor set from IC. More...
|
|
double | GetTerrainElevationFtIC (void) const |
| Gets the initial terrain elevation. More...
|
|
double | GetThetaDegIC (void) const |
| Gets the initial pitch angle. More...
|
|
double | GetThetaRadIC (void) const |
| Gets the initial pitch angle. More...
|
|
double | GetUBodyFpsIC (void) const |
| Gets the initial body axis X velocity. More...
|
|
const FGColumnVector3 | GetUVWFpsIC (void) const |
| Gets the initial body velocity. More...
|
|
double | GetVBodyFpsIC (void) const |
| Gets the initial body axis Y velocity. More...
|
|
double | GetVcalibratedKtsIC (void) const |
| Gets the initial calibrated airspeed. More...
|
|
double | GetVDownFpsIC (void) const |
| Gets the initial local frame Z (Down) velocity. More...
|
|
double | GetVEastFpsIC (void) const |
| Gets the initial local frame Y (East) velocity. More...
|
|
double | GetVequivalentKtsIC (void) const |
| Gets the initial equivalent airspeed. More...
|
|
double | GetVgroundFpsIC (void) const |
| Gets the initial ground velocity. More...
|
|
double | GetVgroundKtsIC (void) const |
| Gets the initial ground speed. More...
|
|
double | GetVNorthFpsIC (void) const |
| Gets the initial local frame X (North) velocity. More...
|
|
double | GetVtrueFpsIC (void) const |
| Gets the initial true velocity. More...
|
|
double | GetVtrueKtsIC (void) const |
| Gets the initial true velocity. More...
|
|
double | GetWBodyFpsIC (void) const |
| Gets the initial body axis Z velocity. More...
|
|
double | GetWindDFpsIC (void) const |
| Gets the initial wind velocity in local frame. More...
|
|
double | GetWindDirDegIC (void) const |
| Gets the initial wind direction. More...
|
|
double | GetWindEFpsIC (void) const |
| Gets the initial wind velocity in local frame. More...
|
|
double | GetWindFpsIC (void) const |
| Gets the initial total wind velocity in feet/sec. More...
|
|
FGColumnVector3 | GetWindNEDFpsIC (void) const |
| Gets the initial wind velocity in the NED local frame. More...
|
|
double | GetWindNFpsIC (void) const |
| Gets the initial wind velocity in local frame. More...
|
|
double | GetWindUFpsIC (void) const |
| Gets the initial body axis X wind velocity. More...
|
|
double | GetWindVFpsIC (void) const |
| Gets the initial body axis Y wind velocity. More...
|
|
double | GetWindWFpsIC (void) const |
| Gets the initial body axis Z wind velocity. More...
|
|
void | InitializeIC (void) |
| Initialize the initial conditions to default values.
|
|
bool | IsEngineRunning (unsigned int n) const |
| Is an engine running ? More...
|
|
bool | Load (const SGPath &rstname, bool useAircraftPath=true) |
| Loads the initial conditions. More...
|
|
void | ResetIC (double u0, double v0, double w0, double p0, double q0, double r0, double alpha0, double beta0, double phi0, double theta0, double psi0, double latitudeRad0, double longitudeRad0, double altitudeAGL0, double gamma0) |
| Resets the IC data structure to new values. More...
|
|
void | SetAlphaDegIC (double a) |
| Sets angle of attack initial condition in degrees. More...
|
|
void | SetAlphaRadIC (double alpha) |
| Sets the initial angle of attack. More...
|
|
void | SetAltitudeAGLFtIC (double agl) |
| Sets the initial Altitude above ground level. More...
|
|
void | SetAltitudeASLFtIC (double altitudeASL) |
| Sets the altitude above sea level initial condition in feet. More...
|
|
void | SetBetaDegIC (double b) |
| Sets angle of sideslip initial condition in degrees. More...
|
|
void | SetBetaRadIC (double beta) |
| Sets the initial sideslip angle. More...
|
|
void | SetClimbRateFpmIC (double roc) |
| Sets the climb rate initial condition in feet/minute. More...
|
|
void | SetClimbRateFpsIC (double roc) |
| Sets the initial climb rate. More...
|
|
void | SetCrossWindKtsIC (double cross) |
| Sets the initial crosswind speed. More...
|
|
void | SetFlightPathAngleDegIC (double gamma) |
| Sets the flight path angle initial condition in degrees. More...
|
|
void | SetFlightPathAngleRadIC (double gamma) |
| Sets the initial flight path angle. More...
|
|
void | SetGeodLatitudeDegIC (double glat) |
| Sets the initial geodetic latitude. More...
|
|
void | SetGeodLatitudeRadIC (double glat) |
| Sets the initial geodetic latitude. More...
|
|
void | SetHeadWindKtsIC (double head) |
| Sets the initial headwind velocity. More...
|
|
void | SetLatitudeDegIC (double lat) |
| Sets the initial latitude. More...
|
|
void | SetLatitudeRadIC (double lat) |
| Sets the initial latitude. More...
|
|
void | SetLongitudeDegIC (double lon) |
| Sets the initial longitude. More...
|
|
void | SetLongitudeRadIC (double lon) |
| Sets the initial longitude. More...
|
|
void | SetMachIC (double mach) |
| Set mach initial condition. More...
|
|
void | SetPhiDegIC (double phi) |
| Sets the roll angle initial condition in degrees. More...
|
|
void | SetPhiRadIC (double phi) |
| Sets the initial roll angle. More...
|
|
void | SetPRadpsIC (double P) |
| Sets the initial body axis roll rate. More...
|
|
void | SetPsiDegIC (double psi) |
| Sets the heading angle initial condition in degrees. More...
|
|
void | SetPsiRadIC (double psi) |
| Sets the initial heading angle. More...
|
|
void | SetQRadpsIC (double Q) |
| Sets the initial body axis pitch rate. More...
|
|
void | SetRRadpsIC (double R) |
| Sets the initial body axis yaw rate. More...
|
|
void | SetTargetNlfIC (double nlf) |
| Sets the target normal load factor. More...
|
|
void | SetTerrainElevationFtIC (double elev) |
| Sets the initial terrain elevation. More...
|
|
void | SetThetaDegIC (double theta) |
| Sets pitch angle initial condition in degrees. More...
|
|
void | SetThetaRadIC (double theta) |
| Sets the initial pitch angle. More...
|
|
void | SetUBodyFpsIC (double ubody) |
| Sets the initial body axis X velocity. More...
|
|
void | SetVBodyFpsIC (double vbody) |
| Sets the initial body axis Y velocity. More...
|
|
void | SetVcalibratedKtsIC (double vc) |
| Set calibrated airspeed initial condition in knots. More...
|
|
void | SetVDownFpsIC (double vd) |
| Sets the initial local axis down velocity. More...
|
|
void | SetVEastFpsIC (double ve) |
| Sets the initial local axis east velocity. More...
|
|
void | SetVequivalentKtsIC (double ve) |
| Set equivalent airspeed initial condition in knots. More...
|
|
void | SetVgroundFpsIC (double vg) |
| Sets the initial ground speed. More...
|
|
void | SetVgroundKtsIC (double vg) |
| Set ground speed initial condition in knots. More...
|
|
void | SetVNorthFpsIC (double vn) |
| Sets the initial local axis north velocity. More...
|
|
void | SetVtrueFpsIC (double vt) |
| Sets the initial true airspeed. More...
|
|
void | SetVtrueKtsIC (double vtrue) |
| Set true airspeed initial condition in knots. More...
|
|
void | SetWBodyFpsIC (double wbody) |
| Sets the initial body axis Z velocity. More...
|
|
void | SetWindDirDegIC (double dir) |
| Sets the initial wind direction. More...
|
|
void | SetWindDownKtsIC (double wD) |
| Sets the initial wind downward speed. More...
|
|
void | SetWindMagKtsIC (double mag) |
| Sets the initial total wind speed. More...
|
|
void | SetWindNEDFpsIC (double wN, double wE, double wD) |
| Sets the initial wind velocity. More...
|
|
int | TrimRequested (void) const |
| Does initialization file call for trim ? More...
|
|
| FGJSBBase () |
| Constructor for FGJSBBase.
|
|
virtual | ~FGJSBBase () |
| Destructor for FGJSBBase.
|
|
void | disableHighLighting (void) |
| Disables highlighting in the console output.
|
|
|
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 const std::string & | GetVersion (void) |
| Returns the version number of JSBSim. More...
|
|
static constexpr double | KelvinToFahrenheit (double kelvin) |
| Converts from degrees Kelvin to degrees Fahrenheit. More...
|
|
static constexpr double | CelsiusToRankine (double celsius) |
| Converts from degrees Celsius to degrees Rankine. More...
|
|
static constexpr double | RankineToCelsius (double rankine) |
| Converts from degrees Rankine to degrees Celsius. More...
|
|
static constexpr double | KelvinToRankine (double kelvin) |
| Converts from degrees Kelvin to degrees Rankine. More...
|
|
static constexpr double | RankineToKelvin (double rankine) |
| Converts from degrees Rankine to degrees Kelvin. More...
|
|
static constexpr double | FahrenheitToCelsius (double fahrenheit) |
| Converts from degrees Fahrenheit to degrees Celsius. More...
|
|
static constexpr double | CelsiusToFahrenheit (double celsius) |
| Converts from degrees Celsius to degrees Fahrenheit. More...
|
|
static constexpr double | CelsiusToKelvin (double celsius) |
| Converts from degrees Celsius to degrees Kelvin. More...
|
|
static constexpr double | KelvinToCelsius (double kelvin) |
| Converts from degrees Kelvin to degrees Celsius. More...
|
|
static constexpr double | FeetToMeters (double measure) |
| Converts from feet to meters. More...
|
|
static bool | EqualToRoundoff (double a, double b) |
| Finite precision comparison. More...
|
|
static bool | EqualToRoundoff (float a, float b) |
| Finite precision comparison. More...
|
|
static bool | EqualToRoundoff (float a, double b) |
| Finite precision comparison. More...
|
|
static bool | EqualToRoundoff (double a, float b) |
| Finite precision comparison. More...
|
|
static constexpr double | Constrain (double min, double value, double max) |
| Constrain a value between a minimum and a maximum value.
|
|
static constexpr double | sign (double num) |
|
static 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 std::string | CreateIndexedPropertyName (const std::string &Property, int index) |
|
static constexpr double | radtodeg = 180. / M_PI |
|
static constexpr double | degtorad = M_PI / 180. |
|
static constexpr double | hptoftlbssec = 550.0 |
|
static constexpr double | psftoinhg = 0.014138 |
|
static constexpr double | psftopa = 47.88 |
|
static constexpr double | fttom = 0.3048 |
|
static constexpr double | ktstofps = 1852./(3600*fttom) |
|
static constexpr double | fpstokts = 1.0 / ktstofps |
|
static constexpr double | inchtoft = 1.0/12.0 |
|
static constexpr double | m3toft3 = 1.0/(fttom*fttom*fttom) |
|
static constexpr double | in3tom3 = inchtoft*inchtoft*inchtoft/m3toft3 |
|
static constexpr double | inhgtopa = 3386.38 |
|
static constexpr double | slugtolb = 32.174049 |
| Note that definition of lbtoslug by the inverse of slugtolb and not to a different constant you can also get from some tables will make lbtoslug*slugtolb == 1 up to the magnitude of roundoff. More...
|
|
static constexpr double | lbtoslug = 1.0/slugtolb |
|
static constexpr double | kgtolb = 2.20462 |
|
static constexpr double | kgtoslug = 0.06852168 |
|
static const std::string | needed_cfg_version = "2.0" |
|
static const std::string | JSBSim_version = JSBSIM_VERSION " " __DATE__ " " __TIME__ |
|