当前位置: 首页>>代码示例>>Python>>正文


Python Data.weights方法代码示例

本文整理汇总了Python中SUAVE.Core.Data.weights方法的典型用法代码示例。如果您正苦于以下问题:Python Data.weights方法的具体用法?Python Data.weights怎么用?Python Data.weights使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SUAVE.Core.Data的用法示例。


在下文中一共展示了Data.weights方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: fuel_for_missions

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import weights [as 别名]
def fuel_for_missions(interface):

    # unpack data
    config   = interface.configs.cruise
    analyses = interface.analyses

    mission         = interface.analyses.missions.fuel.mission
    mission_payload = interface.analyses.missions.fuel.payload
    
    # determine maximum range based in tow short_field
    from SUAVE.Methods.Performance import size_mission_range_given_weights
    
    # unpack
    cruise_segment_tag = 'cruise'
    
    weight_max    = config.mass_properties.max_takeoff
    weight_min    = config.mass_properties.operating_empty + 0.10 * mission_payload  # 10%
    
    takeoff_weight_vec  = np.linspace(weight_min,weight_max,3)
    distance_vec        = np.zeros_like(takeoff_weight_vec)
    fuel_vec            = np.zeros_like(takeoff_weight_vec)
    
    # call function
    distance_vec,fuel_vec = size_mission_range_given_weights(config,mission,cruise_segment_tag,mission_payload,takeoff_weight_vec)

    # pack 
    results = Data()
    results.tag            = 'missions_fuel'
    results.weights        = takeoff_weight_vec
    results.distances      = distance_vec
    results.fuels          = fuel_vec
    
##    print results
    
    return results
开发者ID:aerialhedgehog,项目名称:SUAVE,代码行数:37,代码来源:optimization_interface.py

示例2: setup

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import weights [as 别名]
def setup():
    # ------------------------------------------------------------------
    #   Analysis Procedure
    # ------------------------------------------------------------------ 

    # size the base config
    procedure = Data()
    procedure.simple_sizing = simple_sizing

    # find the weights
    procedure.weights = weight

    # AVL Analysis to create surrogate model

    # finalizes the data dependencies
    procedure.finalize = finalize

    # performance studies
    procedure.missions = Process()
    procedure.missions.design_mission = design_mission

    # # Noise evaluation
    # procedure.noise = Process()
    # procedure.noise.sideline_init = noise_sideline_init
    # procedure.noise.takeoff_init = noise_takeoff_init
    # procedure.noise.noise_sideline = noise_sideline
    # procedure.noise.noise_flyover = noise_flyover
    # procedure.noise.noise_approach = noise_approach

    # post process the results
    procedure.post_process = post_process

    # done!
    return procedure
开发者ID:lukekulik,项目名称:saga-one,代码行数:36,代码来源:Procedure.py

示例3: setup

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import weights [as 别名]
def setup():
    
    # ------------------------------------------------------------------
    #   Analysis Procedure
    # ------------------------------------------------------------------ 
    
    # size the base config
    procedure = Data()
    procedure.initial_sizing = initial_sizing
    procedure.weights = weight
    procedure.weights_sizing = weights_sizing
    procedure.estimate_clmax = estimate_clmax
    
    # find the weights
    # finalizes the data dependencies
    procedure.finalize = finalize   
    
    # Noise evaluation
    procedure.noise                   = Process()
    procedure.noise.sideline_init     = noise_sideline_init
    procedure.noise.takeoff_init      = noise_takeoff_init
    procedure.noise.noise_sideline    = noise_sideline
    procedure.noise.noise_flyover     = noise_flyover
    procedure.noise.noise_approach    = noise_approach 
  
    # post process the results
    procedure.post_process = post_process
        
    # done!
    return procedure
开发者ID:Alexandrovich,项目名称:SUAVE,代码行数:32,代码来源:Procedure.py

