]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/FGAuxiliary.cpp
Andreas Gaeb: fix #222 (JSBSIm reset problems)
[flightgear.git] / src / FDM / JSBSim / models / FGAuxiliary.cpp
index 86d1cbdc53f7e6323e760eb2c49d56ac59d2bb59..1dd3e2207cec89a17cab35548ee8b9fbdf675a23 100755 (executable)
@@ -4,9 +4,9 @@
  Author:       Tony Peden, Jon Berndt
  Date started: 01/26/99
  Purpose:      Calculates additional parameters needed by the visual system, etc.
- Called by:    FGSimExec
+ Called by:    FGFDMExec
 
- ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
+ ------------- Copyright (C) 1999  Jon S. Berndt (jon@jsbsim.org) -------------
 
  This program is free software; you can redistribute it and/or modify it under
  the terms of the GNU Lesser General Public License as published by the Free Software
@@ -44,15 +44,22 @@ INCLUDES
 #include "FGAerodynamics.h"
 #include "FGPropagate.h"
 #include "FGAtmosphere.h"
-#include <FGState.h>
-#include <FGFDMExec.h>
+#include "FGFDMExec.h"
 #include "FGAircraft.h"
 #include "FGInertial.h"
-#include <input_output/FGPropertyManager.h>
+#include "FGExternalReactions.h"
+#include "FGBuoyantForces.h"
+#include "FGGroundReactions.h"
+#include "FGPropulsion.h"
+#include "FGMassBalance.h"
+#include "input_output/FGPropertyManager.h"
+#include <iostream>
+
+using namespace std;
 
 namespace JSBSim {
 
-static const char *IdSrc = "$Id$";
+static const char *IdSrc = "$Id: FGAuxiliary.cpp,v 1.45 2010/11/18 12:38:06 jberndt Exp $";
 static const char *IdHdr = ID_AUXILIARY;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -65,10 +72,10 @@ FGAuxiliary::FGAuxiliary(FGFDMExec* fdmex) : FGModel(fdmex)
   Name = "FGAuxiliary";
   vcas = veas = pt = tat = 0;
   psl = rhosl = 1;
-  earthPosAngle = 0.0;
   qbar = 0;
   qbarUW = 0.0;
   qbarUV = 0.0;
+  Re = 0.0;
   Mach = 0.0;
   alpha = beta = 0.0;
   adot = bdot = 0.0;
@@ -77,6 +84,7 @@ FGAuxiliary::FGAuxiliary(FGFDMExec* fdmex) : FGModel(fdmex)
   day_of_year = 1;
   seconds_in_day = 0.0;
   hoverbmac = hoverbcg = 0.0;
+  tatc = RankineToCelsius(tat);
 
   vPilotAccel.InitMatrix();
   vPilotAccelN.InitMatrix();
@@ -91,9 +99,37 @@ FGAuxiliary::FGAuxiliary(FGFDMExec* fdmex) : FGModel(fdmex)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+bool FGAuxiliary::InitModel(void)
+{
+  if (!FGModel::InitModel()) return false;
+
+  vcas = veas = pt = tat = 0;
+  psl = rhosl = 1;
+  qbar = 0;
+  qbarUW = 0.0;
+  qbarUV = 0.0;
+  Mach = 0.0;
+  alpha = beta = 0.0;
+  adot = bdot = 0.0;
+  gamma = Vt = Vground = 0.0;
+  psigt = 0.0;
+  day_of_year = 1;
+  seconds_in_day = 0.0;
+  hoverbmac = hoverbcg = 0.0;
+
+  vPilotAccel.InitMatrix();
+  vPilotAccelN.InitMatrix();
+  vToEyePt.InitMatrix();
+  vAeroPQR.InitMatrix();
+  vEulerRates.InitMatrix();
+
+  return true;
+}
+  
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 FGAuxiliary::~FGAuxiliary()
 {
-  unbind();
   Debug(1);
 }
 
@@ -101,27 +137,36 @@ FGAuxiliary::~FGAuxiliary()
 
 bool FGAuxiliary::Run()
 {
-  double A,B,D, hdot_Vt;
-  const FGColumnVector3& vPQR = Propagate->GetPQR();
-  const FGColumnVector3& vUVW = Propagate->GetUVW();
-  const FGColumnVector3& vUVWdot = Propagate->GetUVWdot();
-  const FGColumnVector3& vVel = Propagate->GetVel();
+  double A,B,D;
 
   if (FGModel::Run()) return true; // return true if error returned from base class
-
   if (FDMExec->Holding()) return false;
 
-  p = Atmosphere->GetPressure();
-  rhosl = Atmosphere->GetDensitySL();
-  psl = Atmosphere->GetPressureSL();
-  sat = Atmosphere->GetTemperature();
+  RunPreFunctions();
+
+  const double density = FDMExec->GetAtmosphere()->GetDensity();
+  const double soundspeed = FDMExec->GetAtmosphere()->GetSoundSpeed();
+  const double DistanceAGL = FDMExec->GetPropagate()->GetDistanceAGL();
+  const double wingspan = FDMExec->GetAircraft()->GetWingSpan();
+  const FGMatrix33& Tl2b = FDMExec->GetPropagate()->GetTl2b();
+  const FGMatrix33& Tb2l = FDMExec->GetPropagate()->GetTb2l();
+
+  const FGColumnVector3& vPQR = FDMExec->GetPropagate()->GetPQR();
+  const FGColumnVector3& vUVW = FDMExec->GetPropagate()->GetUVW();
+  const FGColumnVector3& vUVWdot = FDMExec->GetPropagate()->GetUVWdot();
+  const FGColumnVector3& vVel = FDMExec->GetPropagate()->GetVel();
+
+  p = FDMExec->GetAtmosphere()->GetPressure();
+  rhosl = FDMExec->GetAtmosphere()->GetDensitySL();
+  psl = FDMExec->GetAtmosphere()->GetPressureSL();
+  sat = FDMExec->GetAtmosphere()->GetTemperature();
 
 // Rotation
 
-  double cTht = Propagate->GetCosEuler(eTht);
-  double sTht = Propagate->GetSinEuler(eTht);
-  double cPhi = Propagate->GetCosEuler(ePhi);
-  double sPhi = Propagate->GetSinEuler(ePhi);
+  double cTht = FDMExec->GetPropagate()->GetCosEuler(eTht);
+  double sTht = FDMExec->GetPropagate()->GetSinEuler(eTht);
+  double cPhi = FDMExec->GetPropagate()->GetCosEuler(ePhi);
+  double sPhi = FDMExec->GetPropagate()->GetSinEuler(ePhi);
 
   vEulerRates(eTht) = vPQR(eQ)*cPhi - vPQR(eR)*sPhi;
   if (cTht != 0.0) {
@@ -129,24 +174,13 @@ bool FGAuxiliary::Run()
     vEulerRates(ePhi) = vPQR(eP) + vEulerRates(ePsi)*sTht;
   }
 
-// 12/16/2005, JSB: For ground handling purposes, at this time, let's ramp
-// in the effects of wind from 10 fps to 30 fps when there is weight on the
-// landing gear wheels.
-
-  if (GroundReactions->GetWOW() && vUVW(eU) < 10) {
-    vAeroPQR = vPQR;
-    vAeroUVW = vUVW;
-  } else if (GroundReactions->GetWOW() && vUVW(eU) < 30) {
-    double factor = (vUVW(eU) - 10.0)/20.0;
-    vAeroPQR = vPQR + factor*Atmosphere->GetTurbPQR();
-    vAeroUVW = vUVW + factor*Propagate->GetTl2b()*Atmosphere->GetWindNED();
-  } else {
-    vAeroPQR = vPQR + Atmosphere->GetTurbPQR();
-    vAeroUVW = vUVW + Propagate->GetTl2b()*Atmosphere->GetWindNED();
-  }
+// Combine the wind speed with aircraft speed to obtain wind relative speed
+  FGColumnVector3 wind = Tl2b*FDMExec->GetAtmosphere()->GetTotalWindNED();
+  vAeroPQR = vPQR - FDMExec->GetAtmosphere()->GetTurbPQR();
+  vAeroUVW = vUVW - wind;
 
   Vt = vAeroUVW.Magnitude();
-  if ( Vt > 0.05) {
+  if ( Vt > 1.0 ) {
     if (vAeroUVW(eW) != 0.0)
       alpha = vAeroUVW(eU)*vAeroUVW(eU) > 0.0 ? atan2(vAeroUVW(eW), vAeroUVW(eU)) : 0.0;
     if (vAeroUVW(eV) != 0.0)
@@ -155,10 +189,9 @@ bool FGAuxiliary::Run()
 
     double mUW = (vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eW)*vAeroUVW(eW));
     double signU=1;
-    if (vAeroUVW(eU) != 0.0)
-      signU = vAeroUVW(eU)/fabs(vAeroUVW(eU));
+    if (vAeroUVW(eU) < 0.0) signU=-1;
 
-    if ( (mUW == 0.0) || (Vt == 0.0) ) {
+    if ( mUW < 1.0 ) {
       adot = 0.0;
       bdot = 0.0;
     } else {
@@ -170,30 +203,23 @@ bool FGAuxiliary::Run()
     alpha = beta = adot = bdot = 0;
   }
 
-  qbar = 0.5*Atmosphere->GetDensity()*Vt*Vt;
-  qbarUW = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eW)*vAeroUVW(eW));
-  qbarUV = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eV)*vAeroUVW(eV));
-  Mach = Vt / Atmosphere->GetSoundSpeed();
-  MachU = vMachUVW(eU) = vAeroUVW(eU) / Atmosphere->GetSoundSpeed();
-  vMachUVW(eV) = vAeroUVW(eV) / Atmosphere->GetSoundSpeed();
-  vMachUVW(eW) = vAeroUVW(eW) / Atmosphere->GetSoundSpeed();
+  Re = Vt * FDMExec->GetAircraft()->Getcbar() / FDMExec->GetAtmosphere()->GetKinematicViscosity();
+
+  qbar = 0.5*density*Vt*Vt;
+  qbarUW = 0.5*density*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eW)*vAeroUVW(eW));
+  qbarUV = 0.5*density*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eV)*vAeroUVW(eV));
+  Mach = Vt / soundspeed;
+  MachU = vMachUVW(eU) = vAeroUVW(eU) / soundspeed;
+  vMachUVW(eV) = vAeroUVW(eV) / soundspeed;
+  vMachUVW(eW) = vAeroUVW(eW) / soundspeed;
 
 // Position
 
   Vground = sqrt( vVel(eNorth)*vVel(eNorth) + vVel(eEast)*vVel(eEast) );
 
