WOLFRAM SYSTEMMODELER LINK PACKAGE

Modelica CombiTimeTable

BackgroundBackground

    Modelica CombiTimeTable ASCII format data files.
    File format used by Modelica.
    Exported files can be read by Modelica component "Modelica.Blocks.Sources.CombiTimeTable".

Import and ExportImport and Export

  • Import["file.txt","ModelicaCombiTimeTable"] imports table data from the ASCII file and returns {"n1"->data1,} where datai are lists of lists.
  • Export["file.txt",{{"n1",{{t1,v1},},},"ModelicaCombiTimeTable"] writes the time-value pairs {ti,vi} for variable names "ni" in an ASCII file readable by Modelica component "Modelica.Blocks.Sources.CombiTimeTable".
  • Export["file.txt",{{"n1",{v1,},},"ModelicaCombiTimeTable"] exports the values vi for variable names "ni".
  • For a list of values vi, SamplingPeriod controls the time step, with a default step of 1.
  • Export["file.txt",{{"n1",ts1},},"ModelicaCombiTimeTable"] exports the TimeSeries tsi for variable names "ni".
  • Export["file.txt",{{"n1",f1},},"ModelicaCombiTimeTable","StartTime"->tmin,"StopTime"->tmax] exports sampled functions fi at automatically determined sample points from tmin to tmax.
  • The option SamplingPeriod can be used to explicitly set the distance between samples.

ElementsElements

  • General Import elements:
  • "Elements"list of elements and options available in this file
    "Rules"full list of rules for each element and option
  • Data representation element:
  • "Data"data given as a multidimensional array
    "TimeSeries"data given as TimeSeries
  • Import uses the "Data" element by default.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Load Wolfram SystemModeler Link:

In[1]:=
Click for copyable input

Export already sampled data for two variables:

In[1]:=
Click for copyable input
Out[1]=

Export a TimeSeries:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Import data as arrays:

In[1]:=
Click for copyable input
Out[1]=