Step 6: Using lookup tables

 

Suppose that somebody has actually gone out to Lake1 and measured the pollutant discharge rate on the first day of each week. Instead of using the regular pattern of discharge assumed so far, we can use this new information to get a more accurate picture of what is going on. We will use a lookup table component to add the following table of data to our model:

Time (days) Discharge rate (kg/day)
0 25
7 12
14 30
21 20
28 50
35 4
42 65
49 15
56 20
63 3
70 45
77 17
84 21
91 10
98 8
105 2

To follow this example load the model "tutor5.mod"

  • Delete the Switch event and the Discharge defined value
  • Add a lookup table, T1
  • Add an influence between T1 and Lake1
  • Double click T1 to open its definition dialog box
  • In the Table tab, enter Data in the Symbol edit box
  • Select the Series tab

We must create a lookup series for every column of data in the table so that ModelMaker knows what the data represents. The first column of data contains observation times. We will define this column as a 'control' series because ModelMaker uses this column to control which value is drawn from the discharge rate column. We will define the second column as 'controlled' because it is controlled by time.

  • Select Series1 in the Lookup Series list box and enter t in the Series Symbol edit box
ModelMaker assumes that the first column is a control series.
  • Click Define to complete the definition of the first series
  • Select Series2 in the Lookup Series list box and enter Discharge in the Series Symbol edit box

ModelMaker assumes that the second column is controlled by t.

There is not a data point for every day of the year, so if we want to know what the discharge rate is on day 65, for example, we must use interpolation. The default method is linear interpolation where the data takes a straight line between data points. In our model, we will assume that the discharge rate on day 65 is the same as on day 63, i.e. we will use start value interpolation.

  • Select the Interval Start interpolation method
  • Click Define to complete the definition of the second series
  • Click the View Data button
The Lookup Tables view is created and activated with the sub-view Data. Data contains an empty sheet called Page 1 with the column headers t and Discharge. This is where the lookup table data are entered.
  • Enter the lookup table data
We can now re-run the model. The new graph of Lake2 shows that there is actually more pollutant reaching the bottom lake than we had assumed, and that the chemical treatment is being applied much more often.
Click image to enlarge

The completed model for this step is "tutor6.mod"

Return to the main tutorial page

ModelKinetix is a trade name of FamilyGenetix, managed by AP Benson.
© FamilyGenetix 2001-2003