本文整理汇总了Python中SUAVE.Structure.Data.states方法的典型用法代码示例。如果您正苦于以下问题:Python Data.states方法的具体用法?Python Data.states怎么用?Python Data.states使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SUAVE.Structure.Data
的用法示例。
在下文中一共展示了Data.states方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __defaults__
# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import states [as 别名]
def __defaults__(self):
self.tag = 'Base_Segment'
# --- Segment Inputs
# these are the inputs the user will define in the input script
# an example
##self.mach_number = 0.7
#self.mass_initial = 'previous_segment' ??
#self.time_initial = 'previous_segment'
#self.position_initial = 'previous_segment'
# --- Vehicle Configuration
# a linked copy of the vehicle
self.config = Data()
# --- Conditions and Unknowns
# user shouldn't change these in an input script
# only used for processing / post processing
# they will be shared with analysis modules and meaningful naming is important
# base array column lengths
# use a trivial operation to copy the array
ones_1col = np.ones([1,1])
ones_2col = np.ones([1,2])
ones_3col = np.ones([1,3])
# --- Conditions
# setup conditions
conditions = Data()
conditions.frames = Data()
conditions.weights = Data()
conditions.energies = Data()
self.conditions = conditions
# inertial conditions
conditions.frames.inertial = Data()
conditions.frames.inertial.position_vector = ones_3col * 0
conditions.frames.inertial.velocity_vector = ones_3col * 0
conditions.frames.inertial.acceleration_vector = ones_3col * 0
conditions.frames.inertial.total_force_vector = ones_3col * 0
conditions.frames.inertial.time = ones_1col * 0
# body conditions
conditions.frames.body = Data()
conditions.frames.body.inertial_rotations = ones_3col * 0
conditions.frames.body.transform_to_inertial = np.empty([0,0,0])
# weights conditions
conditions.weights.total_mass = ones_1col * 0
conditions.weights.weight_breakdown = Data()
# energy conditions
conditions.energies.total_energy = ones_1col * 0
conditions.energies.total_efficiency = ones_1col * 0
# --- Unknowns
# setup unknowns
unknowns = Data()
unknowns.states = Data()
unknowns.controls = Data()
unknowns.finals = Data()
self.unknowns = unknowns
# an example
## unknowns.states.gamma = ones_1col + 0
# --- Residuals
# setup unknowns
residuals = Data()
residuals.states = Data()
residuals.controls = Data()
residuals.finals = Data()
self.residuals = residuals
# --- Initial Conditions
# this data structure will hold a copy of the last
# rows from the conditions of the last segment
self.initials = Data()
# --- Numerics
self.numerics = Data()
self.numerics.tag = 'Solution Numerical Setup'
# discretization
#.........这里部分代码省略.........
示例2: __defaults__
# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import states [as 别名]
def __defaults__(self):
self.tag = 'Empty_Segment'
# --- Segment Inputs
# these are the inputs the user will define in the input script
## EXAMPLE
#self.mach_number = 0.7
# --- Conditions and Unknowns
# used for processing / post processing
# they will be shared with analysis modules and meaningful naming is important
# a user shouldn't change these in an input script
# base array column lengths
# use a trivial operation to copy the array
ones_1col = np.ones([1,1])
ones_2col = np.ones([1,2])
ones_3col = np.ones([1,3])
# --- Conditions
# setup conditions
conditions = Data()
self.conditions = conditions
## EXAMPLE
#conditions.frames = Data()
#conditions.frames.inertial = Data()
#conditions.frames.inertial.position_vector = ones_3col * 0
# --- Unknowns
# setup unknowns
unknowns = Data()
unknowns.states = Data()
unknowns.controls = Data()
unknowns.finals = Data()
self.unknowns = unknowns
## EXAMPLE
# unknowns.states.gamma = ones_1col + 0
# --- Residuals
# setup unknowns
# must implement the same fields as unknowns.(...)
residuals = Data()
residuals.states = Data()
residuals.controls = Data()
residuals.finals = Data()
self.residuals = residuals
## EXAMPLE
# unknowns.states.gamma = ones_1col + 0
return