Exemple #1
0
def empty(vehicle):
    """ output = SUAVE.Methods.Weights.Correlations.Tube_Wing.empty(engine,wing,aircraft,fuselage,horizontal,vertical)
        This is for a standard Tube and Wing aircraft configuration.        
        
        Inputs:
            engine - a data dictionary with the fields:                    
                thrust_sls - sea level static thrust of a single engine [Newtons]
            
            wing - a data dictionary with the fields:
                gross_area - wing gross area [meters**2]
                span - span of the wing [meters]
                taper - taper ratio of the wing [dimensionless]
                t_c - thickness-to-chord ratio of the wing [dimensionless]
                sweep - sweep angle of the wing [radians]
                mac - mean aerodynamic chord of the wing [meters]
                r_c - wing root chord [meters]
                
            aircraft - a data dictionary with the fields:                    
                Nult - ultimate load of the aircraft [dimensionless]
                Nlim - limit load factor at zero fuel weight of the aircraft [dimensionless]
                TOW - maximum takeoff weight of the aircraft [kilograms]
                zfw - maximum zero fuel weight of the aircraft [kilograms]
                num_eng - number of engines on the aircraft [dimensionless]
                num_pax - number of passengers on the aircraft [dimensionless]
                wt_cargo - weight of the bulk cargo being carried on the aircraft [kilograms]
                num_seats - number of seats installed on the aircraft [dimensionless]
                ctrl - specifies if the control system is "fully powered", "partially powered", or not powered [dimensionless]
                ac - determines type of instruments, electronics, and operating items based on types: 
                    "short-range", "medium-range", "long-range", "business", "cargo", "commuter", "sst" [dimensionless]
                w2h - tail length (distance from the airplane c.g. to the horizontal tail aerodynamic center) [meters]
                
            fuselage - a data dictionary with the fields:
                area - fuselage wetted area [meters**2]
                diff_p - Maximum fuselage pressure differential [Pascal]
                width - width of the fuselage [meters]
                height - height of the fuselage [meters]
                length - length of the fuselage [meters]                     
            
            horizontal
                area - area of the horizontal tail [meters**2]
                span - span of the horizontal tail [meters]
                sweep - sweep of the horizontal tail [radians]
                mac - mean aerodynamic chord of the horizontal tail [meters]
                t_c - thickness-to-chord ratio of the horizontal tail [dimensionless]
                exposed - exposed area ratio for the horizontal tail [dimensionless]
            
            vertical
                area - area of the vertical tail [meters**2]
                span - sweight = weight * Units.lbpan of the vertical [meters]
                t_c - thickness-to-chord ratio of the vertical tail [dimensionless]
                sweep - sweep angle of the vertical tail [radians]
                t_tail - factor to determine if aircraft has a t-tail, "yes" [dimensionless]
    
        Outputs:
            output - a data dictionary with fields:
                wt_payload - weight of the passengers plus baggage and paid cargo [kilograms]
                wt_pax - weight of all the passengers [kilogram]
                wt_bag - weight of all the baggage [kilogram]
                wt_fuel - weight of the fuel carried[kilogram]
                wt_empty - operating empty weight of the aircraft [kilograms]
                
        Assumptions:
            calculated aircraft weight from correlations created per component of historical aircraft
    """     

    # Unpack inputs
    Nult       = vehicle.envelope.ultimate_load
    Nlim       = vehicle.envelope.limit_load
    TOW        = vehicle.mass_properties.max_takeoff
    wt_zf      = vehicle.mass_properties.max_zero_fuel
    num_pax    = vehicle.passengers

    wt_cargo   = vehicle.mass_properties.cargo
    num_seats  = vehicle.fuselages.Fuselage.number_coach_seats
    ctrl_type  = vehicle.systems.control
    ac_type    = vehicle.systems.accessories         
    
    if not vehicle.propulsors.has_key('Turbo Fan'):
        wt_engine_jet = 0.0
        wt_propulsion = 0.0
        warnings.warn("There is no Turbo Fan Engine Weight being added to the Configuration", stacklevel=1)    
    else:    
        num_eng            = vehicle.propulsors['Turbo Fan'].number_of_engines
        thrust_sls         = vehicle.propulsors['Turbo Fan'].thrust.design
        wt_engine_jet      = Propulsion.engine_jet(thrust_sls)
        wt_propulsion      = Propulsion.integrated_propulsion(wt_engine_jet,num_eng)
    
    S_gross_w  = vehicle.reference_area
    #S_gross_w  = vehicle.wings['Main Wing'].Areas.reference
    if not vehicle.wings.has_key('Main Wing'):
        wt_wing = 0.0
        wing_c_r = 0.0
        warnings.warn("There is no Wing Weight being added to the Configuration", stacklevel=1)
    else:
        b          = vehicle.wings['Main Wing'].spans.projected
        lambda_w   = vehicle.wings['Main Wing'].taper
        t_c_w      = vehicle.wings['Main Wing'].thickness_to_chord
        sweep_w    = vehicle.wings['Main Wing'].sweep
        mac_w      = vehicle.wings['Main Wing'].chords.mean_aerodynamic
        wing_c_r   = vehicle.wings['Main Wing'].chords.root
        wt_wing    = wing_main(S_gross_w,b,lambda_w,t_c_w,sweep_w,Nult,TOW,wt_zf)
        vehicle.wings['Main Wing'].mass_properties.mass = wt_wing        
        
    S_fus      = vehicle.fuselages.Fuselage.areas.wetted
    diff_p_fus = vehicle.fuselages.Fuselage.differential_pressure
    w_fus      = vehicle.fuselages.Fuselage.width
    h_fus      = vehicle.fuselages.Fuselage.heights.maximum
    l_fus      = vehicle.fuselages.Fuselage.lengths.total
    
    if not vehicle.wings.has_key('Horizontal Stabilizer'):
        wt_tail_horizontal = 0.0
        S_h = 0.0
        warnings.warn("There is no Horizontal Tail Weight being added to the Configuration", stacklevel=1)
    else:    
        S_h            = vehicle.wings['Horizontal Stabilizer'].areas.reference
        b_h            = vehicle.wings['Horizontal Stabilizer'].spans.projected
        sweep_h        = vehicle.wings['Horizontal Stabilizer'].sweep
        mac_h          = vehicle.wings['Horizontal Stabilizer'].chords.mean_aerodynamic
        t_c_h          = vehicle.wings['Horizontal Stabilizer'].thickness_to_chord
        h_tail_exposed = vehicle.wings['Horizontal Stabilizer'].areas.exposed / vehicle.wings['Horizontal Stabilizer'].areas.wetted
        l_w2h      = vehicle.wings['Horizontal Stabilizer'].origin[0] + vehicle.wings['Horizontal Stabilizer'].aerodynamic_center[0] - vehicle.wings['Main Wing'].origin[0] - vehicle.wings['Main Wing'].aerodynamic_center[0] #Need to check this is the length of the horizontal tail moment arm
        wt_tail_horizontal = tail_horizontal(b_h,sweep_h,Nult,S_h,TOW,mac_w,mac_h,l_w2h,t_c_h, h_tail_exposed)                
        vehicle.wings['Horizontal Stabilizer'].mass_properties.mass = wt_tail_horizontal        
    
    if not vehicle.wings.has_key('Vertical Stabilizer'):   
        output_3 = Data()
        output_3.wt_tail_vertical = 0.0
        output_3.wt_rudder = 0.0
        S_v = 0.0
        warnings.warn("There is no Vertical Tail Weight being added to the Configuration", stacklevel=1)    
    else:     
        S_v        = vehicle.wings['Vertical Stabilizer'].areas.reference
        b_v        = vehicle.wings['Vertical Stabilizer'].spans.projected
        t_c_v      = vehicle.wings['Vertical Stabilizer'].thickness_to_chord
        sweep_v    = vehicle.wings['Vertical Stabilizer'].sweep
        t_tail     = vehicle.wings['Vertical Stabilizer'].t_tail  
        output_3   = tail_vertical(S_v,Nult,b_v,TOW,t_c_v,sweep_v,S_gross_w,t_tail)
        vehicle.wings['Vertical Stabilizer'].mass_properties.mass = output_3.wt_tail_vertical + output_3.wt_rudder
        

    # process
    # Calculating Empty Weight of Aircraft
    wt_landing_gear    = landing_gear(TOW)
    wt_fuselage        = tube(S_fus, diff_p_fus,w_fus,h_fus,l_fus,Nlim,wt_zf,wt_wing,wt_propulsion, wing_c_r)
    output_2           = systems(num_seats, ctrl_type, S_h, S_v, S_gross_w, ac_type)
    
    # Calculate the equipment empty weight of the aircraft
    wt_empty           = (wt_wing + wt_fuselage + wt_landing_gear + wt_propulsion + output_2.wt_systems + \
                          wt_tail_horizontal + output_3.wt_tail_vertical + output_3.wt_rudder) 
    vehicle.fuselages.Fuselage.mass_properties.mass = wt_fuselage
    
    # packup outputs
    output             = payload(TOW, wt_empty, num_pax,wt_cargo)
    output.wing              = wt_wing
    output.fuselage          = wt_fuselage
    output.propulsion        = wt_propulsion
    output.landing_gear      = wt_landing_gear
    output.systems           = output_2.wt_systems
    output.wt_furnish        = output_2.wt_furnish
    output.horizontal_tail   = wt_tail_horizontal
    output.vertical_tail     = output_3.wt_tail_vertical
    output.rudder            = output_3.wt_rudder    
    
    return output
