.. _lookup_tables: Lookup Tables ============= Lookup tables provide a method to compute an approximate value of a function based on indexes into arrays of values with interpolation between values. The indexing is normally simpler and faster than the equivalent mathematical formula. Lookup tables can save processing time, while being faster to setup for complex non-linear equations, and easy to calibrate on the fly. OpenECU Lookup Tables ---------------------- OpenECU provides support for 1d and 2d lookup tables, with linear interpolation between data points, and no extrapolation. OpenECU also supports 1d and 2d non-volatile adaptive lookup tables. OpenECU lookup blocks provide full support for ASAP2 MAP entries in the generated A2L file for all Simulink coders (i.e. RSIM, RTMODEL, and ERT based), including the active interpolation point (if available). Simulink Native Lookup Tables ----------------------------- Simulink provides similar functionality, but allows for greater configurability for the lookup table dimensions, data types, index search, and interpolation method (with extrapolation available). .. note:: * The tables do not support non-volatile adaptive table data. * The tables have limited support for ASAP2 integration features. * Additional considerations exist based on the model's configuration. Naming Considerations --------------------- To support a common axis in either OpenECU or Simulink lookup table blocks, one must either disable the naming convention using Simulink Data Dictionaries in R2015a or later, or enable Simulink based ASAP2 generation. .. csv-table:: :header: "Feature", "put_Calmap1d", "put_Calmap2d", "pnv_AdaptiveMap1d", "pnv_AdaptiveMap2d", "Lookup Table", "Lookup (2-D)", "Lookup (n-D)", "Interpolation Using Prelookup" "Data types", "float", "float", "float", "float", "float", "float", "Any numeric (incl. fixed pt)", "Any numeric (incl. fixed pt)" "Table dimensions", "1", "2", "1", "2", "1", "2", "1-30", "1-30" "Configurable index search", "No", "No", "No", "No", "No", "No", "Yes", "Yes" "Configurable interpolation method", "No", "No", "No", "No", "Yes", "Yes", "Yes", "Yes" "Nonvolatile data", "No", "No", "Yes", "Yes", "No", "No", "No", "No" "ASAP2 MAP entry", "RSIM", "Yes", "Yes", "Yes", "Yes", "Yes :sup:`1`", "Yes :sup:`1`", "Yes :sup:`1`", "Yes :sup:`1`" "RTMODEL", "Yes", "Yes", "Yes", "Yes", "Yes :sup:`1` or :sup:`2`", "Yes :sup:`1` or :sup:`2`", "Yes :sup:`1` or :sup:`3`", "Yes :sup:`1` or :sup:`3`" "ERT", "Yes", "Yes", "Yes", "Yes", "Yes :sup:`1` or :sup:`2`", "Yes :sup:`1` or :sup:`2`", "Yes :sup:`1` or :sup:`3`", "Yes :sup:`1` or :sup:`3`" :sup:`1` requires map (m) prefix naming convention :sup:`2` requires Simulink based ASAP2 generation :sup:`3` requires Simulink based ASAP2 generation and R2010a or later .. _Wikipedia's Lookup table Article: https://en.wikipedia.org/wiki/Lookup_table .. _Wikipedia's Linear interpolation Article: https://en.wikipedia.org/wiki/Linear_interpolation For more description of lookup tables, see `Wikipedia's Lookup table Article`_. For more description of linear interpolation, see `Wikipedia's Linear interpolation Article`_.