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


Python Data.mass_properties方法代码示例

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


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

示例1: main

# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.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.taper          = 14.7/54.5
    wing.aspect_ratio   = wing.spans.projected**2/wing.areas.reference
    wing.symmetric      = True
    wing.origin           = np.array([0.0,0,3.6]) * Units.feet  
    
    reference               = SUAVE.Structure.Container()
    vehicle.reference_area   = wing.areas.reference
    vehicle.append_component(wing)
    
    lifting_surfaces    = []
    lifting_surfaces.append(wing)
    
    wing          = SUAVE.Components.Wings.Wing()
    wing.tag = 'Vertical Stabilizer'
    vertical = Data()
    vertical.span         = 32.4   * Units.feet
    vertical.root_chord   = 38.7   * Units.feet
    vertical.tip_chord    = 13.4   * Units.feet
    vertical.sweep     = 50.0   * Units.deg
    vertical.x_root_LE1   = 180.0  * Units.feet
    vertical.symmetric    = False
    dz_centerline         = 13.3   * Units.feet
    ref_vertical          = extend_to_ref_area(vertical,dz_centerline)    
    wing.areas.reference     = ref_vertical.ref_area
    wing.spans.projected     = ref_vertical.ref_span
    wing.sweep = 50.0   * Units.deg # leading edge
    wing.taper    = vertical.tip_chord/ref_vertical.ref_root_chord
    wing.aspect_ratio = ref_vertical.ref_aspect_ratio
    wing.origin     = np.array([vertical.x_root_LE1 + ref_vertical.root_LE_change,0.,0.]) * Units.feet
    wing.effective_aspect_ratio = 2.2
    wing.symmetric= True
    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)
    lifting_surfaces.append(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   * Units.feet
    fuselage.heights.at_three_quarters_length = 19.7 * Units.feet
    fuselage.heights.at_wing_root_quarter_chord = 15.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.0,0,0]) * Units.feet    
    
    segment            = SUAVE.Attributes.Missions.Segments.Base_Segment()
    segment.freestream = Data()
    segment.freestream.mach_number          = 0.198
    segment.atmosphere = SUAVE.Attributes.Atmospheres.Earth.US_Standard_1976()
    altitude           = 0.0 * Units.feet
    segment.a          = segment.atmosphere.compute_values(altitude / Units.km, type="a")
    segment.freestream.density        = segment.atmosphere.compute_values(altitude / Units.km, type="rho")
    segment.freestream.viscosity        = segment.atmosphere.compute_values(altitude / Units.km, type="mew")
    segment.freestream.velocity      = segment.freestream.mach_number * segment.a    
    
    #Method Test   
    cn_b = taw_cnbeta(vehicle,segment,configuration)
    expected = -0.35 # 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
    fuselage.height_at_vroot_quarter_chord   = 2.9 * Units.feet
    fuselage.height_at_quarter_length        = 4.8 * Units.feet
    fuselage.height_at_three_quarters_length = 4.3 * Units.feet
    
    nacelle           = SUAVE.Components.Fuselages.Fuselage()
#.........这里部分代码省略.........
开发者ID:designToolDeveloper,项目名称:SUAVE,代码行数:103,代码来源:test_cnbeta.py

示例2: main

# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.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.Structure.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.Structure.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:designToolDeveloper,项目名称:SUAVE,代码行数:103,代码来源:test_cmalpha.py

示例3: datcom

# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.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:jiaxu825,项目名称:SUAVE,代码行数:33,代码来源:taw_cmalpha.py


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