Exemple #2
0
def empty_custom_eng(vehicle, propulsor):
    """ output = SUAVE.Methods.Weights.Correlations.Tube_Wing.empty(engine,wing,aircraft,fuselage,horizontal,vertical)
        This is for a standard Tube and Wing aircraft configuration.        
        
        Inputs:
            propulsor - a propulsor object
                mass_properties.mass
            
            wing - a data dictionary with the fields:
                gross_area - wing gross area [meters**2]
                span - span of the wing [meters]
                taper - taper ratio of the wing [dimensionless]
                t_c - thickness-to-chord ratio of the wing [dimensionless]
                sweep - sweep angle of the wing [radians]
                mac - mean aerodynamic chord of the wing [meters]
                r_c - wing root chord [meters]
                
            aircraft - a data dictionary with the fields:                    
                Nult - ultimate load of the aircraft [dimensionless]
                Nlim - limit load factor at zero fuel weight of the aircraft [dimensionless]
                TOW - maximum takeoff weight of the aircraft [kilograms]
                zfw - maximum zero fuel weight of the aircraft [kilograms]
                num_eng - number of engines on the aircraft [dimensionless]
                num_pax - number of passengers on the aircraft [dimensionless]
                wt_cargo - weight of the bulk cargo being carried on the aircraft [kilograms]
                num_seats - number of seats installed on the aircraft [dimensionless]
                ctrl - specifies if the control system is "fully powered", "partially powered", or not powered [dimensionless]
                ac - determines type of instruments, electronics, and operating items based on types: 
                    "short-range", "medium-range", "long-range", "business", "cargo", "commuter", "sst" [dimensionless]
                w2h - tail length (distance from the airplane c.g. to the horizontal tail aerodynamic center) [meters]
                
            fuselage - a data dictionary with the fields:
                area - fuselage wetted area [meters**2]
                diff_p - Maximum fuselage pressure differential [Pascal]
                width - width of the fuselage [meters]
                height - height of the fuselage [meters]
                length - length of the fuselage [meters]                     
            
            horizontal
                area - area of the horizontal tail [meters**2]
                span - span of the horizontal tail [meters]
                sweep - sweep of the horizontal tail [radians]
                mac - mean aerodynamic chord of the horizontal tail [meters]
                t_c - thickness-to-chord ratio of the horizontal tail [dimensionless]
                exposed - exposed area ratio for the horizontal tail [dimensionless]
            
            vertical
                area - area of the vertical tail [meters**2]
                span - sweight = weight * Units.lbpan of the vertical [meters]
                t_c - thickness-to-chord ratio of the vertical tail [dimensionless]
                sweep - sweep angle of the vertical tail [radians]
                t_tail - factor to determine if aircraft has a t-tail, "yes" [dimensionless]
    
        Outputs:
            output - a data dictionary with fields:
                wt_payload - weight of the passengers plus baggage and paid cargo [kilograms]
                wt_pax - weight of all the passengers [kilogram]
                wt_bag - weight of all the baggage [kilogram]
                wt_fuel - weight of the fuel carried[kilogram]
                wt_empty - operating empty weight of the aircraft [kilograms]
                
        Assumptions:
            calculated aircraft weight from correlations created per component of historical aircraft
    """

    # Unpack inputs
    #thrust_sls = vehicle.propulsors['Turbo Fan'].thrust.design

    S_gross_w = vehicle.reference_area
    #S_gross_w  = vehicle.wings['Main Wing'].Areas.reference
    b = vehicle.wings['Main Wing'].spans.projected
    lambda_w = vehicle.wings['Main Wing'].taper
    t_c_w = vehicle.wings['Main Wing'].thickness_to_chord
    sweep_w = vehicle.wings['Main Wing'].sweep
    mac_w = vehicle.wings['Main Wing'].chords.mean_aerodynamic
    wing_c_r = vehicle.wings['Main Wing'].chords.root

    Nult = vehicle.envelope.ultimate_load
    Nlim = vehicle.envelope.limit_load
    TOW = vehicle.mass_properties.max_takeoff
    wt_zf = vehicle.mass_properties.max_zero_fuel
    num_pax = vehicle.passengers
    wt_cargo = vehicle.mass_properties.cargo
    num_seats = vehicle.fuselages.Fuselage.number_coach_seats
    ctrl_type = vehicle.systems.control
    ac_type = vehicle.systems.accessories
    #l_w2h      = vehicle.wings['Horizontal Stabilizer'].position[0] + vehicle.wings['Horizontal Stabilizer'].aerodynamic_center[0] - vehicle.wings['Main Wing'].position[0] - vehicle.wings['Main Wing'].aerodynamic_center[0] #Need to check this is the length of the horizontal tail moment arm
    l_w2h = vehicle.w2h
    S_fus = vehicle.fuselages.Fuselage.areas.wetted
    diff_p_fus = vehicle.fuselages.Fuselage.differential_pressure
    w_fus = vehicle.fuselages.Fuselage.width
    h_fus = vehicle.fuselages.Fuselage.heights.maximum
    l_fus = vehicle.fuselages.Fuselage.lengths.total

    S_h = vehicle.wings['Horizontal Stabilizer'].areas.reference
    b_h = vehicle.wings['Horizontal Stabilizer'].spans.projected
    sweep_h = vehicle.wings['Horizontal Stabilizer'].sweep
    mac_h = vehicle.wings['Horizontal Stabilizer'].chords.mean_aerodynamic
    t_c_h = vehicle.wings['Horizontal Stabilizer'].thickness_to_chord
    h_tail_exposed = vehicle.wings[
        'Horizontal Stabilizer'].areas.exposed / vehicle.wings[
            'Horizontal Stabilizer'].areas.wetted

    S_v = vehicle.wings['Vertical Stabilizer'].areas.reference
    b_v = vehicle.wings['Vertical Stabilizer'].spans.projected
    t_c_v = vehicle.wings['Vertical Stabilizer'].thickness_to_chord
    sweep_v = vehicle.wings['Vertical Stabilizer'].sweep
    t_tail = vehicle.wings['Vertical Stabilizer'].t_tail

    # process
    # Calculating Empty Weight of Aircraft

    wt_wing = wing_main(S_gross_w, b, lambda_w, t_c_w, sweep_w, Nult, TOW,
                        wt_zf)
    wt_landing_gear = landing_gear(TOW)

    wt_propulsion = propulsor.mass_properties.mass
    wt_fuselage = tube(S_fus, diff_p_fus, w_fus, h_fus, l_fus, Nlim, wt_zf,
                       wt_wing, wt_propulsion, wing_c_r)
    output_2 = systems(num_seats, ctrl_type, S_h, S_v, S_gross_w, ac_type)
    wt_tail_horizontal = tail_horizontal(b_h, sweep_h, Nult, S_h, TOW, mac_w,
                                         mac_h, l_w2h, t_c_h, h_tail_exposed)
    output_3 = tail_vertical(S_v, Nult, b_v, TOW, t_c_v, sweep_v, S_gross_w,
                             t_tail)

    # Calculate the equipment empty weight of the aircraft
    wt_empty           = (wt_wing + wt_fuselage + wt_landing_gear + wt_propulsion + output_2.wt_systems + \
                          wt_tail_horizontal + output_3.wt_tail_vertical + output_3.wt_rudder)

    vehicle.wings['Main Wing'].mass_properties.mass = wt_wing
    vehicle.wings[
        'Horizontal Stabilizer'].mass_properties.mass = wt_tail_horizontal
    vehicle.wings[
        'Vertical Stabilizer'].mass_properties.mass = output_3.wt_tail_vertical + output_3.wt_rudder
    vehicle.fuselages.Fuselage.mass_properties.mass = wt_fuselage
    #vehicle.propulsors['Turbo Fan'].mass_properties.mass = wt_engine_jet

    # packup outputs
    output = payload(TOW, wt_empty, num_pax, wt_cargo)

    output.wing = wt_wing
    output.fuselage = wt_fuselage
    output.propulsion = wt_propulsion
    output.landing_gear = wt_landing_gear
    output.systems = output_2.wt_systems
    output.wt_furnish = output_2.wt_furnish
    output.horizontal_tail = wt_tail_horizontal
    output.vertical_tail = output_3.wt_tail_vertical
    output.rudder = output_3.wt_rudder

    return output
