<!-- Generated by book/tools/make-index.py from the book source. -->

> Hedengren, J. (Ed.) (2027). Chapter 2: The Athlete as a System. In *Data-Driven Athletics: Measuring, Modeling and Coaching Human Performance with Video and Wearable Data* (pp. 20–51). IRSRI Sports Research Institute. CC BY 4.0.

**Question.** Why can a runner hold one pace for an hour, and a pace only a little faster for barely ten minutes?

**Objectives.**
- Trace oxygen from the air to a working muscle, compute oxygen uptake with the Fick relation, and name what limits each step.
- Describe the three energy systems by their power and capacity, and the durations each one dominates.
- Explain maximal oxygen uptake, the lactate threshold and economy as the three numbers behind endurance performance.
- Model heart rate and oxygen uptake after a step in work as first-order responses, and read a time constant from a recovery curve.
- Explain load, fatigue, recovery and adaptation as a dynamic system, and say why the same plan gives different results in two people.
- Fit heart rate against work rate as a linear regression, give the slope its units, read the residuals and compare the fit with a mean baseline.

# 2 The Athlete as a System

Sam is a 20-year-old student who runs and rides a bicycle. Sam is
made up, and so is every number this chapter measures on Sam, but each one is
typical of a fit student and each is computed by a script you can run. Sam has
noticed something every runner notices. On a good day Sam can hold
4:38 per kilometer for close to an hour. At 4:16 per kilometer,
only 8% faster, Sam is done in about ten minutes. Most machines do not behave like
this: run an engine a little harder, within its rating, and it does not stop
five times sooner. This
chapter explains why a body does, and gives you the physiology an engineer
needs and the engineering view an exercise scientist may not have met. By the
end you will have measured yourself in a step test, fitted two models to the
data, and built the first page of your own app.

## 2.1 Energy In, Work Out

A muscle is an engine that runs on chemical energy. Food is stored as
carbohydrate (glycogen in muscle and liver, glucose in blood) and fat. The
muscle cannot use either directly. It uses one molecule, adenosine
triphosphate (*ATP*), whose breakdown releases the energy that makes the
muscle's protein filaments slide past each other. Everything else in this
chapter is about how fast the body can rebuild ATP, and what that rebuilding
costs.

Like any engine, the muscle wastes most of what it burns. The ratio of
mechanical work out to chemical energy in is the *efficiency*. For
cycling, where work at the pedals is easy to measure, the gross efficiency of
trained cyclists riding at 300 W ranges from about 18.5 to
23.5% : roughly a quarter of the energy becomes
work and three quarters becomes heat. That heat is not a side
issue. It is why you sweat, why you slow down on a hot day, and why
Section 2.7 exists.

How do you measure the energy in? Almost all of it, during steady exercise,
comes from burning fuel with oxygen. Each litre of oxygen consumed releases
about 20.9 kJ (5 \kcal), the exact figure depending on the
mix of fat and carbohydrate being burned. The classical formula of Weir gives
19.7 kJ/L when the fuel is all fat and
21.1 kJ/L when it is all
carbohydrate , so the round number is good to a few
percent. Measure oxygen uptake and you have measured metabolic power.

> **Engineer's note: Energy, power and the units of the gym.**
> 
> Power is energy per unit time: 1 W is 1 J/s.
> Exercise science often counts energy in kilocalories (1 \kcal =
> 4.184 kJ; the “Calorie” on a food label is a kilocalorie) and
> oxygen uptake in litres per minute, or in millilitres per kilogram of body mass
> per minute so people of different sizes can be compared. To turn an oxygen
> uptake $\VO$ in L/min into a metabolic power in watts,
> 
$$> P_met = \frac{\VO \times 20\,900}{60}.
>$$

> Mechanical power is then $P_mech=\eta\,P_met$ for efficiency
> $\eta$, and the heat released is $(1-\eta)P_met$.

## 2.2 Three Energy Systems

The muscle holds only a few seconds' worth of ATP. It refills the store in
three ways, which differ in how fast they can deliver energy (power) and how
much they can deliver before they run out (capacity).

- **Immediate (phosphocreatine).**  A second compound in the muscle,
phosphocreatine, hands its phosphate to ADP (adenosine diphosphate, the spent
form of ATP) and rebuilds ATP in one step. This
is the fastest supply and the smallest. It carries the first seconds of a
sprint, a jump or a throw, and it refills during rest, using energy from the
aerobic system.