示例4: vehicle_setup

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import weights [as 别名]
def vehicle_setup():
    vehicle = SUAVE.Vehicle()
    vehicle.mass_properties.max_takeoff  = 4727*Units.kg #from Wikipedia
    vehicle.mass_properties.empty        = 2515*Units.kg
    vehicle.mass_properties.max_zero_fuel=vehicle.mass_properties.max_takeoff-vehicle.mass_properties.empty+15.*225*Units.lbs #15 passenger ac
    
    wing = SUAVE.Components.Wings.Wing()
    wing.tag = 'main_wing'
    wing.areas.reference           = 280.0 * Units.feet**2
    wing.spans.projected           = 46.0  * Units.feet
    wing.chords.mean_aerodynamic   = 6.5 * Units.feet
    wing.chords.root               = 7.9 * Units.feet
    wing.sweeps.leading_edge       = 4.0   * Units.deg # Same as the quarter chord sweep (ignore why EMB)
    wing.sweeps.quarter_chord      = 4.0   * Units.deg # Leading edge
    wing.taper                     = 0.47
    wing.aspect_ratio              = wing.spans.projected**2/wing.areas.reference
    wing.symmetric                 = True
    wing.vertical                  = False
    wing.origin                    = np.array([15.,0,0]) * Units.feet  
    wing.aerodynamic_center        = np.array([trapezoid_ac_x(wing), 0. , 0. ])
    wing.dynamic_pressure_ratio    = 1.0
    wing.ep_alpha                  = 0.0
    span_location_mac                        =compute_span_location_from_chord_length(wing, wing.chords.mean_aerodynamic)
    mac_le_offset                            =.8*np.sin(wing.sweeps.leading_edge)*span_location_mac  #assume that 80% of the chord difference is from leading edge sweep
    wing.mass_properties.center_of_gravity[0]=.3*wing.chords.mean_aerodynamic+mac_le_offset
    
    
    
    
    
    Mach = np.array([0.152])
    reference = SUAVE.Core.Container()
    conditions = Data()
    conditions.lift_curve_slope = datcom(wing,Mach)
    
    conditions.weights=Data()
    conditions.weights.total_mass=np.array([[vehicle.mass_properties.max_takeoff]]) 
   
    wing.CL_alpha               = conditions.lift_curve_slope
    vehicle.reference_area      = wing.areas.reference
    vehicle.append_component(wing)
    
    main_wing_CLa = wing.CL_alpha
    main_wing_ar  = wing.aspect_ratio
    
    wing = SUAVE.Components.Wings.Wing()
    wing.tag                      = 'horizontal_stabilizer'
    wing.areas.reference          = 100.5 * Units.feet**2
    wing.spans.projected          = 22.5  * Units.feet
    wing.sweeps.leading_edge      = 21.0   * Units.deg # Same as the quarter chord sweep (ignore why EMB)
    wing.sweeps.quarter_chord     = 21.0   * Units.deg # leading edge
    wing.taper                    = 3.1/6.17
    wing.aspect_ratio             = wing.spans.projected**2/wing.areas.reference
    wing.origin                   = np.array([36.3,0,0])  * Units.feet
    wing.symmetric                = True
    wing.vertical                 = False
    wing.dynamic_pressure_ratio   = 0.95
    wing.ep_alpha                 = 2.0*main_wing_CLa/np.pi/main_wing_ar
    wing.aerodynamic_center       = np.array([trapezoid_ac_x(wing), 0.0, 0.0])
    wing.CL_alpha                 = datcom(wing,Mach)
    vehicle.append_component(wing)
    
    fuselage = SUAVE.Components.Fuselages.Fuselage()
    fuselage.tag                  = 'fuselage'
    fuselage.x_root_quarter_chord = 5.4 * Units.feet
    fuselage.lengths.total        = 44.0  * Units.feet
    fuselage.width                = 5.4   * Units.feet 
    vehicle.append_component(fuselage)
    
    vehicle.mass_properties.center_of_gravity = np.array([17.2,0,0]) * Units.feet   
    
    fuel                                                     =SUAVE.Components.Physical_Component()
    fuel.origin                                              =wing.origin
    fuel.mass_properties.center_of_gravity                   =wing.mass_properties.center_of_gravity
    fuel.mass_properties.mass                                =vehicle.mass_properties.max_takeoff-vehicle.mass_properties.max_zero_fuel
   
    
    
    #find zero_fuel_center_of_gravity
    cg                   =vehicle.mass_properties.center_of_gravity
    MTOW                 =vehicle.mass_properties.max_takeoff
    fuel_cg              =fuel.origin+fuel.mass_properties.center_of_gravity
    fuel_mass            =fuel.mass_properties.mass

    
    sum_moments_less_fuel=(cg*MTOW-fuel_cg*fuel_mass)
    vehicle.fuel = fuel
    vehicle.mass_properties.zero_fuel_center_of_gravity = sum_moments_less_fuel/vehicle.mass_properties.max_zero_fuel
    return vehicle
开发者ID:michK,项目名称:SUAVE,代码行数:91,代码来源:Beech_99.py

