本文整理汇总了Python中SUAVE.Core.Data.append方法的典型用法代码示例。如果您正苦于以下问题:Python Data.append方法的具体用法?Python Data.append怎么用?Python Data.append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SUAVE.Core.Data
的用法示例。
在下文中一共展示了Data.append方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Aircraft
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import append [as 别名]
class Aircraft(Data):
def __defaults__(self):
self.tag = 'aircraft'
self.wings = Data()
self.bodies = Data()
def append_wing(self,wing):
# assert database type
if not isinstance(wing,Wing):
raise Component_Exception, 'input component must be of type AVL.Data.Wing()'
# store data
self.wings.append(wing)
return
def append_body(self,body):
# assert database type
if not isinstance(body,Body):
raise Component_Exception, 'input component must be of type AVL.Data.Body()'
# store data
self.bodies.append(body)
return
示例2: read_results
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import append [as 别名]
def read_results(avl_object):
results = Data()
for case in avl_object.current_status.cases:
num_ctrl = case.stability_and_control.control_deflections.size
with open(case.result_filename,'r') as res_file:
case_res = Results()
case_res.tag = case.tag
lines = res_file.readlines()
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][25:35].strip())
case_res.stability.alpha_derivatives.side_force_derivative = float(lines[37+num_ctrl][25:35].strip())
case_res.stability.alpha_derivatives.roll_moment_derivative = float(lines[38+num_ctrl][25:35].strip())
case_res.stability.alpha_derivatives.pitch_moment_derivative = float(lines[39+num_ctrl][25:35].strip())
case_res.stability.alpha_derivatives.yaw_moment_derivative = float(lines[40+num_ctrl][25:35].strip())
case_res.stability.beta_derivatives.lift_coefficient_derivative = float(lines[36+num_ctrl][44:55].strip())
case_res.stability.beta_derivatives.side_force_derivative = float(lines[37+num_ctrl][44:55].strip())
case_res.stability.beta_derivatives.roll_moment_derivative = float(lines[38+num_ctrl][44:55].strip())
case_res.stability.beta_derivatives.pitch_moment_derivative = float(lines[39+num_ctrl][44:55].strip())
case_res.stability.beta_derivatives.yaw_moment_derivative = float(lines[40+num_ctrl][44:55].strip())
case_res.stability.neutral_point = float(lines[50+13*(num_ctrl>0)][22:33].strip())
results.append(case_res)
return results
示例3: Wing
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import append [as 别名]
class Wing(Data):
def __defaults__(self):
self.tag = 'wing'
self.symmetric = True
self.vertical = False
self.origin = [0.,0.,0.]
self.sweep = 0.0
self.dihedral = 0.0
self.sections = Data()
self.configuration = Data()
self.control_surfaces = Data()
self.configuration.nspanwise = 10
self.configuration.nchordwise = 5
self.configuration.sspace = 1.0
self.configuration.cspace = 1.0
def append_section(self,section):
""" adds a segment to the wing """
# assert database type
if not isinstance(section,Data):
raise Component_Exception, 'input component must be of type Data()'
# store data
self.sections.append(section)
return
示例4: Wing
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import append [as 别名]
class Wing(Data):
""" A class that defines parameters of the AVL aircraft wing
Assumptions:
None
Source:
None
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
def __defaults__(self):
self.tag = 'wing'
self.symmetric = True
self.vertical = False
self.origin = [0.,0.,0.]
self.sweep = 0.0
self.dihedral = 0.0
self.sections = Data()
self.configuration = Data()
self.control_surfaces = Data()
self.configuration.nspanwise = 10
self.configuration.nchordwise = 5
self.configuration.sspace = 1.0
self.configuration.cspace = 1.0
def append_section(self,section):
""" adds a segment to the wing """
# assert database type
if not isinstance(section,Data):
raise Exception('input component must be of type Data()')
# store data
self.sections.append(section)
return
示例5: Section
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import append [as 别名]
class Section(Data):
def __defaults__(self):
self.tag = 'section'
self.origin = [0.0,0.0,0.0]
self.chord = 0.0
self.twist = 0.0
self.airfoil_coord_file = None
self.control_surfaces = Data()
def append_control_surface(self,control):
""" adds a control_surface to the wing section """
# assert database type
if not isinstance(control,Data):
raise Component_Exception, 'input component must be of type Data()'
# store data
self.control_surfaces.append(control)
return
示例6: Control_Surface
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import append [as 别名]
class Control_Surface(Lofted_Body):
def __defaults__(self):
self.tag = 'control_surface'
self.span = 0.0
self.span_fraction = 0.0
self.deflection_symmetry = 1.0
self.origin = [0.0,0.0,0.0]
self.transformation_matrix = [[1,0,0],[0,1,0],[0,0,1]]
self.sections = Data()
def append_section(self,section):
"""adds a component to vehicle """
# assert database type
if not isinstance(section,Data):
raise Component_Exception, 'input control surface section must be of type Data()'
# store data
self.sections.append(section)
return
示例7: Segment
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import append [as 别名]
class Segment(Lofted_Body.Segment):
def __defaults__(self):
"""This sets the default for wing segments in SUAVE.
Assumptions:
None
Source:
N/A
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
self.tag = 'segment'
self.percent_span_location = 0.0
self.twist = 0.0
self.root_chord_percent = 0.0
self.dihedral_outboard = 0.0
self.sweeps = Data()
self.sweeps.quarter_chord = 0.0
self.sweeps.leading_edge = 0.0
self.areas = Data()
self.areas.reference = 0.0
self.areas.exposed = 0.0
self.areas.wetted = 0.0
self.Airfoil = SUAVE.Core.ContainerOrdered()
self.control_surfaces = Data()
def append_airfoil(self,airfoil):
""" Adds an airfoil to the segment
Assumptions:
None
Source:
N/A
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
# assert database type
if not isinstance(airfoil,Data):
raise Exception('input component must be of type Data()')
# store data
self.Airfoil.append(airfoil)
def append_control_surface(self,control_surface):
""" Adds an control_surface to the segment
Assumptions:
None
Source:
N/A
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
# assert database type
if not isinstance(control_surface,Data):
raise Exception('input component must be of type Data()')
# store data
self.control_surfaces.append(control_surface)
return
示例8: read_results
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import append [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())
#.........这里部分代码省略.........
示例9: Wing
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import append [as 别名]
class Wing(Lofted_Body):
def __defaults__(self):
self.tag = 'wing'
self.mass_properties = Mass_Properties()
self.position = [0.0,0.0,0.0]
self.symmetric = True
self.vertical = False
self.t_tail = False
self.sweep = 0.0
self.taper = 0.0
self.dihedral = 0.0
self.aspect_ratio = 0.0
self.thickness_to_chord = 0.0
self.span_efficiency = 0.9
self.aerodynamic_center = [0.0,0.0,0.0]
self.exposed_root_chord_offset = 0.0
self.spans = Data()
self.spans.projected = 0.0
self.areas = Data()
self.areas.reference = 0.0
self.areas.exposed = 0.0
self.areas.affected = 0.0
self.areas.wetted = 0.0
self.chords = Data()
self.chords.mean_aerodynamic = 0.0
self.chords.mean_geometric = 0.0
self.chords.root = 0.0
self.chords.tip = 0.0
self.twists = Data()
self.twists.root = 0.0
self.twists.tip = 0.0
self.control_surfaces = Data()
self.flaps = Data()
self.flaps.chord = 0.0
self.flaps.angle = 0.0
self.flaps.span_start = 0.0
self.flaps.span_end = 0.0
self.flaps.type = None
self.slats = Data()
self.slats.chord = 0.0
self.slats.angle = 0.0
self.slats.span_start = 0.0
self.slats.span_end = 0.0
self.slats.type = None
self.high_lift = False
self.high_mach = False
self.vortex_lift = False
self.transition_x_upper = 0.0
self.transition_x_lower = 0.0
def append_segment(self,segment):
""" adds a segment to the wing """
# assert database type
if not isinstance(segment,Data):
raise Component_Exception, 'input component must be of type Data()'
# store data
self.Segments.append(segment)
return
def append_control_surface(self,control_surface):
""" adds a component to vehicle """
# assert database type
if not isinstance(control_surface,Data):
raise Component_Exception, 'input control surface must be of type Data()'
# store data
self.control_surfaces.append(control_surface)
return
示例10: Wing
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import append [as 别名]
#.........这里部分代码省略.........
self.sweeps.half_chord = 0.0
self.twists = Data()
self.twists.root = 0.0
self.twists.tip = 0.0
self.control_surfaces = Data()
self.flaps = Data()
self.flaps.chord = 0.0
self.flaps.angle = 0.0
self.flaps.span_start = 0.0
self.flaps.span_end = 0.0
self.flaps.type = None
self.flaps.area = 0.0
self.slats = Data()
self.slats.chord = 0.0
self.slats.angle = 0.0
self.slats.span_start = 0.0
self.slats.span_end = 0.0
self.slats.type = None
self.high_lift = False
self.high_mach = False
self.vortex_lift = False
self.transition_x_upper = 0.0
self.transition_x_lower = 0.0
self.Airfoil = Data()
self.Segments = SUAVE.Core.ContainerOrdered()
self.Fuel_Tanks = SUAVE.Core.Container()
def append_segment(self,segment):
""" Adds a segment to the wing
Assumptions:
None
Source:
N/A
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
# Assert database type
if not isinstance(segment,Data):
raise Exception('input component must be of type Data()')
# Store data
self.Segments.append(segment)
return
def append_airfoil(self,airfoil):
""" Adds an airfoil to the segment
Assumptions:
None
示例11: Aircraft
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import append [as 别名]
class Aircraft(Data):
"""A data class defining the entire AVL aircraft geometry
Assumptions:
None
Source:
None
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
def __defaults__(self):
""" Defines the data structure and defaults of aircraft classes
Assumptions:
None
Source:
None
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
self.tag = 'aircraft'
self.wings = Data()
self.bodies = Data()
def append_wing(self,wing):
""" Appends wing geometry onto aircraft class
Assumptions:
None
Source:
None
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
# assert database type
if not isinstance(wing,Wing):
raise Exception, 'input component must be of type AVL.Data.Wing()'
# store data
self.wings.append(wing)
return
def append_body(self,body):
""" Appends body geometry onto aircraft class
Assumptions:
None
Source:
None
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
# assert database type
if not isinstance(body,Body):
raise Exception, 'input component must be of type AVL.Data.Body()'
# store data
self.bodies.append(body)
return
示例12: Control_Surface
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import append [as 别名]
class Control_Surface(Component):
def __defaults__(self):
"""This sets the default values of control surfaces defined in SUAVE.
sign_duplicate: 1.0 or -1.0 - the sign of the duplicate control on the mirror wing.
Use 1.0 for a mirrored control surface, like an elevator. Use -1.0 for an aileron.
The span fraction is given by the array shown below:
[abs. % span location at beginning of crtl surf, abs. % span location at end of crtl surf]
Assumptions:
None
Source:
N/A
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
self.tag = 'control_surface'
self.span = 0.0
self.span_fraction = [0.0,0.0]
self.chord_fraction = 0.0
self.deflection_gain = 0.0
self.origin = [0.0,0.0,0.0]
self.transformation_matrix = [[1,0,0],[0,1,0],[0,0,1]]
self.deflection_symmetry = 1.0
self.sections = Data()
self.prev = None
self.next = None # for connectivity
def append_section(self,section):
"""Adds a section
Assumptions:
None
Source:
N/A
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
# assert database type
if not isinstance(section,Data):
raise Exception('input control surface section must be of type Data()')
# store data
self.sections.append(section)
return
示例13: Section
# 需要导入模块: from SUAVE.Core import Data [as 别名]
# 或者: from SUAVE.Core.Data import append [as 别名]
class Section(Data):
""" A class that defines the sections of the aircraft wing in AVL.
Each section can be thought of as a trapezoid
Assumptions:
None
Source:
None
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
def __defaults__(self):
""" Sets the defaunts of the aircraft wing geometry
Assumptions:
None
Source:
None
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
self.tag = 'section'
self.origin = [0.0,0.0,0.0]
self.chord = 0.0
self.twist = 0.0
self.airfoil_coord_file = None
self.control_surfaces = Data()
def append_control_surface(self,control):
""" Adds a control_surface to the wing section in AVL
Assumptions:
None
Source:
None
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
# assert database type
if not isinstance(control,Data):
raise Exception('input component must be of type Data()')
# store data
self.control_surfaces.append(control)
return