FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0330 — The mean-tension filter advances on a retried step at the same time
Class BUG
Severity 1
Status ready

Models: Net/NetStructure

Found: 2026-09-30 review of f42360e..a6492d6 (four parallel correctness reviews)

Decision needed: —

Evidence

src/net/NetStructure.cpp:411 const double step = std::isnan(m_meanTensionTime) ? 0.0 : T - m_meanTensionTime; is not guarded against a rejected step retried from an earlier T; UpdateMeanTension clamps it to max(1e-5, step), so a retry at the same T advances the filter by 1e-5 s once more, and a retry from an earlier T by 1e-5 s instead of rolling back. Suspected by reading.

Effect

Negligible unless AdaptationPeriod is tiny; the mean tension then depends on how many steps the integrator rejected.

Possible fix

Skip the update when step <= 0, or filter in AcceptedStep with the accepted step size.

Test that would prove it

Call PreOdeFcn twice at the same T with different states: the mean tension must not change the second time.

Risk

None.