接入test_mql大质量块约束

This commit is contained in:
huojiarong committed 2026-07-20 09:23:23 +00:00
1 parent bb4a71c612
commit 65cdd2284e
3 files changed
+103 -3

No files matched your search

+35
View File
@@ -597,6 +597,41 @@ class TestMqlPn3P4NodeChamberSegmentTests(unittest.TestCase):
expected_contact_force,
)
def test_full_state_closure_constrains_large_masses_at_active_limits(self) -> None:
closure = self.system.full_state_closure_from_spec(
self.spec,
inlet_node_pressure_pa=15.31e6,
resistance_boundary_pressure_pa=15.29e6,
)
rhs = closure.rhs(closure.initial_state_vector())
self.assertAlmostEqual(rhs[128], 0.0)
self.assertAlmostEqual(rhs[129], 0.0)
self.assertAlmostEqual(rhs[130], 0.0)
self.assertAlmostEqual(rhs[131], 0.0)
def test_full_state_closure_releases_large_mass_when_node_force_points_inward(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_at(0.8000000000000009, state)
endstop = closure.mechanical_closure.assembly.elastic_endstops[
"elasticendstop_8"
].endstop()
expected_contact_force = endstop.contact_force(-1.0, 0.0)
support_mass = closure.mechanical_closure.assembly.masses[
"mass_friction_endstops_18"
].mass_kg
self.assertAlmostEqual(rhs[128], expected_contact_force / support_mass)
self.assertAlmostEqual(rhs[129], 0.0)
def test_simulates_full_132_state_closure(self) -> None:
solution = self.system.simulate_full_state_from_spec(
self.spec,