Пример #1
0
def show_outputs(prob):
    # print some outputs
    vars_list = [
        'descent.fuel_used_final', 'descent.hx_battery.xs_area_cold',
        'descent.hx_battery.frontal_area'
    ]
    units = ['lb', 'inch**2', 'inch**2']
    nice_print_names = [
        'Block fuel', 'Duct HX XS area', 'Duct HX Frontal Area'
    ]
    print(
        "======================================================================="
    )
    for i, thing in enumerate(vars_list):
        print(nice_print_names[i] + ': ' +
              str(prob.get_val(thing, units=units[i])[0]) + ' ' + units[i])

    # plot some stuff
    plots = True
    if plots:
        x_var = 'range'
        x_unit = 'NM'
        y_vars = [
            'fltcond|h', 'fltcond|Ueas', 'fuel_used', 'throttle', 'fltcond|vs',
            'fltcond|M', 'fltcond|CL', 'battery.SOC', 'motorheatsink.T',
            'batteryheatsink.T', 'batteryheatsink.T_in',
            'variable_duct.force.F_net', 'motorheatsink.T_in',
            'motor_duct.force.F_net', 'hx_fault_prot.T_out_hot'
        ]
        y_units = [
            'ft', 'kn', 'lbm', None, 'ft/min', None, None, None, 'degC',
            'degC', 'degC', 'lbf', 'degC', 'lbf', 'degC'
        ]
        x_label = 'Range (nmi)'
        y_labels = [
            'Altitude (ft)', 'Veas airspeed (knots)', 'Fuel used (lb)',
            'Throttle setting', 'Vertical speed (ft/min)', 'Mach number', 'CL',
            'Batt SOC', 'Motor Temp', 'Battery Temp (C)',
            'Battery Coolant Inflow Temp', 'Batt duct cooling Net Force (lb)',
            'Motor Coolant Inflow Temp', 'Motor duct cooling Net Force (lb)',
            'Motor fault prot inflow temp (C)'
        ]
        phases = ['groundroll', 'climb', 'cruise', 'descent']
        oc.plot_trajectory(prob,
                           x_var,
                           x_unit,
                           y_vars,
                           y_units,
                           phases,
                           x_label=x_label,
                           y_labels=y_labels,
                           marker='-',
                           plot_title='Hybrid Single Aisle Mission')
Пример #2
0
def show_outputs(prob):
    # print some outputs
    vars_list = ['descent.fuel_used_final', 'loiter.fuel_used_final']
    units = ['lb', 'lb']
    nice_print_names = ['Block fuel', 'Total fuel']
    print(
        "======================================================================="
    )
    for i, thing in enumerate(vars_list):
        print(nice_print_names[i] + ': ' +
              str(prob.get_val(thing, units=units[i])[0]) + ' ' + units[i])

    # plot some stuff
    plots = True
    if plots:
        x_var = 'range'
        x_unit = 'NM'
        y_vars = [
            'fltcond|h', 'fltcond|Ueas', 'fuel_used', 'throttle', 'fltcond|vs',
            'fltcond|M', 'fltcond|CL'
        ]
        y_units = ['ft', 'kn', 'lbm', None, 'ft/min', None, None]
        x_label = 'Range (nmi)'
        y_labels = [
            'Altitude (ft)', 'Veas airspeed (knots)', 'Fuel used (lb)',
            'Throttle setting', 'Vertical speed (ft/min)', 'Mach number', 'CL'
        ]
        phases = [
            'climb', 'cruise', 'descent', 'reserve_climb', 'reserve_cruise',
            'reserve_descent', 'loiter'
        ]
        oc.plot_trajectory(prob,
                           x_var,
                           x_unit,
                           y_vars,
                           y_units,
                           phases,
                           x_label=x_label,
                           y_labels=y_labels,
                           marker='-',
                           plot_title='737-800 Mission Profile')