About Lookup Table Blocks
Page in progress. |
A search table is a data array that maps input values to output values, thereby approximating a mathematical function. Given a given set of input values, a lookup operation retrieves the corresponding output values from the table. If the lookup table does not explicitly define the input values, Engee can estimate the output value using interpolation, extrapolation, or rounding, where:
-
Interpolation is the process of estimating values lying between known data points.
-
Extrapolation is the process of estimating values lying outside the range of known data points.
-
Rounding is the process of approximating a value by changing it according to a known rule.
Lookup table blocks use an array of data to match input values to output values by approximating a mathematical function. Given input values, Engee performs a lookup operation to retrieve the corresponding output values from the table. If the lookup table does not define the input values, the block estimates the output values based on nearby table values.
The following example illustrates a one-dimensional lookup table approximating the function . The lookup table defines its output data ( ) discretely over a range of input data ( ) [-3, 3]
. The following table and graph illustrate the relationship between input and output:
An input value -2
allows the table to search and retrieve the corresponding output value (-8
). Similarly, in response to the input value -3
, the lookup table produces 27
.
When a lookup table block encounters an input value that does not match any of the values of the table, it can interpolate or extrapolate a response. For example, the lookup table does not define an input value of -1.5
, but the block can linearly interpolate the nearest neighbouring data points and . For example, two points are given:
-
-2,-8
) is (-2,-8
); -
is (
-1,-1
).
The lookup table evaluates and returns the value -4.5
.
Similarly, although the lookup table does not contain data for values of outside the [-3, 3]
range, the block can extrapolate values using a pair of data points at either end of the table. Given an input value of 4
, the lookup table block linearly extrapolates the nearest data points (2, 8
) and (3, 27
) to estimate an output value of 46
.
Since lookup tables and simple estimation can be faster than mathematical function evaluations, usage of lookup table blocks can lead to increased speed in model simulation. Consider usage of lookup tables instead of mathematical function evaluations when:
-
An analytical expression is expensive to calculate.
-
No analytical expression exists, but the relationship has been determined empirically.
Engee provides a wide variety of lookup table blocks, each designed for a specific type of application. The following sections describe the various offerings, suggest which lookup table is most appropriate for your application, and explain how to interact with the various lookup table blocks.