- **Glycolytic.**  Glucose and glycogen are split into pyruvate, rebuilding a
little ATP quickly without oxygen. When pyruvate is made faster than the
mitochondria (the cell's oxygen-burning compartments) can take it, it is converted to *lactate*. This system
carries most of the work in efforts of tens of seconds to a couple of minutes.

- **Aerobic (oxidative).**  In the mitochondria, carbohydrate and fat are
burned completely with oxygen. This is the slowest to start and by far the
largest: its fuel tank holds hours of work, and it supplies almost all the
energy in any effort longer than a few minutes.

The three are not switched on one after another. They all run all the time,
and what changes with the duration of an effort is their share. In a
review of the data from all-out efforts of different lengths,
Gastin  concluded that energy comes from every
pathway in almost all exercise, that the two anaerobic systems have high power
but limited capacity while the aerobic system has an enormous capacity but
cannot deliver energy quickly, and that the aerobic and anaerobic shares are
equal in an all-out effort lasting between one and two minutes, most probably
about 75 s. In anything longer, the aerobic system supplies most of
the energy. Table 2.1 summarizes the three.

*Table 2.1. The three energy systems as an engineer might describe them. The anaerobic pair together supply most of the energy in all-out efforts shorter than about 75 s, the aerobic system in longer ones .*

| System | Power | Capacity | Largest share |
|---|---|---|---|
| Immediate (phosphocreatine) | highest | smallest | first seconds |
| Glycolytic | high | limited | short all-out efforts |
| Aerobic | lowest | hours of fuel | beyond about 75 s |

An engineer's picture helps, if you hold it loosely. The immediate system is
a *capacitor*: huge current, tiny charge, recharged quickly from the
mains. The glycolytic system is a *battery*: less current, more charge,
slower to recharge. The aerobic system is a *generator* with a fuel tank:
modest power that it can hold for hours, limited by how fast fuel and oxygen
reach it. A sprint drains the capacitor; a 400 m race drains the
battery; a marathon is a question of the generator's rating and the size of
the tank.

> **Limits and cautions: Where the circuit analogy breaks.**
> 
> The three sources are not separate boxes wired in parallel. They share fuel
> (glycogen feeds both the battery and the generator), they share the product
> (lactate made by the battery is burned by the generator in the same and other
> muscles ), and the generator recharges the
> capacitor. “Running out” is also not a clean switch: fatigue is spread over
> the brain, the nerves and the muscle, and the body slows down long before any
> store reads zero.

## 2.3 The Oxygen Path

If most of the energy for anything longer than a couple of minutes comes from
oxygen, then endurance is set by how much oxygen reaches the muscle and how
well the muscle uses it. Follow one molecule.

> **Body science: From the air to the mitochondria.**
> 
> Air flows through the airways to tiny sacs in the lungs, the alveoli, where
> oxygen crosses a membrane about 0.5 \microm thick into the blood.
> Only about 1.5% of it travels dissolved in plasma; the rest is bound to
> hemoglobin in the red cells . The
> heart's right side pumps blood through the lungs; its left side pumps the
> oxygen-rich blood out through the arteries. In a working muscle the arteries
> branch into capillaries, oxygen leaves the hemoglobin, and it diffuses into the
> muscle cells to the mitochondria, where it is used. The blood returns through
> the veins with less oxygen than it left with, and the cycle repeats.

The heart's output, the *cardiac output* $Q$, is the volume of blood it
pumps each minute. It is the beats per minute times the volume per beat, the
*stroke volume* $\mathit{SV}$:

$$Q = \HR \times \mathit{SV}.$$

At rest a typical 70 kg adult has a stroke volume near
70 mL and a heart rate near 75 bpm, a cardiac output of
about 5.25 L/min . The oxygen the body
takes up is the blood flow times how much oxygen each litre of blood gives up
on its way around, the difference between the oxygen content of arterial and
mixed venous blood. This is the *Fick relation*:

$$\VO = Q \times (C_a - C_v) = \HR \times \mathit{SV} \times (C_a - C_v).$$

It is a mass balance, the same one a chemical engineer writes for a reactor:
flow in times concentration in, minus flow out times concentration out, is the
rate of consumption . The difference
$C_a-C_v$ cannot exceed what the arterial blood carries, so it is set partly by
hemoglobin. A maximally working limb leaves only about 15% of the oxygen that
reached it in its venous blood ; for the whole
body the extraction is lower, because some blood flows through organs that are
not working hard.

**Example 2.1: Sam's oxygen uptake from the Fick relation.**

Riding hard, Sam's heart rate is 180 bpm. Assume a stroke volume of
0.12 L and that each litre of blood gives up 150 mL
of oxygen on its way around the body. Cardiac output is $180\times0.12=\SI{21.6}{\litre\per\minute}$.
Oxygen uptake is $21.6\times0.150=\SI{3.24}{\litre\per\minute}$, or
$3240/70=\SI{46}{\milli\litre\per\kilo\gram\per\minute}$ for Sam's
70 kg. The script `code/hand_checks.py` prints
`Q = 21.6 L/min, VO2 = 3.24 L/min = 46.3 mL/kg/min`.

Which link in the chain limits the whole? In healthy people the weight of the
evidence points to the delivery of oxygen, mainly the maximal cardiac output,
rather than the muscle's ability to extract it, as the main limit on the highest oxygen uptake
a trained person can reach . That highest value
is the *maximal oxygen uptake*, $\VOmax$. It is the generator's rating.

Joyner and Coyle  explain endurance performance
with three numbers, which this book will use again and again:

- $\VOmax$, the size of the aerobic engine;

- the *lactate threshold*, the fraction of $\VOmax$ that can be held
for a long time (Section 2.5);

- *economy* (or efficiency), how much speed or power each litre of
oxygen buys.

Their product is the speed an athlete can sustain. Two runners with the same
$\VOmax$ can race very differently if one holds a higher fraction of it or
spends less oxygen per kilometer.

> **Check it by hand: Metabolic power and work at the pedals.**
> 
> Sam's 3.24 L/min of oxygen is
> $3.24\times20.9=67.7 kJ/min$, or
> $67\,700/60\approx1130 W$ by Equation \eqref{ch02-system:eq:pmet}. At
> 22% efficiency, $0.22\times1130\approx250 W$ reaches the pedals, and
> about 880 W is heat. Notebook check: `metabolic 1129 W, pedals
> 248 W, heat 880 W`.

\paragraph{Economy of running.} A useful rule is that running on the level
costs about 1 \kcal per kilogram of body mass per kilometer, nearly
independent of speed. In one study of nine trained runners the cost was
0.97 \kcal per kilogram per kilometer, independent of running speed and
in close agreement with earlier work . Sam's 10 km costs about
$1\times70\times10=\SI{700}{\kcal}$, or 2.9 \megaJ. Because
1 \kcal/kg/km is 4.184 J per kilogram
per metre, and a litre of oxygen releases 20.9 kJ, the rule
says a runner uses about 0.20 mL of oxygen per kilogram for
each metre. At Sam's hour pace of 3.6 m/s that is
1050 W of metabolic power and 43 mL/kg/min
of oxygen, close to the riding value above. The rule is an average: the oxygen
cost of running at a given speed can differ by 30 to 40% between
people , and that difference is one of Joyner and
Coyle's three numbers.

## 2.4 The Response to a Step

Step onto a treadmill moving at a steady speed. Your muscles' demand for ATP
jumps to its new level within a second. Your oxygen uptake does not: it climbs
over a minute or two, and your heart rate follows a similar curve. The gap
between demand and aerobic supply at the start is met from the capacitor and
the battery, and it is called the oxygen deficit.

To an engineer the climb looks like the response of a *first-order
system*: a tank filling through a valve, a thermometer dropped into hot water,
a capacitor charging through a resistor. If $y$ is the variable (oxygen uptake,
or heart rate), $y_0$ its starting value and $y_\infty$ the value it settles
at, then after a step at $t=0$

$$y(t) = y_\infty + (y_0 - y_\infty)\,\ee^{-t/\tau}.$$

The *time constant* $\tau$ is the time to cover 63% of the change. After
$2\tau$ the response has covered 86%, after $3\tau$ 95%, and after $5\tau$
it is within 1% of the end.

> **Engineer's note: Where the exponential comes from.**
> 
> A first-order system obeys $\tau\,\dd{y}{t} = -y + K u$: the rate of change is
> proportional to the distance from where the input $u$ would put it. For a step
> in $u$, the solution is Equation \eqref{ch02-system:eq:first} with
> $y_\infty = K u$. The gain $K$ says how far $y$ moves per unit input (for
> heart rate, beats per minute per watt); the time constant says how fast. Taking
> logarithms, $\ln\left(y-y_\infty\right)$ is a straight line in time with slope
> $-1/\tau$, so a straight-line fit gives $\tau$; the Heart app instead fits the
> curve itself (Section 2.12).

Below the first threshold (Section 2.5), oxygen
uptake behaves as a linear first-order system with a time constant of about
25 to 35 s after a delay of 15 to 20 s, and it
normally reaches a steady state within three minutes .
That is why the step test in Section 2.11 uses
three-minute stages. Heart rate also climbs over tens of seconds, as Sam's
data show. Core temperature is far slower, because the body has a large heat capacity
(Section 2.7).

\paragraph{The oxygen deficit.} While oxygen uptake catches up, the muscles
still need their energy, and the difference is met from the immediate and
glycolytic systems. Figure 2.1 shows the gap, the
*oxygen deficit*, as the area between the step in demand and the response.
For a first-order response with a delay $T_d$, the area is simple: the size of
the step times $(T_d+\tau)$.

*Figure 2.1. The oxygen deficit (shaded) after a step in demand from 0.5 to 3.0 L/min, for a response with a 17.5 s delay and a 30 s time constant, the middle of the ranges Whipp reports . The area is $2.5(17.5+30)/60 = 1.98 L$ of oxygen.*

**Example 2.2: Sam's oxygen deficit.**

Sam steps onto a treadmill at a pace that needs 3.0 L/min
of oxygen, from 0.5 L/min while standing. The step is
2.5 L/min, or 0.0417 L each second. With a
17.5 s delay and a 30 s time constant the deficit is
$0.0417\times47.5=\SI{1.98}{\litre}$ of oxygen, worth
$1.98\times20.9=\SI{41}{\kilo\joule}$, which the capacitor and battery must
supply. Oxygen uptake is within 5% of its new level at $17.5+3\times30 =
108 s$. Notebook check: `O2 deficit: 1.98 L = 41.4 kJ; 95%
of steady state at 108 s`. A fitter person with a shorter $\tau$ runs up a
smaller deficit for the same step.

Figure 2.2 shows Sam's synthetic heart rate through a whole step test: three steps up, each
followed by a first-order climb, and a first-order fall in recovery.

*Figure 2.2. Sam's synthetic step test. Heart rate rises toward a new level at each stage and falls in recovery, both as first-order responses. The squares are the 15-second pulse counts a partner took; they sit below the strap's line at the end of each stage because heart rate has already begun to fall by the time the count starts. Data: `data/steptest_hr.csv` and `steptest_counts.csv` (synthetic).*

\paragraph{Drift.} At a steady moderate pace held for more than about ten
minutes, heart rate creeps upward while the work stays
the same. This *cardiovascular drift* goes with a progressive fall in stroke
volume after 10 to 20 minutes of exercise. Coyle and Gonz\'alez-Alonso argue
that the rising heart rate itself, which leaves less time for the heart to
fill, is the main cause of the falling stroke volume, rather than blood being
diverted to the skin as the body warms . Physiologists
still debate the mechanism; the pattern is not in doubt. Drift means heart rate
is not a pure gauge of work: the same 150 bpm is a lower pace at minute
50 than at minute 10.

\paragraph{Recovery.} When work stops, heart rate falls. The first part of the
fall is fast and is driven by the nervous system's brake on the heart, the
vagus nerve; Imai and colleagues showed the fall in the first half minute is
faster in athletes than in untrained people . A
single exponential fitted over the first few minutes gives a recovery time
constant, which the Heart app reports.

**Example 2.3: A recovery time constant read by hand.**

Sam's partner counted 31 beats in the 15 seconds starting 2 s
after Sam stopped (124 bpm, centered 9.5 s after the stop),
and 22 beats in the 15 seconds starting at one minute (88 bpm, centered
at 67.5 s). Sam's heart rate settles near 78 bpm. From
Equation \eqref{ch02-system:eq:first}, two points on the same exponential
satisfy

$$\tau = \frac{t_2 - t_1}{\ln\!\big[(y_1-y_\infty)/(y_2-y_\infty)\big]}
= \frac{58}{\ln(46/10)} = \frac{58}{1.526} = \SI{38}{\second}.$$

If the floor were 76 bpm instead, $\tau$ would be 42 s: the
answer is sensitive to the floor you assume. The full fit to the strap's
second-by-second data gives 50.5 s (Listing 2.5),
the value the synthetic data were built with. Notebook check:
`code/checks_extra.py` prints `two-point tau: 38.0 s; floor 76:
41.8 s`.

> **Try it in the app: A first look at the Heart app.**
> 
> The Heart app reads a chest strap's ECG file, finds every beat, and reports,
> among much else, the heart-rate drop at 30, 60 and 120 seconds after the
> end of work and a recovery time constant. You will use it fully in
> Chapter 5. This week, make Sam's step test into a strap-style file
> with `code/make_heart_csv.py`, open it in the app with age 20, and
> find “Recovery time-constant $\tau$” in the workout results. Compare it with
> the 50 s the data were built with, then read
> Section 2.12 to see what this check once caught.
> 
> 
> https://apopt.com/heart/

## 2.5 Thresholds

Now Sam's puzzle. Run a person through a test in which the pace rises a
little every few minutes, and take a drop of blood at each stage. At easy
paces the lactate concentration in the blood stays near its resting value,
about 1 mmol/L. Past a certain pace it starts to rise
above rest; past a second, higher pace it no longer settles at a steady value
at all, but climbs for as long as the pace is held. These two bends are the
*first* and *second thresholds*. There are many ways to define and
detect them, from blood lactate, from breathing and from fixed concentrations,
and they do not all agree .

> **Body science: Lactate is a fuel, not a waste.**
> 
> Lactate was long thought to be a waste product of exercise without oxygen.
> It is now known to be formed continuously under aerobic conditions, to be a
> major fuel for other tissues, and to be the main raw material from which the
> liver makes new glucose . Its
> concentration in the blood is the balance of production and removal. A rising
> lactate tells you production has outrun removal, a sign of how hard the
> glycolytic “battery” is working, not that a poison is building up. This is
> why the book calls lactate a marker.

A threshold, then, is a definition applied to a curve, and two reasonable
definitions can give two different answers. Figure 2.3
shows Sam's synthetic incremental test, with the pace raised by
0.2 m/s every stage. Listing 2.1
applies two rules of the kinds Faude and colleagues
catalog : a rise of 0.5 mmol/L
above the lowest value, and a fixed concentration of
4 mmol/L. The parameters are chosen for illustration.

*Figure 2.3. Blood lactate in Sam's synthetic incremental test. Two threshold rules, applied to the same points, give speeds 0.55 m/s apart (squares). Data: `data/lactate_steps.csv` (synthetic).*

**Listing 2.1.** Two threshold rules on one lactate test (`code/lactate_rules.py`). (`code/lactate_rules.py`)

```python
# Two threshold rules applied to the same (synthetic) lactate test.
import numpy as np
import pandas as pd

df = pd.read_csv("ch02-system/data/lactate_steps.csv")
v, lac = df.speed_ms.to_numpy(), df.lactate_mmol.to_numpy()

def speed_at(level):                     # first crossing, linear between stages
    i = np.argmax(lac >= level)
    return v[i-1] + (level - lac[i-1]) * (v[i] - v[i-1]) / (lac[i] - lac[i-1])

rise = speed_at(lac.min() + 0.5)         # rule A: 0.5 mmol/L above the lowest value
fixed = speed_at(4.0)                    # rule B: a fixed 4 mmol/L
for name, s in (("A: lowest + 0.5", rise), ("B: fixed 4.0", fixed)):
    print(f"rule {name:16s} {s:.2f} m/s  ({1000/s//60:.0f}:{1000/s%60:02.0f} per km)")
```

```text
rule A: lowest + 0.5  3.33 m/s  (5:00 per km)
rule B: fixed 4.0     3.88 m/s  (4:18 per km)
```

The two “thresholds” are more than 40 seconds per kilometer apart. Neither is
wrong; they answer different questions. When you read a threshold in a report,
ask which rule produced it, and compare an athlete only with numbers produced
by the same rule.

The second threshold matters most for Sam's question. Below it, the body
reaches a steady state: oxygen uptake, lactate and heart rate settle (apart
from drift), and the pace can be held for a long time. Above it there is no
steady state. Oxygen uptake keeps creeping upward, the so-called slow
component , until it reaches its maximum, and the
effort ends soon after . Exercise
physiologists call the boundary the *critical power* (for running, the
*critical speed*); it lies close to the highest steady lactate, the
maximal lactate steady state .

Above critical speed the extra work draws on a fixed reserve, written $D'$ for
running (a distance) or $W'$ for cycling (an energy). If $\mathit{CS}$ is the
critical speed, the time a runner can hold a speed $v$ above it is

$$t = \frac{D'}{v - \mathit{CS}}.$$

This is the hyperbola of Figure 2.4. It answers the
chapter's question. Say Sam's critical speed is 3.6 m/s
(4:38 per kilometer) and $D'$ is 200 m. At
3.9 m/s (4:16 per kilometer, 8% faster), the
reserve drains at 0.3 m every second and lasts
$200/0.3 = \SI{667}{\second}$, about 11 minutes. At critical speed itself,
nothing drains, and Sam is limited by other things: fuel, heat, and the slow
fatigue of an hour's work. A small change in pace crosses a boundary between
two regimes, and that is why the time to exhaustion changes so much.

*Figure 2.4. The critical-speed model for Sam (illustrative values, $CS=3.6 m/s$, $D'=200 m$). Above the dashed line every second costs part of a fixed reserve, so time to exhaustion falls steeply as speed rises. Below it, the model has nothing to say about time; other limits take over.*

> **Limits and cautions: Where the model breaks.**
> 
> Equation \eqref{ch02-system:eq:cs} predicts that a pace at or below critical
> speed can be held forever. Nobody can: as Poole and colleagues put it, no
> exercise can ever be undertaken indefinitely . The
> model is usually fitted to trials that end in exhaustion within about 2 to 15
> minutes, and work above critical power lasts at most about half an
> hour . Outside that window, use it with care.

> **Check the AI: A threshold you can hold for an hour?.**
> 
> An AI assistant, given Sam's lactate table, writes: “Your lactate threshold
> is 3.88 m/s (4:18 per kilometer), the pace you can hold for
> an hour.” The number is rule B's, but the claim is wrong. A fixed
> 4 mmol/L is one definition among many, and with Sam's
> critical speed of 3.6 m/s and $D'=200 m$,
> 3.88 m/s would last about $200/0.28\approx714 s$,
> some 12 minutes. Ask the assistant which rule it used, and check any “hold
> for an hour” claim against the athlete's own long efforts.

### 2.5.1 Why the curve bends

Think of the lactate in your blood as water in a tank. Working muscle pours
it in; the heart, the liver and other muscles draw it out, and they draw out
more when there is more of it (Chapter 7 writes this as a mass
balance). The level settles where the outflow matches the inflow. Two things
change as the pace rises, and together they bend the curve.

The inflow grows faster than the pace. Each step up in speed asks for more ATP
from glycolysis, and it also brings new fibers into play: as intensity rises
more fast-twitch fibers are recruited, and these fibers are better suited to
producing lactate .

The outflow has a ceiling. Removal rises with concentration, but not without
limit. Messonnier and colleagues measured lactate kinetics with tracers while
trained and untrained men exercised for an hour at their lactate threshold. The rate at which
lactate was cleared from the blood reached its peak *below* the
threshold, and they concluded that the threshold marks a limit in
clearance . Put the two together. At easy
paces the outflow keeps up with little effort and the level sits near rest:
the flat part. Higher up, each extra bit of inflow needs a larger rise in
concentration before the outflow matches it: the bend. Once the inflow is
larger than the largest outflow the body can reach, the level never settles:
the climb.

> **Body science: One muscle makes it, its neighbor burns it.**
> 
> Lactate does not have to leave the muscle to be used. Lactate made in a
> fast-twitch, glycolytic fiber can be taken up and oxidized by a slow-twitch,
> oxidative fiber next to it, by the heart, or by the liver, which turns it back
> into glucose. Brooks calls this the lactate shuttle .
> A blood sample sees only what spills over into the circulation, the
> difference between what all tissues release and what all tissues take up. That
> is why the same concentration can mean high production with fast removal, or
> low production with slow removal.

### 2.5.2 Three domains of intensity

Physiologists divide steady exercise into three *domains of intensity*
by what happens when the pace is held constant :

- **Moderate,**  below the first threshold. Oxygen uptake and blood lactate
reach a steady state quickly, with lactate near its resting value.

- **Heavy,**  between the first threshold and critical speed. A steady state
is still reached, but later and higher, and oxygen uptake carries an extra
slow component.

- **Severe,**  above critical speed. There is no steady state: oxygen uptake
and lactate climb until oxygen uptake reaches its maximum and the effort
ends .

The lower boundary is the first (lactate or gas-exchange) threshold; the upper
one is critical power or critical speed, which typically falls at 75 to 90%
of $\VOmax$ . Figure 2.5
shows the three behaviors from the tank model: a removal that saturates, and a
production that grows steeply with speed (`code/domains.py`; the
parameters are illustrative and chosen to put Sam's critical speed at
3.6 m/s).

*Figure 2.5. Blood lactate during 30 minutes at three constant paces, from a tank model with a saturating removal (illustrative parameters). The moderate pace settles within minutes near rest; the heavy pace settles later and higher; the severe pace has no steady state and climbs out of the frame. Data: `data/domains.csv` from `code/domains.py`.*

Running the script prints the boundaries the model implies:

```text
first threshold (steady + 0.5) 2.88 m/s
MLSS by the 30-minute rule     3.31 m/s
no steady state above          3.60 m/s (9% above MLSS)
```

The first line applies a rule like rule A to the steady-state levels. The
second applies the usual laboratory test for the maximal lactate steady
state, MLSS: a series of 30-minute runs on separate days, each at a constant
speed, and MLSS is the fastest one in which lactate rises by no more than
1 mmol/L between minutes 10 and
30 . The third is where the inflow equals the
largest outflow, the model's critical speed.

Why are MLSS and critical speed not the same number, when both claim to be
the highest steady state? Look at the dashed curve. Close to the upper
boundary the tank fills slowly, and it is still rising at minute 30 even at
speeds where it would settle given longer. The 30-minute rule calls those
speeds “not steady” and so lands below the true boundary. Jones and
colleagues argue that this is what happens in the laboratory: because of how it
is defined, MLSS falls below critical power, by about 7% on average across studies
(individual studies range from 1% to 16%), and critical power is the real
boundary between the heavy and severe domains .
Each number also carries its own measurement error, so on any one day the gap
can be larger or smaller. For Sam, then, “threshold” could mean
2.88, 3.31 or 3.60 m/s: three answers to
three different questions. Name the boundary, and the rule that found it.

## 2.6 Muscle

A skeletal muscle is a bundle of long cells, the muscle fibers, each packed
with filaments of two proteins, actin and myosin. Myosin heads grab actin,
pull, let go and grab again, each cycle spending one ATP. Three facts about
this machine matter for the rest of the book.

\paragraph{Fiber types.} Human muscle fibers are named by the form of myosin
they carry: type I (slow twitch, relatively fatigue-resistant), type IIa
(faster, oxidative and glycolytic) and type IIx (fastest, but highly
fatigable), with hybrid fibers between them .
Every muscle is a mix, and the mix differs between people, partly because of
genes and partly because of training .

\paragraph{Length and speed.} The force a fiber can make depends on its
length: it is greatest at a middle length where actin and myosin overlap best,
and falls when the fiber is stretched or squashed beyond
it . Force also depends on speed. The faster a
muscle shortens, the less force it can make, along a curve that A. V. Hill
described as a hyperbola :

$$(F + a)(v + b) = (F_0 + a)\,b,$$

where $F_0$ is the force when the muscle is held still and $a$, $b$ are
constants. Power is $F\times v$. It is zero when the muscle is held still and
zero again at its top speed, and it peaks between, at about a third of the top
speed and a third of the maximal force when $a/F_0$ is about
0.25 (Figure 2.6). This is why a cyclist chooses a gear,
and why a jump is not done with locked knees: both aim to put the muscle near
the top of its power curve. Chapter 3 and Chapter 10
build on this.

*Figure 2.6. Hill's force–velocity curve with $a/F_0=0.25$ and the power it implies. Power peaks at about 31% of the maximal shortening speed, where force is also about 31% of its maximum. Values from `code/checks_extra.py`.*

\paragraph{The stretch–shortening cycle.} In running, jumping and throwing, a
muscle is usually stretched under load just before it shortens: the calf as
the foot lands, the thigh in the dip before a jump. Compared with a pure
shortening action, this *stretch–shortening cycle* gives a clear gain in
performance, with more force at a given shortening
speed . You can test it on yourself with the jump
app, comparing a jump with a dip and a jump from a held squat
(Exercise 2.10).

## 2.7 Heat and Fluid

Go back to Sam's ride. About 880 W of heat must leave the body, or
the body warms. Some leaves by convection and radiation from the skin; whatever is left must
leave by the evaporation of sweat, and whole-body sweat rate rises in direct
proportion to that evaporative requirement . Each
gram of sweat that evaporates at 30 °C carries away about
2426 J .

> **Check it by hand: How much sweat?.**
> 
> If all 880 W left by evaporation, Sam would need to evaporate
> $880/2426=0.363 g$ of sweat each second, or
> $0.363\times3600=1.3 kg$, about 1.3 L, an hour. Sweat
> that drips off without evaporating removes no heat, so the real rate is higher.
> At that rate Sam loses 2% of body mass (1.4 kg) in about an
> hour. Notebook check: `sweat 1.31 L/h; per 2% of body mass: 64 min`.

Sweat rates vary considerably between people, so the American College of
Sports Medicine's position stand recommends a drinking plan fitted to the
person, with the goal of preventing a water loss of more than 2% of body
mass during exercise . Your own rate can be
estimated by weighing yourself before and after a
session , a field exercise in Chapter 7.

What if the heat cannot leave? Heat-balance studies have long used a
specific heat for the body of 3.47 kJ per kilogram per degree; a
recent calculation from the masses and properties of 24 tissues gives about
2.98 kJ/kg/\kelvin . Sam's
70 kg then hold 209 to 243 kJ/\kelvin. With
880 W going in and nothing going out, Sam's temperature would rise by
$880\times60/243\,000=\SI{0.22}{\kelvin}$ to 0.25 \kelvin every minute:
two degrees in under ten minutes. Even a “constant” from a textbook can move
by 15% when someone measures it. In real life most of the heat does leave, so core temperature rises far more
slowly than this. That large heat capacity is why temperature is the slowest of the responses in
Section 2.4, and why, when the air is hot and humid and
sweat cannot evaporate, it keeps rising.

> **Limits and cautions: Heat is a safety issue.**
> 
> Exercise in the heat can cause heat illness, even in fit athletes. Every
> field protocol in this book has a stop rule. Stop, cool down and get help if a
> person becomes confused, stops sweating in the heat, feels faint or vomits.
> Nothing in this chapter is a test of heat tolerance, and none should be
> improvised.

## 2.8 Training as a System

A training session is a disturbance. It tires you today and, if you recover,
leaves you a little fitter. An engineer would call training a dynamic system
with an input (the *training load*), a state that changes slowly (fitness)
and a state that changes quickly (fatigue).

\paragraph{Load.} Load can be described by what the athlete did (distance,
pace, power, repetitions: *external load*) or by what it cost the body
(heart rate, perceived effort: *internal load*). Two athletes doing the same
external session can have very different internal loads. One
heart-rate measure of internal load is Banister's training impulse,
*TRIMP*. The Heart app sums it over every clean beat as

$$\mathrm{TRIMP} = \sum_\text{beats} \frac{\mathit{RR}}{60\,000}\, f\, 0.64\, \ee^{1.92 f},
\qquad f = \frac{\HR-\HR_\text{rest}}{\HR_\text{max}-\HR_\text{rest}},$$

with $\mathit{RR}$ the beat interval in milliseconds, $\HR_\text{max}$ the
maximal heart rate and $\HR_\text{rest}$ a resting rate (the app takes the
session's own low heart rate, its 5th percentile capped at 80 bpm), so
each minute counts more the closer it is to maximal heart rate.
Chapter 5 works through it by hand.

\paragraph{Fitness and fatigue.} Banister's impulse–response model treats the
daily load $w$ as the input to two first-order systems in
parallel . Each day's load adds to a fitness
that decays slowly (time constant $\tau_1$, weeks) and to a fatigue that decays
quickly ($\tau_2$, days). Performance is a baseline plus fitness minus fatigue:

$$p(t) = p_0 + k_1\sum_{s<t} w(s)\,\ee^{-(t-s)/\tau_1} - k_2\sum_{s<t} w(s)\,\ee^{-(t-s)/\tau_2}.$$

Because fatigue weighs more ($k_2>k_1$) but fades faster, a hard block of
training first lowers performance and only later raises it, and a short
reduction in load before a race, a taper, lets fatigue fall while fitness
stays. Figure 2.7 shows this with illustrative
values: performance peaks 17 days after the taper starts.

*Figure 2.7. Banister's fitness–fatigue model (Equation 2.7) on a made-up plan: six weeks of 400 load units a week, two lighter weeks, then rest. Illustrative parameters $k_1=1$, $k_2=2$, $_1=42 $, $_2=7 $. Performance is below its baseline for the first 12 days, rises through the block, and is highest on day 59. Data: `data/banister.csv` from `code/banister.py`.*

> **Limits and cautions: Where the training model breaks.**
> 
> The four constants of Equation \eqref{ch02-system:eq:banister} differ from
> person to person and drift over a season, and fitting four constants needs
> many performance tests, each of them noisy. The
> model has no ceiling, so it predicts that doubling the load doubles the gain;
> in reality too much load with too little recovery leads first to
> overreaching. A short dip that ends in improvement after recovery is
> functional overreaching; a longer one is not, and in the worst case the result
> is the prolonged maladaptation called *overtraining
> syndrome* . Treat the model as a way to
> think, not as a calculator for a plan.

> **Body science: What changes when you train.**
> 
> Endurance training raises $\VOmax$ mainly by raising the heart's maximal
> output , and it changes the muscles too: fibers
> can shift between types and hybrids form, under the joint influence of
> training and genes . These are slow changes, over
> weeks and months, which is why the fitness term in Banister's model has a long
> time constant.

\paragraph{Recovery, sleep and fuel.} Adaptation happens in recovery, not in
the session. The building of new mitochondria and capillaries, the repair of
muscle and the refilling of glycogen need time, sleep and food. An athlete who
trains hard while sleeping badly or eating too little is adding load to a
system whose recovery has been slowed. Unexplained fatigue, falling
performance and mood changes that persist are reasons to reduce load and to
talk with a clinician.

\paragraph{The simulators.} If you want to watch these ideas move, the
control-engineering series has two pacing simulators at
https://apmonitor.com/apps/. The treadmill simulator
(https://apmonitor.com/apps/treadmill-runner/) runs one hour with belt
speed as its only control, against limits on lactate, a heart-rate band set
from $220-\text{age}$, core temperature and carbohydrate. The cycling
simulator (https://apmonitor.com/apps/cycling-rider/) commands effort
rather than watts, and every watt above critical power is drawn from a finite
$W'$. Change the pace by a few percent and watch which limit is reached first.

### 2.8.1 The adaptation cycle

Coaches draw training as a cycle of four steps. A session is a
*stress*; it leaves *fatigue*; during *recovery* the body
repairs and refills; and if the stress was large enough it rebuilds a little
more than it lost, an *adaptation*. The usual picture,
*supercompensation*, shows capacity dipping after a session, climbing
back past its old level, and sliding back if no new session follows. The
art, in this picture, is to train again near the top of the overshoot.

You have already met this curve. Feed a single session into Banister's model
(Equation 2.7) and the output is exactly the
supercompensation shape (Figure 2.8): with the
illustrative constants of Figure 2.7, performance
drops at once, is back to baseline on day 5.8, peaks on day 20.9, and fades
over the following weeks.

*Figure 2.8. The supercompensation picture is Banister's model answering one session: fatigue ($k_2=2$, $_2=7 $) outweighs fitness ($k_1=1$, $_1=42 $) at first and fades sooner. Illustrative constants; `code/m2m3_checks.py`.*

Hold the picture loosely, for three reasons. First, the body is not one tank
that refills: different systems recover on different clocks. After a session
the heart's nervous control does not recover in step with the energy stores or
the muscles , so there is no single
moment of “full recovery”. Second, the curve for one session is far too
small to measure; what you can measure is the sum of many sessions. Third, the
size and timing of the response differ from person to person and from one
part of a season to another .

\paragraph{Principles.} The rules of thumb that coaches call the principles
of training follow from the cycle. Table 2.2
lists them with a sign you could look for in an athlete's record.

*Table 2.2. Principles of training, each with one measurable sign.*

| Principle | Meaning | A sign in the record |
|---|---|---|
| Overload | Adaptation needs a load above what the body is used to | Weekly load above the mean of the past four weeks |
| Progression | Raise the load as the body adapts | The same session at a lower heart rate, then a harder session |
| Specificity | You adapt to what you train | The test most like the training improves most |
| Reversibility | Gains fade when the load stops | Retest after a break is worse |
| Individual response | The same plan gives different gains | Changes in a squad spread from near zero to large |
| Diminishing returns | Each block of the same load buys less | Smaller change per test as the record grows |

### 2.8.2 Time scales

How long is “recovery”? It depends on what is recovering.
Table 2.3 gathers ranges from reviews. They are
for healthy, trained adults and vary widely between people.

*Table 2.3. How long adaptation and recovery take.*

| What changes | Time scale |
|---|---|
| Muscle glycogen | A fast phase in the first 4 hours, then a slower one to about 24 hours, set mainly by the total carbohydrate eaten |
| Heart's nervous control (seen in heart-rate variability) | Up to 24 h after an easy session, 24–48 h after threshold work, at least 48 h after high-intensity work; faster in fitter people |
| Muscle force after damage | A few days after normal training such as downhill running; more than a week after unaccustomed, maximal eccentric work |
| Taper before a race | About two weeks |
| Losing fitness | $\VOmax$ , blood volume and the lactate threshold fall within 4 weeks of too little training |
| Gaining $\VOmax$ | Weeks to months; after 20 weeks of the same program, gains ranged from near zero to over 1 L/min |

> **Engineer's note: Every row is a time constant.**
> 
> Each row of Table 2.3 behaves roughly like the
> first-order response of Section 2.4, with its own time
> constant: Equation \eqref{ch02-system:eq:first} with hours or weeks in place
> of seconds. If “recovered” means 95% of the way back, the time constant is
> a third of the recovery time. Listing 2.2 turns
> three rows into time constants and asks how much is still missing the next
> morning. The last two lines feed a constant daily load into the slow fitness
> term of Banister's model ($\tau_1=42 \day$, illustrative): fitness
> approaches a plateau, and each week adds less than the one before. That is
> diminishing returns, from nothing but a first-order system.

**Listing 2.2.** Recovery times as time constants (`code/time_scales.py`). (`code/time_scales.py`)

```python
# Recovery times read as first-order responses; "complete" = 95 %, i.e. 3 tau.
import numpy as np

rows = [("glycogen refilled", 24),         # hours to "complete"
        ("heart, easy session", 24),
        ("heart, threshold session", 48)]
for name, hours in rows:
    tau = hours / 3
    left12, left24 = np.exp(-12 / tau), np.exp(-24 / tau)
    print(f"{name:25s} tau {tau:2.0f} h; missing {100 * left12:2.0f}% "
          f"at 12 h, {100 * left24:2.0f}% at 24 h")

tau1 = 42.0                              # fitness, days (illustrative)
plateau = 1 / (1 - np.exp(-1 / tau1))    # fitness per unit daily load
week = lambda n: np.exp(-7 * (n - 1) / tau1) - np.exp(-7 * n / tau1)
print(f"fitness plateau {plateau:.1f} x daily load; 95% after {3 * tau1:.0f} d")
print(f"gained in week 1 {100 * week(1):.0f}%, week 6 {100 * week(6):.0f}%, "
      f"week 12 {100 * week(12):.0f}% of the plateau")
```

```text
glycogen refilled         tau  8 h; missing 22% at 12 h,  5% at 24 h
heart, easy session       tau  8 h; missing 22% at 12 h,  5% at 24 h
heart, threshold session  tau 16 h; missing 47% at 12 h, 22% at 24 h
fitness plateau 42.5 x daily load; 95% after 126 d
gained in week 1 15%, week 6 7%, week 12 2% of the plateau
```

Banister's model keeps only two of these clocks, one fast and one slow. A
model with one time constant per row would be more faithful and impossible to
fit from one athlete's data; that trade-off runs through the rest of the book.

### 2.8.3 Dose and intensity distribution

The dose of training has three parts: *volume* (how much),
*intensity* (how hard) and *frequency* (how often). Endurance
athletes spread their intensity in a recognizable way. Descriptive studies of
nationally and internationally competitive endurance athletes training 10 to
13 times a week converge on about 80% of sessions at low intensity (blood
lactate below about 2 mmol/L, the moderate domain) and
about 20% dominated by hard work such as intervals near 90% of
$\VOmax$ . Studies that made already
well-trained athletes do more high-intensity intervals have not shown
convincing long-term gains . Two cautions when you
compute a distribution: say whether you count sessions or minutes, because
the two give different shares, and say which boundaries define a zone (the
domains above, or heart-rate zones as in Chapter 5).

Recovery is part of the dose. Section 5.7 gathers the
ways to watch it, resting heart rate, heart-rate variability, sleep, perceived
effort and a short wellness score, in one table with what each can and
cannot show.

### 2.8.4 Periodization, taper and detraining

*Periodization* is the planning of load in cycles, from the week to the
block of several weeks to the season, so that the athlete is fittest when it
matters. The classic models look different but rest on shared assumptions,
and Kiely argues that because training responses vary so much between people,
a plan should respond to the athlete's measured response rather than follow
a fixed rule . That is an argument for the record
you will keep in this course.

The *taper* is the best-studied piece. A meta-analysis of 27 studies in
competitive athletes found the largest performance gain with a taper of about
two weeks in which training volume falls by 41 to 60%, while intensity and
frequency are kept . In Banister's terms you
cut the input so that the fast fatigue term drains while the slow fitness term
barely moves (Figure 2.7).

The opposite of training is *detraining*. Less than four weeks of too
little training brings a rapid fall in $\VOmax$ and blood volume and a lower
lactate threshold in highly trained athletes ;
over longer breaks, recently gained $\VOmax$ is lost completely. Most of this
can be avoided by a reduced program that keeps the intensity, cuts frequency
only moderately and cuts volume a lot .

### 2.8.5 What moves a threshold

Endurance training raises the body's capacity to produce, dispose of and
clear lactate. At their lactate thresholds, the clearance rate of Messonnier's trained
men was 34% higher than that of the untrained men .
In the tank model a larger clearance is a larger maximum outflow. Run
`code/domains.py 1.2` to raise it by 20% with the production
unchanged:

```text
removal max 1.20; resting lactate 0.80 mmol/L
first threshold (steady + 0.5) 2.96 m/s
MLSS by the 30-minute rule     3.40 m/s
no steady state above          3.67 m/s (8% above MLSS)
```

The whole curve moves right and down: every boundary shifts by 0.07 to
0.09 m/s, and the resting level falls. Training also
changes production, so real curves shift by more and less than this; the
model shows only the direction. A threshold also moves back down within weeks
of stopping . Whether *your* threshold
moved is a question about measurement error: a retest weeks later has to beat
the typical error of the test (Section 11.1.3).

## 2.9 Differences Among Athletes

Every number in this chapter has been one person's. Real athletes differ, and
a reference value from one group can mislead in another.

\paragraph{Age.} Maximal heart rate falls with age. The familiar
$220-\text{age}$ is a rough rule. A meta-analysis of 351 studies with 18 712
people found $208-0.7\times\text{age}$ fits better: $220-\text{age}$
overestimates the maximum of young adults and underestimates that of older
ones, and individuals scatter about the line with a standard deviation of
about 10 bpm . For a 20-year-old the two
equations give 200 and 194 bpm, but any one person can sit 10 or 20
beats from either. The Heart app uses
$220-\text{age}$ from the age you enter.

\paragraph{Sex.} After puberty, the best men's endurance performances are
about 10 to 12% faster than the best women's. The gap probably centers on
$\VOmax$, which is lower in women mainly because of higher body fat and lower
red cell mass for a given body weight . The gap says nothing about any one
pair of athletes, and women were long underrepresented in the studies from
which many reference values come.

\paragraph{Training history and genes.} When 481 previously sedentary
adults from 98 families did the same 20-week training program in the HERITAGE
Family Study, their gains in $\VOmax$ averaged about 0.4 L/min
but ranged from little or nothing to more than 1 L/min, and
the gains clustered in families, with a heritability of up to
47% .
The same plan gives different results in two people. This is the strongest
reason in the book to compare an athlete with their own baseline, not with a
table.

\paragraph{Body size and units.} Three athletes each take up
3.5 L/min of oxygen at their maximum. Per kilogram, the
55 kg athlete scores 63.6 mL/kg/min,
the 70 kg athlete 50.0 and the 85 kg athlete 41.2.
Which is “fittest” depends on the task: carrying your own mass uphill favors
the per-kilogram number, pushing a boat or a scrum favors the absolute one.
Dividing by body mass is a modeling choice, and like every normalization it
helps some comparisons and distorts others.

> **Key idea.**
> 
> A reference range is a summary of other people. Measure the person in front
> of you, record how you measured, and compare them with themselves first.

## 2.10 Putting It Together: Sam's Hour

Every relation in this chapter can now be chained, the way an engineer sizes a
plant from its duty. Take Sam's hour at critical speed,
3.6 m/s, and ask what the body must supply.
Table 2.4 runs the chain; `code/sams_hour.py`
prints every line.

*Table 2.4. Sam's hour at 3.6 m/s, built from the chapter's relations. The stroke volume and extraction are the assumed values of Example 2.1.*

| Step | Relation | Value |
|---|---|---|
| Distance | $v\times\SI{3600}{\second}$ | 12.96 km |
| Metabolic power | 4.184 J/kg/m $\times m\times v$ | 1054 W |
| Energy | power $\times$ time | 3.80 (907 ) |
| Oxygen uptake | $P_\text{met}\times60/20\,900$ | 3.03 L/min (43 mL/kg/min) |
| Cardiac output | $\VO/(C_a-C_v)$ , 150 mL/L | 20.2 L/min |
| Heart rate | $Q/\mathit{SV}$ , 0.12 L | 168 bpm |
| Heat to shed | all of $P_\text{met}$ (level running) | 1054 W |
| Sweat, if all evaporated | heat $/\SI{2426}{\joule\per\gram}$ | 1.56 L/h |
| 2% of body mass lost | 1.4 kg $/$ sweat rate | after 54 min |

Two lines deserve comment. First, the heat. A cyclist turns about a fifth of
the energy into work at the pedals, and that work leaves the body. A runner on
level ground at a steady speed does no net work on the surroundings: each
stride lifts and speeds up the body and then lets it fall and slow down again,
and the mechanical energy ends as heat in the muscles, tendons and shoes. So,
to a good first approximation, all of a level runner's metabolic power must be
shed as heat. That is one reason a hot day costs a runner more than a rider,
who also has the cooling of a 10 m/s breeze.

Second, the heart rate. Running the Fick relation backwards gives
168 bpm, a plausible number for an hour's hard running at 20, and well
below the predicted maximum of 194 bpm. But it rests on two assumed
values, and a 10% error in stroke volume moves it by 15 to 19 bpm. It
also ignores drift. The chain is useful because it shows which numbers matter
and how they are linked, not because the last digit is right. That is the use
of a model in this book: to tell you what to measure next.

## 2.11 Measuring Yourself: A Step Test

You can measure the response to a step in work with a bench, a metronome and
a partner who can count. The protocol is Field Exercise 2.18;
here is what Sam's synthetic data look like and how to analyze them.

Sam steps up and down a 0.30 m bench for three 3-minute stages at
15, 20 and 25 step cycles a minute (a cycle is up, up, down, down; set the
metronome to four beats per cycle, so 60, 80 and 100 beats a minute). The
power spent lifting the body is $m g h$ times cycles per second:
$70\times9.81\times0.30\times15/60=\SI{51.5}{\watt}$ for the first stage, and
68.7 W and 85.8 W for the others. Stepping down and
swinging the legs cost energy too, so this “lifting power” is an index of
work, not the whole of it. After each stage Sam stops and the partner counts
beats for 15 seconds, starting two seconds after the stop. After the last
stage, the partner counts again at 1, 2, 3, 4 and 5 minutes.

\paragraph{Heart rate against work.} Over the middle of its range, heart rate
rises almost in a straight line with metabolic rate, especially between about
120 and 170 bpm; classic submaximal fitness tests rest on that
fact . Sam's first two stages sit below that band,
one more reason to treat the fit with care. Listing 2.3
fits that line.

**Listing 2.3.** Fit heart rate against work rate for the step test (`code/step_fit.py`). (`code/step_fit.py`)

```python
# Fit heart rate against work rate for the three stages (synthetic data).
import numpy as np
import pandas as pd

df = pd.read_csv("ch02-system/data/steptest_counts.csv")
st = df[df.label.str.startswith("stage")]
slope, icpt = np.polyfit(st.power_W, st.hr_bpm, 1)
pred = icpt + slope * st.power_W
r2 = 1 - np.sum((st.hr_bpm - pred)**2) / np.sum((st.hr_bpm - st.hr_bpm.mean())**2)
print(st[["label", "power_W", "count15", "hr_bpm"]].to_string(index=False))
print(f"HR = {icpt:.1f} + {slope:.3f} x P   (R^2 = {r2:.3f})")

age = 20
hr_max = 208 - 0.7 * age              # one published age equation
p_at_max = (hr_max - icpt) / slope
print(f"predicted HRmax {hr_max:.0f} bpm -> lifting power {p_at_max:.0f} W")
for d in (-10, 10):                   # if the true maximum is 10 bpm off
    print(f"  HRmax {hr_max + d:.0f}: {(hr_max + d - icpt) / slope:.0f} W")
```

```text
  label  power_W  count15  hr_bpm
stage 1     51.5       24      96
stage 2     68.7       27     108
stage 3     85.8       31     124
HR = 53.3 + 0.816 x P   (R^2 = 0.993)
predicted HRmax 194 bpm -> lifting power 172 W
  HRmax 184: 160 W
  HRmax 204: 185 W
```

Each watt of lifting power adds about 0.8 bpm. The last three lines
extrapolate the line to Sam's predicted maximal heart rate. That is how
submaximal fitness tests estimate a maximal capacity without a maximal effort,
and it shows their weakness: if Sam's real maximum is ten beats from the
prediction, the estimate moves by about 12 W, or 7%.

> **Engineer's note: Your first straight-line fit.**
> 
> Listing 2.3 is a *linear regression*: it chooses the
> intercept and slope that make the sum of squared vertical misses as small as
> possible (least squares). Three habits go with every fit. Give the slope its
> units: heart rate is in bpm and power in W, so the slope is in
> beats per minute per watt, and it means nothing without them. Look at the
> *residual*s, measured minus fitted: they should be small and show no
> pattern. And beat a *mean baseline*, the model that ignores power and
> always guesses the average heart rate. A fit that cannot beat it has learned
> nothing. $R^2$ is that comparison in one number:
> $1-SSE/SST$, where SSE sums the squared residuals of the line
> and SST those of the mean baseline. Chapter 11 returns to all
> three in Section 11.4, with more data and
> an honest test on data the fit has not seen.

Listing 2.4 does the three checks on Sam's three
stages.

**Listing 2.4.** Slope with units, residuals and a mean baseline (`code/step_line.py`). (`code/step_line.py`)

```python
# Heart rate against lifting power as a linear regression: slope, residuals, baseline.
import numpy as np
import pandas as pd

df = pd.read_csv("ch02-system/data/steptest_counts.csv")
st = df[df.label.str.startswith("stage")]
x, y = st.power_W.to_numpy(), st.hr_bpm.to_numpy()

slope, icpt = np.polyfit(x, y, 1)            # least-squares straight line
pred = icpt + slope * x
resid = y - pred                              # measured minus fitted
base = np.full_like(y, y.mean(), dtype=float) # baseline: always guess the mean

print(f"slope {slope:.3f} bpm per W, intercept {icpt:.1f} bpm")
print("residuals (bpm):", resid.round(1))
print(f"MAE line {np.abs(resid).mean():.1f} bpm, "
      f"MAE mean baseline {np.abs(y - base).mean():.1f} bpm")
print(f"R^2 = 1 - SSE/SST = {1 - (resid**2).sum() / ((y - base)**2).sum():.3f}")
```

```text
slope 0.816 bpm per W, intercept 53.3 bpm
residuals (bpm): [ 0.7 -1.4  0.7]
MAE line 0.9 bpm, MAE mean baseline 9.8 bpm
R^2 = 1 - SSE/SST = 0.993
```

The line misses each stage by 1.4 bpm or less, against an average miss
(mean absolute error, MAE) of 9.8 bpm for the baseline. Do not read too
much into that: the counts move in steps of 4 bpm, so residuals smaller
than that are partly luck, and three points leave only one degree of freedom
to judge the fit. Exercise 2.23 repeats the fit on the
strap's data.

\paragraph{Recovery.} Listing 2.5 fits
Equation \eqref{ch02-system:eq:first} to recovery twice: to the strap's
second-by-second data and to the six hand counts.

**Listing 2.5.** Fit an exponential to recovery heart rate (`code/recovery_fit.py`). (`code/recovery_fit.py`)

```python
# Fit a first-order (exponential) fall to recovery heart rate (synthetic data).
import numpy as np
import pandas as pd
from scipy.optimize import curve_fit

def model(t, hr_end, drop, tau):            # HR(t) = floor + drop * exp(-t/tau)
    return hr_end + drop * np.exp(-t / tau)

hr = pd.read_csv("ch02-system/data/steptest_hr.csv")
rec = hr[hr.phase == "recovery"]
t = rec.time_s.to_numpy() - rec.time_s.iloc[0]   # seconds since stopping
p, cov = curve_fit(model, t, rec.hr_bpm, p0=(80, 50, 60))
se = np.sqrt(np.diag(cov))
print(f"strap: floor {p[0]:.1f}, drop {p[1]:.1f} bpm, tau {p[2]:.1f} +/- {se[2]:.1f} s")

c = pd.read_csv("ch02-system/data/steptest_counts.csv")
k = c[c.label.str.startswith("recovery") | (c.label == "stage 3")]
tk = k.t_mid_s - 700                       # count mid-points, s after stopping
q, qcov = curve_fit(model, tk, k.hr_bpm, p0=(80, 50, 60))
print(f"hand counts: floor {q[0]:.1f}, drop {q[1]:.1f} bpm, tau {q[2]:.1f} +/- {np.sqrt(qcov[2,2]):.1f} s")
```

```text
strap: floor 78.0, drop 50.8 bpm, tau 50.5 +/- 0.9 s
hand counts: floor 77.9, drop 57.9 bpm, tau 41.3 +/- 9.2 s
```

> **Engineer's note: Straight-line fit or curve fit?.**
> 
> There are two ways to fit Equation \eqref{ch02-system:eq:first} to recovery.
> The first chooses a floor $y_\infty$, takes $\ln(y-y_\infty)$ and fits a straight
> line; $\tau$ is $-1$ over the slope. It needs only a straight-line fit, but the
> logarithm magnifies the noise where $y$ is close to the floor, and the answer
> depends on the floor you chose. The second, nonlinear least squares
> (`scipy.optimize.curve_fit`), adjusts the floor, the drop and $\tau$
> together to minimize the squared error in beats per minute, the units the
> noise is in. It needs a starting guess and can fail to converge, but it does
> not make you guess the floor, and it returns a standard error for each
> parameter from the curvature of the error surface. Exercise 2.12
> measures how much the floor matters.

The strap recovers the 50 s time constant the data were built
with, to within a second. The hand counts give 41 s, with a
standard error of 9 s: six numbers, each rounded to four beats a
minute, cannot pin down three parameters well.

## 2.12 How Good Is the Number?

Sam's synthetic data let you compare every measurement with the truth, which
real data never do. Four errors show up.

- **Resolution.**  A 15-second count can only give multiples of four beats a
minute; a 10-second count, multiples of six; a 30-second count, of two. Longer
counts are finer but take longer, and heart rate changes while you count.

- **The count starts late.**  Heart rate starts falling the moment work stops.
Sam's true heart rate at the end of the last stage was 129.6 bpm; the
average over the count window, from 2 to 17 seconds after the stop, was
120.9 bpm. A post-exercise count underestimates the exercise heart rate,
here by about 9 bpm, and more for a fitter person whose recovery is
faster.

- **Miscounts.**  Counting by hand, a partner is often off by one beat, or
4 bpm in a 15-second count. The synthetic counts include such errors.

- **The model and the method.**  An earlier version of the Heart app
started recovery at the session's highest 15-second median of heart rate and
fitted a straight line to $\ln(\HR-\text{floor})$. On Sam's file it reported
about 68 s, not 50 s, and a one-minute drop of
12 bpm, not 37 bpm. Checking it against this file, where the
truth is known, exposed the cause: the highest bin came about 47 seconds
before the stop, during the plateau of the last stage, so the fit included
flat data. The app now finds the end of work by fitting a line before it and
an exponential fall after it, and measures every drop from there. On Sam's
file it finds the stop at exactly 700 s and reports a one-minute
drop of 37 bpm and $\tau=\SI{51}{\second}$. The lesson is general: know
what the app's number is the time constant *of*, and test it on a file
with a known answer before you compare it with someone else's.

Table 2.5 collects the sizes. Every one was measured
on Sam's synthetic test, where the truth is known; on your own data you can
check the first three by counting the same minute twice, with a partner
counting alongside you, or with a chest strap.

*Table 2.5. Sources of error in the step test and their size on Sam's synthetic data.*

| Source | Size | How to check |
|---|---|---|
| Resolution of a 15 s count | steps of 4 bpm | count for 30 s at rest |
| Count starts after the stop | -9 bpm at the last stage | a strap beside the count |
| Miscount by one beat | $\pm\SI{4}{\bpm}$ | two people count at once |
| Maximal heart rate predicted, not measured | $\pm\SI{10}{\bpm}$ gives $\pm\SI{12}{\watt}$ | repeat; treat as a trend |
| Recovery fit to six counts | $\tau$ $\pm\SI{9}{\second}$ | strap data, curve fit |
| Where the app starts recovery | $\tau$ 51 s for a true 50 s (earlier version 68 s) | a file with a known answer |

The number to give Sam is therefore “a recovery time constant near 50
seconds, measured with a strap; a hand count gives 40 to 50 seconds and
cannot tell differences smaller than about 10 seconds.”

## 2.13 Telling the Athlete

Sam asks what the step test showed. Here are two answers.

> **Coach's translation: A poor answer.**
> 
> “Your HR–work slope was 0.816 bpm/W with R$^2$ 0.993 and your recovery
> $\tau$ was 41.3 s, so your predicted PWC at HRmax is 172 W. Your recovery is
> in the good range for your age.”

The poor answer is accurate and useless. It uses words Sam does not know,
gives three decimal places that the counts cannot support, compares Sam with
an unnamed “range”, and offers nothing to do.

> **Coach's translation: A better answer.**
> 
> “Your heart rate climbed steadily and evenly as the steps got faster, which
> is what we expect. After you stopped, it came down quickly: most of the way
> back in about two to three minutes. Counting by hand, we can't see changes
> smaller than about ten seconds in that recovery, so this is your starting
> point, not a grade. Let's repeat the same test, same bench and same time of
> day, in six weeks and see whether your heart rate at each stage is lower.”

The better answer says what was seen in plain words, says how sure it is,
gives one action, and names when to look again. It compares Sam with Sam.

## 2.14 Build Step B-2: A Form and a Table

Last week you made an empty page and put it online. This week the page learns
to take input and keep it. Your page will have a form where you enter a stage
name and a 15-second count, and a table that shows every entry with its heart
rate. The new idea is *state*: a list in memory that the page keeps and
redraws from.

Keep the arithmetic apart from the page, so you can test it without a
browser. Listing 2.6 is the logic and its test;
the page itself is in `code/b2-steptest/`.

**Listing 2.6.** The step-test logic (`steptest.js`) and its test (`test.mjs`).

```javascript
export function countToBpm(count, seconds = 15) {
  const n = Number(count);
  if (!Number.isInteger(n) || n < 5 || n > 60) throw new Error("count out of range");
  return n * 60 / seconds;
}
// test.mjs: the hand answer first -- 31 beats in 15 s is 124 bpm
assert.equal(countToBpm(31), 124);
assert.equal(countToBpm("24"), 96);
assert.throws(() => countToBpm(3));
```

Running `node test.mjs` prints `all step-test checks pass`. The
page's `main.js` listens for the form's submit, adds a row to the list,
clears the form and redraws the table. It writes each cell with
`textContent`, never as HTML, so a stage named
`<b>3</b>` appears as typed rather than in bold. Ask your AI assistant
for the page, then check it against Exercise 2.20.

## Summary

- Muscle runs on ATP, rebuilt by three systems: immediate (seconds),
glycolytic (tens of seconds to minutes) and aerobic (everything longer). All
three always run; their shares change with duration.

- About a quarter of the energy becomes work; the rest is heat. Each litre
of oxygen is worth about 20.9 kJ.

- Oxygen uptake is heart rate times stroke volume times extraction (the
Fick relation). Delivery, set by maximal cardiac output, is the main limit on
$\VOmax$.

- Endurance rests on three numbers: $\VOmax$, the fraction of it that can
be held (threshold), and economy.

- Heart rate and oxygen uptake respond to a step in work like first-order
systems with time constants of tens of seconds; temperature responds over tens
of minutes. Heart rate drifts upward in long exercise.

- Above the second threshold, or critical speed, there is no steady state
and a fixed reserve drains. That is why a little faster lasts so much shorter.

- Training is an input to a system with slow fitness and fast fatigue;
people respond differently to the same plan. Compare each athlete with
themselves.

- Heart rate against work rate is a linear regression. Report the slope
with its units (bpm per watt), check the residuals, and show that the
line beats a mean baseline before you trust it.

*Table 2.6. Formulas of Chapter 2.*

| Quantity | Formula |
|---|---|
| Cardiac output | $Q=\HR\times\mathit{SV}$ |
| Fick relation | $\VO = Q\,(C_a-C_v)$ |
| Metabolic power (W) | $P_\text{met}=\VO[\si{\litre\per\minute}]\times20\,900/60$ |
| Mechanical power and heat | $\eta P_\text{met}$ ; $(1-\eta)P_\text{met}$ |
| Sweat to evaporate heat $H$ | $H/\SI{2426}{\joule\per\gram}$ |
| Energy cost of running | $\approx\SI{1}{\kcal}$ per kg per km |
| First-order step response | $y=y_\infty+(y_0-y_\infty)\ee^{-t/\tau}$ |
| Time constant from two points | $\tau=(t_2-t_1)/\ln[(y_1-y_\infty)/(y_2-y_\infty)]$ |
| Critical speed | $t = D'/(v-\mathit{CS})$ |
| Hill's force–velocity | $(F+a)(v+b)=(F_0+a)b$ |
| Banister model | $p=p_0+k_1\sum w\,\ee^{-\Delta t/\tau_1}-k_2\sum w\,\ee^{-\Delta t/\tau_2}$ |
| Pulse count to rate | $\HR = \text{count}\times60/\text{seconds}$ |

**New glossary terms:** ATP, efficiency, lactate, cardiac output,
stroke volume, Fick relation, maximal oxygen uptake, lactate threshold,
economy, first-order system, time constant, oxygen deficit, cardiovascular drift, first and
second thresholds, critical power, critical speed, stretch–shortening cycle,
training load, external load, internal load, TRIMP, overtraining syndrome,
state, linear regression, residual, mean baseline.

**Going further:** https://apmonitor.com/dde/index.php/Main/SensorSignal on turning a sensor's
output into a physical value; https://apmonitor.com/pds/index.php/Main/VisualizeData for plotting time series.

**Track it:** last-stage heart rate and one-minute recovery from each `step-test` (Appendix J).

## Exercises

> **Course use: Week 2.**
> 
> **H04** (due Class 4, *Measure*): 2.1, 2.2, 2.5, 2.9, 2.18; about 70 minutes.
> 
> **H05** (due Class 5, *Model and tell*): 2.12, 2.20, 2.21, 2.22, 2.23, 2.24; about 175 minutes. A case-file exercise may be done on your own data instead. The full map is in the Course Guide.

**Exercise 2.1** (Concept check · Foundation · 2 min · CORE)

An athlete races all-out for five minutes. Which energy system supplies most of
the energy over the whole race?

(a) The immediate (phosphocreatine) system
(b) The glycolytic system
(c) The aerobic system
(d) All three supply equal shares

**Exercise 2.2** (Concept check · Foundation · 2 min · CORE)

Oxygen uptake rises after a step in work with a time constant of
40 s. Two minutes after the step, about what fraction of the total
change has occurred?

(a) 95%
(b) 63%
(c) 86%
(d) 100%

**Exercise 2.3** (Concept check · Core · 2 min)

During a steady run, a runner's blood lactate rises stage by stage. What does
the rise tell you most directly?

(a) The muscles have run out of oxygen
(b) Lactate is poisoning the muscle and causing fatigue
(c) The aerobic system has switched off
(d) Lactate production has outrun its removal

**Exercise 2.4** (Concept check · Core · 2 min)

Two runners have the same $\VOmax$. One runs a marathon 12 minutes faster.
Which pair of differences could explain it?

(a) Maximal heart rate and resting heart rate
(b) The fraction of $\VOmax$ each can hold, and running economy
(c) Body height and leg length alone
(d) Lung volume and breathing rate

**Exercise 2.5** (Hand calculation · Foundation · 8 min · CORE)

A 62 kg cyclist rides with a heart rate of 170 bpm and a
stroke volume of 0.110 L, and each litre of blood gives up
140 mL of oxygen.

- Cardiac output. *Checkpoint:* {18.7 L/min.}

- Oxygen uptake, in L/min and mL/kg/min. *Checkpoint:* {2.62 L/min; 42.2 mL/kg/min.}

- Metabolic power at 20.9 kJ per litre. *Checkpoint:* {912 W.}

- Power at the pedals at 21% efficiency, and the heat released. *Checkpoint:* {192 W; 720 W.}

Confirm your numbers by editing the inputs of `code/hand_checks.py`;
answers within 1% are correct.

**Exercise 2.6** (Hand calculation · Core · 10 min)

A 60 kg cyclist holds 300 W at the pedals for two hours
at 23% gross efficiency.

- Metabolic power and heat released. *Checkpoint:* {1304 W; 1004 W.}

- Sweat that must evaporate each hour if all the heat left that way
(2426 J/g). *Checkpoint:* {1.49 L/h.}

- With no drinking, after how many minutes has the rider lost 2% of body
mass? *Checkpoint:* {48 min.}

- Is the real sweat rate higher or lower than (b)? Give one reason.

**Exercise 2.7** (Hand calculation · Extension · 10 min)

- Use the rule of about 1 \kcal per kilogram per kilometer to estimate
the energy a 55 kg runner spends on a half marathon
(21.1 km). *Checkpoint:* {about 1160 \kcal.}

- The same runner runs at 3.0 m/s. Find the metabolic power
and the oxygen uptake. *Checkpoint:* {690 W; 1.98 L/min, 36.0 mL/kg/min.}

- After a hard interval, a partner counts 140 bpm centered
10 s after the stop and 100 bpm centered at 70 s.
Assume heart rate settles at 70 bpm. Find the recovery time constant.
*Checkpoint:* {71 s.}

**Exercise 2.8** (Hand calculation · Core · 8 min)

A runner standing still uses 0.4 L/min of oxygen and steps
onto a treadmill at a pace that needs 2.8 L/min. Oxygen uptake
responds with a 20 s delay and a 25 s time constant.

- Find the oxygen deficit in litres and in kilojoules. *Checkpoint:* {1.80 L; 37.6 kJ.}

- When is oxygen uptake within 5% of its new level? *Checkpoint:* {95 s.}

- After training, the time constant falls to 18 s. By how much does the deficit shrink? *Checkpoint:* {0.28 L.}

**Exercise 2.9** (App lab · Core · 20 min · CORE)

Heart app, https://apopt.com/heart/. Make Sam's synthetic step test into a strap-style
file with `python ch02-system/code/make_heart_csv.py steptest_ecg.csv`
(about 3.7 \mega\byte, 134 000 rows at 130 Hz). Open the app,
enter age 20, choose the file and run the analysis. No video is involved, so
there is no frame rate to set; the file's own sampling rate is measured by the
app.

- Record Peak HR and its time, HR recovery 60 s, the recovery time-constant
$\tau$, TRIMP and the maximal heart rate the zones are based on.

- The data were built with a recovery time constant of 50 s and
work stopped at 11:40 (700 s). Compare the app's end of work, $\tau$
and 60-second drop with these, and say what each depends on.

- Save the PDF and text results.

**Exercise 2.10** (App lab · Core · 30 min)

Analyze yourself: the stretch–shortening cycle. Jump app,
https://apopt.com/jump/jump.php, Basic mode. Film from the side with the whole body in
frame from the start to the landing, phone still on a tripod at about waist
height, at 60 fps or more; if you film in slow motion, choose the rate
you recorded at. Each clip is one jump, about 3 to 5 s long.

- Warm up. Film three countermovement jumps (a quick dip, then jump) and
three squat jumps (sink to the same depth, hold still for three seconds, then
jump without dipping further). Hands on hips for all six.

- Run each clip in Basic mode and save the PDF and the text (Markdown)
result.

- Pick one clip. Step through the frames, count the frames in the air, and
compute height from flight time, $h=g t^2/8$ with $t=\text{frames}/\text{rate}$.
Compare with the app's flight-time height.

- Switch on Advanced mode. Find Countermovement Depth and say whether it
shows your squat jumps really had no dip.

- Write half a page: what you measured, which jump went higher and by how
much, how sure you are, and what you would change before you retest.

**Exercise 2.11** (Python analysis · Foundation · 15 min)

Foundation. Open `data/steptest_counts.csv` with pandas.

- Before you run anything, predict the heart rate for a count of 27 beats in
15 seconds.

- Ask your AI assistant for code that adds a column `bpm_check` equal
to `count15` times 4 and checks it equals `hr_bpm` on every row.

- Plot `hr_bpm` against `t_mid_s` with markers, and label the
axes with units.

**Exercise 2.12** (Python analysis · Core · 25 min · CORE)

Run Listing 2.5, then change the model so the floor is fixed
rather than fitted. Refit $\tau$ to the strap's recovery data with the floor set
to 74, 76, 78, 80 and 82 bpm.

- Tabulate $\tau$ against the floor.

- How many seconds does $\tau$ change per beat of floor near 78 bpm?

- What does this tell you about comparing a $\tau$ from the Heart app with a
$\tau$ from your own fit?

**Exercise 2.13** (Python analysis · Extension · 30 min)

Extension. A runner's results from three track races this season are 1000 m
in 225 s, 2000 m in 497 s and
3000 m in 781 s. The critical-speed model says distance
$=\mathit{CS}\times t + D'$.

- Fit a straight line of distance against time and report $\mathit{CS}$ and $D'$.
*Checkpoint:* {3.60 m/s; 198 m.}

- Predict the best 5 km time. *Checkpoint:* {1335 s, 22:15.}

- Is the prediction an interpolation or an extrapolation? Which way would
you expect it to err, and why?

**Exercise 2.14** (Body science · Foundation · 5 min)

Write for an engineer who has never studied physiology. Trace one oxygen
molecule from the air to a mitochondrion in a leg muscle, naming four stages.
For each stage say what moves the oxygen and which stage most limits $\VOmax$
in a healthy, trained person at sea level.

**Exercise 2.15** (Body science · Extension · 8 min)

During a 60-minute run at constant pace on a warm day, cardiac output stays
the same while stroke volume falls by 10%.

- What happens to heart rate if it was 150 bpm before the fall?
*Checkpoint:* {167 bpm.}

- Name the phenomenon and give the mechanism that Coyle and
Gonz\'alez-Alonso propose.

- What does it mean for an athlete who trains by heart-rate zones?

**Exercise 2.16** (Science of the sport · Foundation · 5 min)

A 100 m sprinter and a marathoner both train their legs hard. Which
energy system and which muscle fiber type matter most to each, and why does
neither athlete's training suit the other's event?

**Exercise 2.17** (Science of the sport · Extension · 8 min)

Sam (critical speed 3.6 m/s, $D'=\SI{200}{\metre}$) races
5 km.

- What constant speed uses exactly all of $D'$ at the finish, and what time
does it give? *Checkpoint:* {3.75 m/s; 22:13.}

- Sam instead runs the first kilometer at 4.0 m/s. How much
of $D'$ is spent, and what constant speed is left for the last 4 km?
*Checkpoint:* {100 m; 3.69 m/s.}

- The model says both plans finish in the same time. Why might a coach still
advise the even plan?

**Exercise 2.18** (Field collection · Foundation · 40 min · CORE)

A three-stage step test on yourself. Equipment: a sturdy step or bench 25 to
35 cm high that cannot slide, a tape measure, a metronome, a
timer, a partner who counts, a sheet to record.

- Safety first. Do not do this test if you are unwell, injured, or have been
told to avoid hard exercise. Stop at once for chest pain, faintness, unusual
breathlessness or a heart rate that feels irregular, and tell your instructor.
Nobody does this test to exhaustion.

- Measure the step height to the nearest centimeter and weigh yourself if
you wish (body mass is never shared or graded; you may use 70 kg
instead).

- Sit quietly for two minutes. Your partner counts your pulse at the wrist
or neck for 30 seconds.

- Warm up with one minute of easy stepping. Then step for three minutes at
15 cycles a minute (metronome at 60, up–up–down–down).

- Stop. Your partner finds the pulse and counts for 15 seconds starting two
seconds after you stop. Record the count. Resume within 20 seconds.

- Repeat steps 4–5 at 20 and 25 cycles a minute (metronome at 80 and 100).

- After the last count, stand still. Your partner counts for 15 seconds
starting at 1, 2, 3, 4 and 5 minutes.

- Record: step height, cycles a minute, each count, the time each count
started, and anything that went wrong (a lost pulse, a missed beat).

- Convert each count to heart rate (count $\times4$) and compute each
stage's lifting power, $m g h$ times the cycles a minute over 60, as in
Section 2.11.

**Exercise 2.19** (Field collection · Foundation · 20 min)

Resting pulse three ways. On three mornings, before getting up, count your
pulse for 15, 30 and 60 seconds, one after another. Then stand for two minutes
and count for 30 seconds.

- Convert each count to beats per minute and state the resolution of each.

- Which count length would you use from now on, and why?

- How much does standing change your pulse?

**Exercise 2.20** (Build · Core · 60 min · CORE)

Build step B-2. Extend your B-1 page with a form that takes a stage name and a
15-second count, and a table that lists every entry with its heart rate.

- Write the specification first: inputs, outputs, what happens on a bad
count (below 5, above 60, not a whole number), and one test with a hand
answer (31 beats is 124 bpm).

- Ask your AI assistant for `steptest.js`, `main.js` and
`index.html`, keeping the arithmetic in its own module.

- Run the test in Node until it passes. Then enter your step-test counts on
your phone.

- Type `<b>3</b>` as a stage name. It must appear as typed, not bold.

- Put the page online and keep the link.

**Exercise 2.21** (Communicate · Core · 20 min · CORE)

A 15-year-old runner asks you what “threshold” means. Explain it in at most
120 words without using the word “lactate”. Include one thing she could do
with the idea in training.

**Exercise 2.22** (Check the AI · Core · 8 min)

An AI assistant wrote this to find Sam's recovery time constant from
`steptest_hr.csv`, and reported $\tau=\SI{930}{\second}$:
\ttfamily
rec = hr[hr.phase == "recovery"]

t = rec.time_s - rec.time_s.iloc[0]

slope = np.polyfit(t, np.log(rec.hr_bpm), 1)[0]

print("tau", -1 / slope)

Find the flaw, say why it inflates $\tau$, and fix it.

**Exercise 2.23** (Python analysis · Core · 20 min)

Core. Repeat the straight-line fit of Listing 2.4 on
the strap's second-by-second data, `data/\allowbreak steptest_hr.csv`, with
scikit-learn's `LinearRegression`. The stages end at 300, 500 and
700 s; their lifting powers are 51.5, 68.7 and 85.8 W.

- Average heart rate over the last 60 s of each stage.
*Checkpoint:* {103.1, 116.4 and 129.3 bpm.}

- Fit heart rate against power. Report the slope with its units and the
intercept. *Checkpoint:* {0.766 bpm per watt; 63.7 bpm.}

- Report the residuals and the mean absolute error of the line and of the
mean baseline. *Checkpoint:* {All residuals within 0.2 bpm; MAE 0.07 against
8.80 bpm.}

- The hand counts gave 0.816 bpm per watt. Which slope do you trust
more, and why?

**Exercise 2.24** (Python analysis · Core · 40 min)

Case file: take an interval session from the instructor's watch archive in the
instructor's case file (the activity has heart rate, pace and distance). The
question is how heart rate rises with running speed for this athlete.

- For each work repeat, find the mean speed (m/s) over the
whole repeat and the mean heart rate over its last 30 seconds. Explain in one
sentence why you skip the start of each repeat (Section 2.4).
*Checkpoint:* {One row per repeat; the number of rows equals the number of repeats in
the session.}

- Fit heart rate against speed with `np.polyfit` or
`LinearRegression`. Report the slope with its units, the intercept, and
the residuals. *Checkpoint:* {The slope is positive and in bpm per
m/s; the residuals sum to zero within rounding.}

- Compare the line's mean absolute error with the mean baseline's.
*Checkpoint:* {The line's MAE is smaller than the baseline's; if it is not, say why.}

- Plot the residuals against repeat number. Do they trend upward? Name the
effect from Section 2.4 that would make them trend.

**Exercise 2.25** (Communicate · Core · 20 min)

Case file: use your fit from Exercise 2.24 (or, if you have not done it,
Listing 2.4). Write at most 120 words to the athlete
in the case file explaining what the line shows. Give one number in plain units
(for example, “about $N$ beats a minute more for each 0.1 m/s
faster”), say how sure you are and why, and give one thing to repeat next time
so the two sessions can be compared. Use the better answer of
Section 2.13 as a model.

**Exercise 2.26** (Concept check · Foundation · 3 min)

A runner holds one pace for 30 minutes. Blood lactate is
1.0 mmol/L at rest, 3.1 mmol/L at
minute 10 and 3.6 mmol/L at minute 30, and the runner
finishes without slowing. In which domain of intensity was the run?

(a) Moderate
(b) Heavy
(c) Severe
(d) None: a steady state never occurs above rest

**Exercise 2.27** (Python analysis · Extension · 25 min)

Use `code/domains.py`, the tank model of
Section 2.5.2.

- Run it as given, then with the maximum removal lowered to 0.9 by
passing `0.9` as its argument. Report the three boundaries each time.

- By how much did each boundary move? In which direction would detraining
move them, and which source in Section 2.8.4
agrees?

- Explain, using the printed lactate at minutes 10 and 30 for the heavy
pace, why the MLSS found by the 30-minute rule lies below the speed at which a
steady state stops being possible.

- Why does the resting lactate rise when the maximum removal falls?

**Exercise 2.28** (Body science · Core · 12 min)

Stanley and colleagues found that the heart's nervous control takes 24 to 48
hours to recover after a threshold session (Table 2.3).
Treat recovery as first order and “recovered” as 95%, using the 48-hour end.

- What is the time constant? *Checkpoint:* {16 h.}

- What fraction is still missing 12, 24 and 36 hours after the session?

- The athlete wants a second threshold session the next evening, 24 hours
later. What does the model say, and what would you look at in the morning to
check it on the athlete rather than in the model?

**Exercise 2.29** (Science of the sport · Foundation · 8 min)

A runner has trained steadily at 60 km a week, with two hard
sessions and four easy runs. Using the meta-analysis of
Section 2.8.4, plan the two weeks before a race:

- How long should the taper be, and what range of weekly volume does it
call for? *Checkpoint:* {\SIrange{24}{35.4}{\kilo\metre} a week.}

- Which of volume, intensity and frequency should change, and which should not?

- Explain the taper with Banister's model in two sentences.

**Exercise 2.30** (Hand calculation · Core · 10 min)

One week of an endurance athlete's log: easy 45 min; easy
60 min; intervals 40 min (of which 20 min hard);
easy 50 min; tempo 30 min, all hard; long easy
90 min.

- What share of the week is low intensity counted by sessions, and by
minutes? *Checkpoint:* {67% and 84%.}

- Compare each with the distribution Seiler describes. Which way of
counting did that description use?

- Write one sentence for a report that states the share without misleading.
