示例#1
0
def test_4_target_velocities():
    """
    Calculate the velocities at the starting and ending positions
    """

    results = find_target_velocities(earth, mars)

    assert number_fudger(results['V1'], 29.78)
    assert number_fudger(results['V2'], 24.007)
示例#2
0
def test_3_transfer_period():
    """
    Find the period in seconds of the transfer orbit using Kepler's Third Law
    """

    results = find_transfer_period(earth, mars)

    assert number_fudger(results, 44734138.6)
    assert number_fudger(results, (4.493 * 10**7))
示例#3
0
def test_2_transfer_orbit():
    """
    Find the semimajor axis of the transfer orbit
    """

    a_transfer = find_transfer_orbit(earth, mars)

    assert number_fudger(a_transfer, 188768611.5)
    assert number_fudger(a_transfer, 188000000)
示例#4
0
def test_7_arrival_velocity():
    """
    Calculate the velocity at arrival
    """
    results = find_velocity_at_destination(earth, mars)

    assert number_fudger(results, 21.476)
示例#5
0
def test_6_insertion_velocity():
    """
    Calculate the change in velocity required to eject from p_start
    """
    results = find_insertion_velocity(earth, mars)

    assert number_fudger(results, 2.946)
示例#6
0
def test_8_final_injection_velocity():
    """
    Calculate the velocity required to inject into final orbit
    """
    results = find_arrival_injection_velocity(earth, mars) * 1000

    assert number_fudger(results, 2650)
示例#7
0
def test_1_semi_major_axis():
    """
    Get the semi major axis of start and finish positions
    """

    results = find_semimajor_axis(earth, mars)

    assert number_fudger(results['SMA Start'], 149598023)
    assert number_fudger(results['SMA Finish'], 227939200)

    # STEP 2
    """
    Note - Step 2 isn't being tested because it is a constant
    """

    # STEP 3
    """
示例#8
0
def test_5_transfer_velocity():
    """
    Calculate the velocity of the transfer orbit at periapsis
    """

    results = find_transfer_velocity(earth, mars)

    assert number_fudger(results, 32.731)