------------- Copyright (C) 2000 Jon S. Berndt (jsb@hal-pc.org) -------------
This program is free software; you can redistribute it and/or modify it under
- the terms of the GNU General Public License as published by the Free Software
+ the terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
- You should have received a copy of the GNU General Public License along with
+ You should have received a copy of the GNU Lesser General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA.
- Further information about the GNU General Public License can also be found on
+ Further information about the GNU Lesser General Public License can also be found on
the world wide web at http://www.gnu.org.
FUNCTIONAL DESCRIPTION
{
Name = "FGInertial";
- // Defaults
- RotationRate = 0.00007272205217;
- GM = 14.06252720E15;
- RadiusReference = 20925650.00;
+ // Earth defaults
+ RotationRate = 0.00007292115;
+ GM = 14.07644180E15; // WGS84 value
+ RadiusReference = 20925650.00; // Equatorial radius (WGS84)
+ C2_0 = -4.84165371736E-04; // WGS84 value for the C2,0 coefficient
+ J2 = 1.0826266836E-03; // WGS84 value for J2
+ a = 20925646.3255; // WGS84 semimajor axis length in feet
+ b = 20855486.5951; // WGS84 semiminor axis length in feet
+ earthPosAngle = 0.0;
+
+ // Lunar defaults
+ /*
+ RotationRate = 0.0000026617;
+ GM = 1.7314079E14; // Lunar GM
+ RadiusReference = 5702559.05; // Equatorial radius
+ C2_0 = 0; // value for the C2,0 coefficient
+ J2 = 2.033542482111609E-4; // value for J2
+ a = 5702559.05; // semimajor axis length in feet
+ b = 5695439.63; // semiminor axis length in feet
+ earthPosAngle = 0.0;
+ */
+
gAccelReference = GM/(RadiusReference*RadiusReference);
gAccel = GM/(RadiusReference*RadiusReference);
+ bind();
+
Debug(0);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+bool FGInertial::InitModel(void)
+{
+ if (!FGModel::InitModel()) return false;
+
+ earthPosAngle = 0.0;
+
+ return true;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
bool FGInertial::Run(void)
{
// Fast return if we have nothing to do ...
// Gravitation accel
double r = Propagate->GetRadius();
gAccel = GetGAccel(r);
+ earthPosAngle += State->Getdt()*RotationRate;
return false;
}
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+double FGInertial::GetGAccel(double r) const
+{
+ return GM/(r*r);
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGInertial::bind(void)
+{
+ PropertyManager->Tie("position/epa-rad", this, &FGInertial::GetEarthPositionAngle);
+}
+
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// The bitmasked value choices are as follows:
// unset: In this case (the default) JSBSim would only print