File Formats—CombiTimeTable Files (.txt)
System Modeler uses a number of different file formats. For a complete list, see the System Modeler File Formats guide.
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.
The first line of the file must always consist of exactly two characters, namely #1.
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.
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:
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.