A few weeks ago, I released the first version of my W’ Bal datafield on Garmin Connect IQ. This app is designed to display the remaining value of W’ during a ride on the cyclist’s device. Let’s dig a bit into this interesting value…

## What is W’ Balance ?

To make it simple, assume that a cyclist have a given amount of energy at the beginning of a ride. This value, known as W’ (or W prime) is measured in joules.

While you’re riding at low intensity, W’ remains at it full level, and you can theoretically continue riding at this intensity for a while. But if you push harder, you will start using this energy. The limit at which you will start lowering the W’ is known as CP (Critical Power). At my level, I use to consider my CP and FTP as the same value.

So if you push on the pedals harder than CP, W’ will decrease. As soon as your watts get lower than CP, W’ will “regenerate”, and the value will increase again. So if you ride long enough below CP, W’ will be at 100% again.

All these variation in W’ are expressed as “W’ Bal” in the Dr. Skiba theory, and this value was then implemented on the GoldenCheetah software, on the “Charge” chart of a ride:

You can note on this chart the peaks above CP (the line is going down, as the amount of remaining W’ decrease), and the periods where power is below CP (the line is going up, as the amount of remaining W’ increase).

To be able to compute W’ Bal, we need two values:

- CP: a given threshold (watts)
- W’: a given amount of energy (joules)

## How to get my CP and W’ values ?

To estimate your CP and W’ values (if you don’t already know them), GoldenCheetah provides a tool in the “*Tools -> Estimate CP and W’*” menu. Here you can enter you maximum amount of watts for a short effort (3-5min) and a long one (15-60 minutes). Based on that, it will give you an estimation of W’ and CP.

Of course, if you already know your FTP value, you can use it as CP.

## Compute methods (the real maths behind the data)

Initially, the only known formula to get W’ Bal was the one from Dr Skiba. It was the one implemented in *GoldenCheetah* at the beginning. On my data field, it’s called “*integral*” and it’s the default method, just because I prefer it… This formula uses another parameter to define the speed at which W’ is regenerating when the power is below CP. This value is known as TAU, and it’s based on the activity history.

The second method, by Froncioni / Clarke only use current power to compute recovery, so with this formula, W’ Bal will usually regenerate faster, and decrease faster as well. It’s now the default method on *GoldenCheetah*. It’s known as “*differential*” and available starting from version 1.2 on my data field, but you have to configure “compute method” parameter to “differential” instead of “integral”.

What is the difference between the two formulas? This one:

The blue line is the differential formula (the one used by default in *GoldenCheetah*). The red is the integral formula of Dr. Skiba. Values here are for a mixed field test (5min VO2Max, 10 min recovery, 20 min FTP test).

The only advice I can give you is: try both formulas and choose the one you prefer. Science has not yet validated one against the other.

## Where can I get this app ?

First, you will need to ensure your Garmin device is compatible with Connect IQ apps, and has an updated firmware. Compatible devices with powermeters and Connect IQ are, at the time of writing are:

- Forerunner 920XT
- Fenix 3 / Fenix 3 HR
- Edge 1000
- Edge 520
- Epix

Then, go to the Connect IQ store on Garmin Connect Mobile, or directly at this page: https://apps.garmin.com/en-US/apps/6dcfffe5-cd3d-41f3-8ba3-13fa0647b003 and get the stuff.

You will have to change the three parameters to suit your values (CP, W’ and Method).

## Can I get the sources ?

Yep, all the source code is available on Github here.

## Anything else ?

Feel free to leave a comment to this entry for any feature request, bug, advice or question. Enjoy your ride!

I didn’t see the instructions to change the Cp and W’. To update the them do I have to do it directly on the source code lines;

// Constants

var CP; // = 250;

var WPRIME; // = 20000;

Thanks,

Azari

Hi Azari!

I’ve just added a post about the parameters management of the app here: https://www.trinakan.com/wp/2016/04/04/how-to-manage-the-settings-of-the-wbal-app-on-connectiq/

You can of course change the source code, but you will then need to compile/publish your own version of the field, and it’s probably a bit “overkill” in order to change the two or three values π

Cheers.

Hi Nakan,

I’m using this app and I find It really useful!

I was wondering if time to exaustion and time to recharge are data that it’s possible to see as data field.

I think it would be really useful when doing intervals.

What do you think?

Amazing job by the way.. thanks for sharing the source code.

Paolo

Hi Paolo,

Thanks for your message! The hard work in computing TTE is the W’Bal value. If you have it, the work is almost done. I don’t know if there is “standard” way to compute TTE, as we have to smooth the last seconds power data to estimate, if the decreasing rate of W’Bal is steady, when W’Bal will reach zero.

I didn’t have much time right now, but will definitely continue my work on matches app, and have a look at TTE (and also Time To Recovery), and if it’s not too complicated to implement, why not release a dedicated app for these values !

Greg

Hi Nakan,

i have been reading some articles on how critical heart rate could be used instead of critical power for running.

i want to do an app which does wbal for the heart rate, which could be used for running in a similar way of what your app does for cycling with a power meter.

i am going to fork your source code. i hope it is ok for you. of course if i release an app, i will mention you π

thanks and keep the good work!

Hi Dani,

Thanks for your message. Sure, the code is out exactly for this kind of purpose so you are more than welcome to fork it!

Looking forward for news about your app !

Best.

Hi Nakan,

Thanks for the great article and software update. Is there any way we could get an update for the edge 500?

Kind regards

Dorian

Hi Dorian,

Thanks for the message. Unfortunatly, the Edge 500 is not Connect IQ capable and because of that it’s simly impossible to add third party apps or code on this bike computer. You will have to upgrade to the 520 at least to be able to enjoy IQ apps on the computer.

