Beispiel #1
0
def show_outputs(prob):
    # print some outputs
    vars_list = [
        'ac|weights|MTOW', 'climb.OEW', 'descent.fuel_used_final',
        'rotate.range_final'
    ]
    units = ['lb', 'lb', 'lb', 'ft']
    nice_print_names = [
        'MTOW', 'OEW', 'Fuel used', 'TOFL (over 35ft obstacle)'
    ]
    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 = 'ft'
        y_vars = ['fltcond|Ueas', 'fltcond|h']
        y_units = ['kn', 'ft']
        x_label = 'Distance (ft)'
        y_labels = ['Veas airspeed (knots)', 'Altitude (ft)']
        phases = ['v0v1', 'v1vr', 'rotate', 'v1v0']
        plot_trajectory(prob,
                        x_var,
                        x_unit,
                        y_vars,
                        y_units,
                        phases,
                        x_label=x_label,
                        y_labels=y_labels,
                        plot_title='King Air Takeoff')

        x_var = 'range'
        x_unit = 'NM'
        y_vars = [
            'fltcond|h', 'fltcond|Ueas', 'fuel_used', 'throttle', 'fltcond|vs'
        ]
        y_units = ['ft', 'kn', 'lbm', None, 'ft/min']
        x_label = 'Range (nmi)'
        y_labels = [
            'Altitude (ft)', 'Veas airspeed (knots)', 'Fuel used (lb)',
            'Throttle setting', 'Vertical speed (ft/min)'
        ]
        phases = ['climb', 'cruise', 'descent']
        plot_trajectory(prob,
                        x_var,
                        x_unit,
                        y_vars,
                        y_units,
                        phases,
                        x_label=x_label,
                        y_labels=y_labels,
                        marker='-',
                        plot_title='King Air Mission Profile')
def show_outputs(prob):
    # print some outputs
    vars_list = ['ac|weights|MTOW','climb.OEW','descent.fuel_used_final',
                 'rotate.range_final','descent.propmodel.batt1.SOC_final','cruise.hybridization',
                 'ac|weights|W_battery','margins.MTOW_margin',
                 'ac|propulsion|motor|rating','ac|propulsion|generator|rating','ac|propulsion|engine|rating',
                 'ac|geom|wing|S_ref','v0v1.Vstall_eas','v0v1.takeoff|vr',
                 'engineoutclimb.gamma',
                 'cruise.propmodel.duct.drag', 'ac|propulsion|thermal|hx|coolant_mass',
                 'climb.propmodel.duct.mdot']
    units = ['lb','lb','lb',
             'ft', None, None,
             'lb','lb',
             'hp','hp','hp',
             'ft**2','kn','kn',
             'deg',
             'lbf','lb',
             'lb/s']
    nice_print_names = ['MTOW', 'OEW', 'Fuel used',
                        'TOFL (over 35ft obstacle)', 'Final state of charge', 'Cruise hybridization',
                        'Battery weight','MTOW margin',
                        'Motor rating', 'Generator rating', 'Engine rating',
                        'Wing area', 'Stall speed', 'Rotate speed',
                        'Engine out climb angle',
                        'Coolant duct cruise drag', 'Coolant mass',
                        'Coolant duct mass flow']
    print("=======================================================================")
    for i, thing in enumerate(vars_list):
        print(nice_print_names[i]+': '+str(prob.get_val(thing,units=units[i])[0])+' '+str(units[i]))

    print('Motor temps (climb): '+str(prob.get_val('climb.propmodel.motorheatsink.T',units='degC')))
    print('Battery temps (climb): '+str(prob.get_val('climb.propmodel.batteryheatsink.T',units='degC')))

    # plot some stuff
    plots = True
    if plots:
        x_var = 'range'
        x_unit = 'NM'
        y_vars = ['fltcond|h','fltcond|Ueas','fuel_used','throttle','fltcond|vs','propmodel.batt1.SOC',
                  'propmodel.motorheatsink.T','propmodel.batteryheatsink.T','propmodel.reservoir.T_out']
        y_units = ['ft','kn','lbm',None,'ft/min',None,'degC','degC','degC']
        x_label = 'Range (nmi)'
        y_labels = ['Altitude (ft)', 'Veas airspeed (knots)', 'Fuel used (lb)', 'Throttle setting', 'Vertical speed (ft/min)', 'Battery SOC', 'Motor temp', 'Battery temp','Reservoir outlet temp']
        phases = ['v0v1','v1vr','v1v0','rotate']
        plot_trajectory(prob, x_var, x_unit, y_vars, y_units, phases,
                        x_label=x_label, y_labels=y_labels, marker='o',
                        plot_title='Takeoff Profile')

        phases = ['v0v1','v1vr','rotate','climb','cruise','descent']
        plot_trajectory(prob, x_var, x_unit, y_vars, y_units, phases,
                        x_label=x_label, y_labels=y_labels, marker='-',
                        plot_title='Full Mission Profile')
