MathSBML

MathSBML Home Page MathSBML Site Map

dataTable


dataTable[var, {t, tbegin, tend, tdelta}, solution] returns table of values of var by interpolating into solution, which must be the output of SBMLNDSolve.

dataTable[{v1,v2,...}, {t, tbegin, tend, tdelta}, solution] returns table of values of v1, v2, ....

dataTable[var, {t, tbegin, tend, tdelta}, solution, file->string-filename, format->format-string] or dataTable[{v1,v2,...}, {t, tbegin, tend, tdelta}, solution, file->string-filename, format->format-string] writes the table of values to the specified file and returns the name of the file.


If no output file is specified, the table has the format

{{"time", "v1", "v2",...},
 {tbegin, v1(tbegin), v2(tbegin),...},
 {tbegin+tdelta, v1(tbegin+tdelta), v2(tbegin+tdelta),...},
 ...
 }
The first sublist constains the word "time" and the variable names; each subsequent sublist contains the time and values for each of the variables at each subseuqent time point.

format may take on any of the following values:

format->"CSV", comma separated values
format->"HDF", heirarchical data format (column headers omitted from output file)
format->"LIST", a text file containing Mathematica lists
format->"MAT", MAT matrix file format (column headers omitted from output file)
format->"MTX", matrix market file format (column headers omitted from output file)
format->"NB", as a Mathematica Notebook
format->"TSV", tab separated values
format->"TABLE", white-space separated values

For more details on the individual format the user is referred to the Mathematica Export fuction documentation

New in version 2.3.33.

Example

In: newModel["test"];
    addSpecies["A", initialAmount -> 1];
    addSpecies["B", initialAmount -> 0.5];
    addSpecies["C", initialAmount -> 0.1];
    addReaction[A + B -> C, kineticLaw -> k*A*B, parameters -> {k -> 1}];
    createModel["test.xml"];
    m=SBMLRead["test.xml", context->None];
    r = SBMLNDSolve[m, 1];
    dataTable[{A,B,C},{t,0,1, 0.2}, r]
    
Out:{{time, A, B, C}, 
    {0, 1., 0.5, 0.1}, 
    {0.2, 0.913106, 0.413106, 0.186894}, 
    {0.4, 0.846547, 0.346547, 0.253453}, 
    {0.6, 0.794167, 0.294167, 0.305833}, 
    {0.8, 0.752061, 0.252061, 0.347939}, 
    {1., 0.717633, 0.217633, 0.382367}}

In: dataTable[{A,B,C},{t,0,1, 0.2}, r,file->"foo.csv", format->"CSV"]

out:foo.csv

Here is the file foo.csv:

time,A,B,C
0,1.,0.5,0.1
0.2,0.913106433887895,0.4131064338878954,0.18689356611210473
0.4,0.8465470596243387,0.34654705962433924,0.25345294037566085
0.6000000000000001,0.7941665101947815,0.29416651019478196,0.30583348980521813
0.8,0.7520606613872981,0.25206066138729855,0.34793933861270154
1.,0.717633297229723,0.21763329722972344,0.3823667027702767



10-Aug-2004