示例5: main

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import weights [as 别名]
def main():
    #Parameters Required
    #Using values for a Boeing 747-200  
    vehicle = SUAVE.Vehicle()
    #print vehicle
    vehicle.mass_properties.max_zero_fuel=238780*Units.kg
    vehicle.mass_properties.max_takeoff  =785000.*Units.lbs
    wing = SUAVE.Components.Wings.Wing()
    wing.tag = 'main_wing'
    wing.areas.reference           = 5500.0 * Units.feet**2
    wing.spans.projected           = 196.0  * Units.feet
    wing.chords.mean_aerodynamic   = 27.3 * Units.feet
    wing.chords.root               = 42.9 * Units.feet  #54.5ft
    wing.sweep          = 42.0   * Units.deg # Leading edge
    wing.taper          = 14.7/42.9  #14.7/54.5
    wing.aspect_ratio   = wing.spans.projected**2/wing.areas.reference
    wing.symmetric      = True
    wing.vertical       = False
    wing.origin         = np.array([58.6,0,0]) * Units.feet  
    wing.aerodynamic_center     = np.array([112.2*Units.feet,0.,0.])-wing.origin#16.16 * Units.meters,0.,0,])
    wing.dynamic_pressure_ratio = 1.0
    wing.ep_alpha               = 0.0
    
    span_location_mac                        =compute_span_location_from_chord_length(wing, wing.chords.mean_aerodynamic)
    mac_le_offset                            =.8*np.sin(wing.sweep)*span_location_mac  #assume that 80% of the chord difference is from leading edge sweep
    wing.mass_properties.center_of_gravity[0]=.3*wing.chords.mean_aerodynamic+mac_le_offset
    
    
    Mach                         = np.array([0.198])
    conditions                   = Data()
    conditions.weights           = Data()
    conditions.lift_curve_slope  = datcom(wing,Mach)
    conditions.weights.total_mass=np.array([[vehicle.mass_properties.max_takeoff]]) 
   
    wing.CL_alpha                = conditions.lift_curve_slope
    vehicle.reference_area       = wing.areas.reference
    vehicle.append_component(wing)
    
    main_wing_CLa = wing.CL_alpha
    main_wing_ar  = wing.aspect_ratio
    
    wing                     = SUAVE.Components.Wings.Wing()
    wing.tag = 'horizontal_stabilizer'
    wing.areas.reference     = 1490.55* Units.feet**2
    wing.spans.projected     = 71.6   * Units.feet
    wing.sweep               = 44.0   * Units.deg # leading edge
    wing.taper               = 7.5/32.6
    wing.aspect_ratio        = wing.spans.projected**2/wing.areas.reference
    wing.origin              = np.array([187.0,0,0])  * Units.feet
    wing.symmetric           = True
    wing.vertical            = False
    wing.dynamic_pressure_ratio = 0.95
    wing.ep_alpha            = 2.0*main_wing_CLa/np.pi/main_wing_ar    
    wing.aerodynamic_center  = [trapezoid_ac_x(wing), 0.0, 0.0]
    wing.CL_alpha            = datcom(wing,Mach)
    vehicle.append_component(wing)
    
    fuselage = SUAVE.Components.Fuselages.Fuselage()
    fuselage.tag = 'fuselage'
    fuselage.x_root_quarter_chord = 77.0 * Units.feet
    fuselage.lengths.total     = 229.7  * Units.feet
    fuselage.width      = 20.9   * Units.feet 
    vehicle.append_component(fuselage)
    vehicle.mass_properties.center_of_gravity=np.array([112.2,0,0]) * Units.feet  
    
    
    
 
    #configuration.mass_properties.zero_fuel_center_of_gravity=np.array([76.5,0,0])*Units.feet #just put a number here that got the expected value output; may want to change
    fuel                                                     =SUAVE.Components.Physical_Component()
    fuel.origin                                              =wing.origin
    fuel.mass_properties.center_of_gravity                   =wing.mass_properties.center_of_gravity
    fuel.mass_properties.mass                                =vehicle.mass_properties.max_takeoff-vehicle.mass_properties.max_zero_fuel
   
    
    #find zero_fuel_center_of_gravity
    cg                   =vehicle.mass_properties.center_of_gravity
    MTOW                 =vehicle.mass_properties.max_takeoff
    fuel_cg              =fuel.origin+fuel.mass_properties.center_of_gravity
    fuel_mass            =fuel.mass_properties.mass
    
    
    sum_moments_less_fuel=(cg*MTOW-fuel_cg*fuel_mass)
    
    
    #now define configuration for calculation
    configuration = Data()
    configuration.mass_properties                            = Data()
    configuration.mass_properties.center_of_gravity          = vehicle.mass_properties.center_of_gravity
    configuration.mass_properties.max_zero_fuel              =vehicle.mass_properties.max_zero_fuel
    configuration.fuel                                       =fuel
    
    configuration.mass_properties.zero_fuel_center_of_gravity=sum_moments_less_fuel/vehicle.mass_properties.max_zero_fuel
  
    
    #print configuration
    cm_a = taw_cmalpha(vehicle,Mach,conditions,configuration)
    expected =-1.56222373 #Should be -1.45
    error = Data()
    error.cm_a_747 = (cm_a - expected)/expected
