. |
Lookup2D Mechaware API Documentation > Lookup
OverviewOverviewThe two-dimensional Lookup block is very similar to the one-dimensional version, except two inputs are mapped to the output instead of one. The mapping is either stepwise (type 0) or piecewise linear (types 1 and 2). Two dimensional Lookup blocks have three forms Direct (direct indexing into table), Fixed (table spacing is fixed), and Vector (table spacing is specified by a vector). The Direct form (type 0) uses the inputs to index into a two-dimensional lookup table. If an index is outside the bounds of the table the nearest output end value in the table is output. For the Fixed form (Type 1) the input minimum values and point spacing are specified. The output values are interpolated over the a range determined by the size of the lookup table. If an input is outside the range of the table (below the input minimum or above the minimum + number of points * spacing) the output value is extrapolated from the nearest two end points in the table. For the Vector form (Type 2), input vectors are used to determine the interpolation value used for the output. The input vectors must be ordered (ascending values). The input values are used to search the input vectors for points that bracket the input (i. e. vector0[n] <= input0 <= vector0[n+1], and vector1[m] <= input1 <= vector1[m+1]). The output is then calculated by interpolating the corresponding values in the lookup table. The following example shows a Vector Lookup block:
The Lookup Block parameters are as follows:
Matlab/SimulinkSimulink Interface
The Lookup Input may be connected to any block output except FTOI. The Output will be generated from the input using a lookup table. The table may be indexed directly (Lookup Type = 0 (default)) or interpolated (Type = 1, Fixed and Type = 2, Vector). See the Overview section for descriptions of the lookup types. The Lookup Table File field should have the name of a text file that contains the lookup table data appropriate for the Lookup Type. For Direct (Type 0) lookup the file contains 1 line per table row. The entry values must be a row of numbers at the beginning of the line. Each line may contain a comment following the table values as long as the comment does not begin with a numeric character and there is at least one space or tab character between the last value number and the comment. The following is an example of a Direct table file:
The format for the text file containing data for Fixed (Type 1) lookup table blocks is the same as that for Direct types except the first line contain the minimum input values and table spacing values respectively. The following is an example of a Fixed table file:
For Vector (Type 2) lookup the file contains an two input vectors and a lookup table. The input vectors are in the first two rows and must be in ascending order. The following is an example of a Vector table file:
The block has two user data fields (User Data 0, User Data 1) to store application-specific data for convenient storage and retrieval. See User Data Storage for details. The block's update schedule is determined by the Subsample Code (See Subsampling). The following Parameter Dialog Box can be opened by double-clicking on the block in a Simulink Model:
C++ APILOOKUP2DBlock Declaration Public method
Description The LOOKUP2D block maps the an output to an input using a lookup table. The manner of lookup is controlled by the type which can be Direct indexing, Fixed spacing, or Vector specified spacing. See the Overview for details. Parameters
Methods |
| | Copyright © 2001-2012 Motion Engineering |