导出test_mql活塞运动学
This commit is contained in:
1 parent
65cdd2284e
commit
d4edf1ccb3
2 files changed
+68
-1
No files matched your search
@@ -120,6 +120,30 @@ class TestMqlMechanicalAssemblyTests(unittest.TestCase):
|
||||
self.assertAlmostEqual(rear.velocities_m_s[1], -0.3)
|
||||
self.assertAlmostEqual(rear.displacements_m[8], -0.72)
|
||||
|
||||
def test_mechanical_mass_snapshot_exposes_piston_kinematics(self) -> None:
|
||||
closure = TestMqlMechanicalMassClosure(self.assembly)
|
||||
state = closure.initial_state_vector()
|
||||
state[0] = 0.4
|
||||
state[1] = 0.37
|
||||
state[18] = -0.3
|
||||
state[19] = -0.72
|
||||
|
||||
snapshot = closure.snapshot(state)
|
||||
piston = snapshot.piston_kinematics_by_alias["pn_brp2_8"]
|
||||
|
||||
self.assertEqual(set(snapshot.piston_kinematics_by_alias), set(self.assembly.pistons))
|
||||
self.assertAlmostEqual(piston.port_2_velocity_m_s, 0.4)
|
||||
self.assertAlmostEqual(piston.port_2_displacement_m, 0.37)
|
||||
self.assertAlmostEqual(piston.port_3_velocity_m_s, -0.3)
|
||||
self.assertAlmostEqual(piston.port_3_displacement_m, -0.72)
|
||||
self.assertAlmostEqual(
|
||||
self.assembly.pistons["pn_brp2_8"].geometry().chamber_length_mm(
|
||||
piston.port_3_displacement_m,
|
||||
piston.port_2_displacement_m,
|
||||
),
|
||||
1090.0,
|
||||
)
|
||||
|
||||
def test_system_simulates_mechanical_mass_state_closure(self) -> None:
|
||||
system = TestMqlSystem()
|
||||
|
||||
|
||||
Reference in new issue
Block a user