#.........这里部分代码省略.........
开发者ID:Alexandrovich,项目名称:SUAVE,代码行数:103,代码来源:cmalpha.py

示例6: main

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import weights [as 别名]
def main():

    from Boeing_747 import vehicle_setup, configs_setup
    vehicle = vehicle_setup()
    configs = configs_setup(vehicle)
    Mach                          = np.array([0.198])
    
    #conditions object used to create mission-like structure
    conditions                    = Data()
    conditions.weights            = Data()
    conditions.lift_curve_slope   = configs.base.wings['main_wing'].CL_alpha 
    conditions.weights.total_mass = np.array([[vehicle.mass_properties.max_takeoff]]) 
    conditions.aerodynamics       = Data()
    conditions.aerodynamics.angle_of_attack = 0.
   
    #print configuration
    cm_a           = taw_cmalpha(vehicle,Mach,conditions,configs.base)[0]
    expected       = -1.56222373 #Should be -1.45
    error          = Data()
    error.cm_a_747 = (cm_a - expected)/expected
    
    
    from Beech_99 import vehicle_setup, configs_setup
    vehicle = vehicle_setup()
    configs = configs_setup(vehicle)
    Mach    = np.array([0.152])
    
    #conditions object used to create mission-like structure
    conditions                    = Data()
    conditions.weights            = Data()
    conditions.lift_curve_slope   = configs.base.wings['main_wing'].CL_alpha 
    conditions.weights.total_mass = np.array([[vehicle.mass_properties.max_takeoff]]) 
    conditions.aerodynamics       = Data()
    conditions.aerodynamics.angle_of_attack = 0.    
   
    
    #Method Test   
    #print configuration
    cm_a = taw_cmalpha(vehicle,Mach,conditions,configs.base)[0]
    expected = -2.48843437 #Should be -2.08
    error.cm_a_beech_99 = (cm_a - expected)/expected   
    
    
    from SIAI_Marchetti_S211 import vehicle_setup, configs_setup
    vehicle = vehicle_setup()
    configs = configs_setup(vehicle)
    Mach                          = np.array([0.111])
    #conditions object used to create mission-like structure
    conditions                    = Data()
    conditions.weights            = Data()
    conditions.lift_curve_slope   = configs.base.wings['main_wing'].CL_alpha 
    conditions.weights.total_mass = np.array([[vehicle.mass_properties.max_takeoff]]) 
    conditions.aerodynamics       = Data()
    conditions.aerodynamics.angle_of_attack = 0.    
   
    
    
    cm_a = taw_cmalpha(vehicle,Mach,conditions,configs.base)[0]
   
    expected = -0.54071741 #Should be -0.6
    error.cm_a_SIAI = (cm_a - expected)/expected
    print error
    for k,v in error.items():
        assert(np.abs(v)<0.01)
        
    return
开发者ID:michK,项目名称:SUAVE,代码行数:68,代码来源:cmalpha.py

