验收四路模型并优化拓扑求解性能
This commit is contained in:
1 parent
caca32a513
commit
456c29b3b6
20 files changed
+1085
-137
No files matched your search
@@ -488,6 +488,36 @@ class MechanicalSolverCausalizationTests(unittest.TestCase):
|
||||
for value in result.series["mass.a"]:
|
||||
self.assertAlmostEqual(value, 0.0, places=12)
|
||||
|
||||
def test_ideal_stop_ignores_zero_velocity_roundoff_inside_boundary_band(self) -> None:
|
||||
system, _mass = _single_mass_system(
|
||||
0.0,
|
||||
stoptype=1.0,
|
||||
x0=0.0,
|
||||
xmin=0.0,
|
||||
xmax=1.0,
|
||||
)
|
||||
reducer = system.mechanical_state_reducer
|
||||
previous_state = [0.0, 2.0e-32]
|
||||
current_state = [0.0, -1.0e-32]
|
||||
|
||||
def dense_state(time: float) -> list[float]:
|
||||
fraction = float(time)
|
||||
return [
|
||||
0.0,
|
||||
previous_state[1]
|
||||
+ fraction * (current_state[1] - previous_state[1]),
|
||||
]
|
||||
|
||||
transition = reducer.state_transition(
|
||||
0.0,
|
||||
previous_state,
|
||||
1.0,
|
||||
current_state,
|
||||
dense_state,
|
||||
)
|
||||
|
||||
self.assertIsNone(transition)
|
||||
|
||||
def test_ideal_upper_stop_projects_a_high_speed_impact(self) -> None:
|
||||
system, _mass = _single_mass_system(
|
||||
100.0,
|
||||
|
||||
Reference in new issue
Block a user