Exemple #3
0
def empty(vehicle):
    """ output = SUAVE.Methods.Weights.Correlations.Tube_Wing.empty(engine,wing,aircraft,fuselage,horizontal,vertical)
        This is for a standard Tube and Wing aircraft configuration.

        Inputs:
            engine - a data dictionary with the fields:
                thrust_sls - sea level static thrust of a single engine [Newtons]

            wing - a data dictionary with the fields:
                gross_area - wing gross area [meters**2]
                span - span of the wing [meters]
                taper - taper ratio of the wing [dimensionless]
                t_c - thickness-to-chord ratio of the wing [dimensionless]
                sweep - sweep angle of the wing [radians]
                mac - mean aerodynamic chord of the wing [meters]
                r_c - wing root chord [meters]

            aircraft - a data dictionary with the fields:
                Nult - ultimate load of the aircraft [dimensionless]
                Nlim - limit load factor at zero fuel weight of the aircraft [dimensionless]
                TOW - maximum takeoff weight of the aircraft [kilograms]
                zfw - maximum zero fuel weight of the aircraft [kilograms]
                num_eng - number of engines on the aircraft [dimensionless]
                num_pax - number of passengers on the aircraft [dimensionless]
                wt_cargo - weight of the bulk cargo being carried on the aircraft [kilograms]
                num_seats - number of seats installed on the aircraft [dimensionless]
                ctrl - specifies if the control system is "fully powered", "partially powered", or not powered [dimensionless]
                ac - determines type of instruments, electronics, and operating items based on types:
                    "short-range", "medium-range", "long-range", "business", "cargo", "commuter", "sst" [dimensionless]
                w2h - tail length (distance from the airplane c.g. to the horizontal tail aerodynamic center) [meters]

            fuselage - a data dictionary with the fields:
                area - fuselage wetted area [meters**2]
                diff_p - Maximum fuselage pressure differential [Pascal]
                width - width of the fuselage [meters]
                height - height of the fuselage [meters]
                length - length of the fuselage [meters]

            horizontal
                area - area of the horizontal tail [meters**2]
                span - span of the horizontal tail [meters]
                sweep - sweep of the horizontal tail [radians]
                mac - mean aerodynamic chord of the horizontal tail [meters]
                t_c - thickness-to-chord ratio of the horizontal tail [dimensionless]
                exposed - exposed area ratio for the horizontal tail [dimensionless]

            vertical
                area - area of the vertical tail [meters**2]
                span - sweight = weight * Units.lbpan of the vertical [meters]
                t_c - thickness-to-chord ratio of the vertical tail [dimensionless]
                sweep - sweep angle of the vertical tail [radians]
                t_tail - factor to determine if aircraft has a t-tail, "yes" [dimensionless]

        Outputs:
            output - a data dictionary with fields:
                wt_payload - weight of the passengers plus baggage and paid cargo [kilograms]
                wt_pax - weight of all the passengers [kilogram]
                wt_bag - weight of all the baggage [kilogram]
                wt_fuel - weight of the fuel carried[kilogram]
                wt_empty - operating empty weight of the aircraft [kilograms]

        Assumptions:
            calculated aircraft weight from correlations created per component of historical aircraft
    """

    # Unpack inputs
    Nult = vehicle.envelope.ultimate_load
    Nlim = vehicle.envelope.limit_load
    TOW = vehicle.mass_properties.max_takeoff
    wt_zf = vehicle.mass_properties.max_zero_fuel
    num_pax = vehicle.passengers
    wt_cargo = vehicle.mass_properties.cargo
    num_seats = vehicle.fuselages['fuselage'].number_coach_seats
    ctrl_type = vehicle.systems.control
    ac_type = vehicle.systems.accessories
    V_descent = 80.
    d_fus = vehicle.fuselages['fuselage'].effective_diameter

    propulsor_name = vehicle.propulsors.keys()[0]  # obtain the key for the propulsor for assignment purposes

    propulsors = vehicle.propulsors[propulsor_name]
    num_eng = propulsors.number_of_engines
    if propulsor_name == 'turbofan' or propulsor_name == 'Turbofan':
        # thrust_sls should be sea level static thrust. Using design thrust results in wrong propulsor
        # weight estimation. Engine sizing should return this value.
        # for now, using thrust_sls = design_thrust / 0.20, just for optimization evaluations
        thrust_sls = propulsors.sealevel_static_thrust
        wt_engine_jet = Propulsion.engine_jet(thrust_sls)
        # print wt_engine_jet
        # print "Test2"
        wt_propulsion = Propulsion.integrated_propulsion(wt_engine_jet, num_eng)
        propulsors.mass_properties.mass = wt_propulsion
        # print wt_propulsion

        d_eng = propulsors.nacelle_diameter

    else:  # propulsor used is not a turbo_fan; assume mass_properties defined outside model
        wt_propulsion = propulsors.mass_properties.mass

        if wt_propulsion == 0:
            warnings.warn("Propulsion mass= 0 ;e there is no Engine Weight being added to the Configuration",
                          stacklevel=1)

    S_gross_w = vehicle.reference_area
    # S_gross_w  = vehicle.wings['main_wing'].Areas.reference
    if not vehicle.wings.has_key('main_wing'):
        wt_wing = 0.0
        wing_c_r = 0.0
        warnings.warn("There is no Wing Weight being added to the Configuration", stacklevel=1)

    else:
        b = vehicle.wings['main_wing'].spans.projected
        lambda_w = vehicle.wings['main_wing'].taper
        t_c_w = vehicle.wings['main_wing'].thickness_to_chord
        sweep_w = vehicle.wings['main_wing'].sweep
        mac_w = vehicle.wings['main_wing'].chords.mean_aerodynamic
        wing_c_r = vehicle.wings['main_wing'].chords.root
        # print 'c_root =',wing_c_r
        wt_wing = wing_main(S_gross_w, b, lambda_w, t_c_w, sweep_w, Nult, TOW, wt_zf)
        vehicle.wings['main_wing'].mass_properties.mass = wt_wing

    S_fus = vehicle.fuselages['fuselage'].areas.wetted
    diff_p_fus = vehicle.fuselages['fuselage'].differential_pressure
    w_fus = vehicle.fuselages['fuselage'].width
    h_fus = vehicle.fuselages['fuselage'].heights.maximum
    l_fus = vehicle.fuselages['fuselage'].lengths.total

    if not vehicle.wings.has_key('horizontal_stabilizer'):
        wt_tail_horizontal = 0.0
        S_h = 0.0
        warnings.warn("There is no Horizontal Tail Weight being added to the Configuration", stacklevel=1)

    else:
        S_h = vehicle.wings['horizontal_stabilizer'].areas.reference
        b_h = vehicle.wings['horizontal_stabilizer'].spans.projected
        A_h = vehicle.wings['horizontal_stabilizer'].aspect_ratio
        sweep_h = vehicle.wings['horizontal_stabilizer'].sweep
        mac_h = vehicle.wings['horizontal_stabilizer'].chords.mean_aerodynamic
        c_r_h = vehicle.wings['horizontal_stabilizer'].chords.root
        t_c_h = vehicle.wings['horizontal_stabilizer'].thickness_to_chord
        # print 'c_r_h =',c_r_h
        taper_h = vehicle.wings['horizontal_stabilizer'].taper
        h_tail_exposed = vehicle.wings['horizontal_stabilizer'].areas.exposed / vehicle.wings[
            'horizontal_stabilizer'].areas.wetted
        l_w2h = vehicle.wings['horizontal_stabilizer'].origin[0] + \
                vehicle.wings['horizontal_stabilizer'].aerodynamic_center[0] - vehicle.wings['main_wing'].origin[0] - \
                vehicle.wings['main_wing'].aerodynamic_center[
                    0]  # Need to check this is the length of the horizontal tail moment arm
        # wt_tail_horizontal = tail_horizontal(b_h, sweep_h, Nult, S_h, TOW, mac_w, mac_h, l_w2h, t_c_h, h_tail_exposed)
        Sel = 0.15 * S_h
        wt_tail_horizontal = hor_tail(c_r_h, taper_h, l_w2h, Sel, S_h, A_h, b_h, sweep_h, TOW, Nult)
        vehicle.wings['horizontal_stabilizer'].mass_properties.mass = wt_tail_horizontal

    if not vehicle.wings.has_key('vertical_stabilizer'):
        output_3 = Data()
        output_3.wt_tail_vertical = 0.0
        output_3.wt_rudder = 0.0
        S_v = 0.0
        warnings.warn("There is no Vertical Tail Weight being added to the Configuration", stacklevel=1)

    else:
        S_v = vehicle.wings['vertical_stabilizer'].areas.reference
        b_v = vehicle.wings['vertical_stabilizer'].spans.projected
        A_v = vehicle.wings['vertical_stabilizer'].aspect_ratio
        t_c_v = vehicle.wings['vertical_stabilizer'].thickness_to_chord
        sweep_v = vehicle.wings['vertical_stabilizer'].sweep
        taper_v = vehicle.wings['vertical_stabilizer'].taper
        c_r_v = vehicle.wings['vertical_stabilizer'].chords.root
        mac_v = vehicle.wings['vertical_stabilizer'].chords.mean_aerodynamic
        t_tail = vehicle.wings['vertical_stabilizer'].t_tail
        output_3 = tail_vertical(S_v, Nult, b_v, TOW, t_c_v, sweep_v, S_gross_w, t_tail)
        wt_tail_vertical = vert_tail(S_v, b_v, c_r_v, taper_v, t_c_v, A_v, sweep_v, l_w2h, TOW)
        vehicle.wings['vertical_stabilizer'].mass_properties.mass = wt_tail_vertical
        # print 'b_v =',b_v
        # print 'c_r_v =',c_r_v
        # print 'c_t_v =',c_r_v*taper_v
        # vehicle.wings['vertical_stabilizer'].mass_properties.mass = output_3.wt_tail_vertical + output_3.wt_rudder

    # Calculating Empty Weight of Aircraft
    wt_landing_gear, gear, h_gear = landing_gear(TOW, d_eng, h_fus, V_descent)
    # print 'h_gear =', h_gear
    l_nose = vehicle.fuselages['fuselage'].lengths.nose
    l_center = vehicle.fuselages['fuselage'].lengths.cabin
    l_tail = vehicle.fuselages['fuselage'].lengths.tail
    S_cstot = 0.22 * mac_w * 0.6 * b * 1.5 + 0.3 * mac_v * 0.9 * b_v + 0.2 * mac_h * 0.9 * b_h  # 1.5 factor is because of assumed spoilers on wings
    Iy_SI = 1230140.7646609414  # kgm^2
    Vmax = 240  # m/s
    wt_fuselage = tube(S_fus, diff_p_fus, w_fus, h_fus, l_nose, l_center, l_tail, l_fus, Nlim, wt_zf, wt_wing,
                       wt_propulsion, wing_c_r, TOW, h_gear)
    # output_2 = systems(num_seats, ctrl_type, S_h, S_v, S_gross_w, ac_type)
    OEW = 109000  # kg #FIXME
    V_fuel = 69000 / 820  # m^3 #FIXME
    wt_engine_jet = 9000  # kg
    output_sys = classIIsys(num_eng, wt_engine_jet, V_fuel, Iy_SI, S_cstot, l_fus, OEW, TOW, Vmax, b)

    l_eng = 7  # m
    output_prop = propgroup(num_eng, wt_engine_jet, d_eng, l_eng, output_sys.w_fuelsys, output_sys.w_starter, Nult,
                            Vmax)
    wt_propulsion = output_prop.w_propulsion
    # Calculate the equipment empty weight of the aircraft
    wt_empty = (wt_wing + wt_fuselage + wt_landing_gear + wt_propulsion + output_sys.w_system +
                wt_tail_horizontal + output_3.wt_tail_vertical + output_3.wt_rudder)
    vehicle.fuselages['fuselage'].mass_properties.mass = wt_fuselage

    # packup outputs
    output = payload(TOW, wt_empty, num_pax, wt_cargo)
    output.wing = wt_wing
    output.fuselage = wt_fuselage
    output.propulsion = wt_propulsion
    output.landing_gear = wt_landing_gear
    output.horizontal_tail = wt_tail_horizontal
    output.vertical_tail = output_3.wt_tail_vertical
    output.rudder = output_3.wt_rudder
    output.systems = output_sys.w_system
    output.systems_breakdown = Data()
    output.systems_breakdown.control_systems = output_sys.w_flightcontrol
    output.systems_breakdown.apu = output_sys.w_apu
    output.systems_breakdown.hydraulics = output_sys.w_hydraullics
    # output.systems_breakdown.instruments = output_sys.wt_instruments
    output.systems_breakdown.avionics = output_sys.w_avionics
    # output.systems_breakdown.optionals = output_sys.wt_opitems
    output.systems_breakdown.electrical = output_sys.w_electrical
    output.systems_breakdown.air_conditioner = output_sys.w_env
    # output.systems_breakdown.furnish = output_2.wt_furnish

    # define weights components

    try:
        landing_gear_component = vehicle.landing_gear  # landing gear previously defined
    except AttributeError:  # landing gear not defined
        landing_gear_component = SUAVE.Components.Landing_Gear.Landing_Gear()
        vehicle.landing_gear = landing_gear_component

    control_systems = SUAVE.Components.Physical_Component()
    electrical_systems = SUAVE.Components.Physical_Component()
    passengers = SUAVE.Components.Physical_Component()
    # furnishings = SUAVE.Components.Physical_Component()
    air_conditioner = SUAVE.Components.Physical_Component()
    fuel = SUAVE.Components.Physical_Component()
    apu = SUAVE.Components.Physical_Component()
    hydraulics = SUAVE.Components.Physical_Component()
    # optionals = SUAVE.Components.Physical_Component()
    rudder = SUAVE.Components.Physical_Component()
    avionics = SUAVE.Components.Energy.Peripherals.Avionics()

    # assign output weights to objects
    landing_gear_component.mass_properties.mass = output.landing_gear
    control_systems.mass_properties.mass = output.systems_breakdown.control_systems
    electrical_systems.mass_properties.mass = output.systems_breakdown.electrical
    passengers.mass_properties.mass = output.pax + output.bag
    # furnishings.mass_properties.mass = output.systems_breakdown.furnish
    avionics.mass_properties.mass = output.systems_breakdown.avionics  # \
    # + output.systems_breakdown.instruments
    air_conditioner.mass_properties.mass = output.systems_breakdown.air_conditioner
    fuel.mass_properties.mass = output.fuel
    apu.mass_properties.mass = output.systems_breakdown.apu
    hydraulics.mass_properties.mass = output.systems_breakdown.hydraulics
    # optionals.mass_properties.mass = output.systems_breakdown.optionals
    rudder.mass_properties.mass = output.rudder

    # assign components to vehicle
    vehicle.control_systems = control_systems
    vehicle.electrical_systems = electrical_systems
    vehicle.avionics = avionics
    # vehicle.furnishings = furnishings
    vehicle.passenger_weights = passengers
    vehicle.air_conditioner = air_conditioner
    vehicle.fuel = fuel
    vehicle.apu = apu
    vehicle.hydraulics = hydraulics
    # vehicle.optionals = optionals
    vehicle.landing_gear = landing_gear_component
    vehicle.wings['vertical_stabilizer'].rudder = rudder

    return output
