LookupTableND_port

This block approximates a non-linear function using interpolation on data provided as an "n-dimensional table".

    LookupTableND_port

Library

Activate/LookupTables

Description

Data of the LookupTableND_port are provided through separate ports per input plus one port for table data. Each input vector is a row vector, table data is a also row vector, the results varying according to the order of the n input vectors. Table data is a combination of the data for a variation of the first input over a variation of the second input over a variation of the third input and so on.

For example, for 2 input vectors, the table data varies by all of values the input vector 1 for *only* the first value of input vectors 2. After this is exhausted, the next values in Table Data varies by incrementing to the second value of input vector 2 while also incrementing through all of the vales of input vector 1 at this second value. This continues until all of the values of the second input vector are completed. With additional input vectors, the same pattern persists to increment through the next input vector values while incrementing through the prior input vector values.

Input vector 1: [x1 x2 x3]
Input vector 2: [y1 y2]
Input vector 3: [z1 z2]
Table data: [x1y1z1, x2y1z1, x3y1z1, x1y2z1, x2y2z1, x3y2z1, x1y1z2, x2y1z2, x3y1z2, x1y2z2, x2y2z2, x3y2z2]

Parameters

LookupTableND_port_0

NameLabelDescriptionData TypeValid Values

nDims

Number of dimensions

Number of dimensions of the lookup table. One dimension corresponds to one input.

Number

Method

Interpolation method

Interpolation method. Default: linear.

String

'ZeroOrder(floor)'
'ZeroOrder(nearest)'
'Linear'
'Akima'
'Fritsch_Butland'
'Steffen'

DoOutside

Result outside the table range

Action to be taken with results outside of the table range.

String

'Hold'
'Linear'
'Zero'
'Error'

derivative

Provide partial derivative vector

If selected, the block provides the partial derivative vector of the table with respect to each dimension. In this case, inputs should be row vector. The directional derivative output will be a matrix of row size nDim and the same column size as inputs.

Number

0
1

externalActivation

External activation

Specifies whether the block receives an external activation or inherits its activation through its regular input ports. When External Activation is selected, an additional activation port is added to the block. By default, external activation is not selected.

Number

0
1

Ports

NameTypeDescriptionIO TypeNumber

y

explicit

output

1

Port 2

explicit

output

derivative

Port 3

explicit

input

2*nDims+1

Port 4

activation

input

externalActivation

Example

The demo model LookupTableND_port.scm is available in demo browser in folder Activate/Basics/LookupTable.

The input vectors and table data are defined in model context and applied via constant blocks.

See Also