Mass, mole, momentum, and energy balances are at the heart of several first principles simulators. This tutorial details how to solve for the level of a gravity drained tank with 2 different analytic approaches and 2 different numeric approaches. See https://github.com/APMonitor/applications/tree/master/transient_balances for source files and lecture notes.