diff --git a/src/main/java/scratch/kevin/simulators/slipRateVar/SingleLocSlipRateVarPlot.java b/src/main/java/scratch/kevin/simulators/slipRateVar/SingleLocSlipRateVarPlot.java index 900f5eea..c8170c49 100644 --- a/src/main/java/scratch/kevin/simulators/slipRateVar/SingleLocSlipRateVarPlot.java +++ b/src/main/java/scratch/kevin/simulators/slipRateVar/SingleLocSlipRateVarPlot.java @@ -98,10 +98,11 @@ public static void main(String[] args) throws IOException { if (time > endTime) break; prevIndex = i; - if (slipAtStart==0 && i > 0) + if (slipAtStart==0 && startTime > firstEventTime) slipAtStart = cumulativeSlipFunc.getY(i-1); double slip = cumulativeSlipFunc.getY(i) - slipAtStart; - double relTime = cumulativeSlipFunc.getX(i) - startTime; + double relTime = time - startTime; + Preconditions.checkState(relTime >= 0d); subFunc.set(relTime, slip); } funcs.add(subFunc);