%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include "FGAuxiliary.h"
+#include "FGAerodynamics.h"
#include "FGTranslation.h"
#include "FGRotation.h"
#include "FGAtmosphere.h"
#include "FGColumnVector4.h"
#include "FGPropertyManager.h"
+namespace JSBSim {
+
static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_AUXILIARY;
vPilotAccelN.InitMatrix();
+ bind();
+
Debug(0);
}
FGAuxiliary::~FGAuxiliary()
{
+ unbind();
Debug(1);
}
if (!FGModel::Run()) {
GetState();
+
+ //caculate total temperature assuming isentropic flow
+ tat=sat*(1 + 0.2*mach*mach);
+
if (mach < 1) { //calculate total pressure assuming isentropic flow
pt=p*pow((1 + 0.2*mach*mach),3.5);
} else {
vPilotAccel.InitMatrix();
if ( Translation->GetVt() > 1 ) {
- vToEyePt = Aircraft->GetXYZep() - MassBalance->GetXYZcg();
- vToEyePt *= inchtoft;
- vPilotAccel = Aerodynamics->GetForces()
+ vPilotAccel = Aerodynamics->GetForces()
+ Propulsion->GetForces()
+ GroundReactions->GetForces();
- vPilotAccel /= MassBalance->GetMass();
- vPilotAccel += Rotation->GetPQRdot() * vToEyePt;
- vPilotAccel += Rotation->GetPQR() * (Rotation->GetPQR() * vToEyePt);
- //vPilotAccel(2)*=-1;
- vPilotAccelN = vPilotAccel/Inertial->gravity();
- }
+ vPilotAccel /= MassBalance->GetMass();
+ vToEyePt = Aircraft->GetXYZep() - MassBalance->GetXYZcg();
+ vToEyePt *= inchtoft;
+ vPilotAccel += Rotation->GetPQRdot() * vToEyePt;
+ vPilotAccel += Rotation->GetPQR() * (Rotation->GetPQR() * vToEyePt);
+ } else {
+ vPilotAccel = -1*( State->GetTl2b() * Inertial->GetGravity() );
+ }
+
+ vPilotAccelN = vPilotAccel/Inertial->gravity();
+
+
earthPosAngle += State->Getdt()*Inertial->omega();
return false;
} else {
void FGAuxiliary::bind(void)
{
+ typedef double (FGAuxiliary::*PMF)(int) const;
PropertyManager->Tie("velocities/vc-fps", this,
&FGAuxiliary::GetVcalibratedFPS);
PropertyManager->Tie("velocities/vc-kts", this,
&FGAuxiliary::GetVequivalentFPS);
PropertyManager->Tie("velocities/ve-kts", this,
&FGAuxiliary::GetVequivalentKTS);
+ PropertyManager->Tie("velocities/tat-r", this,
+ &FGAuxiliary::GetTotalTemperature);
+ PropertyManager->Tie("velocities/pt-lbs_sqft", this,
+ &FGAuxiliary::GetTotalPressure);
+
PropertyManager->Tie("accelerations/a-pilot-x-ft_sec2", this,1,
- &FGAuxiliary::GetPilotAccel);
+ (PMF)&FGAuxiliary::GetPilotAccel);
PropertyManager->Tie("accelerations/a-pilot-y-ft_sec2", this,2,
- &FGAuxiliary::GetPilotAccel);
+ (PMF)&FGAuxiliary::GetPilotAccel);
PropertyManager->Tie("accelerations/a-pilot-z-ft_sec2", this,3,
- &FGAuxiliary::GetPilotAccel);
+ (PMF)&FGAuxiliary::GetPilotAccel);
PropertyManager->Tie("accelerations/n-pilot-x-norm", this,1,
- &FGAuxiliary::GetNpilot);
+ (PMF)&FGAuxiliary::GetNpilot);
PropertyManager->Tie("accelerations/n-pilot-y-norm", this,2,
- &FGAuxiliary::GetNpilot);
+ (PMF)&FGAuxiliary::GetNpilot);
PropertyManager->Tie("accelerations/n-pilot-z-norm", this,3,
- &FGAuxiliary::GetNpilot);
+ (PMF)&FGAuxiliary::GetNpilot);
PropertyManager->Tie("position/epa-rad", this,
&FGAuxiliary::GetEarthPositionAngle);
/* PropertyManager->Tie("atmosphere/headwind-fps", this,
p = Atmosphere->GetPressure();
rhosl = Atmosphere->GetDensitySL();
psl = Atmosphere->GetPressureSL();
+ sat = Atmosphere->GetTemperature();
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}
}
+} // namespace JSBSim