def check_results(new_results):

    # check segment values
    truth = Data()
    truth.dist = [6426122.4935872 ,  5848398.49923247  ,7044468.46851841]
    truth.fuel = [ 14771. ,  12695.  , 12695.]

    error = Data()
    error.dist = np.max(np.abs(new_results.dist-truth.dist))
    error.fuel = np.max(np.abs(new_results.fuel-truth.fuel))

    for k,v in error.items():
        assert(np.abs(v)<0.001)
def main():

    # define the problem
    vehicle, mission = full_setup()

    # run the problem
    # defining inputs of the module
    cruise_segment_tag = 'Cruise'
    mission_payload = [11792. ,  9868. ,     0. ]
    takeoff_weight =  [54480. , 50480. , 40612. ]
    # call module
    distance,fuel = size_mission_range_given_weights(vehicle,mission,cruise_segment_tag,mission_payload,takeoff_weight)

    # check the results
    results = Data()
    results.dist = distance
    results.fuel = fuel
    check_results(results)

    return
def main():

    # define the problem
    vehicle, mission = full_setup()

    # run the problem
    # defining inputs of the module
    cruise_segment_tag = 'Cruise'
    mission_payload =             [11792. , 9868. ,    10. ]
    target_range =  np.multiply ( [ 3470. , 3158. ,  3804. ] , 1. * Units.nautical_mile )

    # call module
    distance,fuel,tow = size_weights_given_mission_range(vehicle,mission,cruise_segment_tag,mission_payload,target_range)

    # check the results
    results = Data()
    results.dist = distance
    results.fuel = fuel
    results.tow  = tow

    check_results(results)

    return