Best.

Hello,

I just started using the app and am stoked on the idea. The remaining kj displayed on my 520 didn’t go down as much as when compared to golden cheetah afterwards. I think I had the values in accurately. (using 375 CP & 35000 w’) Those numbers can fluctuate a little bit, but as pretty useful for reviewing the data on GC. Any ideas?

Thanks!

Mark

Your app is great. Any chance you could copy the code and spin up one for Running? Replacing Power with Pace.

Also, a 2nd vote for adding TTE. Simply,…. TTE (in seconds) = W’ bal/(Current Power – Critical Power). You may have to smooth or average a little depending on the input of Current Power (or take a 10s avg power as input,..however you want). May want to display TTE in mm:ss also. B/c we can only add 2 apps in data fields (on watches) would be ideal to not make separate app for TTE, rather can have D’ balance % and TTE in same one π

Thanks!

Best,

BK

Hi, first, congratulate you on your work.

What do I have to do to display “matchs” thanks

Hi Nakan,

Love your product! Finally we have something to cycling against and reflecting real time. Thank you.

I notice couple thing, actually questions:

1./ The W’ Balance value is a bit lower than Golden Cheetah (GC) through out the cycling ride. Probably 3.0KJ lower than GC. However, it seems to reflect the true personal “battery”. When I hit 0′ Watt, I could not do anymore work unless it came back up a little bit let’s say 2 or 3Watts. So why is it lower than GC? All the parameters for W’ field I got them from GC.

2./ Is the value of W’ Balance record somewhere? I look and the values available seem to be from GC itself and not W’ Balance.

Thanks,

MN

Sorry for the late reply.

Difference is beacause of TAU. I explain this in the article, Golden Cheetah will compute the whole session as my app will use an updated TAU depending on time.

Regarding the recording of the data, it is now available: https://www.trinakan.com/wp/2018/03/05/wbal-connect-iq-app-now-stores-data-and-make-it-available-into-garmin-connect/

Thanks !

Nakan,

A great app, thanks.

One question, which model is used to model the power curve I.e extended, 2 parameter, ward smith etc. and is the option available to select a different model?

Thanks,

Richard

Hello Nakan,

Thank you for this app, really nice.

Just wandering, how to get graph in Connect after training? I can’t find it. I see W’ during training only.

Thank you.

Hi,

Available now! https://www.trinakan.com/wp/2018/03/05/wbal-connect-iq-app-now-stores-data-and-make-it-available-into-garmin-connect/

Thanks for great App!

How to get graph of W’ after training? In Connect or somehow else.

Thank you!

Hi!

Available now: https://www.trinakan.com/wp/2018/03/05/wbal-connect-iq-app-now-stores-data-and-make-it-available-into-garmin-connect/

You can analyze CIQ field data in SportTracks. π

For simple exponentials there is nothing necessarily different about a differential or integral calculation. They both have a “TAU” (pronounced “mean time”) built into them. In the differential form it may be less obvious that it’s actually a mean time, to someone who isn’t as expert with the math, possibly even the person who wrote it, I don’t know. In a differential approach there is a proportionality constant that determines the amount of change in proportion to the present difference between present power and steady state power (CP). That proportionality constant is equivalent to tau. To get a glimpse of this you only need to look at the slope (proportionality constant, ie derivative, ie differential) of a (1-e^-(t/tau)) graph at t=0. And the answer is… tau. The instantaneous differential proportionality IS tau.

The difference in the two approaches is most likely simply that they use a different value for tau. If the differential approach doesn’t have a tuning parameter for response time, it’s only because it was fixed and not made adjustable to the user.

Regardless of the equation, the real trouble with W’ is the unmanageable error in its calculation in the long run. In theory if you’re above CP by even 1 watt you are at an unsustainable power and say your W’ is 20kJ, then it will take about 30 minutes before you have 0 Wbal. In a sense, this is probably true. You’re either at your CP, or you’re above it and you’re going to bonk sometime before the hour is up, with continuously decreased overhead for a surge up to that point. That’s kind of the definition of CP (or ftp at least) right?

The problem is in reality that can be off by 20kJ. If your CP is one watt higher that day than you thought, then calculating things that way is telling you that you have zero sprint energy left when in reality, you have 100% of W’ left. Add to this the fact that even CP isn’t really constant or sustainable over a long ride, and it kind of becomes a mess.

Hmm, but wouldn’t it be nice to have some basic measure of how much surge energy we’ve put out in the last few minutes compared to our abilities? So digging deeper, the “integral form” of Wbal is not only exponential for recovery, but depletion as well. So depletions in the distant past become forgotten slowly even if you’re still above threshold. Is that physically right? It would mean that it’s possible to sustain levels above threshold. But it does match a desire to get an idea of recent match-stick efforts. It’s up to the rider to know that maybe they were already worn down before starting those efforts. It’s probably just not possible for the math to keep up with the book keeping of how tired you are that precisely. It seems like what’s been called the integral method is making a good compromise and apparently the “integral method” (ie the solution historically written in integral form) is now being calculated deferentially to make it one pass and faster to calculate.

Hi, many compliments for your blog. My question is this: you write “How to get my CP and Wβ values ?

To estimate your CP and Wβ values (if you donβt already know them), GoldenCheetah provides a tool in the βTools -> Estimate CP and Wββ menu. Here you can enter you maximum amount of watts for a short effort (3-5min) and a long one (15-60 minutes). Based on that, it will give you an estimation of Wβ and CP”

Where I can find something about this test? How to perform it? Is not the classical FTP test by Coggan and Allen true?

Thank you so much in advance.

Regards

Paolo