.. add W'bal Zoned to Histogram
- for a ride
- for a date range
- *NOT* for a compared ride
- for a compared date range
This makes the last of the updates for W'bal
in zone, but highlights the issues related to
W'bal being held in a different structure to
the rest of the ride data.
Need to think on how that might work better
for intervals.
.. SEGV on setting CP when no zones configured. Since
RideItem::updateIntervals() dereferenced a range
when CP is set, but none existed.
.. fixup use of Metadata field "W'" to override settings
in Metrics tab.
Dave Waterworth has fixed my implementation of W'bal to
remove my "optimisations" and fix the math.
The W'bal is now computed in a single pass and is just
as fast as the differential form from Andy Froncioni but
has the benefit that is still uses Tau.
Many thanks to Dave, and I'll write this up shortly.
.. previously we have computed below cp work as only that
work when power was at or below CP
.. since we want to track energy from CP and W' it makes more
sense to make below CP work include all work not from W' stores.
.. when computing W'bal decay -- since we know the half-life
for the decay we might as well use it rather than a pretty
big constant of 1 hour !
.. it saves about 35% of time to compute metrics
.. forgot to remove the threaded integrator which is no longer
needed and then found it is still being used by the minForCP()
method, so tidied that up.
Using Andy Froncioni's modification to the original
formula that removes the need for Tau and also lets
the exponentials drop out.
Massive speed improvement!
Added a few new training stress metrics whilst discussing
and working on a multicomponent view of training stress.
This is all a wip falling out of discussions around stress
metrics beyond the old TSS/BikeScore models.
For now this just includes;
1. Aerobic Training Impact Scoring System on PM/PMC
2. Work (Kj) above/below CP on PM/PMC
3. Aerobic TISS on the Ride Plot
There is lots more to come; specifically around Anaerobic TISS,
looking again at polarised training and personalised training stress
based upon the individual's CP model.
.. the calculation assumed 1s recording (or was just wrong)
joules are now calculated properly, this is especially
important for SRM recordings of 0.5s samples
.. No more cutoff of the decay. Since we use threads its
not such a big deal as before.
.. We now get a full, smooth decay till the end of the ride
which was much more noticeable when predicting W'bal for
a workout, than it was for a ride.
.. to save on computing cost the W'bal decay was only
calculated to 20mins and also bounds checked to a
decay of 0.1w, but of course, the decay is more like
25 minutes and 0.1w * 1500 samples is a lot... so
I've removed them.
.. the key optimisation is the way the decay is integrated
and that is skipped for samples where W' exp is zero ..
that optimisation reduces the amount of computing cost
to 25% of doing it for all samples.
For maximum W' capacity expended i.e. Min W'bal
expressed as a percentage of W'.
So if W' is 20 kJ and W'bal is 2kJ then 18 kJ
have been expended, which when expressed as a
percentage of W' (18/20 %) would be;
Max W' Exp of 90%
I also cleaned up a few extra instances of WPrime
being created when calculatinf metrics which was
not a big deal for the Metric refresh but would make
interval metrics painful.
.. if duration is overly large we don't want to get some
massive array, it will exhaust heap and cause a crash ..
and it is likely to just be bad data.