-  if (vVel(eNorth) == 0) psigt = 0;
-  else psigt =  atan2(vVel(eEast), vVel(eNorth));
-
+  psigt = atan2(vVel(eEast), vVel(eNorth));
   if (psigt < 0.0) psigt += 2*M_PI;
-
-  if (Vground == 0.0) {
-    if (vVel(eDown) == 0.0) gamma = 0.0;
-    else if (vVel(eDown) < 0.0) gamma = 90.0*degtorad;
-    else gamma = -90.0*degtorad;
-  } else {
-    gamma = atan2(-vVel(eDown), Vground);
-  }
+  gamma = atan2(-vVel(eDown), Vground);
 
   tat = sat*(1 + 0.2*Mach*Mach); // Total Temperature, isentropic flow
   tatc = RankineToCelsius(tat);
@@ -215,14 +241,15 @@ bool FGAuxiliary::Run()
     vcas = veas = 0.0;
   }
 
+  const double SLgravity = FDMExec->GetInertial()->SLgravity();
+
   vPilotAccel.InitMatrix();
   if ( Vt > 1.0 ) {
-     vPilotAccel =  Aerodynamics->GetForces()
-                    +  Propulsion->GetForces()
-                    +  GroundReactions->GetForces();
-     vPilotAccel /= MassBalance->GetMass();
-     vToEyePt = MassBalance->StructuralToBody(Aircraft->GetXYZep());
-     vPilotAccel += Propagate->GetPQRdot() * vToEyePt;
+     vAircraftAccel = FDMExec->GetAircraft()->GetBodyAccel();
+     // Nz is Acceleration in "g's", along normal axis (-Z body axis)
+     Nz = -vAircraftAccel(eZ)/SLgravity;
+     vToEyePt = FDMExec->GetMassBalance()->StructuralToBody(FDMExec->GetAircraft()->GetXYZep());
+     vPilotAccel = vAircraftAccel + FDMExec->GetPropagate()->GetPQRdot() * vToEyePt;
      vPilotAccel += vPQR * (vPQR * vToEyePt);
   } else {
      // The line below handles low velocity (and on-ground) cases, basically
@@ -231,51 +258,71 @@ bool FGAuxiliary::Run()
      // any jitter that could be introduced by the landing gear. Theoretically,
      // this branch could be eliminated, with a penalty of having a short
      // transient at startup (lasting only a fraction of a second).
-     vPilotAccel = Propagate->GetTl2b() * FGColumnVector3( 0.0, 0.0, -Inertial->gravity() );
+     vPilotAccel = Tl2b * FGColumnVector3( 0.0, 0.0, -SLgravity );
+     Nz = -vPilotAccel(eZ)/SLgravity;
   }
 
