IntegerTable

Generate an Integer output signal based on a table matrix with [time, yi] values

    IntegerTable

Library

Modelica/Blocks/Sources

Description

This block generates an Integer output signal by using a table. The time points and y-values are stored in a matrix table[i,j], where the first column table[:,1] contains the Real time points and the second column contains the Integer value of the output y at this time point. The table interpolation has the following properties:

  • An assert is triggered, if no table values are provided, if the time points are not strict monotonically increasing, or if the second column of the table matrix does not contain Integer values.
  • Values outside of the table range, are computed by extrapolation according to the setting of parameter extrapolation:
      extrapolation = 1: Hold the first or last value of the table,
                         if outside of the table scope.
                    = 2: Extrapolate by using the derivative at the first/last table
                         points if outside of the table scope.
                         (This setting is not suitable and triggers an assert.)
                    = 3: Periodically repeat the table data (periodical function).
                    = 4: No extrapolation, i.e. extrapolation triggers an error
    
  • If the table has only one row, no interpolation is performed and the table values of this row are just returned.
  • Via parameter shiftTime the curve defined by the table can be shifted in time. The time instants stored in the table are therefore relative to shiftTime.
  • If time < startTime, no interpolation is performed and zero is used as ordinate value for the output.

Example:

   table = [  0, 1;
              1, 4;
            1.5, 5;
              2, 6];

results in the following output:

IntegerTable.png

Parameters

IntegerTable_0

NameLabelDescriptionData TypeValid Values

mo_table

table

Table matrix (first column: time; second column: y)

Matrix of size Mx2

mo_extrapolation

extrapolation

Extrapolation of data outside the definition range

Structure

mo_extrapolation/choice1

Hold the first/last table point outside of the table scope

Number

0
1

mo_extrapolation/choice2

Extrapolate by using the derivative at the first/last table points outside of the table scope

Number

0
1

mo_extrapolation/choice3

Repeat the table scope periodically

Number

0
1

mo_extrapolation/choice4

Extrapolation triggers an error

Number

0
1

mo_startTime

startTime

Output = 0 for time < startTime

Scalar

mo_shiftTime

shiftTime

Shift time of first table column

Scalar

mo_n

n

Number of table points

Scalar

IntegerTable_1

NameLabelDescriptionData TypeValid Values

mo_y

y

y

Structure

mo_y/fixed

fixed

Cell of scalars

true
false

mo_y/start

start

Cell of scalars

Ports

NameTypeDescriptionIO TypeNumber

y

implicit

Connector of Integer output signal

output

1