Exemple #4
0
def empty(vehicle):
    """ output = SUAVE.Methods.Weights.Correlations.Tube_Wing.empty(engine,wing,aircraft,fuselage,horizontal,vertical)
        This is for a standard Tube and Wing aircraft configuration.        

        Inputs:
            engine - a data dictionary with the fields:                    
                thrust_sls - sea level static thrust of a single engine [Newtons]

            wing - a data dictionary with the fields:
                gross_area - wing gross area [meters**2]
                span - span of the wing [meters]
                taper - taper ratio of the wing [dimensionless]
                t_c - thickness-to-chord ratio of the wing [dimensionless]
                sweep - sweep angle of the wing [radians]
                mac - mean aerodynamic chord of the wing [meters]
                r_c - wing root chord [meters]

            aircraft - a data dictionary with the fields:                    
                Nult - ultimate load of the aircraft [dimensionless]
                Nlim - limit load factor at zero fuel weight of the aircraft [dimensionless]
                TOW - maximum takeoff weight of the aircraft [kilograms]
                zfw - maximum zero fuel weight of the aircraft [kilograms]
                num_eng - number of engines on the aircraft [dimensionless]
                num_pax - number of passengers on the aircraft [dimensionless]
                wt_cargo - weight of the bulk cargo being carried on the aircraft [kilograms]
                num_seats - number of seats installed on the aircraft [dimensionless]
                ctrl - specifies if the control system is "fully powered", "partially powered", or not powered [dimensionless]
                ac - determines type of instruments, electronics, and operating items based on types: 
                    "short-range", "medium-range", "long-range", "business", "cargo", "commuter", "sst" [dimensionless]
                w2h - tail length (distance from the airplane c.g. to the horizontal tail aerodynamic center) [meters]

            fuselage - a data dictionary with the fields:
                area - fuselage wetted area [meters**2]
                diff_p - Maximum fuselage pressure differential [Pascal]
                width - width of the fuselage [meters]
                height - height of the fuselage [meters]
                length - length of the fuselage [meters]                     

            horizontal
                area - area of the horizontal tail [meters**2]
                span - span of the horizontal tail [meters]
                sweep - sweep of the horizontal tail [radians]
                mac - mean aerodynamic chord of the horizontal tail [meters]
                t_c - thickness-to-chord ratio of the horizontal tail [dimensionless]
                exposed - exposed area ratio for the horizontal tail [dimensionless]

            vertical
                area - area of the vertical tail [meters**2]
                span - sweight = weight * Units.lbpan of the vertical [meters]
                t_c - thickness-to-chord ratio of the vertical tail [dimensionless]
                sweep - sweep angle of the vertical tail [radians]
                t_tail - factor to determine if aircraft has a t-tail, "yes" [dimensionless]

        Outputs:
            output - a data dictionary with fields:
                wt_payload - weight of the passengers plus baggage and paid cargo [kilograms]
                wt_pax - weight of all the passengers [kilogram]
                wt_bag - weight of all the baggage [kilogram]
                wt_fuel - weight of the fuel carried[kilogram]
                wt_empty - operating empty weight of the aircraft [kilograms]

        Assumptions:
            calculated aircraft weight from correlations created per component of historical aircraft
    """

    # Unpack inputs
    Nult = vehicle.envelope.ultimate_load
    Nlim = vehicle.envelope.limit_load
    TOW = vehicle.mass_properties.max_takeoff
    wt_zf = vehicle.mass_properties.max_zero_fuel
    num_pax = vehicle.passengers
    wt_cargo = vehicle.mass_properties.cargo
    num_seats = vehicle.fuselages['fuselage'].number_coach_seats
    ctrl_type = vehicle.systems.control
    ac_type = vehicle.systems.accessories

    propulsor_name = vehicle.propulsors.keys()[
        0]  #obtain the key for the propulsor for assignment purposes

    propulsors = vehicle.propulsors[propulsor_name]
    num_eng = propulsors.number_of_engines
    if propulsor_name == 'turbofan' or propulsor_name == 'Turbofan':
        # thrust_sls should be sea level static thrust. Using design thrust results in wrong propulsor
        # weight estimation. Engine sizing should return this value.
        # for now, using thrust_sls = design_thrust / 0.20, just for optimization evaluations
        thrust_sls = propulsors.sealevel_static_thrust
        wt_engine_jet = Propulsion.engine_jet(thrust_sls)
        wt_propulsion = Propulsion.integrated_propulsion(
            wt_engine_jet, num_eng)
        propulsors.mass_properties.mass = wt_propulsion

    else:  #propulsor used is not a turbo_fan; assume mass_properties defined outside model
        wt_propulsion = propulsors.mass_properties.mass

        if wt_propulsion == 0:
            warnings.warn(
                "Propulsion mass= 0 ;e there is no Engine Weight being added to the Configuration",
                stacklevel=1)

    S_gross_w = vehicle.reference_area
    #S_gross_w  = vehicle.wings['main_wing'].Areas.reference
    if not vehicle.wings.has_key('main_wing'):
        wt_wing = 0.0
        wing_c_r = 0.0
        warnings.warn(
            "There is no Wing Weight being added to the Configuration",
            stacklevel=1)

    else:
        b = vehicle.wings['main_wing'].spans.projected
        lambda_w = vehicle.wings['main_wing'].taper
        t_c_w = vehicle.wings['main_wing'].thickness_to_chord
        sweep_w = vehicle.wings['main_wing'].sweep
        mac_w = vehicle.wings['main_wing'].chords.mean_aerodynamic
        wing_c_r = vehicle.wings['main_wing'].chords.root
        wt_wing = wing_main(S_gross_w, b, lambda_w, t_c_w, sweep_w, Nult, TOW,
                            wt_zf)
        vehicle.wings['main_wing'].mass_properties.mass = wt_wing

    S_fus = vehicle.fuselages['fuselage'].areas.wetted
    diff_p_fus = vehicle.fuselages['fuselage'].differential_pressure
    w_fus = vehicle.fuselages['fuselage'].width
    h_fus = vehicle.fuselages['fuselage'].heights.maximum
    l_fus = vehicle.fuselages['fuselage'].lengths.total

    if not vehicle.wings.has_key('horizontal_stabilizer'):
        wt_tail_horizontal = 0.0
        S_h = 0.0
        warnings.warn(
            "There is no Horizontal Tail Weight being added to the Configuration",
            stacklevel=1)

    else:
        S_h = vehicle.wings['horizontal_stabilizer'].areas.reference
        b_h = vehicle.wings['horizontal_stabilizer'].spans.projected
        sweep_h = vehicle.wings['horizontal_stabilizer'].sweep
        mac_h = vehicle.wings['horizontal_stabilizer'].chords.mean_aerodynamic
        t_c_h = vehicle.wings['horizontal_stabilizer'].thickness_to_chord
        h_tail_exposed = vehicle.wings[
            'horizontal_stabilizer'].areas.exposed / vehicle.wings[
                'horizontal_stabilizer'].areas.wetted
        l_w2h = vehicle.wings['horizontal_stabilizer'].origin[
            0] + vehicle.wings['horizontal_stabilizer'].aerodynamic_center[
                0] - vehicle.wings['main_wing'].origin[0] - vehicle.wings[
                    'main_wing'].aerodynamic_center[
                        0]  #Need to check this is the length of the horizontal tail moment arm
        wt_tail_horizontal = tail_horizontal(b_h, sweep_h, Nult, S_h, TOW,
                                             mac_w, mac_h, l_w2h, t_c_h,
                                             h_tail_exposed)
        vehicle.wings[
            'horizontal_stabilizer'].mass_properties.mass = wt_tail_horizontal

    if not vehicle.wings.has_key('vertical_stabilizer'):
        output_3 = Data()
        output_3.wt_tail_vertical = 0.0
        output_3.wt_rudder = 0.0
        S_v = 0.0
        warnings.warn(
            "There is no Vertical Tail Weight being added to the Configuration",
            stacklevel=1)

    else:
        S_v = vehicle.wings['vertical_stabilizer'].areas.reference
        b_v = vehicle.wings['vertical_stabilizer'].spans.projected
        t_c_v = vehicle.wings['vertical_stabilizer'].thickness_to_chord
        sweep_v = vehicle.wings['vertical_stabilizer'].sweep
        t_tail = vehicle.wings['vertical_stabilizer'].t_tail
        output_3 = tail_vertical(S_v, Nult, b_v, TOW, t_c_v, sweep_v,
                                 S_gross_w, t_tail)
        vehicle.wings[
            'vertical_stabilizer'].mass_properties.mass = output_3.wt_tail_vertical + output_3.wt_rudder

    # Calculating Empty Weight of Aircraft
    wt_landing_gear = landing_gear(TOW)
    wt_fuselage = tube(S_fus, diff_p_fus, w_fus, h_fus, l_fus, Nlim, wt_zf,
                       wt_wing, wt_propulsion, wing_c_r)
    output_2 = systems(num_seats, ctrl_type, S_h, S_v, S_gross_w, ac_type)

    # Calculate the equipment empty weight of the aircraft
    wt_empty           = (wt_wing + wt_fuselage + wt_landing_gear + wt_propulsion + output_2.wt_systems + \
                          wt_tail_horizontal + output_3.wt_tail_vertical + output_3.wt_rudder)
    vehicle.fuselages['fuselage'].mass_properties.mass = wt_fuselage

    # packup outputs
    output = payload(TOW, wt_empty, num_pax, wt_cargo)
    output.wing = wt_wing
    output.fuselage = wt_fuselage
    output.propulsion = wt_propulsion
    output.landing_gear = wt_landing_gear
    output.horizontal_tail = wt_tail_horizontal
    output.vertical_tail = output_3.wt_tail_vertical
    output.rudder = output_3.wt_rudder
    output.systems = output_2.wt_systems
    output.systems_breakdown = Data()
    output.systems_breakdown.control_systems = output_2.wt_flt_ctrl
    output.systems_breakdown.apu = output_2.wt_apu
    output.systems_breakdown.hydraulics = output_2.wt_hyd_pnu
    output.systems_breakdown.instruments = output_2.wt_instruments
    output.systems_breakdown.avionics = output_2.wt_avionics
    output.systems_breakdown.optionals = output_2.wt_opitems
    output.systems_breakdown.electrical = output_2.wt_elec
    output.systems_breakdown.air_conditioner = output_2.wt_ac
    output.systems_breakdown.furnish = output_2.wt_furnish

    #define weights components

    try:
        landing_gear_component = vehicle.landing_gear  #landing gear previously defined
    except AttributeError:  # landing gear not defined
        landing_gear_component = SUAVE.Components.Landing_Gear.Landing_Gear()
        vehicle.landing_gear = landing_gear_component

    control_systems = SUAVE.Components.Physical_Component()
    electrical_systems = SUAVE.Components.Physical_Component()
    passengers = SUAVE.Components.Physical_Component()
    furnishings = SUAVE.Components.Physical_Component()
    air_conditioner = SUAVE.Components.Physical_Component()
    fuel = SUAVE.Components.Physical_Component()
    apu = SUAVE.Components.Physical_Component()
    hydraulics = SUAVE.Components.Physical_Component()
    optionals = SUAVE.Components.Physical_Component()
    rudder = SUAVE.Components.Physical_Component()
    avionics = SUAVE.Components.Energy.Peripherals.Avionics()

    #assign output weights to objects
    landing_gear_component.mass_properties.mass = output.landing_gear
    control_systems.mass_properties.mass = output.systems_breakdown.control_systems
    electrical_systems.mass_properties.mass = output.systems_breakdown.electrical
    passengers.mass_properties.mass = output.pax + output.bag
    furnishings.mass_properties.mass = output.systems_breakdown.furnish
    avionics.mass_properties.mass                                    = output.systems_breakdown.avionics \
        + output.systems_breakdown.instruments
    air_conditioner.mass_properties.mass = output.systems_breakdown.air_conditioner
    fuel.mass_properties.mass = output.fuel
    apu.mass_properties.mass = output.systems_breakdown.apu
    hydraulics.mass_properties.mass = output.systems_breakdown.hydraulics
    optionals.mass_properties.mass = output.systems_breakdown.optionals
    rudder.mass_properties.mass = output.rudder

    #assign components to vehicle
    vehicle.control_systems = control_systems
    vehicle.electrical_systems = electrical_systems
    vehicle.avionics = avionics
    vehicle.furnishings = furnishings
    vehicle.passenger_weights = passengers
    vehicle.air_conditioner = air_conditioner
    vehicle.fuel = fuel
    vehicle.apu = apu
    vehicle.hydraulics = hydraulics
    vehicle.optionals = optionals
    vehicle.landing_gear = landing_gear_component
    vehicle.wings['vertical_stabilizer'].rudder = rudder

    return output
