WOLFRAM SYSTEMMODELER
CombiTimeTableTable lookup with respect to time and linear/periodic extrapolation methods (data from matrix/file) 
SystemModel["Modelica.Blocks.Sources.CombiTimeTable"]
This information is part of the Modelica Standard Library maintained by the Modelica Association.
This block generates an output signal y[:] by linear interpolation in a table. The time points and function values are stored in a matrix table[i,j], where the first column table[:,1] contains the time points and the other columns contain the data to be interpolated.
Via parameter columns it can be defined which columns of the table are interpolated. If, e.g., columns={2,4}, it is assumed that 2 output signals are present and that the first output is computed by interpolation of column 2 and the second output is computed by interpolation of column 4 of the table matrix. The table interpolation has the following properties:
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. (If smoothness is LinearSegments or ConstantSegments this means to extrapolate linearly through the first/last two table points.). = 3: periodically repeat the table data (periodical function). = 4: no extrapolation, i.e. extrapolation triggers an error
smoothness = 1: linear interpolation = 2: Akima interpolation: Smooth interpolation by cubic Hermite splines such that der(y) is continuous, also if extrapolated. = 3: constant segments = 4: FritschButland interpolation: Smooth interpolation by cubic Hermite splines such that y preserves the monotonicity and der(y) is continuous, also if extrapolated. = 5: Steffen interpolation: Smooth interpolation by cubic Hermite splines such that y preserves the monotonicity and der(y) is continuous, also if extrapolated.
table = [0, 0; 1, 0; 1, 1; 2, 3; 3, 5; 3, 2; 4, 4; 5, 5];defines three intervalls: 0..1, 1..3, 3..5. Within an interval the defined interpolation method is applied (so the table outputs within an interval are continuous,and if the interpolation method is smooth, also continuously differentiable). No time events are generated within an interval in order that also intervals with many points do not reduce the simulation efficiency (note in package Modelica version 3.2 and earlier, time events had been generated).
table = [0, 0; 1, 2; 1, 2; 2, 0; 2, 0; 3, 2; 3, 2];instead of
table = [0, 0; 1, 2; 2, 0; 3, 2];because time events are then generated at every time point.
Example:
table = [0, 0; 1, 0; 1, 1; 2, 4; 3, 9; 4, 16]; extrapolation = 3 (default) If, e.g., time = 1.0, the output y = 0.0 (before event), 1.0 (after event) e.g., time = 1.5, the output y = 2.5, e.g., time = 2.0, the output y = 4.0, e.g., time = 5.0, the output y = 23.0 (i.e., extrapolation via last 2 points).
The table matrix can be defined in the following ways:
tableName is "NoName" or has only blanks, fileName is "NoName" or has only blanks.
save tables.mat tab1 tab2 tab3or Scilab by command
savematfile tables.mat tab1 tab2 tab3when the three tables tab1, tab2, tab3 should be used from the model.
When the constant "NO_FILE_SYSTEM" is defined, all file I/O related parts of the source code are removed by the Cpreprocessor, such that no access to files takes place.
If tables are read from an ASCIIfile, the file needs to have the following structure ("" is not part of the file content):
 #1 double tab1(6,2) # comment line 0 0 1 0 1 1 2 4 3 9 4 16 double tab2(6,2) # another comment line 0 0 2 0 2 2 4 8 6 18 8 32 
Note, that the first two characters in the file need to be "#1" (a line comment defining the version number of the file format). Afterwards, the corresponding matrix has to be declared with type (= "double" or "float"), name and actual dimensions. Finally, in successive rows of the file, the elements of the matrix have to be given. The elements have to be provided as a sequence of numbers in rowwise order (therefore a matrix row can span several lines in the file and need not start at the beginning of a line). Numbers have to be given according to C syntax (such as 2.3, 2, +2.e4). Number separators are spaces, tab ( ), comma (,), or semicolon (;). Several matrices may be defined one after another. Line comments start with the hash symbol (#) and can appear everywhere. Other characters, like trailing non comments, are not allowed in the file.
MATLAB is a registered trademark of The MathWorks, Inc.
y 
Type: RealOutput[nout] Description: Connector of Real output signals 

nout 
Value: max([size(columns, 1); size(offset, 1)]) Type: Integer Description: Number of outputs 

tableOnFile 
Value: false Type: Boolean Description: = true, if table is defined on file or in function usertab 
table 
Value: fill(0.0, 0, 2) Type: Real[:,:] Description: Table matrix (time = first column; e.g., table=[0,2]) 
tableName 
Value: "NoName" Type: String Description: Table name on file or in function usertab (see docu) 
fileName 
Value: "NoName" Type: String Description: File where matrix is stored 
verboseRead 
Value: true Type: Boolean Description: = true, if info message that file is loading is to be printed 
columns 
Value: 2:size(table, 2) Type: Integer[:] Description: Columns of table to be interpolated 
smoothness 
Value: Modelica.Blocks.Types.Smoothness.LinearSegments Type: Smoothness Description: Smoothness of table interpolation 
extrapolation 
Value: Modelica.Blocks.Types.Extrapolation.LastTwoPoints Type: Extrapolation Description: Extrapolation of data outside the definition range 
offset 
Value: {0} Type: Real[:] Description: Offsets of output signals 
startTime 
Value: 0 Type: Time (s) Description: Output = offset for time < startTime 
timeScale 
Value: 1 Type: Time (s) Description: Time scale of first table column 
t_min 
Value: Type: Time (s) Description: Minimum abscissa value defined in table 
t_max 
Value: Type: Time (s) Description: Maximum abscissa value defined in table 
t_minScaled 
Value: Type: Real Description: Minimum (scaled) abscissa value defined in table 
t_maxScaled 
Value: Type: Real Description: Maximum (scaled) abscissa value defined in table 
p_offset 
Value: if size(offset, 1) == 1 then ones(nout) * offset[1] else offset Type: Real[nout] Description: Offsets of output signals 
tableOnFileRead 
Value: Type: Real Description: = 1, if table was successfully read from file 
tableID 
Type: ExternalCombiTimeTable Description: External table object 

Test example: AsynchronousInductionMachineSquirrelCage with inverter driving a conveyor 

Pullin stroke of both solenoid models after a voltage step at time t=0 

Rolling wheel set that is pulled by a force 

Second order thermal model of a motor 