/// <summary> /// 计算绕地航天器主要的加速度。 /// Computes the acceleration of an Earth orbiting satellite due to /// - the Earth's harmonic gravity field, /// - the gravitational perturbations of the Sun and Moon /// - the solar radiation pressure and /// - the atmospheric drag /// </summary> /// <param name="Mjd_TT"> Mjd_TT Terrestrial Time (Modified Julian Date)</param> /// <param name="satXyzIcrf"> r 卫星在国际天球参考框架的位置 Satellite position vector in the ICRF/EME2000 system</param> /// <param name="satVelocityIcrf"> v 卫星在国际天球参考框架的速度 Satellite velocity vector in the ICRF/EME2000 system</param> /// <param name="Area"> Area Cross-section </param> /// <param name="mass"> mass 质量 Spacecraft mass</param> /// <param name="solarRadiPresCoeff"> coefOfRadiation 光压系数 Radiation pressure coefficient</param> /// <param name="atmDragCoefficient"> coefOfDrag 大气阻力系数 Drag coefficient</param> /// <returns> Acceleration (a=d^2r/dt^2) in the ICRF/EME2000 system</returns> public static Geo.Algorithm.Vector AccelerOfMainForces(double Mjd_TT, Geo.Algorithm.Vector satXyzIcrf, Geo.Algorithm.Vector satVelocityIcrf, double Area, double mass, double solarRadiPresCoeff, double atmDragCoefficient) { double Mjd_UT1; Geo.Algorithm.Vector a = new Geo.Algorithm.Vector(3), r_Sun = new Geo.Algorithm.Vector(3), r_Moon = new Geo.Algorithm.Vector(3); Matrix T = new Matrix(3, 3), E = new Matrix(3, 3); // Acceleration due to harmonic gravity field Mjd_UT1 = Mjd_TT; T = IERS.NutMatrix(Mjd_TT) * IERS.PrecessionMatrix(MJD_J2000, Mjd_TT); E = IERS.GreenwichHourAngleMatrix(Mjd_UT1) * T; a = AccelerOfHarmonicGraviFiled(satXyzIcrf, E, Grav.GM, Grav.R_ref, Grav.CS, Grav.n_max, Grav.m_max); // Luni-solar perturbations r_Sun = CelestialUtil.Sun(Mjd_TT); r_Moon = CelestialUtil.Moon(Mjd_TT); a += AccelerOfPointMass(satXyzIcrf, r_Sun, OrbitConsts.GM_Sun); a += AccelerOfPointMass(satXyzIcrf, r_Moon, OrbitConsts.GM_Moon); // Solar radiation pressure a += CelestialUtil.Illumination(satXyzIcrf, r_Sun) * AccelerOfSolarRadiPressure(satXyzIcrf, r_Sun, Area, mass, solarRadiPresCoeff, OrbitConsts.PressureOfSolarRadiationPerAU, AU); // Atmospheric drag a += AccelerDragOfAtmos(Mjd_TT, satXyzIcrf, satVelocityIcrf, T, Area, mass, atmDragCoefficient); // Acceleration return(a); }
/// <summary> /// Computes the acceleration of an Earth orbiting satellite due to /// - the Earth's harmonic gravity field, /// - the gravitational perturbations of the Sun and Moon /// - the solar radiation pressure and /// - the atmospheric drag /// </summary> /// <param name="Mjd_TT">Mjd_TT Terrestrial Time (Modified Julian Date)</param> /// <param name="r">r Satellite position vector in the ICRF/EME2000 system</param> /// <param name="v">v Satellite velocity vector in the ICRF/EME2000 system</param> /// <param name="Area"> Area Cross-section </param> /// <param name="mass"> mass Spacecraft mass</param> /// <param name="coefOfRadiation">coefOfRadiation Radiation pressure coefficient</param> /// <param name="coefOfDrag">coefOfDrag Drag coefficient</param> /// <param name="n"></param> /// <param name="m"></param> /// <param name="isConsiderSun">是否启用太阳质量影响</param> /// <param name="isConsiderMoon">是否启用月亮质量影响</param> /// <param name="isConsiderSolarRadi">是否启用太阳光压影响</param> /// <param name="isConsiderDrag">是否考虑大气影响</param> /// <returns>Acceleration (a=d^2r/dt^2) in the ICRF/EME2000 system</returns> public Geo.Algorithm.Vector GetAcceleration(double Mjd_TT, Geo.Algorithm.Vector r, Geo.Algorithm.Vector v) { // Acceleration due to harmonic gravity field var Mjd_UT1 = Mjd_TT + (IERS.GetUT1_UTC(Mjd_TT) - IERS.GetTT_UTC(Mjd_TT)) / 86400.0; var T = IERS.NutMatrix(Mjd_TT) * IERS.PrecessionMatrix(OrbitConsts.MJD_J2000, Mjd_TT); var E = IERS.GreenwichHourAngleMatrix(Mjd_UT1) * T; var a = Force.AccelerOfHarmonicGraviFiled(r, E, Force.Grav.GM, Force.Grav.R_ref, Force.Grav.CS, Option.MaxDegree, Option.MaxOrder); // Luni-solar perturbations var r_Sun = CelestialUtil.Sun(Mjd_TT); if (Option.EnableSun) { a += Force.AccelerOfPointMass(r, r_Sun, OrbitConsts.GM_Sun); } if (Option.EnableMoon) { var r_Moon = CelestialUtil.Moon(Mjd_TT); a += Force.AccelerOfPointMass(r, r_Moon, OrbitConsts.GM_Moon); } // Solar radiation pressure if (Option.EnableSolarRadiation) { a += Force.AccelerOfSolarRadiPressure(r, r_Sun, Option.Area, Option.Mass, Option.CoefOfRadiation, OrbitConsts.PressureOfSolarRadiationPerAU, OrbitConsts.AU); } // Atmospheric drag if (Option.EnableDrag) { a += Force.AccelerDragOfAtmos(Mjd_TT, r, v, T, Option.Area, Option.Mass, Option.CoefOfDrag); } // Acceleration return(a); }
static void Main0(string[] args) { // Constants const int N_Step = 8; const double Step = 0.5; // [d] // Sample Chebyshev coefficients from JPL DE405 for geocentric lunar // coordinates in the ITRF(EME2000) frame valid from 2006/03/14 TDB // to 2006/03/18 TDB const double t1 = 53808.0; // MJD at start of interval const double t2 = 53812.0; // MJD at end of interval double[] Cx_moon = // Coefficients for x-coordinate N_coeff { -0.383089044877016277e+06, 0.218158411754834669e+05, 0.179067292901463843e+05, -0.836928063411765777e+02, -0.628266733052023696e+02, -0.459274434235101225e+00, 0.491167202819885532e-01, 0.770804039287614762e-03, -0.125935992206166816e-03, 0.500271026610991370e-05, 0.107044869185752331e-05, 0.172472464343636242e-08, -0.269667589576924680e-08 }; double[] Cy_moon = // Coefficients for y-coordinate N_coeff { -0.379891721705081436e+05, -0.143611643157166138e+06, 0.187126702787245881e+04, 0.112734362473135207e+04, 0.932891213817359177e+00, -0.191932684130578513e+01, -0.266517663331897990e-01, 0.104558913448630337e-02, -0.359077689123857890e-04, -0.123405162037249834e-04, 0.180479239596339495e-06, 0.525522632333670539e-07, 0.543313967008773005e-09 }; double[] Cz_moon = // Coefficients for z-coordinate { -0.178496690739133737e+05, -0.788257550331743259e+05, 0.880684692614081882e+03, 0.618395886330471512e+03, 0.103331218594995988e+01, -0.104949867328178592e+01, -0.150337371962561087e-01, 0.569056416308259317e-03, -0.186297523286550968e-04, -0.680012420653791955e-05, 0.902057208454410917e-07, 0.287891446432139173e-07, 0.319822827699973363e-09 }; // Chebyshev approximation of lunar coordinates MultiDimChebshevFitter MoonCheb = new MultiDimChebshevFitter(t1, t2, // Order and interval new Vector(Cx_moon), // Coefficients new Vector(Cy_moon), new Vector(Cz_moon)); // Variables int i; double Mjd0, Mjd_TT; Vector r = new Vector(3); // Epoch Mjd0 = DateUtil.DateToMjd(2006, 03, 14, 00, 00, 0.0); // Output var info = "Exercise 3-2: Lunar Ephemerides " + "\r\n"; info += " Moon position from low precision analytical theory" + "\r\n"; info += " Date [TT] " + " Position [km] " + "\r\n"; Console.WriteLine(info); for (i = 0; i <= N_Step; i++) { Mjd_TT = Mjd0 + i * Step; r = CelestialUtil.Moon(Mjd_TT) / 1000.0; info = " " + DateUtil.MjdToDateTimeString(Mjd_TT) + " " + r; Console.WriteLine(info); } info = " Moon position from DE405" + "\r\n"; info += " Date [TT] " + " Position [km] " + "\r\n"; Console.WriteLine(info); for (i = 0; i <= N_Step; i++) { Mjd_TT = Mjd0 + i * Step; r = MoonCheb.Fit(Mjd_TT); info = " " + DateUtil.MjdToDateTimeString(Mjd_TT) + " " + r; Console.WriteLine(info); } Console.ReadKey(); }