Avoid slight inaccuracies at the end of events detections steps.

This commit is contained in:
Luc Maisonobe 2015-10-02 17:37:01 +02:00
parent 66d0a9a0a0
commit 1b5925b563
1 changed files with 1 additions and 1 deletions

View File

@ -251,7 +251,7 @@ public class EventState {
for (int i = 0; i < n; ++i) {
// evaluate handler value at the end of the substep
final double tb = t0 + (i + 1) * h;
final double tb = (i == n - 1) ? t1 : t0 + (i + 1) * h;
interpolator.setInterpolatedTime(tb);
final double gb = handler.g(tb, getCompleteState(interpolator));