# Q-21: Sweat rate from two weighings

Data-Driven Athletics tutorial · Week 7 · Chapter 7 · about 15 min · workflow steps: Gather, Statistics, Cleanse, Features

Web page: https://apopt.com/course/tutorials/q21-sweat-rate/ · Data: https://apopt.com/data/tutorials/q21-sweat-rate/

## The decision

A runner has a hot 90-minute race coming. How much does she sweat, and how much should she
plan to drink to keep her body-mass loss under 2%?

## The raw data

- `raw/weighings_synthetic.csv`: SYNTHETIC weighing log, ten runs by an invented 70 kg runner (date, minutes, air_temp_c, mass_before_kg, mass_after_kg, drink_l, urine_l); one after-weight is typed in pounds Made by this tutorial's `prepare.py` (seeded, reproducible); no real person.

You do not need a sweat patch to know how much you sweat. Weigh yourself before and after a
run, note what you drank and any urine you passed, and almost all of the mass lost is water
(Section 7.6):

sweat rate = (mass before − mass after + drink − urine) / time, with 1 L of water = 1 kg.

The log here is **synthetic**: ten runs by an invented 70 kg runner, made by `prepare.py` to
look like a real log, including one mistake a real log would have.

### Open the log and check it

*Predict first:* One of the ten rows has an error you could catch without any formula. Which column, and what kind of error?

```python
import numpy as np
import pandas as pd

log = pd.read_csv("raw/weighings_synthetic.csv")
print(log.to_string(index=False))
change = (log["mass_after_kg"] - log["mass_before_kg"]) / log["mass_before_kg"]
print("rows where the mass changed by more than 10%:", log.index[change.abs() > 0.10].tolist())
```

Output:

```
      date  minutes  air_temp_c  mass_before_kg  mass_after_kg  drink_l  urine_l
2027-03-01       60         8.0            69.9           69.9     0.49      0.0
2027-03-06       75        12.0            70.2           69.6     0.19      0.0
2027-03-11       60        15.0            69.7           69.1     0.13      0.0
2027-03-16       75        18.0            70.1           69.8     0.83      0.0
2027-03-21       60        20.0            69.8           68.7     0.24      0.2
2027-03-26       75        22.0            70.1           69.0     0.39      0.0
2027-03-31       60        24.0            70.4          153.0     0.46      0.2
2027-04-05       45        26.0            69.9           69.2     0.23      0.0
2027-04-10       60        28.0            70.3           69.0     0.00      0.0
2027-04-15       75        31.0            69.6           67.7     0.23      0.0
rows where the mass changed by more than 10%: [6]
```

Row 6 shows 153.0 kg after a one-hour run that started at 70.4 kg. Nobody gains 83 kg on a
run: 153.0 is the after-weight typed in pounds (153.0 / 2.20462 = 69.4 kg). Fix it with a rule
you can state, and keep a note of the change.

### Sweat rate and mass loss

```python
LB = 2.20462
fix = change.abs() > 0.10
log.loc[fix, "mass_after_kg"] = (log.loc[fix, "mass_after_kg"] / LB).round(1)
log["note"] = np.where(fix, "after-weight was in lb; divided by 2.20462", "")
loss = log["mass_before_kg"] - log["mass_after_kg"]
log["sweat_l_per_h"] = (loss + log["drink_l"] - log["urine_l"]) / (log["minutes"] / 60)
log["mass_loss_pct"] = 100 * loss / log["mass_before_kg"]
print(log[["date", "air_temp_c", "minutes", "sweat_l_per_h", "mass_loss_pct", "note"]].round(2).to_string(index=False))
```

Output:

```
      date  air_temp_c  minutes  sweat_l_per_h  mass_loss_pct                                       note
2027-03-01         8.0       60           0.49           0.00                                           
2027-03-06        12.0       75           0.63           0.85                                           
2027-03-11        15.0       60           0.73           0.86                                           
2027-03-16        18.0       75           0.90           0.43                                           
2027-03-21        20.0       60           1.14           1.58                                           
2027-03-26        22.0       75           1.19           1.57                                           
2027-03-31        24.0       60           1.26           1.42 after-weight was in lb; divided by 2.20462
2027-04-05        26.0       45           1.24           1.00                                           
2027-04-10        28.0       60           1.30           1.85                                           
2027-04-15        31.0       75           1.70           2.73
```

