ThirdBodyDisturbances.h

Go to the documentation of this file.
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); // negative to "switch the head" around
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 // Do not change the comments below - they will be added automatically by CVS
00056 /*****************************************************************************
00057 *       $Log: ThirdBodyDisturbances.h,v $
00058 *       Revision 1.1  2003/06/12 17:58:42  nilspace
00059 *       Initial Submission.
00060 *       
00061 *       
00062 ******************************************************************************/

Generated on Wed Aug 6 12:58:53 2003 for Open-Sessame Framework by doxygen1.3