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


Python Data.mass_properties方法代码示例

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


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

示例1: datcom

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import mass_properties [as 别名]
 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)
 
 configuration = Data()
 configuration.mass_properties = Data()
 configuration.mass_properties.center_of_gravity = Data()
 configuration.mass_properties.center_of_gravity = np.array([112.2,0,0]) * Units.feet  
 
 #Method Test
 print '<<Test run of the taw_cmalpha() method>>'
 print 'Boeing 747 at Mach {0}'.format(Mach[0])
 
 cm_a = taw_cmalpha(vehicle,Mach,conditions,configuration)
 
 expected = -1.45
 print 'Cm_alpha       = {0:.4f}'.format(cm_a[0])
 print 'Expected value = {}'.format(expected)
 print 'Percent Error  = {0:.2f}%'.format(100.0*(cm_a[0]-expected)/expected)
 print 'Static Margin  = {0:.4f}'.format(-cm_a[0]/vehicle.wings['main_wing'].CL_alpha[0])
 print ' '
开发者ID:michK,项目名称:SUAVE,代码行数:33,代码来源:taw_cmalpha.py

示例2: main

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import mass_properties [as 别名]
def main():
    #Parameters Required
    #Using values for a Boeing 747-200 
    vehicle = SUAVE.Vehicle()
    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.sweep       = 42.0   * Units.deg # Leading edge
    wing.taper          = 14.7/54.5
    wing.aspect_ratio   = wing.spans.projected**2/wing.areas.reference
    wing.symmetric      = True
    wing.origin           = np.array([58.6,0,0]) * Units.feet  
    wing.aerodynamic_center  = np.array([112., 0. , 0. ]) * Units.feet- wing.origin
    wing.eta            = 1.0
    wing.downwash_adj   = 1.0
    wing.ep_alpha       = 1. - wing.downwash_adj
    
    Mach                    = np.array([0.198])
    reference               = SUAVE.Core.Container()
    conditions = Data()
    conditions.lift_curve_slope = datcom(wing,Mach)
    wing.CL_alpha = conditions.lift_curve_slope
    vehicle.reference_area   = wing.areas.reference
    vehicle.append_component(wing)
    
    lifting_surfaces    = []
    lifting_surfaces.append(wing)
    
    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.eta      = 0.95
    wing.downwash_adj = 1.0 - 2.0*vehicle.wings['main_wing'].CL_alpha/np.pi/wing.aspect_ratio
    wing.ep_alpha       = 1. - wing.downwash_adj    
    wing.aerodynamic_center  = [trapezoid_ac_x(wing), 0.0, 0.0] - wing.origin
    wing.CL_alpha = datcom(wing,Mach)
    vehicle.append_component(wing)
    lifting_surfaces.append(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)
    
    configuration = Data()
    configuration.mass_properties = Data()
    configuration.mass_properties.center_of_gravity = Data()
    configuration.mass_properties.center_of_gravity = np.array([112.,0,0]) * Units.feet    
    
    #Method Test    
    cm_a = taw_cmalpha(vehicle,Mach,conditions,configuration)
    
    expected = 0.93 # Should be -1.45
    error = Data()
    error.cm_a_747 = (cm_a - expected)/expected
    
    #Parameters Required
    #Using values for a Beech 99 
    
    vehicle = SUAVE.Vehicle()
    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.sweep       = 3.0   * Units.deg # Leading edge
    wing.taper          = 0.47
    wing.aspect_ratio   = wing.spans.projected**2/wing.areas.reference
    wing.symmetric      = True
    wing.origin           = np.array([14.0,0,0]) * Units.feet  
    wing.aerodynamic_center  = np.array([trapezoid_ac_x(wing), 0. , 0. ]) - wing.origin
    wing.eta            = 1.0
    wing.downwash_adj   = 1.0
    wing.ep_alpha       = 1. - wing.downwash_adj
    
    Mach                    = np.array([0.152])
    reference               = SUAVE.Core.Container()
    conditions = Data()
    conditions.lift_curve_slope = datcom(wing,Mach)
    wing.CL_alpha = conditions.lift_curve_slope
    vehicle.reference_area   = wing.areas.reference
    vehicle.append_component(wing)
    
    lifting_surfaces    = []
    lifting_surfaces.append(wing)
    
    wing          = SUAVE.Components.Wings.Wing()
    wing.tag = 'horizontal_stabilizer'
    wing.areas.reference     = 100.5 * Units.feet**2
    wing.spans.projected     = 22.5   * Units.feet
#.........这里部分代码省略.........
开发者ID:aerialhedgehog,项目名称:SUAVE,代码行数:103,代码来源:test_cmalpha.py

