From aa79182730865c055e4efcfac6b7b09805bc780b Mon Sep 17 00:00:00 2001 From: kmilner Date: Tue, 10 Sep 2024 18:00:03 -0700 Subject: [PATCH] bugfixes --- .../simulators/slipRateVar/SingleLocSlipRateVarPlot.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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);