优化求解器重试并校正AMESim机械端口

This commit is contained in:
huojiarong committed 2026-08-03 09:54:46 +00:00
1 parent 971e8f2336
commit 18d9802f03
15 files changed
+383 -166

No files matched your search

@@ -144,10 +144,10 @@ class MechanicalSolverCausalizationTests(unittest.TestCase):
Pdis=0.1,
discContactOption=1.0,
)
contact.port_1.x = 0.0
contact.port_2.x = 0.1
contact.port_1.v = 0.0
contact.port_2.v = -2.0
contact.port_1.x = 0.1
contact.port_2.x = 0.0
contact.port_1.v = -2.0
contact.port_2.v = 0.0
expected = 10.0 - 20.0 * (1.0 - exp(-1.0))
self.assertAlmostEqual(contact.contact_force, expected, places=12)
@@ -175,7 +175,7 @@ class MechanicalSolverCausalizationTests(unittest.TestCase):
def test_causal_contact_survives_unrelated_nonlinear_fallback(self) -> None:
medium = IdealGasMedium()
source = AmesimForc("contact_force")
source.res.signal = -40.0
source.res.signal = 40.0
contact = AmesimLstp00a(
"contact",
medium,