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


Python Data.dist方法代码示例

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


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

示例1: check_results

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

    # check segment values
    truth = Data()
    truth.dist = [6426122.4935872 ,  5848398.49923247  ,7044468.46851841]
    truth.fuel = [ 14771. ,  12695.  , 12695.]

    error = Data()
    error.dist = np.max(np.abs(new_results.dist-truth.dist))
    error.fuel = np.max(np.abs(new_results.fuel-truth.fuel))

    for k,v in error.items():
        assert(np.abs(v)<0.001)
开发者ID:aerialhedgehog,项目名称:SUAVE,代码行数:15,代码来源:test_mission_E190_range_for_weights.py

示例2: main

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

    # define the problem
    vehicle, mission = full_setup()

    # run the problem
    # defining inputs of the module
    cruise_segment_tag = 'Cruise'
    mission_payload = [11792. ,  9868. ,     0. ]
    takeoff_weight =  [54480. , 50480. , 40612. ]
    # call module
    distance,fuel = size_mission_range_given_weights(vehicle,mission,cruise_segment_tag,mission_payload,takeoff_weight)

    # check the results
    results = Data()
    results.dist = distance
    results.fuel = fuel
    check_results(results)

    return
开发者ID:aerialhedgehog,项目名称:SUAVE,代码行数:22,代码来源:test_mission_E190_range_for_weights.py

示例3: main

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

    # define the problem
    vehicle, mission = full_setup()

    # run the problem
    # defining inputs of the module
    cruise_segment_tag = 'Cruise'
    mission_payload =             [11792. , 9868. ,    10. ]
    target_range =  np.multiply ( [ 3470. , 3158. ,  3804. ] , 1. * Units.nautical_mile )

    # call module
    distance,fuel,tow = size_weights_given_mission_range(vehicle,mission,cruise_segment_tag,mission_payload,target_range)

    # check the results
    results = Data()
    results.dist = distance
    results.fuel = fuel
    results.tow  = tow

    check_results(results)

    return
开发者ID:aerialhedgehog,项目名称:SUAVE,代码行数:25,代码来源:test_mission_E190_weights_for_range.py


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