X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2FFGPropagate.cpp;h=51bc472d22fbdd7ed4d49f72ff9129fd9b7a6c44;hb=a302cdc1cbb3c147e7c862b484cdd5d86f30a29c;hp=ae2174df91557d5c190be4c4f728d41bbbbc5391;hpb=0becb0df2b3364f92bdcad5b9bfd3f87a1649f06;p=flightgear.git diff --git a/src/FDM/JSBSim/models/FGPropagate.cpp b/src/FDM/JSBSim/models/FGPropagate.cpp index ae2174df9..51bc472d2 100644 --- a/src/FDM/JSBSim/models/FGPropagate.cpp +++ b/src/FDM/JSBSim/models/FGPropagate.cpp @@ -71,7 +71,7 @@ using namespace std; namespace JSBSim { -static const char *IdSrc = "$Id: FGPropagate.cpp,v 1.85 2011/04/03 19:24:58 jberndt Exp $"; +static const char *IdSrc = "$Id: FGPropagate.cpp,v 1.88 2011/05/20 03:18:36 jberndt Exp $"; static const char *IdHdr = ID_PROPAGATE; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -121,8 +121,6 @@ FGPropagate::~FGPropagate(void) bool FGPropagate::InitModel(void) { - if (!FGModel::InitModel()) return false; - // For initialization ONLY: SeaLevelRadius = LocalTerrainRadius = FDMExec->GetInertial()->GetRefRadius(); @@ -140,10 +138,10 @@ bool FGPropagate::InitModel(void) VState.dqInertialVelocity.resize(4, FGColumnVector3(0.0,0.0,0.0)); VState.dqQtrndot.resize(4, FGColumnVector3(0.0,0.0,0.0)); - integrator_rotational_rate = eAdamsBashforth2; - integrator_translational_rate = eTrapezoidal; - integrator_rotational_position = eAdamsBashforth2; - integrator_translational_position = eTrapezoidal; + integrator_rotational_rate = eRectEuler; + integrator_translational_rate = eAdamsBashforth2; + integrator_rotational_position = eRectEuler; + integrator_translational_position = eAdamsBashforth3; return true; } @@ -193,7 +191,6 @@ void FGPropagate::SetInitialState(const FGInitialCondition *FGIC) RecomputeLocalTerrainRadius(); VehicleRadius = GetRadius(); - double radInv = 1.0/VehicleRadius; // Set the angular velocities of the body frame relative to the ECEF frame, // expressed in the body frame. @@ -227,10 +224,10 @@ Inertial. */ -bool FGPropagate::Run(void) +bool FGPropagate::Run(bool Holding) { - if (FGModel::Run()) return true; // Fast return if we have nothing to do ... - if (FDMExec->Holding()) return false; + if (FGModel::Run(Holding)) return true; // Fast return if we have nothing to do ... + if (Holding) return false; double dt = FDMExec->GetDeltaT()*rate; // The 'stepsize' @@ -273,9 +270,10 @@ bool FGPropagate::Run(void) // orientation quaternion and vLocation vector. UpdateBodyMatrices(); - CalculateUVW(); // Translational position derivative (velocities are integrated in the inertial frame) + // Translational position derivative (velocities are integrated in the inertial frame) + CalculateUVW(); - // Set auxililary state variables + // Set auxilliary state variables RecomputeLocalTerrainRadius(); VehicleRadius = GetRadius(); // Calculate current aircraft radius from center of planet @@ -628,9 +626,9 @@ void FGPropagate::UpdateBodyMatrices(void) { Ti2b = VState.qAttitudeECI.GetT(); // ECI to body frame transform Tb2i = Ti2b.Transposed(); // body to ECI frame transform - Tl2b = Ti2b*Tl2i; // local to body frame transform + Tl2b = Ti2b * Tl2i; // local to body frame transform Tb2l = Tl2b.Transposed(); // body to local frame transform - Tec2b = Tl2b * Tec2l; // ECEF to body frame transform + Tec2b = Ti2b * Tec2i; // ECEF to body frame transform Tb2ec = Tec2b.Transposed(); // body to ECEF frame tranform }