-  vPilotAccelN = vPilotAccel/Inertial->gravity();
-
-  earthPosAngle += State->Getdt()*Inertial->omega();
+  vPilotAccelN = vPilotAccel/SLgravity;
 
   // VRP computation
-  const FGLocation& vLocation = Propagate->GetLocation();
-  FGColumnVector3 vrpStructural = Aircraft->GetXYZvrp();
-  FGColumnVector3 vrpBody = MassBalance->StructuralToBody( vrpStructural );
-  FGColumnVector3 vrpLocal = Propagate->GetTb2l() * vrpBody;
+  const FGLocation& vLocation = FDMExec->GetPropagate()->GetLocation();
+  const FGColumnVector3& vrpStructural = FDMExec->GetAircraft()->GetXYZvrp();
+  const FGColumnVector3 vrpBody = FDMExec->GetMassBalance()->StructuralToBody( vrpStructural );
+  const FGColumnVector3 vrpLocal = Tb2l * vrpBody;
   vLocationVRP = vLocation.LocalToLocation( vrpLocal );
 
   // Recompute some derived values now that we know the dependent parameters values ...
-  hoverbcg = Propagate->GetDistanceAGL() / Aircraft->GetWingSpan();
+  hoverbcg = DistanceAGL / wingspan;
+
+  FGColumnVector3 vMac = Tb2l*FDMExec->GetMassBalance()->StructuralToBody(FDMExec->GetAircraft()->GetXYZrp());
+  hoverbmac = (DistanceAGL + vMac(3)) / wingspan;
+
+  // when all model are executed, 
+  // please calculate the distance from the initial point
+
+  CalculateRelativePosition();
 
