# Lower power is not automatically lower energy per request

**Constructed example, not measured HDD data or a replication of DRPM.**
Two hypothetical devices complete the same single request. Comparing energy up
to each completion answers a different question from comparing equal durations.

## Inputs and units

Assume already-established speeds, no queue, no cache hits, one request,
5 ms of speed-independent seek time and 2 ms of transfer at 12,000 RPM.
Assume mean angular wait is half a rotation and transfer time is inversely
proportional to RPM at a fixed track and transfer size.

| Quantity | Faster state | Slower state |
| --- | ---: | ---: |
| Speed | 12,000 RPM | 6,000 RPM |
| Mean rotational wait | 2.5 ms | 5 ms |
| Transfer time | 2 ms | 4 ms |
| Total service time | 9.5 ms | 14 ms |
| Assumed active power | 10 W | 7 W |
| Energy through completion | 95 mJ | 98 mJ |

All numbers are chosen for this example, not fitted to a product.
The service expression is `seek_ms + 30000/rpm + transfer_ms * reference_rpm/rpm`.
Energy in millijoules is power in watts multiplied by milliseconds.

## What changes the ranking?

Completion energy is 98/95 times as large in the slower state, approximately
3.16% higher, although its assumed active power is 30% lower. This accounting
stops each alternative's meter when its request completes.

Now keep both meters running for 14 ms. The faster device is idle for 4.5 ms.
At an assumed ready-idle power of 4 W its total is 95 + 4*4.5 = 113 mJ.
The slower device still uses 98 mJ. At an idle power of 2/3 W the totals tie;
below that threshold the faster alternative uses less energy.

Neither comparison is universally correct. Specify whether the question is
energy charged to a completed operation or total device energy over a common
observation interval. Always report completed work as well as time.

## Limits

This is exact arithmetic on declared assumptions. There is no measured
population, sampling uncertainty or empirical confidence interval. It excludes
transitions, queueing, firmware, host energy, thermal effects and reliability.
It does not implement the paper's controller or its fitted power model.
It cannot select an operating point for a real disk or establish that a
shipping drive supports data I/O at these speeds.

## Reproduce

Python standard library only. Download these four files into one directory:
[model.py](model.py), [test_model.py](test_model.py),
[results.json](results.json) and this README.

```sh
python3 -B model.py --check
python3 -B -m unittest discover -p test_model.py
python3 -B -O -m unittest discover -p test_model.py
```

Run `python3 -B model.py` to regenerate the JSON. Fraction strings retain exact
values. Tests include 1,920 independently summed, finite time-slice cases.

## Evidence context

See the [DRPM record](https://hesela.dev/terms/drpm/) for the original ISCA
paper and the manufacturer documentation that distinguishes reduced-speed idle
from active I/O. This example is original Hesela explanatory material.
