LookupTable2D Block
2-D lookup table with bilinear interpolation. Maps two input values (x, y) to an output value using breakpoints and table data.
Open LookupTable2D in BlockWerk →# 2-D Lookup Table Block
Description
The 2-D Lookup Table block maps two input values (x, y) to an output value using bilinear interpolation within a predefined grid of data points. It is commonly used for complex nonlinear relationships that depend on two variables, such as motor efficiency maps, aerodynamic drag coefficients, or complex sensor calibrations.
Mathematical Model
Output z = f(x, y) based on:
1. Finding the bounding box: x_i <= x < x_{i+1} and y_j <= y < y_{j+1} 2. Using bilinear interpolation to calculate z within that rectangle using the 4 corner values from the tableData.
Parameters
X Breakpoints (xBreakpoints)
A space-separated list of strictly monotonically increasing values representing the x-axis grid coordinates. Example: 0 1 2 3
Y Breakpoints (yBreakpoints)
A space-separated list of strictly monotonically increasing values representing the y-axis grid coordinates. Example: 0 10 20
Table Data (tableData)
A space-separated list of output values (z). The data must be provided in row-major order (iterating through all x columns for the first y row, then the second y row, etc.). The total number of elements must equal length(xBreakpoints) * length(yBreakpoints).
Extrapolation
Behavior when inputs fall outside the defined breakpoint ranges:
- Linear: Extrapolates the surface gradient linearly beyond the edges.
- Clip: Limits the output to the value at the nearest boundary of the table.
Examples
Efficiency Map
Mapping speed (x) and torque (y) to determine motor efficiency (z).
Remarks
- Both
xBreakpointsandyBreakpointsmust be strictly increasing. - Providing mismatched dimensions between breakpoints and
tableDatawill result in configuration errors or NaN outputs. - Interpolation within the table bounds is always bilinear.
See Also
- LookupTable: For 1-dimensional mappings.
- MathFunction: For standard analytic mathematical nonlinearities.