Esempio n. 1
0
    def test_mee_coe_mee(self):
        mee = convert.mod_angles(convert.mee_coe(coe_sltn))
        coe = convert.coe_mee(mee)
        mee2 = convert.mod_angles(convert.mee_coe(coe))
        diff = convert.mod_angles(np.abs(mee - mee2), angle_indices=[5])
        indices_2pi = np.where(2 * np.pi - tol < diff)
        diff[indices_2pi] -= 2 * np.pi

        np.testing.assert_allclose(diff, 0., rtol=0, atol=tol)
Esempio n. 2
0
    def test_compare_meeEl_meefl_to_coeE_coef(self):
        coef = convert.mod_angles(coe_sltn)
        meefl = convert.mee_coe(coef)

        coeE = convert.coeE_coef(coef)
        meeEl = convert.meeEl_meefl(meefl)
        El1 = convert.mee_coe(coeE)[:, 5:]
        El2 = meeEl[:, 5:]

        diff = convert.mod_angles(El1 - El2, angle_indices=[0])
        indices_2pi = np.where(2 * np.pi - tol < diff)
        diff[indices_2pi] -= 2 * np.pi

        np.testing.assert_allclose(diff, 0., rtol=0, atol=tol)
Esempio n. 3
0
    def test_compare_meefl_meeEl_to_coef_coeE(self):
        coeE = convert.mod_angles(coe_sltn)
        meeEl = convert.mee_coe(coeE)

        coef = convert.coef_coeE(coeE)
        meefl = convert.meefl_meeEl(meeEl)
        fl1 = convert.mee_coe(coef)[:, 5:]
        fl2 = meefl[:, 5:]

        diff = convert.mod_angles(np.abs(fl1 - fl2), angle_indices=[0])
        indices_2pi = np.where(2 * np.pi - tol < diff)
        diff[indices_2pi] -= 2 * np.pi

        np.testing.assert_allclose(diff, 0., rtol=0, atol=tol)
Esempio n. 4
0
    def test_rv_mee_rv(self):
        mee = convert.mod_angles(convert.mee_coe(coe_sltn))
        rv = convert.rv_mee(mee)
        mee = convert.mee_rv(rv)
        rv2 = convert.rv_mee(mee)

        np.testing.assert_allclose(rv, rv2, rtol=0, atol=tol)
Esempio n. 5
0
    def test_meefl_meeMl_meefl(self):
        meefl = convert.mod_angles(convert.mee_coe(coe_sltn))
        meeMl = convert.meeMl_meefl(meefl)
        meefl2 = convert.mod_angles(convert.meefl_meeMl(meeMl))
        diff = convert.mod_angles(np.abs(meefl - meefl2), angle_indices=[0])
        indices_2pi = np.where(2 * np.pi - tol < diff)
        diff[indices_2pi] -= 2 * np.pi

        np.testing.assert_allclose(diff, 0., rtol=0, atol=tol)
Esempio n. 6
0
    def test_mee_meeMl0_mee(self):
        T = np.linspace(0, 10, num=m)
        mee = convert.mod_angles(convert.mee_coe(coe_sltn))
        meeMl0 = convert.meeMl0_mee(T, mee)
        mee2 = convert.mod_angles(convert.mee_meeMl0(T, meeMl0))
        diff = convert.mod_angles(np.abs(mee - mee2), angle_indices=[5])
        indices_2pi = np.where(2 * np.pi - tol < diff)
        diff[indices_2pi] -= 2 * np.pi

        np.testing.assert_allclose(diff, 0., rtol=0, atol=tol)
Esempio n. 7
0
m = 1000
tol = 1e-14

# INITIAL CONDITIONS
mu = 1.0
a_0 = 8000. * DU
e_0 = 0.1
i_0 = 10. * np.pi / 180.
W_0 = 10. * np.pi / 180.
w_0 = 10. * np.pi / 180.
f_0 = 10. * np.pi / 180.
period = 2. * np.pi * (a_0**3 / mu)**.5

coe_0 = np.array([[a_0, e_0, i_0, W_0, w_0, f_0]])
rv_0 = convert.rv_coe(coe_0)
mee_0 = convert.mee_coe(coe_0)

T = np.linspace(0, 10, num=m).reshape((m, 1))
meeMl0_0 = convert.meeMl0_mee(T[0:1], mee_0)
coe_sltn = coe.KeplerianSolution(coe_0)(T)

orbits = math.ceil(T[-1] / period)
segs_per_orbit = 3
order_mcpi = 60


class TestRV(unittest.TestCase):
    def test_hamiltonian_constant(self):
        X0 = rv_0

        X = np.tile(X0, (m, 1))