Exemple #5
0
def empty(vehicle):
    """ output = SUAVE.Methods.Weights.Correlations.Tube_Wing.empty(engine,wing,aircraft,fuselage,horizontal,vertical)
        Computes the empty weight breakdown of a General Aviation type aircraft  
        
        Inputs:
            engine - a data dictionary with the fields:                    
                thrust_sls - sea level static thrust of a single engine [Newtons]

            vehicle - a data dictionary with the fields:                    
                reference_area                                                            [meters**2]
                envelope - a data dictionary with the fields:
                    ultimate_load - ultimate load of the aircraft                         [dimensionless]
                    limit_load    - limit load factor at zero fuel weight of the aircraft [dimensionless]
                
                mass_properties - a data dictionary with the fields:
                    max_takeoff   - max takeoff weight of the vehicle           [kilograms]
                    max_zero_fuel - maximum zero fuel weight of the aircraft    [kilograms]
                    cargo         - cargo weight                                [kilograms]
                
                passengers - number of passengers on the aircraft               [dimensionless]
                        
                design_dynamic_pressure - dynamic pressure at cruise conditions [Pascal]
                design_mach_number      - mach number at cruise conditions      [dimensionless]
                
                propulsors - a data dictionary with the fields: 
                    keys           - identifier for the type of propulsor; different types have different fields
                        turbofan
                            thrust_sls - sealevel standard thrust                               [Newtons]             
                        internal_combustion
                            rated_power - maximum rated power of the internal combustion engine [Watts]
                        
                    number_engines - integer indicating the number of engines on the aircraft

                wt_cargo - weight of the bulk cargo being carried on the aircraft [kilograms]
                num_seats - number of seats installed on the aircraft [dimensionless]
                ctrl - specifies if the control system is "fully powered", "partially powered", or not powered [dimensionless]
                ac - determines type of instruments, electronics, and operating items based on types: 
                    "short-range", "medium-range", "long-range", "business", "cargo", "commuter", "sst" [dimensionless]
                w2h - tail length (distance from the airplane c.g. to the horizontal tail aerodynamic center) [meters]
                
                fuel - a data dictionary with the fields: 
                    mass_properties  - a data dictionary with the fields:
                        mass -mass of fuel [kilograms]
                    density          - gravimetric density of fuel                             [kilograms/meter**3]    
                    number_of_tanks  - number of external fuel tanks                           [dimensionless]
                    internal_volume  - internal fuel volume contained in the wing              [meters**3]
                wings - a data dictionary with the fields:    
                    wing - a data dictionary with the fields:
                        span                      - span of the wing                           [meters]
                        taper                     - taper ratio of the wing                    [dimensionless]
                        thickness_to_chord        - thickness-to-chord ratio of the wing       [dimensionless]
                        chords - a data dictionary with the fields:
                            mean_aerodynamic - mean aerodynamic chord of the wing              [meters]
                            root             - root chord of the wing                          [meters]
                            
                            
                        sweeps - a data dictionary with the fields:
                            quarter_chord - quarter chord sweep angle of the wing              [radians]
                        mac                       - mean aerodynamic chord of the wing         [meters]
                        r_c                       - wing root chord                            [meters]
                        origin  - location of the leading edge of the wing relative to the front of the fuselage                                      [meters,meters,meters]
                        aerodynamic_center - location of the aerodynamic center of the horizontal_stabilizer relative to the leading edge of the wing [meters,meters,meters]
        
                    
                    
                    
                    horizontal_stabilizer - a data dictionary with the fields:
                        areas -  a data dictionary with the fields:
                            reference - reference area of the horizontal stabilizer                                    [meters**2]
                            exposed  - exposed area for the horizontal tail                                            [meters**2]
                        taper   - taper ratio of the horizontal stabilizer                                             [dimensionless]
                        span    - span of the horizontal tail                                                          [meters]
                        sweeps - a data dictionary with the fields:
                            quarter_chord - quarter chord sweep angle of the horizontal stabilizer                     [radians]
                        chords - a data dictionary with the fields:
                            mean_aerodynamic - mean aerodynamic chord of the horizontal stabilizer                     [meters]         
                            root             - root chord of the horizontal stabilizer             
                        thickness_to_chord - thickness-to-chord ratio of the horizontal tail                           [dimensionless]
                        mac     - mean aerodynamic chord of the horizontal tail                                        [meters]
                        origin  - location of the leading of the horizontal tail relative to the front of the fuselage                                                 [meters,meters,meters]
                        aerodynamic_center - location of the aerodynamic center of the horizontal_stabilizer relative to the leading edge of the horizontal stabilizer [meters,meters,meters]
        
                    vertical - a data dictionary with the fields:
                        areas -  a data dictionary with the fields:
                            reference - reference area of the vertical stabilizer         [meters**2]
                        span    - span of the vertical tail                               [meters]
                        taper   - taper ratio of the horizontal stabilizer                [dimensionless]
                        t_c     - thickness-to-chord ratio of the vertical tail           [dimensionless]
                        sweeps   - a data dictionary with the fields:
                            quarter_chord - quarter chord sweep angle of the vertical stabilizer [radians]
                        t_tail - flag to determine if aircraft has a t-tail, "yes"               [dimensionless]


                
                fuselages - a data dictionary with the fields:  
                    fuselage - a data dictionary with the fields:
                        areas             - a data dictionary with the fields:
                            wetted - wetted area of the fuselage [meters**2]
                        differential_pressure  - Maximum fuselage pressure differential   [Pascal]
                        width             - width of the fuselage                         [meters]
                        heights - a data dictionary with the fields:
                            maximum - height of the fuselage                              [meters]
                        lengths-  a data dictionary with the fields:
                            structure - structural length of the fuselage                 [meters]                     
                        mass_properties - a data dictionary with the fields:
                            volume - total volume of the fuselage                         [meters**3]
                            internal_volume - internal volume of the fuselage             [meters**3]
                        number_coach_sets - number of seats on the aircraft               [dimensionless]    
                landing_gear - a data dictionary with the fields:
                    main - a data dictionary with the fields:
                        strut_length - strut length of the main gear                      [meters]
                    nose - a data dictionary with the fields:
                        strut_length - strut length of the nose gear                      [meters]
                avionics - a data dictionary, used to determine if avionics weight is calculated, don't include if vehicle has none
                air_conditioner - a data dictionary, used to determine if air conditioner weight is calculated, don't include if vehicle has none
        
        
        Outputs:
            output - a data dictionary with fields:
                wing - wing weight                            [kilograms]
                fuselage - fuselage weight                    [kilograms]
                propulsion - propulsion                       [kilograms]
                landing_gear_main - main gear weight          [kilograms]
                landing_gear_nose - nose gear weight          [kilograms]
                horizonal_tail - horizontal stabilizer weight [kilograms]
                vertical_tail - vertical stabilizer weight    [kilograms]
                systems - total systems weight                [kilograms]
                systems_breakdown - a data dictionary with fields:
                    control_systems - control systems weight  [kilograms]
                    hydraulics - hydraulics weight            [kilograms]
                    avionics - avionics weight                [kilograms]
                    electric - electrical systems weight      [kilograms]
                    air_conditioner - air conditioner weight  [kilograms]
                    furnish - furnishing weight               [kilograms]
                    fuel_system - fuel system weight          [ kilograms]
           Wing, empannage, fuselage, propulsion and individual systems masses updated with their calculated values
       Assumptions:
            calculated aircraft weight from correlations created per component of historical aircraft
        
    """     

    # Unpack inputs
    S_gross_w   = vehicle.reference_area
    fuel        = vehicle.fuel
    Nult        = vehicle.envelope.ultimate_load
    Nlim        = vehicle.envelope.limit_load
    TOW         = vehicle.mass_properties.max_takeoff
    wt_zf       = vehicle.mass_properties.max_zero_fuel
    num_pax     = vehicle.passengers
    wt_cargo    = vehicle.mass_properties.cargo

    q_c         = vehicle.design_dynamic_pressure
    mach_number = vehicle.design_mach_number

    propulsor_name = vehicle.propulsors.keys()[0] #obtain the key for the propulsor for assignment purposes
    propulsors     = vehicle.propulsors[propulsor_name]
    num_eng        = propulsors.number_of_engines

    if propulsor_name == 'turbofan':
        thrust_sls                       = propulsors.sealevel_static_thrust
        wt_engine_jet                    = Propulsion.engine_jet(thrust_sls)
        wt_propulsion                    = Propulsion.integrated_propulsion(wt_engine_jet,num_eng)
        propulsors.mass_properties.mass  = wt_propulsion 

    elif propulsor_name == 'internal_combustion':
        rated_power                      = propulsors.rated_power/num_eng
        wt_engine_piston                 = Propulsion.engine_piston(rated_power)
        wt_propulsion                    = Propulsion.integrated_propulsion_general_aviation(wt_engine_piston,num_eng)
        propulsors.mass_properties.mass  = wt_propulsion 

    else: #propulsor used is not an IC Engine or Turbofan; assume mass_properties defined outside model
        wt_propulsion                    = propulsors.mass_properties.mass
        if wt_propulsion==0:
            warnings.warn("Propulsion mass= 0 ;e there is no Engine Weight being added to the Configuration", stacklevel=1)    
    #find fuel volume
    if not vehicle.has_key('fuel'): 
        warnings.warn("fuel mass= 0 ; fuel system volume is calculated incorrectly ", stacklevel=1)   
        N_tank     = 0 
        V_fuel     = 0.
        V_fuel_int = 0.
      
    else:
        m_fuel                      = fuel.mass_properties.mass
        landing_weight              = TOW-m_fuel  #just assume this for now
        N_tank                      = fuel.number_of_tanks
        V_fuel_int                  = fuel.internal_volume #fuel in internal (as opposed to external tanks)
        V_fuel                      = m_fuel/fuel.density  #total fuel
        fuel.mass_properties.volume = V_fuel 

    #main wing
    if not vehicle.wings.has_key('main_wing'):
        wt_wing = 0.0
        wing_c_r = 0.0
        warnings.warn("There is no Wing Weight being added to the Configuration", stacklevel=1)

    else:
        b          = vehicle.wings['main_wing'].spans.projected
        AR_w       = (b**2.)/S_gross_w
        taper_w    = vehicle.wings['main_wing'].taper
        t_c_w      = vehicle.wings['main_wing'].thickness_to_chord
        sweep_w    = vehicle.wings['main_wing'].sweeps.quarter_chord
        mac_w      = vehicle.wings['main_wing'].chords.mean_aerodynamic
        wing_c_r   = vehicle.wings['main_wing'].chords.root
        #now run weight script for the wing
        wt_wing                                         = wing_main(S_gross_w, m_fuel, AR_w, sweep_w, q_c, taper_w, t_c_w,Nult,TOW)
        vehicle.wings['main_wing'].mass_properties.mass = wt_wing        
   
    if not vehicle.wings.has_key('horizontal_stabilizer'):
        wt_tail_horizontal = 0.0
        S_h = 0.0
        warnings.warn("There is no Horizontal Tail Weight being added to the Configuration", stacklevel=1)

    else:    
        S_h                = vehicle.wings['horizontal_stabilizer'].areas.reference
        b_h                = vehicle.wings['horizontal_stabilizer'].spans.projected
        AR_h               = (b_h**2.)/S_h
        taper_h            = vehicle.wings['horizontal_stabilizer'].spans.projected
        sweep_h            = vehicle.wings['horizontal_stabilizer'].sweeps.quarter_chord
        mac_h              = vehicle.wings['horizontal_stabilizer'].chords.mean_aerodynamic
        t_c_h              = vehicle.wings['horizontal_stabilizer'].thickness_to_chord
        l_w2h              = vehicle.wings['horizontal_stabilizer'].origin[0] + vehicle.wings['horizontal_stabilizer'].aerodynamic_center[0] - vehicle.wings['main_wing'].origin[0] - vehicle.wings['main_wing'].aerodynamic_center[0] #used for fuselage weight
        wt_tail_horizontal = tail_horizontal(S_h, AR_h, sweep_h, q_c, taper_h, t_c_h,Nult,TOW)                
        
        vehicle.wings['horizontal_stabilizer'].mass_properties.mass = wt_tail_horizontal        
    
    #vertical stabilizer
    if not vehicle.wings.has_key('vertical_stabilizer'):   
        output_3 = Data()
        output_3.wt_tail_vertical = 0.0

        S_v = 0.0
        warnings.warn("There is no Vertical Tail Weight being added to the Configuration", stacklevel=1)    

    else:     
        S_v        = vehicle.wings['vertical_stabilizer'].areas.reference
        b_v        = vehicle.wings['vertical_stabilizer'].spans.projected
        AR_v       = (b_v**2.)/S_v
        taper_v    = vehicle.wings['vertical_stabilizer'].taper
        t_c_v      = vehicle.wings['vertical_stabilizer'].thickness_to_chord
        sweep_v    = vehicle.wings['vertical_stabilizer'].sweeps.quarter_chord
        t_tail     = vehicle.wings['vertical_stabilizer'].t_tail  
        output_3   = tail_vertical(S_v, AR_v, sweep_v, q_c, taper_v, t_c_v, Nult,TOW,t_tail)
        
        vehicle.wings['vertical_stabilizer'].mass_properties.mass = output_3.wt_tail_vertical
    
    if not vehicle.has_key('fuselages.fuselage'):
        S_fus      = vehicle.fuselages['fuselage'].areas.wetted
        diff_p_fus = vehicle.fuselages['fuselage'].differential_pressure
        w_fus      = vehicle.fuselages['fuselage'].width
        h_fus      = vehicle.fuselages['fuselage'].heights.maximum
        l_fus      = vehicle.fuselages['fuselage'].lengths.structure
        V_fuse     = vehicle.fuselages['fuselage'].mass_properties.volume
        V_int      = vehicle.fuselages['fuselage'].mass_properties.internal_volume 
        num_seats  = vehicle.fuselages['fuselage'].number_coach_seats 
        #calculate fuselage weight
        wt_fuselage = fuselage(S_fus, Nult, TOW, w_fus, h_fus, l_fus, l_w2h, q_c, V_fuse, diff_p_fus)
    else:
        print 'got here'
        warnings.warn('There is no Fuselage weight being added to the vehicle', stacklevel=1)

    #landing gear
    if not vehicle.has_key('landing_gear'):
        warnings.warn('There is no Landing Gear weight being added to the vehicle', stacklevel=1)
        wt_landing_gear = Data()
        wt_landing_gear.main = 0.0
        wt_landing_gear.nose = 0.0

    else: 
        landing_gear_component = vehicle.landing_gear #landing gear previously defined
        strut_length_main      = landing_gear_component.main.strut_length
        strut_length_nose      = landing_gear_component.nose.strut_length
        wt_landing_gear        = landing_gear(landing_weight, Nult, strut_length_main, strut_length_nose)
        
        landing_gear_component.main.mass_properties.mass = wt_landing_gear.main
        landing_gear_component.nose.mass_properties.mass = wt_landing_gear.nose

    if not vehicle.has_key('avionics'):
        warnings.warn('There is no avionics weight being added to the vehicle; many weight correlations are dependant on this', stacklevel=1)
        avionics          = SUAVE.Components.Energy.Peripherals.Avionics()
        W_uav = 0.

    else:
        avionics = vehicle.avionics
        W_uav = avionics.mass_properties.uninstalled

    has_air_conditioner = 0
    if vehicle.has_key('air_conditioner'):
        has_air_conditioner = 1

    # Calculating Empty Weight of Aircraft
    output_2           = systems(W_uav,V_fuel, V_fuel_int, N_tank, num_eng, l_fus, b, TOW, Nult, num_seats, mach_number, has_air_conditioner)

    # Calculate the equipment empty weight of the aircraft

    wt_empty           = (wt_wing + wt_fuselage + wt_landing_gear.main+wt_landing_gear.nose + wt_propulsion + output_2.wt_systems + \
                          wt_tail_horizontal + output_3.wt_tail_vertical) 
    vehicle.fuselages['fuselage'].mass_properties.mass = wt_fuselage

    # packup outputs
    output                   = payload(TOW, wt_empty, num_pax,wt_cargo)
    output.wing              = wt_wing
    output.fuselage          = wt_fuselage
    output.propulsion        = wt_propulsion
    output.landing_gear_main = wt_landing_gear.main
    output.landing_gear_nose = wt_landing_gear.nose
    output.horizontal_tail   = wt_tail_horizontal
    output.vertical_tail     = output_3.wt_tail_vertical

    output.systems           = output_2.wt_systems       
    output.systems_breakdown = Data()
    output.systems_breakdown.control_systems   = output_2.wt_flt_ctrl        
    output.systems_breakdown.hydraulics        = output_2.wt_hyd_pnu     
    output.systems_breakdown.avionics          = output_2.wt_avionics    
    output.systems_breakdown.electrical        = output_2.wt_elec        
    output.systems_breakdown.air_conditioner   = output_2.wt_ac          
    output.systems_breakdown.furnish           = output_2.wt_furnish    
    output.systems_breakdown.fuel_system       = output_2.wt_fuel_sys
    #define weights components

    control_systems   = SUAVE.Components.Physical_Component()
    electrical_systems= SUAVE.Components.Physical_Component()
    passengers        = SUAVE.Components.Physical_Component()
    furnishings       = SUAVE.Components.Physical_Component()
  
    apu               = SUAVE.Components.Physical_Component()
    hydraulics        = SUAVE.Components.Physical_Component()

    #assign output weights to objects
    control_systems.mass_properties.mass                             = output.systems_breakdown.control_systems
    electrical_systems.mass_properties.mass                          = output.systems_breakdown.electrical
    passengers.mass_properties.mass                                  = output.pax + output.bag
    furnishings.mass_properties.mass                                 = output.systems_breakdown.furnish
    avionics.mass_properties.mass                                    = output.systems_breakdown.avionics              
    hydraulics.mass_properties.mass                                  = output.systems_breakdown.hydraulics

    if has_air_conditioner:
        vehicle.air_conditioner.mass_properties.mass                 = output.systems_breakdown.air_conditioner

    #assign components to vehicle
    vehicle.control_systems                     = control_systems
    vehicle.electrical_systems                  = electrical_systems
    vehicle.avionics                            = avionics
    vehicle.furnishings                         = furnishings
    vehicle.passenger_weights                   = passengers 
   
    vehicle.apu                                 = apu
    vehicle.hydraulics                          = hydraulics
    vehicle.landing_gear                        = landing_gear_component

    #note; air conditioner optional, and weight is added to the air_conditioner object directly
    return output