Bathtub Models

Overview


A bathtub model is a name given to a model that models the flow of some item (in the case of a bathtub, it is water) into and out of a container. For the simple case of a bathtub, the tub has a faucet pouring water into the tub, and a drain that drains water away. The model would specify how quickly water accumulates or leaves the tub.

More complex models will model several different containers, or tubs, where the drain out of one tub might lead into another. That is, water coming out of one, is an input into another.

The bathtub model can be used to model several different scenarios spanning topics, from chemistry to economics.

Basic Setup


The bathtub model has three variables:

  • W(t) : is the amount of water in the tub at time t
  • I(t) : is the amount of water flowing into the tub at time t, per unit time
  • O(t) : is the amount of water flowing out of the tub at time t, per unit time


The basic equation is :
{% W(t+\Delta t) = W(t) + I(t)\times \Delta t - O(t) \times \Delta t %}
That is, the amount of water at time {% t+\Delta t %} is the amount of water at time t, plus the amount of water flowing into the tub over the time {% \Delta t %} minus the amount of water flowing out over the time {% \Delta t %}.

Taking the limit, we get the standard differential equation
{% \frac{d W(t)}{dt} = I(t) - O(t) %}

Multiple Tubs


More complex models will model several different containers, or tubs, where the drain out of one tub might lead into another. That is, water coming out of one, is an input into another.

In a multiple tub model, we have several different W's, that is the first tub is labeled {% W_1 %}, the second tub is labeled {% W_2 %} and so on.

Similarly, each tubs input and output is also labeled with an index.

Model Types