Only the hottest run, at 31 °C, lost more than 2% of body mass (2.7%), the level the American
College of Sports Medicine advises drinking to stay under (Sawka and others, 2007). Sweat rate
more than triples from the coolest run to the hottest.

### Sweat rate against temperature

```python
import matplotlib.pyplot as plt

slope, icpt = np.polyfit(log["air_temp_c"], log["sweat_l_per_h"], 1)
err = 0.1 / (log["minutes"] / 60)                        # up to 0.1 kg from two 0.1 kg readings
print(f"sweat rate ≈ {icpt:.2f} + {slope:.3f} × temperature (L/h, °C)")
hot = icpt + slope * 30
print(f"at 30 °C: {hot:.2f} L/h; scale resolution adds up to ±{err.min():.2f} to ±{err.max():.2f} L/h")
need = (hot * 1.5 - 0.02 * 70) / 1.5                     # 90 min at 30 °C, loss held to 2% of 70 kg
print(f"90 min at 30 °C: drink at least {need:.2f} L/h to keep the loss under 2%")

fig, ax = plt.subplots(figsize=(6.4, 3.6))
ax.errorbar(log["air_temp_c"], log["sweat_l_per_h"], yerr=err, fmt="o", color="k", capsize=3)
tt = np.array([5, 33])
ax.plot(tt, icpt + slope * tt, "--")
ax.set(xlabel="air temperature (°C)", ylabel="sweat rate (L/h)")
plt.tight_layout()
```

Output:

```
sweat rate ≈ 0.06 + 0.049 × temperature (L/h, °C)
at 30 °C: 1.53 L/h; scale resolution adds up to ±0.08 to ±0.13 L/h
90 min at 30 °C: drink at least 0.60 L/h to keep the loss under 2%
```

![Sweat rate in litres per hour against air temperature in degrees C for ten runs, rising from about 0.5 at 8 degrees to about 1.7 at 31, with a fitted straight line and error bars of 0.1 L/h on one-hour runs.](https://apopt.com/course/tutorials/q21-sweat-rate/c05-1.png)

On a scale that reads to 0.1 kg, each weighing can be off by up to 0.05 kg, so the mass change
can be off by up to 0.1 kg; over a one-hour run that is up to 0.1 L/h, and over 45 minutes
up to 0.13 L/h. Longer runs and a finer scale give a better number. The line is this runner's own: sweat
rates differ a great deal between people (Sawka and others, 2007).

**For the athlete:** "At 30 °C you sweat about 1.5 litres an hour; on a 90-minute run in that
heat, drink at least 0.6 litres an hour to keep the loss under 2% of your weight."

## With your own data

Weigh yourself in the same dry clothes before and after your next few runs, write down the
minutes, what you drank and any urine, and the air temperature, and type the log in the same
seven columns.

## Action card

- **Finding:** Sweat rate rises from about 0.5 L/h at 8 °C to about 1.7 L/h at 31 °C for this runner.
- **Evidence:** Ten weighed runs; a straight line through them predicts 1.53 L/h at 30 °C; only the hottest run lost more than 2% (2.7%).
- **Sure:** Each rate is good to about 0.1 L/h on a one-hour run (scale resolution); the line rests on ten runs.
- **Action:** For a 90-minute run at 30 °C, plan to drink at least 0.6 L an hour to keep the loss under 2%.
- **Retest:** Weigh before and after every hot run for a month and refit the line.

## References

- Sawka, M. N., Burke, L. M., Eichner, E. R., Maughan, R. J., Montain, S. J., and Stachenfeld, N. S. (2007). American College of Sports Medicine position stand: exercise and fluid replacement. *Medicine & Science in Sports & Exercise*, 39(2), 377–390. [doi:10.1249/mss.0b013e31802ca597](https://doi.org/10.1249/mss.0b013e31802ca597)
- *Data-Driven Athletics*, Chapter 7, Sweat rate with a scale (Section 7.6).

---
Text CC BY 4.0, code MIT. IRSRI Sports Research Institute.
