better residual estimator, truncate dt if time > Tend (for both SDC versions)