00001 ////////////////////////////////////////////////////////////////////////////////////////////////// 00002 /*! \file TiltedDipoleMagneticModel.cpp 00003 * \brief Algorithm for determining the magnetic field of a central body using a titled dipole mognetic model. 00004 * \author $Author: cakinli $ 00005 * \version $Revision: 1.1.1.1 $ 00006 * \date $Date: 2005/04/26 17:40:56 $ 00007 *////////////////////////////////////////////////////////////////////////////////////////////////// 00008 /* 00009 */ 00010 ////////////////////////////////////////////////////////////////////////////////////////////////// 00011 00012 #include "TiltedDipoleMagneticModel.h" 00013 00014 namespace O_SESSAME { 00015 00016 /*! \brief Calculates the local magnetic field about a central body used a tilted dipole model. 00017 * 00018 */ 00019 Vector TiltedDipoleMagneticModel::GetMagneticField(const ssfTime& _currentTime, const Vector& _PositionVector) 00020 { 00021 m_MagFieldCoeffs.modelEpoch.Set(_currentTime.GetSeconds()); 00022 double alpha_m = m_MagFieldCoeffs.modelEpoch.GetEpochGreenwichMeanSiderealTime() 00023 + m_MagFieldCoeffs.CBAvgRotationRate * m_MagFieldCoeffs.modelEpoch.SecondsSinceEpoch() 00024 + m_MagFieldCoeffs.DipoleEastLongitude; 00025 00026 static Vector DipoleDirection(3); 00027 DipoleDirection(1) = sin(m_MagFieldCoeffs.DipoleCoelevation) * cos(alpha_m); 00028 DipoleDirection(2) = sin(m_MagFieldCoeffs.DipoleCoelevation) * sin(alpha_m); 00029 DipoleDirection(3) = cos(m_MagFieldCoeffs.DipoleCoelevation); 00030 00031 return pow(m_MagFieldCoeffs.CBRadius,3) * m_MagFieldCoeffs.H0 00032 / pow(norm2(_PositionVector),3) 00033 * (3 * (~DipoleDirection * _PositionVector) * _PositionVector - DipoleDirection); 00034 00035 } 00036 } 00037 00038 00039 // Do not change the comments below - they will be added automatically by CVS 00040 /***************************************************************************** 00041 * $Log: TiltedDipoleMagneticModel.cpp,v $ 00042 * Revision 1.1.1.1 2005/04/26 17:40:56 cakinli 00043 * Adding OpenSESSAME to DSACSS distrib to capture fixed version. 00044 * 00045 * Revision 1.2 2003/06/12 18:00:31 nilspace 00046 * Fixed references to CentralBody. 00047 * 00048 * Revision 1.1 2003/06/10 14:26:50 nilspace 00049 * Initial Submission. 00050 * 00051 * 00052 ******************************************************************************/