FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0074 — RK45_i gains energy in an under-resolved contact where v2 did not
ID 0074
Class TEST
Severity 1
Status ready

Models: —

Found: 2026-10-22, porting fhsim_tutorial to fhsim 3.4.0 (test Connect-BallBox)

Evidence

The fhsim_tutorial test Connect-BallBox compares a bouncing ball with the analytic bounce. The wall contact lasts about 1 ms and the input allowed steps up to 2 ms (StepMax 0.002). On fhsim 2 the test passed with tolerance 0.5. On fhsim 3.4.0 with RK45_i (Cash-Karp) the RMS is 0.92 for B/Pos_2 and 0.52 for B/Vel_2: the ball gains energy at each bounce. At the same step limit RKF45_i, DOPRI54_i and BS23_i stay within 0.05. With StepMax 1e-4 RK45_i passes too (fhsim_tutorial d7cbd55). fhsim_base regenerated its copy of this baseline to the energy-gaining run (fhsim_base 3ab62d3).

Effect

Unknown. Either fhsim 2's Cash-Karp controlled the step differently in this case (a behaviour change worth a note in the migration guide) or fhsim 3's RK45_i has an error-control or interpolation defect.

Possible fix

Run the v2 and v3 Cash-Karp step controllers on the same input with step logging and compare the accepted steps across the contact.

Test that would prove it

A golden case of a stiff contact with StepMax larger than the contact time, run with every explicit adaptive method, expecting the same bounce height within a tolerance.

Risk

Results of models with short contacts and a loose StepMax may differ from v2.