Inverse Lookup: Referencing a 1-D Lookup Table Using the Dependent Variable

In some cases, you may want to do an inverse lookup into a Lookup Table. For example, suppose that you had defined a Lookup Table in which the independent variable is the volume of water in a pond, and the dependent variable is the water elevation in the pond (hence, the values in the table are determined by the shape of the pond). You would then use the Table to return a value for the water elevation for a specified value of the volume. However, what if you wanted to know the corresponding volume for a specified value of the water elevation?

GoldSim supports this by allowing you to carry out a reverse lookup; that is, you can reference a 1-D table by sending it a value for the dependent variable, and the function will return the corresponding value for the independent variable.

To implement this, you must add a second argument to the table function A special function for referencing user-defined lookup tables that can be referenced in input fields. It is automatically created whenever you create a Lookup Table element.:

Tablename(Row Variable, TBL_Inverse)

Using the example described above, if you had a Lookup Table (named Elevation) in which the independent variable is the volume of water in a pond, and the dependent variable is the water elevation in the pond, then the following expression would return the elevation corresponding to a volume of 150 m3:

and the following expression would return the volume corresponding to an elevation of 10 m:

Several points should be noted:

An example model which illustrates the inverse function (TableFunctions.gsm) can be found in the General Examples/LookupTable folder in your GoldSim directory (accessed by selecting File | Open Example... from the main menu).