About Lookup Table blocks
A lookup table is an array of data that maps input values to output values, thereby approximating a mathematical function. For a given set of input values, the search operation retrieves the corresponding output values from the table. If the lookup table does not contain an explicit definition of the input values, then 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 that lie outside the range of known data points.
-
Rounding is the process of approximating a value by changing it according to a well—known rule.
Blocks of search tables use an array of data to match input values with output values, approximating a mathematical function. When setting input values, Engee performs a "search" operation to get the corresponding output values from the table. If the lookup table does not determine the input values, then the block evaluates the output values based on nearby table values.
The following example illustrates a one-dimensional lookup table approximating a function . The lookup table defines its output ( ) discretely in the input data range ( ) [-3, 3]
. The following table and graph illustrate the relationship between Input and output:
The input value -2
allows the table to search and retrieve the corresponding output value ('-8'). Similarly, in response to the input value 3
, the search table returns `27'.
When a block of the lookup table encounters an input value that does not match any of the values then it can interpolate or extrapolate the answer. For example, the lookup table does not define an input value of -1.5
, however, the block can linearly interpolate the nearest neighboring data points and . For example, two points are given:
-
these are (
-2,-8
); -
this is (
-1,-1
).
The lookup table evaluates and returns the value `-4.5'.
Similarly, although the lookup table does not contain data for the values outside of the range [-3, 3]
, 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 the output value of `46'.
Since table lookups and simple estimates can be faster than mathematical estimates of functions, the usage of lookup table blocks can lead to an increase in speed when modeling a model. Consider usage of lookup tables instead of mathematical function evaluations when:
-
Analytical expression is expensive to compute.
-
There is no analytical expression, but the dependence has been determined empirically.
Engee provides a wide selection of lookup table blocks, each of which is designed for a specific type of application. The following sections describe the various suggestions, suggest choosing the search table that is most suitable for your application, and explain how to interact with various blocks of search tables.