本文整理汇总了Python中SUAVE.Structure.Data.energies方法的典型用法代码示例。如果您正苦于以下问题:Python Data.energies方法的具体用法?Python Data.energies怎么用?Python Data.energies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SUAVE.Structure.Data
的用法示例。
在下文中一共展示了Data.energies方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __defaults__
# 需要导入模块: from SUAVE.Structure import Data [as 别名]
# 或者: from SUAVE.Structure.Data import energies [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 energies [as 别名]
def __defaults__(self):
self.tag = 'Aerodynamic Segment'
# atmosphere and planet
self.planet = None
self.atmosphere = None
self.start_time = time.gmtime()
# --- 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 matricies
# 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.freestream = Data()
conditions.aerodynamics = Data()
conditions.propulsion = Data()
conditions.weights = Data()
conditions.energies = Data()
self.conditions = conditions
# inertial frame 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.gravity_force_vector = ones_3col * 0
conditions.frames.inertial.total_force_vector = ones_3col * 0
conditions.frames.inertial.time = ones_1col * 0
# wind frame conditions
conditions.frames.wind = Data()
conditions.frames.wind.body_rotations = ones_3col * 0 # rotations in [X,Y,Z] -> [phi,theta,psi]
conditions.frames.wind.velocity_vector = ones_3col * 0
conditions.frames.wind.lift_force_vector = ones_3col * 0
conditions.frames.wind.drag_force_vector = ones_3col * 0
conditions.frames.wind.transform_to_inertial = np.empty([0,0,0])
# body frame conditions
conditions.frames.body = Data()
conditions.frames.body.inertial_rotations = ones_3col * 0 # rotations in [X,Y,Z] -> [phi,theta,psi]
conditions.frames.body.thrust_force_vector = ones_3col * 0
conditions.frames.body.transform_to_inertial = np.empty([0,0,0])
# planet frame conditions
conditions.frames.planet = Data()
conditions.frames.planet.start_time = None
conditions.frames.planet.latitude = ones_1col * 0
conditions.frames.planet.longitude = ones_1col * 0
# freestream conditions
conditions.freestream.velocity = ones_1col * 0
conditions.freestream.mach_number = ones_1col * 0
conditions.freestream.pressure = ones_1col * 0
conditions.freestream.temperature = ones_1col * 0
conditions.freestream.density = ones_1col * 0
conditions.freestream.speed_of_sound = ones_1col * 0
conditions.freestream.viscosity = ones_1col * 0
conditions.freestream.altitude = ones_1col * 0
conditions.freestream.gravity = ones_1col * 0
conditions.freestream.reynolds_number = ones_1col * 0
conditions.freestream.dynamic_pressure = ones_1col * 0
# aerodynamics conditions
conditions.aerodynamics.angle_of_attack = ones_1col * 0
conditions.aerodynamics.side_slip_angle = ones_1col * 0
conditions.aerodynamics.roll_angle = ones_1col * 0
conditions.aerodynamics.lift_coefficient = ones_1col * 0
conditions.aerodynamics.drag_coefficient = ones_1col * 0
conditions.aerodynamics.lift_breakdown = Data()
conditions.aerodynamics.drag_breakdown = Data()
# propulsion conditions
conditions.propulsion.throttle = ones_1col * 0
conditions.propulsion.fuel_mass_rate = ones_1col * 0
conditions.propulsion.battery_energy = ones_1col * 0
conditions.propulsion.thrust_breakdown = Data()
# 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
conditions.energies.gravity_energy = ones_1col * 0
conditions.energies.propulsion_power = ones_1col * 0
#.........这里部分代码省略.........