-  FGColumnVector3 vMac = Propagate->GetTb2l()*MassBalance->StructuralToBody(Aircraft->GetXYZrp());
-  hoverbmac = (Propagate->GetDistanceAGL() + vMac(3)) / Aircraft->GetWingSpan();
+  RunPostFunctions();
 
   return false;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+//
+// A positive headwind is blowing with you, a negative headwind is blowing against you.
+// psi is the direction the wind is blowing *towards*.
 
-double FGAuxiliary::GetHeadWind(void)
+double FGAuxiliary::GetHeadWind(void) const
 {
   double psiw,vw;
 
-  psiw = Atmosphere->GetWindPsi();
-  vw = Atmosphere->GetWindNED().Magnitude();
+  psiw = FDMExec->GetAtmosphere()->GetWindPsi();
+  vw = FDMExec->GetAtmosphere()->GetTotalWindNED().Magnitude();
 
-  return vw*cos(psiw - Propagate->GetEuler(ePsi));
+  return vw*cos(psiw - FDMExec->GetPropagate()->GetEuler(ePsi));
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+//
+// A positive crosswind is blowing towards the right (from teh perspective of the
+// pilot). A negative crosswind is blowing towards the -Y direction (left).
+// psi is the direction the wind is blowing *towards*.
 
-double FGAuxiliary::GetCrossWind(void)
+double FGAuxiliary::GetCrossWind(void) const
 {
   double psiw,vw;
 
-  psiw = Atmosphere->GetWindPsi();
-  vw = Atmosphere->GetWindNED().Magnitude();
+  psiw = FDMExec->GetAtmosphere()->GetWindPsi();
+  vw = FDMExec->GetAtmosphere()->GetTotalWindNED().Magnitude();
 
-  return  vw*sin(psiw - Propagate->GetEuler(ePsi));
+  return  vw*sin(psiw - FDMExec->GetPropagate()->GetEuler(ePsi));
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+double FGAuxiliary::GethVRP(void) const
+{
+  return vLocationVRP.GetRadius() - FDMExec->GetPropagate()->GetSeaLevelRadius();
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -310,7 +357,7 @@ void FGAuxiliary::bind(void)
   PropertyManager->Tie("accelerations/n-pilot-x-norm", this, eX, (PMF)&FGAuxiliary::GetNpilot);
   PropertyManager->Tie("accelerations/n-pilot-y-norm", this, eY, (PMF)&FGAuxiliary::GetNpilot);
   PropertyManager->Tie("accelerations/n-pilot-z-norm", this, eZ, (PMF)&FGAuxiliary::GetNpilot);
-  PropertyManager->Tie("position/epa-rad", this, &FGAuxiliary::GetEarthPositionAngle);
+  PropertyManager->Tie("accelerations/Nz", this, &FGAuxiliary::GetNz);
   /* PropertyManager->Tie("atmosphere/headwind-fps", this, &FGAuxiliary::GetHeadWind, true);
   PropertyManager->Tie("atmosphere/crosswind-fps", this, &FGAuxiliary::GetCrossWind, true); */
   PropertyManager->Tie("aero/alpha-rad", this, (PF)&FGAuxiliary::Getalpha, &FGAuxiliary::Setalpha, true);
@@ -319,6 +366,7 @@ void FGAuxiliary::bind(void)
   PropertyManager->Tie("aero/alpha-deg", this, inDegrees, (PMF)&FGAuxiliary::Getalpha);
   PropertyManager->Tie("aero/beta-deg", this, inDegrees, (PMF)&FGAuxiliary::Getbeta);
   PropertyManager->Tie("aero/mag-beta-deg", this, inDegrees, (PMF)&FGAuxiliary::GetMagBeta);
+  PropertyManager->Tie("aero/Re", this, &FGAuxiliary::GetReynoldsNumber);
   PropertyManager->Tie("aero/qbar-psf", this, &FGAuxiliary::Getqbar, &FGAuxiliary::Setqbar, true);
   PropertyManager->Tie("aero/qbarUW-psf", this, &FGAuxiliary::GetqbarUW, &FGAuxiliary::SetqbarUW, true);
   PropertyManager->Tie("aero/qbarUV-psf", this, &FGAuxiliary::GetqbarUV, &FGAuxiliary::SetqbarUV, true);
@@ -330,59 +378,30 @@ void FGAuxiliary::bind(void)
   PropertyManager->Tie("aero/h_b-mac-ft", this, &FGAuxiliary::GetHOverBMAC);
   PropertyManager->Tie("flight-path/gamma-rad", this, &FGAuxiliary::GetGamma, &FGAuxiliary::SetGamma);
   PropertyManager->Tie("flight-path/psi-gt-rad", this, &FGAuxiliary::GetGroundTrack);
+
+  PropertyManager->Tie("position/distance-from-start-lon-mt", this, &FGAuxiliary::GetLongitudeRelativePosition);
+  PropertyManager->Tie("position/distance-from-start-lat-mt", this, &FGAuxiliary::GetLatitudeRelativePosition);
+  PropertyManager->Tie("position/distance-from-start-mag-mt", this, &FGAuxiliary::GetDistanceRelativePosition);
+  PropertyManager->Tie("position/vrp-gc-latitude_deg", &vLocationVRP, &FGLocation::GetLatitudeDeg);
+  PropertyManager->Tie("position/vrp-longitude_deg", &vLocationVRP, &FGLocation::GetLongitudeDeg);
+  PropertyManager->Tie("position/vrp-radius-ft", &vLocationVRP, &FGLocation::GetRadius);
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-void FGAuxiliary::unbind(void)
+void FGAuxiliary::CalculateRelativePosition(void)
+{ 
+  const double earth_radius_mt = FDMExec->GetInertial()->GetRefRadius()*fttom;
+  lat_relative_position=(FDMExec->GetPropagate()->GetLatitude()  - FDMExec->GetIC()->GetLatitudeDegIC() *degtorad)*earth_radius_mt;
+  lon_relative_position=(FDMExec->GetPropagate()->GetLongitude() - FDMExec->GetIC()->GetLongitudeDegIC()*degtorad)*earth_radius_mt;
+  relative_position = sqrt(lat_relative_position*lat_relative_position + lon_relative_position*lon_relative_position);
+};
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+double FGAuxiliary::BadUnits(void) const
 {
-  PropertyManager->Untie("propulsion/tat-r");
-  PropertyManager->Untie("propulsion/tat-c");
-  PropertyManager->Untie("propulsion/pt-lbs_sqft");
-
-  PropertyManager->Untie("velocities/vc-fps");
-  PropertyManager->Untie("velocities/vc-kts");
-  PropertyManager->Untie("velocities/ve-fps");
-  PropertyManager->Untie("velocities/ve-kts");
-  PropertyManager->Untie("velocities/machU");
-  PropertyManager->Untie("velocities/p-aero-rad_sec");
-  PropertyManager->Untie("velocities/q-aero-rad_sec");
-  PropertyManager->Untie("velocities/r-aero-rad_sec");
-  PropertyManager->Untie("velocities/phidot-rad_sec");
-  PropertyManager->Untie("velocities/thetadot-rad_sec");
-  PropertyManager->Untie("velocities/psidot-rad_sec");
-  PropertyManager->Untie("velocities/u-aero-fps");
-  PropertyManager->Untie("velocities/v-aero-fps");
-  PropertyManager->Untie("velocities/w-aero-fps");
-  PropertyManager->Untie("velocities/vt-fps");
-  PropertyManager->Untie("velocities/mach");
-  PropertyManager->Untie("velocities/vg-fps");
-  PropertyManager->Untie("accelerations/a-pilot-x-ft_sec2");
-  PropertyManager->Untie("accelerations/a-pilot-y-ft_sec2");
-  PropertyManager->Untie("accelerations/a-pilot-z-ft_sec2");
-  PropertyManager->Untie("accelerations/n-pilot-x-norm");
-  PropertyManager->Untie("accelerations/n-pilot-y-norm");
-  PropertyManager->Untie("accelerations/n-pilot-z-norm");
-  PropertyManager->Untie("position/epa-rad");
-  /* PropertyManager->Untie("atmosphere/headwind-fps");
-  PropertyManager->Untie("atmosphere/crosswind-fps"); */
-  PropertyManager->Untie("aero/qbar-psf");
-  PropertyManager->Untie("aero/qbarUW-psf");
-  PropertyManager->Untie("aero/qbarUV-psf");
-  PropertyManager->Untie("aero/alpha-rad");
-  PropertyManager->Untie("aero/beta-rad");
-  PropertyManager->Untie("aero/alpha-deg");
-  PropertyManager->Untie("aero/beta-deg");
-  PropertyManager->Untie("aero/alphadot-rad_sec");
-  PropertyManager->Untie("aero/betadot-rad_sec");
-  PropertyManager->Untie("aero/mag-beta-rad");
-  PropertyManager->Untie("aero/alphadot-deg_sec");
-  PropertyManager->Untie("aero/betadot-deg_sec");
-  PropertyManager->Untie("aero/mag-beta-deg");
-  PropertyManager->Untie("aero/h_b-cg-ft");
-  PropertyManager->Untie("aero/h_b-mac-ft");
-  PropertyManager->Untie("flight-path/gamma-rad");
-  PropertyManager->Untie("flight-path/psi-gt-rad");
+  cerr << "Bad units" << endl; return 0.0;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%