本文整理汇总了Python中mbwind.System.find_equilibrium方法的典型用法代码示例。如果您正苦于以下问题:Python System.find_equilibrium方法的具体用法?Python System.find_equilibrium怎么用?Python System.find_equilibrium使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mbwind.System
的用法示例。
在下文中一共展示了System.find_equilibrium方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_deflection_under_load
# 需要导入模块: from mbwind import System [as 别名]
# 或者: from mbwind.System import find_equilibrium [as 别名]
def test_deflection_under_load(self):
F = 4.2 # N/m
M = (F * self.length) * (self.length / 2)
expected_rotation = M / self.stiffness
expected_tip_motion = expected_rotation * self.length
# First, calculate directly
loading = zeros((50, 3))
loading[:, 2] = F
Qr, Qw, Qs = self.beam.modes.distributed_loading(loading, [0])
actual_tip_motion = Qs / self.beam.stiffness
assert_aae(actual_tip_motion[0], expected_tip_motion, decimal=4)
# Now check using system equilibrium
self.beam.loading = lambda beam, time: loading
system = System()
system.add_leaf(self.beam)
system.setup()
system.find_equilibrium()
actual_tip_motion2 = system.q[system.elements['beam'].istrain]
assert_aae(actual_tip_motion2[0], expected_tip_motion, decimal=4)
示例2: test_find_equilibrium
# 需要导入模块: from mbwind import System [as 别名]
# 或者: from mbwind.System import find_equilibrium [as 别名]
def test_find_equilibrium(self):
g = 9.81
m = 23.1
k = 45.2
s = System(gravity=g)
slider = PrismaticJoint('slider', [0, 0, 1])
slider.stiffness = k
body = RigidBody('body', mass=m)
s.add_leaf(slider)
slider.add_leaf(body)
s.setup()
# Initially position should be zero and acceleration nonzero
s.solve_accelerations()
assert_aae(slider.xstrain, 0)
assert_aae(slider.astrain, -g)
# At equilibrium, position should be nozero and force on body zero
s.find_equilibrium()
s.update_matrices() # recalculate stiffness force
s.solve_accelerations()
assert_aae(slider.xstrain, -m * g / k)
assert_aae(slider.astrain, 0)