Wolfram Computation Meets Knowledge

File FormatsCombiTimeTable Files (.txt)

CombiTimeTable FilesMatrices
File HeaderExample

System Modeler uses a number of different file formats. For a complete list, see the System Modeler File Formats guide.

CombiTimeTable Files

The CombiTimeTable file format is an ASCII-coded text file that is used by the CombiTimeTable component and various table components in the Modelica Standard Library. In System Modeler you can both export plot data in a CombiTimeTable format and use it as input variable data.

The CombiTimeTable file (the ASCII text file) consists of a file header and one or more matrices specifying input variables and their values at different points in time. The format is described in more detail following.

File Header

The first line of the file must always consist of exactly two characters, namely #1.

Matrices

Each matrix in the file represents an input variable and its values at different points in time. A matrix is always preceded with a header specifying the type, name, and size of the matrix. This header must be exactly one line and may include an optional comment. The format of the header is:

double name(rows, columns) #comment

The type of the matrix must always be double. The number of rows in the matrix corresponds to the number of time points specified for the variable, and the number of columns is the size of the variable plus one, where the first column is used to specify time and the other columns contain the data to be interpolated.

For a scalar variable, the number of columns in the matrix would be 2; for an array of length 3, the number of columns in the matrix would be 4. For a matrix with dimensions [3,2], the number of columns would be , and so on.

For each matrix in the file, the first column must either be monotonically increasing or monotonically decreasing. An event is specified using two consecutive rows with the same time value.

Example

For a simulation with three input variables s, t, and u, where s is a scalar, t is an array of size 2, and u is a matrix of size [2,2], an input variable data file with the following contents could be used:

#1
double s(5,2) # scalar
0.2 55.4
0.4 41.7
0.8 21.2
1.6 11.3
3.2 10.7

double t(4, 3) # array of size 2
1.0 0.1 3.2
2.0 22.3 4.4
3.0 31.7 5.0
5.0 34.0 5.2

double u(4, 5) # matrix of size [2,2], with an event at time 0.3.
0.8 4.0 4.1 4.2 4.3
0.3 3.0 3.1 3.2 3.3
0.3 2.0 2.1 2.2 2.3
0.1 1.0 1.1 1.2 1.3

It is worth noting that for the matrix u, the data should be specified in row major order, i.e. at time 0.8, u[1,1]=4.0, u[1.1]=4.1, u[2,1]=4.2, and u[2,2]=4.3. You may also notice that an event has been specified at time 0.3 for the input variable u.