Bucket
Up

 

Numerical Models - The Bucket

1999 by Ed Seykota

 

A model helps understanding by supporting imagination and play. A good model is also able to predict behavior. A numeric (simulation) modelcan reconcile a large number of complicated relationships and also provide a graphical look under the hood.

Numerical models work by recursive solution of integral equations. That is, computation proceeds by using the rates of flow over a small delta time to increment the states. Then, from the new values of the states, it computes the next generation of rates of flow. As the computation runs along, it generates a trace of all the variables over time. In effect, it evolves a motion picture of the behavior from the initial conditions to the end of the simulation.

For example, consider a simple system of a bucket of water with a hole in the bottom. Say we wish to examine the level of water in the bucket as the water drains out. Then, a simple set of model equations would be:

1

Mass = Mass - MassFlux * DT

The mass is the integral of the mass flux

2

Level = Mass / (Density * Area)

The water level is proportional to the mass

3

MassFlux = Level / DrainConstant

The mass flux is proportional to the level

 

Notes: Equation #1 is a simple integration. Equation #2 assumes the bucket has parallel walls and does not widen or taper. Equation #3 assumes the mass flux is proportional to the water level. Another assumption might be a square root law. The purpose of this simple example, however, is to illustrate the mechanics of model simulation, not necessarily to provide accurate predictions of the water level in a leaking bucket. Interested readers may wish to pursue the model with other assumptions such as a square root flux relationship.

In addition to the equations for the states and the rates, the model need values for the constants and some initial conditions. In this case, there is only one state, the mass.

4

Mass = 1 kg

At time = 0

5

Density = 1000 kg / m^2

 

6

Area = .01 m^2

About 11 cm diameter

7

DrainConstant = 10 sec * Kg/m.

 

 

Now, we pick a value for DT and begin the simulation. If DT is too small, the model will not move very quickly. If DT is too large, it will move too quickly with each step and may overshoot and become inaccurate, even unstable. For this example, in this case we can use DT = 10 seconds. 

The Simulation

Time(sec)

Mass (kg)

Level (m)

Flux (kg/s)

0

1.000

0.1000

0.0100

10

0.900

0.0900

0.0090

20

0.810

0.0810

0.0081

30

0.729

0.0729

0.0073

40

0.656

0.0656

0.0066

50

0.590

0.0590

0.0059

 

Note that as the bucket drains, the flux exiting the bucket also becomes less, so the mass falls exponentially and asymptotically toward zero. The reader might like to set up such a simulation model on a spreadsheet program to view the behavior of the mass at say, time = 500 seconds. The reader might also like to experiment with different values of DT to get a feel for the shape of the tradeoff between a small solution interval (more accuracy) and a large solution interval (quicker calculation).