示例7: vehicle_setup

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import weights [as 别名]
def vehicle_setup():

    vehicle = SUAVE.Vehicle()
    
    #print vehicle
    vehicle.mass_properties.max_zero_fuel=238780*Units.kg
    vehicle.mass_properties.max_takeoff  =785000.*Units.lbs
    
    # ------------------------------------------------------------------        
    #   Main Wing
    # ------------------------------------------------------------------        

    wing = SUAVE.Components.Wings.Main_Wing()
    wing.tag = 'main_wing'
    wing.areas.reference           = 5500.0 * Units.feet**2
    wing.spans.projected           = 196.0  * Units.feet
    wing.chords.mean_aerodynamic   = 27.3   * Units.feet
    wing.chords.root               = 42.9   * Units.feet  #54.5ft
    wing.chords.tip                = 14.7   * Units.feet
    wing.sweeps.quarter_chord      = 42.0   * Units.deg  # Leading edge
    wing.sweeps.leading_edge       = 42.0   * Units.deg  # Same as the quarter chord sweep (ignore why EMB)
    wing.taper                     = wing.chords.tip / wing.chords.root
    
    wing.aspect_ratio              = wing.spans.projected**2/wing.areas.reference
    wing.symmetric      = True
    wing.vertical       = False
    wing.origin         = np.array([58.6,0,3.6]) * Units.feet  
    wing.aerodynamic_center     = np.array([112.2*Units.feet,0.,0.])-wing.origin#16.16 * Units.meters,0.,0,])
    wing.dynamic_pressure_ratio = 1.0
    wing.ep_alpha               = 0.0
    
    span_location_mac                         = compute_span_location_from_chord_length(wing, wing.chords.mean_aerodynamic)
    mac_le_offset                             = .8*np.sin(wing.sweeps.leading_edge)*span_location_mac  #assume that 80% of the chord difference is from leading edge sweep
    wing.mass_properties.center_of_gravity[0] = .3*wing.chords.mean_aerodynamic+mac_le_offset
    
    
    Mach                         = np.array([0.198])
    conditions                   = Data()
    conditions.weights           = Data()
    conditions.lift_curve_slope  = datcom(wing,Mach)
    conditions.weights.total_mass=np.array([[vehicle.mass_properties.max_takeoff]]) 
   
    wing.CL_alpha                = conditions.lift_curve_slope
    vehicle.reference_area       = wing.areas.reference
    vehicle.append_component(wing)
    
    main_wing_CLa = wing.CL_alpha
    main_wing_ar  = wing.aspect_ratio
    
    # ------------------------------------------------------------------        
    #  Horizontal Stabilizer
    # ------------------------------------------------------------------        
    
    
    wing                        = SUAVE.Components.Wings.Wing()
    wing.tag                    = 'horizontal_stabilizer'
    wing.areas.reference        = 1490.55* Units.feet**2
    wing.spans.projected        = 71.6   * Units.feet
    wing.sweeps.quarter_chord   = 44.0   * Units.deg # leading edge
    wing.sweeps.leading_edge    = 44.0   * Units.deg # Same as the quarter chord sweep (ignore why EMB)
    wing.taper                  = 7.5/32.6
    wing.aspect_ratio           = wing.spans.projected**2/wing.areas.reference
    wing.origin                 = np.array([187.0,0,0])  * Units.feet
    wing.symmetric              = True
    wing.vertical               = False
    wing.dynamic_pressure_ratio = 0.95
    wing.ep_alpha               = 2.0*main_wing_CLa/np.pi/main_wing_ar    
    wing.aerodynamic_center     = [trapezoid_ac_x(wing), 0.0, 0.0]
    wing.CL_alpha               = datcom(wing,Mach)
    vehicle.append_component(wing)
    
    # ------------------------------------------------------------------
    #   Vertical Stabilizer
    # ------------------------------------------------------------------
    
    wing = SUAVE.Components.Wings.Wing()
    wing.tag                  = 'vertical_stabilizer'
    wing.spans.exposed        = 32.4  * Units.feet
    wing.chords.root          = 38.7  * Units.feet      # vertical.chords.fuselage_intersect
    wing.chords.tip           = 13.4  * Units.feet
    wing.sweeps.quarter_chord = 50.0  * Units.deg # Leading Edge
    wing.x_root_LE1           = 180.0 * Units.feet
    wing.symmetric            = False
    wing.exposed_root_chord_offset = 13.3   * Units.feet
    wing                      = extend_to_ref_area(wing)
 
    wing.areas.reference        = wing.extended.areas.reference
    wing.spans.projected        = wing.extended.spans.projected
    wing.chords.root            = 14.9612585185
    dx_LE_vert                  = wing.extended.root_LE_change
    wing.taper                  = 0.272993077083
    wing.origin                 = np.array([wing.x_root_LE1 + dx_LE_vert,0.,0.])
    wing.aspect_ratio           = (wing.spans.projected**2)/wing.areas.reference
    wing.effective_aspect_ratio = 2.2
    wing.symmetric              = False
    wing.aerodynamic_center     = np.array([trapezoid_ac_x(wing),0.0,0.0])
    wing.dynamic_pressure_ratio = .95
    Mach                        = np.array([0.198])
    wing.CL_alpha               = 0.
    wing.ep_alpha               = 0.
#.........这里部分代码省略.........
开发者ID:michK,项目名称:SUAVE,代码行数:103,代码来源:Boeing_747.py


注:本文中的SUAVE.Core.Data.weights方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。