Commit 0dab0bc
Don't call CVode with an interval it cannot integrate (#1621)
doStepCVODE accumulates end_time while the event times come from the FMU,
so an event landing on the last ULP before end_time leaves time < end_time
true with nothing integrable in between:
time = 0.080000000000000001665 clock tick reported by the FMU
end_time = 0.080000000000000015543 accumulated by the loop
tout = min(tnext, end_time) = end_time gap = 1.39e-17
CVode rejects such an interval with CV_TOO_CLOSE, but only on the first
call after a re-init - which is exactly the call following every event -
so the whole simulation fails there. Skip the call and take end_time as
reached, using CVode's own too-close test.
Reproduced by simulation/clockedStepBoundary: a Modelica.Clocked FMU whose
tick times are exact (k * period) against a communication step of 0.008,
which fails at t = 0.08 without this change.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 77dcf25 commit 0dab0bc
9 files changed
Lines changed: 912 additions & 0 deletions
File tree
- src/OMSimulatorLib
- testsuite/tests
- resources
- ClockedStepBoundary
- binaries/linux64
- documentation
- resources
- simulation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
881 | 881 | | |
882 | 882 | | |
883 | 883 | | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
884 | 893 | | |
885 | 894 | | |
886 | 895 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Binary file not shown.
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments