Table lookup algorithms provide a powerful tool for the modeling of systems the following are some basic tips for making your table look up’s fast and accurate
Pre-process your data
Table data often comes from real-world sources. This presents two issues
- Errors in the data: Validate that any anomalous readings are removed from the data
- Non-uniform input axis: Real-world measurements frequently have jitter on the exact “place” of measurement. Data should be renormalized to a uniform input axis
Know your boundaries
With tables, there are always limits on the input axes range. Understanding the behavior of the table outside of the known range is important. There are two basic options
- Hold last value: In this instance, the last value at the tale boundary is used for all data outside of the axes
- Interpolate data: In this case, the output data is extended beyond the known boundary. For data near the boundaries this is generally acceptable; however, the accuracy can quickly break down as inputs exceed the
There are three approaches to handling this issue
- Expand the range of valid data: This is the ideal solution but is often not possible due to sampling reasons.
- Pre-interpolate the data: Create data outside of the range with “safe” values based on engineering knowledge.
- Limit the input data range: Create a “hard stop” at the data edge.
Reduce, reuse, recycle…
It is common for multiple tables to share the same input axis; in this case, sharing the index lookup across multiple tables is one method for reducing the total number of calculations required by the algorithm.
Data types and discontinuities
lookup algorithms are not well suited for data with discontinuities. When working with such data either piecewise approaches are used or the region in which the discontinuity appears has additional data points to handle the sharp change.
A similar issue is working with integer-based data and interpolation. When the outputs from the table are integer values then either interpolation should not be enabled or all possible input coordinates should be part of the input axes.
So there you go, a few quick suggestions for working with tables!