# Using W balance

**URL:** <https://forum.intervals.icu/t/using-w-balance/804>\
**Category:** Training\
**Created:** [1 May 2020 15:13 UTC](https://forum.intervals.icu/t/using-w-balance/804 "2020-05-01T15:13:29Z")\
**Posts on this page:** 1\
**Showing post:** 81

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [2 July 2021 17:39 UTC](https://forum.intervals.icu/t/using-w-balance/804/81 "2021-07-02T17:39:04Z")

</div>

> [@W' and CP settings help](https://forum.intervals.icu/t/w-and-cp-settings-help/1155/21):
>
> 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:

---

_[View the full topic](https://forum.intervals.icu/t/using-w-balance/804)._
