00001
00002
00008
00009
00011
00012 #ifndef __OSESSAME_THIRDBODY_PERTUBATIONS_H__
00013 #define __OSESSAME_THIRDBODY_PERTUBATIONS_H__
00014 #include "matrix/Matrix.h"
00015 #include "Time.h"
00016 #include "OrbitState.h"
00017 #include "Attitude.h"
00018 #include "Environment.h"
00019 #include <vector.h>
00020 using namespace std;
00021 using namespace O_SESSAME;
00022
00034 Vector ThirdBodyForceDisturbance(const ssfTime &_currentTime, const OrbitState &_currentOrbitState, const AttitudeState &_currentAttitudeState, const EnvFuncParamaterType &_parameterList)
00035 {
00036 static Vector Forces(3);
00037 static Vector Position(3);
00038 static CentralBody* pOrbCB, pThirdBody;
00039 pOrbCB = reinterpret_cast<CentralBody*>(_parameterList[0]);
00040 pThirdBody = reinterpret_cast<CentralBody*>(_parameterList[1]);
00041
00042 static double massThirdBody = pThirdBody->GetMass();
00043 static Vector vectorOrbCB2ThirdBody = pOrbCB->GetVector2Body(pThirdBody);
00044 static Vector vectorThirdBody2Satellite(3);
00045 vectorSat2ThirdBody = - pThirdBody->GetVector2Body(_currentOrbitState);
00046 static double B = norm2(vectorOrbCB2ThirdBody) / norm2(vectorSat2ThirdBody) - 1;
00047 static double beta = pow(1+B, 3);
00048
00049 Position(_) = _currentOrbitState.GetState()(_(VectorIndexBase,VectorIndexBase+2));
00050 Forces = - c_GravitationalConstant * massThirdBody / pow(vectorOrbCB2ThirdBody, 3) * (Position(_) - beta * vectorSat2ThirdBody);
00051 return Forces;
00052 }
00053
00054 #endif
00055
00056
00057
00058
00059
00060
00061
00062