本文整理汇总了Python中SUAVE.Core.Data.tag方法的典型用法代码示例。如果您正苦于以下问题:Python Data.tag方法的具体用法?Python Data.tag怎么用?Python Data.tag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SUAVE.Core.Data
的用法示例。
在下文中一共展示了Data.tag方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fuel_for_missions
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import tag [as 别名]
def fuel_for_missions(interface):
# unpack data
config = interface.configs.cruise
analyses = interface.analyses
mission = interface.analyses.missions.fuel.mission
mission_payload = interface.analyses.missions.fuel.payload
# determine maximum range based in tow short_field
from SUAVE.Methods.Performance import size_mission_range_given_weights
# unpack
cruise_segment_tag = 'cruise'
weight_max = config.mass_properties.max_takeoff
weight_min = config.mass_properties.operating_empty + 0.10 * mission_payload # 10%
takeoff_weight_vec = np.linspace(weight_min,weight_max,3)
distance_vec = np.zeros_like(takeoff_weight_vec)
fuel_vec = np.zeros_like(takeoff_weight_vec)
# call function
distance_vec,fuel_vec = size_mission_range_given_weights(config,mission,cruise_segment_tag,mission_payload,takeoff_weight_vec)
# pack
results = Data()
results.tag = 'missions_fuel'
results.weights = takeoff_weight_vec
results.distances = distance_vec
results.fuels = fuel_vec
## print results
return results
示例2: short_field
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import tag [as 别名]
def short_field(interface):
# unpack data
results_field = interface.results.takeoff_field_length
results_fuel = interface.results.fuel_for_missions
available_tofl = interface.analyses.missions.short_field.mission.airport.available_tofl
tofl_vec = results_field.takeoff_field_length
weight_vec_tofl = results_field.takeoff_weights
range_vec = results_fuel.distances
weight_vec_fuel = results_fuel.weights
fuel_vec = results_fuel.fuels
# evaluate maximum allowable takeoff weight from a given airfield
tow_short_field = np.interp(available_tofl,tofl_vec,weight_vec_tofl)
# determine maximum range/fuel based in tow short_field
range_short_field = np.interp(tow_short_field,weight_vec_fuel,range_vec)
fuel_short_field = np.interp(tow_short_field,weight_vec_fuel,fuel_vec)
# pack
results = Data()
results.tag = 'short_field'
results.takeoff_weight = tow_short_field
results.range = range_short_field
results.fuel = fuel_short_field
return results
示例3: evaluate_range_from_short_field
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import tag [as 别名]
def evaluate_range_from_short_field(vehicle,mission,results):
# unpack
airport_short_field = mission.airport_short_field
tofl = airport_short_field.field_lenght
takeoff_config = vehicle.configs.takeoff
from SUAVE.Methods.Performance import find_takeoff_weight_given_tofl
# evaluate maximum allowable takeoff weight from a short field
tow_short_field = find_takeoff_weight_given_tofl(vehicle,takeoff_config,airport_short_field,tofl)
# determine maximum range based in tow short_field
from SUAVE.Methods.Performance import size_mission_range_given_weights
# unpack
cruise_segment_tag = 'Cruise'
mission_payload = vehicle.mass_properties.payload
# call function
distance,fuel = size_mission_range_given_weights(vehicle,mission,cruise_segment_tag,mission_payload,tow_short_field)
# pack
short_field = Data()
short_field.tag = 'short_field'
short_field.takeoff_weight = tow_short_field
short_field.range = distance
short_field.fuel = fuel
results.short_field = short_field
return results
示例4: append_control_deflection
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import tag [as 别名]
def append_control_deflection(self,control_tag,deflection):
""" Adds a control deflection case
Assumptions:
None
Source:
None
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
control_deflection = Data()
control_deflection.tag = control_tag
control_deflection.deflection = deflection
if self.stability_and_control.control_deflections is None:
self.stability_and_control.control_deflections = Data()
self.stability_and_control.control_deflections.append(control_deflection)
return
示例5: append_control_deflection
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import tag [as 别名]
def append_control_deflection(self,control_tag,deflection):
""" adds a control deflection case """
control_deflection = Data()
control_deflection.tag = control_tag
control_deflection.deflection = deflection
if self.stability_and_control.control_deflections is None:
self.stability_and_control.control_deflections = Data()
self.stability_and_control.control_deflections.append(control_deflection)
return
示例6: mission_fuel
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import tag [as 别名]
def mission_fuel(interface):
# unpack data
design_range = interface.analyses.missions.fuel.range
range_vec = interface.results.fuel_for_missions.distances
fuel_vec = interface.results.fuel_for_missions.fuels
# determine maximum range/fuel based in tow short_field
fuel_design_mission = np.interp(design_range,range_vec,fuel_vec)
# pack results
results = Data()
results.tag = 'design_mission'
results.range = design_range
results.fuel = fuel_design_mission
return results
示例7: max_range
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import tag [as 别名]
def max_range(interface):
# unpack data
max_takeoff_weight = interface.configs.base.mass_properties.max_takeoff
range_vec = interface.results.fuel_for_missions.distances
weight_vec_fuel = interface.results.fuel_for_missions.weights
fuel_vec = interface.results.fuel_for_missions.fuels
# determine maximum range/fuel based in max_tow
range = np.interp(max_takeoff_weight,weight_vec_fuel,range_vec)
fuel = np.interp(max_takeoff_weight,weight_vec_fuel,fuel_vec)
# pack results
results = Data()
results.tag = 'short_field'
results.takeoff_weight = max_takeoff_weight
results.range = range
results.fuel = fuel
return results
示例8: evaluate_field_length
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import tag [as 别名]
def evaluate_field_length(vehicle,mission,results):
# unpack
airport = mission.airport
takeoff_config = vehicle.configs.takeoff
landing_config = vehicle.configs.landing
from SUAVE.Methods.Performance import estimate_take_off_field_length
from SUAVE.Methods.Performance import estimate_landing_field_length
# evaluate
TOFL = estimate_take_off_field_length(vehicle,takeoff_config,airport)
LFL = estimate_landing_field_length(vehicle,landing_config,airport)
# pack
field_length = Data()
field_length.tag = 'field_length'
field_length.takeoff = TOFL[0]
field_length.landing = LFL[0]
results.field_length = field_length
return results
示例9: read_results
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import tag [as 别名]
def read_results(avl_object):
""" This functions reads the results from the results text file created
at the end of an AVL function call
Assumptions:
None
Source:
Drela, M. and Youngren, H., AVL, http://web.mit.edu/drela/Public/web/avl
Inputs:
None
Outputs:
results
Properties Used:
N/A
"""
results = Data()
#i = 0 Used in the dynamic stability module (under development)
for case_name in avl_object.current_status.cases:
case = avl_object.current_status.cases[case_name]
num_ctrl = case.stability_and_control.number_control_surfaces
with open(case.result_filename,'r') as res_file:
case_res = Data()
case_res.aerodynamics = Data()
case_res.stability = Data()
case_res.stability.alpha_derivatives = Data()
case_res.stability.beta_derivatives = Data()
case_res.tag = case.tag
lines = res_file.readlines()
case_res.aerodynamics.Sref = float(lines[8][10:16].strip())
case_res.aerodynamics.Cref = float(lines[8][31:37].strip())
case_res.aerodynamics.Bref = float(lines[8][52:58].strip())
case_res.aerodynamics.Xref = float(lines[9][10:16].strip())
case_res.aerodynamics.Yref = float(lines[9][31:37].strip())
case_res.aerodynamics.Zref = float(lines[9][52:58].strip())
case_res.aerodynamics.CX = float(lines[19][11:19].strip())
case_res.aerodynamics.CY = float(lines[20][11:19].strip())
case_res.aerodynamics.CZ = float(lines[21][11:19].strip())
case_res.aerodynamics.Cltot = float(lines[19][33:41].strip())
case_res.aerodynamics.Cmtot = float(lines[20][33:41].strip())
case_res.aerodynamics.Cntot = float(lines[21][33:41].strip())
case_res.aerodynamics.roll_moment_coefficient = float(lines[19][32:42].strip())
case_res.aerodynamics.pitch_moment_coefficient = float(lines[20][32:42].strip())
case_res.aerodynamics.yaw_moment_coefficient = float(lines[21][32:42].strip())
case_res.aerodynamics.total_lift_coefficient = float(lines[23][10:20].strip())
case_res.aerodynamics.total_drag_coefficient = float(lines[24][10:20].strip())
case_res.aerodynamics.induced_drag_coefficient = float(lines[25][32:42].strip())
case_res.aerodynamics.span_efficiency_factor = float(lines[27][32:42].strip())
case_res.stability.alpha_derivatives.lift_curve_slope = float(lines[36+num_ctrl][24:34].strip()) # CL_a
case_res.stability.alpha_derivatives.side_force_derivative = float(lines[37+num_ctrl][24:34].strip()) # CY_a
case_res.stability.alpha_derivatives.roll_moment_derivative = float(lines[38+num_ctrl][24:34].strip()) # Cl_a
case_res.stability.alpha_derivatives.pitch_moment_derivative = float(lines[39+num_ctrl][24:34].strip()) # Cm_a
case_res.stability.alpha_derivatives.yaw_moment_derivative = float(lines[40+num_ctrl][24:34].strip()) # Cn_a
case_res.stability.beta_derivatives.lift_coefficient_derivative = float(lines[36+num_ctrl][43:54].strip()) # CL_b
case_res.stability.beta_derivatives.side_force_derivative = float(lines[37+num_ctrl][43:54].strip()) # CY_b
case_res.stability.beta_derivatives.roll_moment_derivative = float(lines[38+num_ctrl][43:54].strip()) # Cl_b
case_res.stability.beta_derivatives.pitch_moment_derivative = float(lines[39+num_ctrl][43:54].strip()) # Cm_b
case_res.stability.beta_derivatives.yaw_moment_derivative = float(lines[40+num_ctrl][43:54].strip()) # Cn_b
case_res.stability.CL_p = float(lines[44+num_ctrl][24:34].strip())
case_res.stability.CL_q = float(lines[44+num_ctrl][43:54].strip())
case_res.stability.CL_r = float(lines[44+num_ctrl][65:74].strip())
case_res.stability.CY_p = float(lines[45+num_ctrl][24:34].strip())
case_res.stability.CY_q = float(lines[45+num_ctrl][43:54].strip())
case_res.stability.CY_r = float(lines[45+num_ctrl][65:74].strip())
case_res.stability.Cl_p = float(lines[46+num_ctrl][24:34].strip())
case_res.stability.Cl_q = float(lines[46+num_ctrl][43:54].strip())
case_res.stability.Cl_r = float(lines[44+num_ctrl][65:74].strip())
case_res.stability.Cm_p = float(lines[47+num_ctrl][24:34].strip())
case_res.stability.Cm_q = float(lines[47+num_ctrl][43:54].strip())
case_res.stability.Cm_r = float(lines[44+num_ctrl][65:74].strip())
case_res.stability.Cn_p = float(lines[48+num_ctrl][24:34].strip())
case_res.stability.Cn_q = float(lines[48+num_ctrl][43:54].strip())
case_res.stability.Cn_r = float(lines[48+num_ctrl][65:74].strip())
case_res.stability.neutral_point = float(lines[50+12*(num_ctrl>0)+num_ctrl][22:33].strip())
results.append(case_res)
#------------------------------------------------------------------------------------------
# SUAVE-AVL dynamic stability analysis under development
#
#with open(case.eigen_result_filename,'r') as eigen_res_file:
#lines = eigen_res_file.readlines()
#index = i*8
#case_res.stability.roll_mode_real = float(lines[3+index][11:26].strip())
#case_res.stability.dutch_roll_mode_1_real = float(lines[4+index][11:26].strip())
#case_res.stability.dutch_roll_mode_1_imag = float(lines[4+index][29:40].strip())
#.........这里部分代码省略.........