Code to reproduce the figures for "How to pour a cup of coffee" Niteesh Midlagajni, Roland W. Fleming, Constantin A. Rothkopf
This repo contains the analysis and plotting notebooks used to generate the behavioral and modeling figures in the paper. Preprocessed data is hosted on Zenodo and downloaded automatically when you run the notebooks.
behavioural_plots.ipynb— behavioral figures (Figures 1, 2, 3).model_plots.ipynb— SINDYc dynamics fits, iLQG controller fits, and inverse optimal control results: recovered parameters, model comparison, and the signal-dependent-noise ablation (Figures 4 and 5).controller_helper.py— SINDYc forward dynamics equations and iLQG simulation wrappers for each container–vessel combination.utils.py— shared data loading and plotting utilities.
Preprocessed data is hosted on Zenodo: 10.5281/zenodo.22163061.
The first cell of each notebook downloads and extracts it into data/
automatically if it isn't already present.
iLQG solver come from
nioc-pouring, our fork of the
nioc library that includes all the container-vessel pouring environments. This is installed automatically as a project dependency.
This project uses uv to install and run.
git clone https://github.com/RothkopfLab/human-pouring-control.git
cd human-pouring-control
uv sync
uv run jupyter labOpen behavioural_plots.ipynb or model_plots.ipynb and run.
For replaying and visualizing the raw mocap, scale, and gaze data, see
pouring_data_playback.
@article{midlagajni2026pouring,
title={How to pour a cup of coffee},
author={Midlagajni, Niteesh and Fleming, Roland W. and Rothkopf, Constantin A.},
journal={bioRxiv},
year={2026},
doi={10.64898/2026.08.26.746627},
url={https://www.biorxiv.org/content/10.64898/2026.08.26.746627v1}
}