Beispiel #1
0
def test_kepler_2d_inverse():
    t = 23
    p = kepler.Kepler2DParameters(a=2, pb=3, eps1=0.2, eps2=0.1, t0=t - 1)
    xyv, _ = kepler.kepler_2d(p, t)
    m = kepler.mass(p.a, p.pb)
    p2 = kepler.inverse_kepler_2d(xyv, m, t)

    assert_allclose(p, p2, atol=1e-8)
Beispiel #2
0
def test_kepler_2d_derivs():
    p = kepler.Kepler2DParameters(a=2, pb=3, eps1=0.2, eps2=0.1, t0=-1)
    check_all_partials(
        flatten_namedtuple(kepler.kepler_2d, kepler.Kepler2DParameters), list(p) + [4]
    )
Beispiel #3
0
def test_kepler_2d_t0_pb():
    p = kepler.Kepler2DParameters(a=2, pb=3, eps1=0.1, eps2=0.2, t0=1)
    xyv, _ = kepler.kepler_2d(p, p.t0 + p.pb)
    assert xyv[0] > 0
    assert_allclose(xyv[1], 0, atol=1e-8)