W' and CP settings help

Intervals.icu uses the differential algorithm. Here is the code that computes it:

let wb = wPrime
let pt = 0
for (let i = 0; i < data.length; i++) {
  let t = time[i]
  let secs = t - pt
  let deltaW = cp - data[i]
  if (deltaW > 0) {
    for (let j = 0; j < secs; j++) wb += deltaW * (wPrime - wb) / wPrime
  } else {
    wb += deltaW * secs
  }
  data[i] = Math.floor(wb)
  pt = t
}

I found a nice writeup here:

2 Likes