本文整理汇总了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)
示例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
示例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