Body-Weight Dynamics
A scale is a noisy sensor, a diet is an input, and a plateau is a time constant.
The usual arithmetic of dieting, 3,500 kcal per pound, treats the body as a battery of fixed energy density. It is wrong in three ways that a control engineer will recognize at once: the mass being lost is a mixture whose composition changes as the diet goes on, a fast water compartment moves pounds on the scale without moving any tissue, and expenditure adapts to a sustained deficit with a lag of a few weeks.
Each of those is a state. This project models each one as such, estimates them together with the subject’s personal metabolic parameters from a single noisy reading a morning, and plans what to eat with a model-predictive controller that replans every day.
The presentation
Presentation
Body-Weight Dynamics → walks through the model, the filter and the controller, with figures generated from a real subject’s weigh-ins and food log. About thirty slides, with speaker notes and three backup slides.
The figures
Latest figures →: every figure the package draws for the real record, each with a caption on how to read it, regenerated with the data.
The software
Documentation
wdm documentation → is the manual for wdm, the Python package and command-line tool behind all of this: installing it, the two-command daily routine, every command and file format, the theory, a hands-on walkthrough on synthetic data, and an API reference generated from the code.
The pieces
- Model. Five states (tissue, fat mass, glycogen-bound water, sodium-bound water, adaptive thermogenesis), nine metabolic parameters, and two more that turn fat mass into waist circumference when there is a tape measure. Tissue follows energy balance with an energy density set by Forbes’ partition law; the water compartments and adaptation are first-order lags on days and weeks.
- Estimation, in two phases. Weight-only history identifies the noise by maximum likelihood on a local linear trend model. Weight and food together (and a weekly tape measure, when there is one) identify metabolism, with the parameters appended to the state and estimated by an unscented Kalman filter in a coordinate where no sigma point can be physically impossible.
- Control. Intake planned in weekly blocks, to the goal date in deadline mode and four weeks ahead otherwise, with tissue, not scale weight, in both the objective and the safety constraints, so that a fast water drop is never mistaken for progress or for danger. Only the first day is eaten.
Status
The current attempt began on October 26, 2026. With 23 logged days of food, the filter correctly reports that it has learned little about the subject’s metabolism yet: five of the nine metabolic parameters still sit on their priors. A backtest scores the filter’s forecasts of every weigh-in, and the deck, numbers included, is regenerated as the record grows.
This is a modeling exercise built on population-level physiology and fitted to one person’s self-reported data. It is not medical advice.