68 qbar = qbarUW = qbarUV = 0.0;
72 gamma = Vt = Vground = 0.0;
76 hoverbmac = hoverbcg = 0.0;
80 vPilotAccel.InitMatrix();
81 vPilotAccelN.InitMatrix();
82 vAeroUVW.InitMatrix();
83 vAeroPQR.InitMatrix();
84 vMachUVW.InitMatrix();
85 vEulerRates.InitMatrix();
103 qbar = qbarUW = qbarUV = 0.0;
107 gamma = Vt = Vground = 0.0;
110 seconds_in_day = 0.0;
111 hoverbmac = hoverbcg = 0.0;
115 vPilotAccel.InitMatrix();
116 vPilotAccelN.InitMatrix();
117 vAeroUVW.InitMatrix();
118 vAeroPQR.InitMatrix();
119 vMachUVW.InitMatrix();
120 vEulerRates.InitMatrix();
137 if (Holding)
return false;
142 if (
in.CosTht != 0.0) {
148 vAeroPQR =
in.vPQR -
in.TurbPQR;
149 vAeroUVW =
in.vUVW -
in.Tl2b *
in.TotalWindNED;
151 alpha = beta = adot = bdot = 0;
152 double AeroU2 = vAeroUVW(
eU)*vAeroUVW(
eU);
153 double AeroV2 = vAeroUVW(
eV)*vAeroUVW(
eV);
154 double AeroW2 = vAeroUVW(
eW)*vAeroUVW(
eW);
155 double mUW = AeroU2 + AeroW2;
157 double Vt2 = mUW + AeroV2;
161 beta = atan2(vAeroUVW(
eV), sqrt(mUW));
164 alpha = atan2(vAeroUVW(
eW), vAeroUVW(
eU));
165 double Vtdot = (vAeroUVW(
eU)*
in.vUVWdot(
eU) + vAeroUVW(
eV)*
in.vUVWdot(
eV) + vAeroUVW(
eW)*
in.vUVWdot(
eW))/Vt;
166 adot = (vAeroUVW(
eU)*
in.vUVWdot(
eW) - vAeroUVW(
eW)*
in.vUVWdot(
eU))/mUW;
167 bdot = (
in.vUVWdot(
eV)*Vt - vAeroUVW(
eV)*Vtdot)/(Vt*sqrt(mUW));
171 UpdateWindMatrices();
173 Re = Vt *
in.Wingchord /
in.KinematicViscosity;
175 double densityD2 = 0.5*
in.Density;
177 qbar = densityD2 * Vt2;
178 qbarUW = densityD2 * (mUW);
179 qbarUV = densityD2 * (AeroU2 + AeroV2);
180 Mach = Vt /
in.SoundSpeed;
181 MachU = vMachUVW(
eU) = vAeroUVW(
eU) /
in.SoundSpeed;
182 vMachUVW(
eV) = vAeroUVW(
eV) /
in.SoundSpeed;
183 vMachUVW(
eW) = vAeroUVW(
eW) /
in.SoundSpeed;
190 if (psigt < 0.0) psigt += 2*
M_PI;
191 gamma = atan2(-
in.vVel(
eDown), Vground);
193 tat =
in.Temperature*(1 + 0.2*Mach*Mach);
198 if (abs(Mach) > 0.0) {
200 veas = sqrt(2 * qbar /
in.DensitySL);
205 vPilotAccel.InitMatrix();
206 vNcg =
in.vBodyAccel/
in.StandardGravity;
211 vPilotAccel =
in.vBodyAccel +
in.vPQRidot *
in.ToEyePt;
212 vPilotAccel +=
in.vPQRi * (
in.vPQRi *
in.ToEyePt);
214 vNwcg = mTb2w * vNcg;
215 vNwcg(
eZ) = 1.0 - vNwcg(
eZ);
217 vPilotAccelN = vPilotAccel /
in.StandardGravity;
220 vLocationVRP =
in.vLocation.LocalToLocation(
in.Tb2l *
in.VRPBody );
223 hoverbcg =
in.DistanceAGL /
in.Wingspan;
226 hoverbmac = (
in.DistanceAGL - vMac(3)) /
in.Wingspan;
247void FGAuxiliary::UpdateWindMatrices(
void)
249 double ca, cb, sa, sb;
283 return in.vLocation.GetDistanceTo(
FDMExec->GetIC()->GetLongitudeRadIC(),
284 in.vLocation.GetLatitude())*
fttom;
291 return in.vLocation.GetDistanceTo(
in.vLocation.GetLongitude(),
306void FGAuxiliary::bind(
void)
372double FGAuxiliary::BadUnits(
void)
const
374 cerr <<
"Bad units" << endl;
return 0.0;
396void FGAuxiliary::Debug(
int from)
406 if (from == 0) cout <<
"Instantiated: FGAuxiliary" << endl;
407 if (from == 1) cout <<
"Destroyed: FGAuxiliary" << endl;
414 if (Mach > 100 || Mach < 0.00)
415 cout <<
"FGPropagate::Mach is out of bounds: " << Mach << endl;
416 if (qbar > 1e6 || qbar < 0.00)
417 cout <<
"FGPropagate::qbar is out of bounds: " << qbar << endl;
Encapsulates various uncategorized scheduled functions.
double GetqbarUV(void) const
double Getbeta(void) const
bool Run(bool Holding) override
Runs the Auxiliary routines; called by the Executive Can pass in a value indicating if the executive ...
double GetqbarUW(void) const
double GetVtrueFPS() const
Returns the true airspeed in feet per second.
double GetMachU(void) const
The mach number calculated using the vehicle X axis velocity.
double GetNlf(void) const
double GetLongitudeRelativePosition(void) const
double GetTAT_C(void) const
double GetVequivalentKTS(void) const
Returns equivalent airspeed in knots.
double GetVcalibratedFPS(void) const
Returns Calibrated airspeed in feet/second.
double GetPilotAccel(int idx) const
double Getadot(void) const
struct JSBSim::FGAuxiliary::Inputs in
~FGAuxiliary()
Destructor.
double GetTotalPressure(void) const
Returns the total pressure.
double GetNy(void) const
The lateral acceleration in g's of the aircraft center of gravity.
double GetEulerRates(int axis) const
const FGColumnVector3 & GetAeroUVW(void) const
double GetReynoldsNumber(void) const
double GetTotalTemperature(void) const
Returns the total temperature.
double GetVtrueKTS() const
Returns the true airspeed in knots.
double GetHOverBCG(void) const
double GetAeroPQR(int axis) const
double GetVequivalentFPS(void) const
Returns equivalent airspeed in feet/second.
double GetDistanceRelativePosition(void) const
double Getalpha(void) const
double GetVground(void) const
Gets the ground speed in feet per second.
double GetNz(void) const
The vertical acceleration in g's of the aircraft center of gravity.
double GetVt(void) const
Gets the magnitude of total vehicle velocity including wind effects in feet per second.
bool InitModel(void) override
double GetMach(void) const
Gets the Mach number.
double GetNx(void) const
The longitudinal acceleration in g's of the aircraft center of gravity.
double Getbdot(void) const
double GetGroundTrack(void) const
double GetNpilot(int idx) const
double GetGamma(void) const
double GetHOverBMAC(void) const
FGAuxiliary(FGFDMExec *Executive)
Constructor.
double Getqbar(void) const
double GetLatitudeRelativePosition(void) const
double GetVcalibratedKTS(void) const
Returns Calibrated airspeed in knots.
double GetMagBeta(void) const
This class implements a 3 element column vector.
double GetLatitudeRadIC(void) const
Gets the initial latitude.
double GetLongitudeRadIC(void) const
Gets the initial longitude.
static double PitotTotalPressure(double mach, double p)
Compute the total pressure in front of the Pitot tube.
static constexpr double slugtolb
Note that definition of lbtoslug by the inverse of slugtolb and not to a different constant you can a...
static double VcalibratedFromMach(double mach, double p)
Calculate the calibrated airspeed from the Mach number.
static constexpr double fttom
static constexpr double RankineToCelsius(double rankine)
Converts from degrees Rankine to degrees Celsius.
double GetLongitudeDeg() const
Get the longitude.
double GetRadius() const
Get the distance from the center of the earth in feet.
double GetLatitudeDeg() const
Get the GEOCENTRIC latitude in degrees.
FGMatrix33 Transposed(void) const
Transposed matrix.
FGPropertyManager * PropertyManager
bool InitModel(void) override
FGModel(FGFDMExec *)
Constructor.
virtual bool Run(bool Holding)
Runs the model; called by the Executive.
void Tie(const std::string &name, T *pointer)
Tie a property to an external variable.