接入test_mql端止动机械力

This commit is contained in:
huojiarong committed 2026-07-20 09:07:00 +00:00
1 parent 716a1c572a
commit 0035243361
2 files changed
+61 -2

No files matched your search

+24
View File
@@ -554,6 +554,30 @@ class TestMqlPn3P4NodeChamberSegmentTests(unittest.TestCase):
)
self.assertAlmostEqual(rhs[112], -0.8167936695810917)
def test_full_state_closure_applies_elastic_endstop_force_to_small_masses(self) -> None:
closure = self.system.full_state_closure_from_spec(
self.spec,
inlet_node_pressure_pa=15.31e6,
resistance_boundary_pressure_pa=15.29e6,
)
state = closure.initial_state_vector()
state[113] = 1.0e-3
rhs = closure.rhs(state)
initial_rhs = closure.rhs(closure.initial_state_vector())
endstop = closure.mechanical_closure.assembly.elastic_endstops[
"elasticendstop_8"
].endstop()
expected_contact_force = endstop.contact_force(-1.0, 0.0)
mass = closure.mechanical_closure.assembly.masses[
"mass_friction_endstops_10"
].mass_kg
self.assertAlmostEqual(
rhs[112],
initial_rhs[112] - expected_contact_force / mass,
)
def test_simulates_full_132_state_closure(self) -> None:
solution = self.system.simulate_full_state_from_spec(
self.spec,