Beispiel #3
0
    # plot some stuff
    plots = True
    if plots:
        x_var = 'range'
        x_unit = 'ft'
        y_vars = ['fltcond|Ueas', 'fltcond|h']
        y_units = ['kn', 'ft']
        x_label = 'Distance (ft)'
        y_labels = ['Veas airspeed (knots)', 'Altitude (ft)']
        phases = ['v0v1', 'v1vr', 'rotate', 'v1v0']
        plot_trajectory(prob,
                        x_var,
                        x_unit,
                        y_vars,
                        y_units,
                        phases,
                        x_label=x_label,
                        y_labels=y_labels,
                        plot_title='Caravan Takeoff')

        x_var = 'range'
        x_unit = 'NM'
        y_vars = [
            'fltcond|h', 'fltcond|Ueas', 'fuel_used', 'throttle', 'fltcond|vs'
        ]
        y_units = ['ft', 'kn', 'lbm', None, 'ft/min']
        x_label = 'Range (nmi)'
        y_labels = [
            'Altitude (ft)', 'Veas airspeed (knots)', 'Fuel used (lb)',
            'Throttle setting', 'Vertical speed (ft/min)'
Beispiel #4
0
def show_outputs(prob):
    # print some outputs

    vars_list = [
        'ac|weights|MTOW', 'descent.propmodel.batt1.SOC_final',
        'rotate.range_final'
    ]
    units = ['lb', None, 'ft']
    nice_print_names = [
        'MTOW', 'Final battery state of charge', 'TOFL (over 35ft obstacle)'
    ]
    print(
        "======================================================================="
    )
    for i, thing in enumerate(vars_list):
        print(nice_print_names[i] + ': ' +
              str(prob.get_val(thing, units=units[i])[0]) + ' ' +
              str(units[i]))

        y_variables = [
            'fltcond|h', 'fltcond|Ueas', 'throttle', 'fltcond|vs',
            'propmodel.batt1.SOC', 'propmodel.motorheatsink.T',
            'propmodel.reservoir.T_out', 'propmodel.duct.mdot'
        ]
        y_units = ['ft', 'kn', None, 'ft/min', None, 'degC', 'degC', 'kg/s']

    # plot some stuff
    plots = True
    if plots:
        x_var = 'range'
        x_unit = 'ft'
        y_vars = [
            'fltcond|h', 'fltcond|Ueas', 'throttle', 'fltcond|vs',
            'propmodel.batt1.SOC', 'propmodel.motorheatsink.T',
            'propmodel.reservoir.T_out', 'propmodel.duct.mdot'
        ]
        y_units = ['ft', 'kn', None, 'ft/min', None, 'degC', 'degC', 'lb/s']
        x_label = 'Distance (ft)'
        y_labels = [
            'Altitude (ft)', 'Veas airspeed (knots)', 'Throttle',
            'Vertical speed (ft/min)', 'Battery SOC', 'Motor temp (C)',
            'Reservoir outlet temp (C)', 'Cooling duct mass flow (lb/s)'
        ]
        phases = ['v0v1', 'v1vr', 'rotate', 'v1v0']
        plot_trajectory(prob,
                        x_var,
                        x_unit,
                        y_vars,
                        y_units,
                        phases,
                        x_label=x_label,
                        y_labels=y_labels,
                        plot_title='Elec Single Takeoff')

        x_var = 'range'
        x_unit = 'NM'
        x_label = 'Range (nmi)'
        phases = ['climb', 'cruise', 'descent']
        plot_trajectory(prob,
                        x_var,
                        x_unit,
                        y_vars,
                        y_units,
                        phases,
                        x_label=x_label,
                        y_labels=y_labels,
                        marker='-',
                        plot_title='Elec Single Mission Profile')
Beispiel #5
0
    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 = 'ft'
        y_vars = ['fltcond|Ueas', 'fltcond|h']
        y_units = ['kn', 'ft']
        x_label = 'Distance (ft)'
        y_labels = ['Veas airspeed (knots)', 'Altitude (ft)']
        phases = ['v0v1', 'v1vr', 'rotate', 'v1v0']
        plot_trajectory(prob, x_var, x_unit, y_vars, y_units, phases,
                        x_label=x_label, y_labels=y_labels,
                        plot_title='A320-200 Takeoff')

        x_var = 'range'
        x_unit = 'NM'
        y_vars = ['fltcond|h','fltcond|Ueas','fuel_used','throttle','fltcond|vs', 'fltcond|M']
        # y_units = ['ft','kn','lbm',None,'ft/min', None]
        y_units = ['ft','kn','lbm',None,'ft/min', None]
        x_label = 'Range (nmi)'
        y_labels = ['Altitude (ft)', 'Veas airspeed (knots)', 'Fuel used (lb)', 'Throttle setting', 'Vertical speed (ft/min)', 'Mach']
        # phases = ['climb1', 'climb2', 'cruise', 'descent1', 'descent2']
        # phases = ['climb1', 'cruise', 'descent1']
        phases = ['climb1', 'climb2', 'climb3', 'climb4', 'cruise', 'descent1', 'descent2', 'descent3']
        plot_trajectory(prob, x_var, x_unit, y_vars, y_units, phases,
                        x_label=x_label, y_labels=y_labels, marker='-',
                        plot_title='A320-200 Mission Profile')