示例3: main

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import mass_properties [as 别名]
def main():
    #Parameters Required
        #Using values for a Boeing 747-200
    vehicle = SUAVE.Vehicle()
    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.sweep           = 42.0   * Units.deg # Leading edge
    wing.chords.root     = 42.9   * Units.feet #54.5
    wing.chords.tip      = 14.7   * Units.feet
    wing.chords.mean_aerodynamic = 27.3 * Units.feet
    wing.taper           = wing.chords.tip / wing.chords.root
    wing.aspect_ratio    = wing.spans.projected**2/wing.areas.reference
    wing.symmetric       = True
    wing.origin          = np.array([58.6,0.,3.6]) * Units.feet  
    
    reference = SUAVE.Core.Container()
    vehicle.reference_area = wing.areas.reference
    vehicle.append_component(wing)

    wing = SUAVE.Components.Wings.Wing()
    wing.tag = 'vertical_stabilizer'
    vertical = SUAVE.Components.Wings.Wing()
    vertical.spans.exposed = 32.4   * Units.feet
    vertical.chords.root   = 38.7 * Units.feet      # vertical.chords.fuselage_intersect
    vertical.chords.tip    = 13.4   * Units.feet
    vertical.sweep         = 50.0   * Units.deg # Leading Edge
    vertical.x_root_LE1    = 180.0  * Units.feet
    vertical.symmetric     = False
    vertical.exposed_root_chord_offset = 13.3   * Units.feet
    ref_vertical           = extend_to_ref_area(vertical)
    wing.areas.reference   = ref_vertical.areas.reference
    wing.spans.projected   = ref_vertical.spans.projected
    wing.chords.root       = ref_vertical.chords.root
    dx_LE_vert             = ref_vertical.root_LE_change
    wing.chords.tip        = vertical.chords.tip
    wing.aspect_ratio      = ref_vertical.aspect_ratio
    wing.sweep             = vertical.sweep
    wing.taper             = wing.chords.tip/wing.chords.root
    wing.origin            = np.array([vertical.x_root_LE1 + dx_LE_vert,0.,0.])
    wing.effective_aspect_ratio = 2.2
    wing.symmetric              = False
    wing.aerodynamic_center     = np.array([trapezoid_ac_x(wing),0.0,0.0])
    Mach                        = np.array([0.198])
    wing.CL_alpha = datcom(wing,Mach)
    vehicle.append_component(wing)

    fuselage = SUAVE.Components.Fuselages.Fuselage()
    fuselage.tag = 'fuselage'
    fuselage.areas.side_projected               = 4696.16 * Units.feet**2
    fuselage.lengths.total                      = 229.7   * Units.feet
    fuselage.heights.maximum                    = 26.9    * Units.feet
    fuselage.width                              = 20.9    * Units.feet
    fuselage.heights.at_quarter_length          = 26.0    * Units.feet
    fuselage.heights.at_three_quarters_length   = 19.7    * Units.feet
    fuselage.heights.at_wing_root_quarter_chord = 23.8    * Units.feet
    vehicle.append_component(fuselage)

    configuration = Data()
    configuration.mass_properties = Data()
    configuration.mass_properties.center_of_gravity = Data()
    configuration.mass_properties.center_of_gravity = np.array([112.2,0,6.8]) * Units.feet

    #segment            = SUAVE.Analyses.Mission.Segments.Base_Segment()
    segment            = SUAVE.Analyses.Mission.Segments.Segment()
    segment.freestream = Data()
    segment.freestream.mach_number = Mach[0]
    segment.atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
    altitude           = 0.0 * Units.feet
    
    conditions = segment.atmosphere.compute_values(altitude / Units.km)
    segment.a          = conditions.speed_of_sound
    segment.freestream.density   = conditions.density
    segment.freestream.dynamic_viscosity = conditions.dynamic_viscosity
    segment.freestream.velocity  = segment.freestream.mach_number * segment.a

    #Method Test
    cn_b = taw_cnbeta(vehicle,segment,configuration)
    expected = 0.10045 # Should be 0.184
    error = Data()
    error.cn_b_747 = (cn_b-expected)/expected

    #Parameters Required
    #Using values for a Beechcraft Model 99
    #MODEL DOES NOT ACCOUNT FOR DESTABILIZING EFFECTS OF PROPELLERS!
    """wing               = SUAVE.Components.Wings.Wing()
    wing.area          = 280.0 * Units.feet**2
    wing.span          = 46.0  * Units.feet
    wing.sweep_le      = 3.0   * Units.deg
    wing.z_position    = 2.2   * Units.feet
    wing.taper         = 0.46
    wing.aspect_ratio  = wing.span**2/wing.area
    wing.symmetric     = True

    fuselage           = SUAVE.Components.Fuselages.Fuselage()
    fuselage.side_area = 185.36 * Units.feet**2
    fuselage.length    = 44.0   * Units.feet
    fuselage.h_max     = 6.0    * Units.feet
    fuselage.w_max     = 5.4    * Units.feet
#.........这里部分代码省略.........
开发者ID:Aircraft-Design-UniNa,项目名称:SUAVE,代码行数:103,代码来源:test_cnbeta.py

示例4: main

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import mass_properties [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


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