예제 #1
0
        /// <summary>
        /// 计算真近点角从f1飞行到f2的时间(f1,f2的区间在[0,2*pi]),f1沿逆时针飞行到f2
        /// </summary>
        /// <param name="f1">初始真近点角(rad)</param>
        /// <param name="f2">终点真近点角(rad)</param>
        /// <param name="sma">半长轴</param>
        /// <param name="ecc">偏心率</param>
        /// <param name="mu">引力常数</param>
        /// <returns></returns>
        public static double ComputeTimeOfFlight(double f1, double f2, double sma, double ecc, double mu)
        {
            double dt = KeplerianElements.ComputeTimeOfFlight(Round0_2Pi(f1), Round0_2Pi(f2), sma, ecc, mu);

            if (dt < 0)
            {
                dt = KeplerianElements.SemimajorAxisToPeriod(sma, mu) + dt;
            }

            return(dt);
        }
예제 #2
0
        public static void testTimeOfFlight()
        {
            double mu  = 3.986004418e5;
            double sma = 7078.14;
            double ecc = 0.1;
            double f1  = 0.0;
            double f2  = Math.PI * 2.0;

            double t0  = ComputeTimeOfFlight(f1, f2, sma, ecc, mu);
            double t1  = ComputeTimeOfFlight(0, 2.0, sma, ecc, mu);
            double t2  = ComputeTimeOfFlight(-2.0, 0, sma, ecc, mu);
            double t2p = KeplerianElements.ComputeTimeOfFlight(-2.0, 0, sma, ecc, mu);
            double T   = KeplerianElements.SemimajorAxisToPeriod(sma, mu);
        }
예제 #3
0
        public static void TestLamber1()
        {
            double Gm  = 3.986e14;
            double sma = 7000000;
            double ecc = 0.09956;
            double f1  = 0.0;
            double f2  = Math.PI;
            //double f2 = 1.0;
            //double f2 = 5.0;
            KeplerianElements k1 = new KeplerianElements(sma, ecc, 0.2, 0.4, 1.0, f1, Gm);
            KeplerianElements k2 = new KeplerianElements(sma, ecc, 0.2, 0.4, 1.0, f2, Gm);

            double tof = KeplerianElements.ComputeTimeOfFlight(f1, f2, sma, ecc, Gm);

            Motion <Cartesian> rv1 = k1.ToCartesian();
            Motion <Cartesian> rv2 = k2.ToCartesian();

            Cartesian v1p, v2p;

            Lambert_RhGooding(Gm, rv1.Value, rv1.FirstDerivative, rv2.Value, rv2.FirstDerivative, tof, out v1p, out v2p);

            Cartesian dv1 = v1p - rv1.FirstDerivative;
            Cartesian dv2 = v2p - rv2.FirstDerivative;
        }