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


Python Data.weight_empty方法代码示例

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


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

示例1: summarize

# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import weight_empty [as 别名]
def summarize(interface):
    
    # Unpack
    inputs                = interface.inputs
    vehicle               = interface.configs.base    
    results               = interface.results
    mission_profile       = results.sizing_loop   
  
    # Weights
    operating_empty   = vehicle.mass_properties.operating_empty
    payload           = vehicle.mass_properties.payload    
          
    # pack
    summary = SUAVE.Core.Results()
    
    # TOFL for MTOW @ SL, ISA
    
    summary.total_range           =mission_profile.segments[-1].conditions.frames.inertial.position_vector[-1,0]
    summary.GLW                   =mission_profile.segments[-1].conditions.weights.total_mass[-1,0] 
    summary.takeoff_field_length  =results.field_length.takeoff
    summary.landing_field_length  =results.field_length.landing
    summary.climb_alt_constr     =inputs.climb_alt_fraction_1-inputs.climb_alt_fraction_2
    # MZFW margin calculation
    #summary.max_zero_fuel_margin  = max_zero_fuel - (operating_empty + payload)
    # fuel margin calculation
    
    # Print outs   
    printme = Data()
    printme.weight_empty = operating_empty
    printme.total_range  =summary.total_range/Units.nautical_miles
    printme.GLW     =summary.GLW
    printme.tofl    = summary.takeoff_field_length
    printme.lfl     = summary.landing_field_length
    
    #printme.range_max    = summary.range_max_nmi    
    #printme.max_zero_fuel_margin      = summary.max_zero_fuel_margin
    #printme.available_fuel_margin     = summary.available_fuel_margin
    
    print "RESULTS"
    print printme  
    
    inputs = interface.inputs
    import datetime
    fid = open('Results.dat','a')
    fid.write('{:18.10f} ; {:18.10f} ; {:18.10f} ; {:18.10f} ; {:18.10f} ; '.format( \
        inputs.aspect_ratio,
        inputs.reference_area,
        #inputs.sweep,
        inputs.wing_thickness,
        #operating_empty ,
        summary.takeoff_field_length , 
        summary.landing_field_length
    ))
    fid.write(datetime.datetime.now().strftime("%I:%M:%S"))
    fid.write('\n')

##    print interface.configs.takeoff.maximum_lift_coefficient
    
    return summary
开发者ID:aerialhedgehog,项目名称:SUAVE,代码行数:61,代码来源:optimization_interface.py


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