libRoadRunner C API  1.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions
Time-course simulation

Deterministic, stochastic, and hybrid simulation algorithms. More...

Functions

bool setConfigurationXML (RRHandle handle, const char *caps)
 Set the simulator's capabilities. More...
 
char * getConfigurationXML (RRHandle handle)
 Get the simulator's capabilities. More...
 
bool setTimeStart (RRHandle handle, double timeStart)
 Set the time start for a time course simulation. More...
 
bool setTimeEnd (RRHandle handle, double timeEnd)
 Set the time end for a time course simulation. More...
 
bool setNumPoints (RRHandle handle, int numberOfPoints)
 Set the number of points to generate in a time course simulation. More...
 
bool setTimeCourseSelectionList (RRHandle handle, const char *list)
 Set the selection list for output from simulate(void) or simulateEx(void) More...
 
RRStringArrayPtr getTimeCourseSelectionList (RRHandle handle)
 Get the current selection list for simulate(void) or simulateEx(void) More...
 
RRCDataPtr simulate (RRHandle handle)
 Carry out a time-course simulation. setTimeStart, setTimeEnd, setNumPoints, etc are used to set the simulation characteristics. More...
 
RRCDataPtr getSimulationResult (RRHandle handle)
 Retrieve the result of the last simulation. More...
 
RRCDataPtr simulateEx (RRHandle handle, const double timeStart, const double timeEnd, const int numberOfPoints)
 Carry out a time-course simulation based on the given arguments, time start, time end and number of points. More...
 
bool oneStep (RRHandle handle, const double currentTime, const double stepSize, double *value)
 Carry out a one step integration of the model. More...
 
bool getTimeStart (RRHandle handle, double *timeStart)
 Get the value of the current time start. More...
 
bool getTimeEnd (RRHandle handle, double *timeEnd)
 Get the value of the current time end. More...
 
bool getNumPoints (RRHandle handle, int *numPoints)
 Get the value of the current number of points. More...
 

Detailed Description

Deterministic, stochastic, and hybrid simulation algorithms.

Function Documentation

char * getConfigurationXML ( RRHandle  handle)

Get the simulator's capabilities.

Example:

1  <caps name="RoadRunner" description="Settings For RoadRunner">
2  <section name="integration" method="CVODE" description="CVODE Integrator">
3  <cap name="BDFOrder" value="5" hint="Maximum order for BDF Method" type="integer" />
4  <cap name="AdamsOrder" value="12" hint="Maximum order for Adams Method" type="integer" />
5  <cap name="rtol" value="1E-06" hint="Relative Tolerance" type="double" />
6  <cap name="atol" value="1E-12" hint="Absolute Tolerance" type="double" />
7  <cap name="maxsteps" value="10000" hint="Maximum number of internal stepsc" type="integer" />
8  <cap name="initstep" value="0" hint="the initial step size" type="double" />
9  <cap name="minstep" value="0" hint="specifies a lower bound on the magnitude of the step size." type="double" />
10  <cap name="maxstep" value="0" hint="specifies an upper bound on the magnitude of the step size." type="double" />
11  <cap name="conservation" value="1" hint="enables (=1) or disables (=0) the conservation analysis of models for timecourse simulations." type="int" />
12  <cap name="allowRandom" value="1" hint="if enabled (=1), reinterprets certain function definitions as distributions and draws random numbers for it." type="int" />
13  <cap name="usekinsol" value="0" hint="Is KinSol used as steady state integrator" type="int" />
14  </section>
15 
16  <section name="SteadyState" method="NLEQ2" description="NLEQ2 Steady State Solver">
17  <cap name="MaxIterations" value="100" hint="Maximum number of newton iterations" type="integer" />
18  <cap name="relativeTolerance" value="0.0001" hint="Relative precision of solution components" type="double" />
19  </section>
20 </caps>
Parameters
[in]handleHandle to a RoadRunner instance
Returns
Returns null if it fails, otherwise it returns the simulator's capabilities in the form of an XML string
bool getNumPoints ( RRHandle  handle,
int *  numPoints 
)

Get the value of the current number of points.

Example:

1 status = getNumPoints (rrHandle, &numberOfPoints);
Parameters
[in]handleHandle to a RoadRunner instance
numPointsThe current value for the number of points
Returns
Returns true if successful
RRCDataPtr getSimulationResult ( RRHandle  handle)

Retrieve the result of the last simulation.

Parameters
[in]handleHandle to a RoadRunner instance
Returns
Returns an array (RRCDataPtr) of columns containing the results of the simulation including string labels for the individual columns. The client is responsible for freeing the resulting RRCDataPtr structure.
RRStringArrayPtr getTimeCourseSelectionList ( RRHandle  handle)

Get the current selection list for simulate(void) or simulateEx(void)

Parameters
[in]handleHandle to a RoadRunner instance
Returns
A list of symbol Ids indicating the current selection list
bool getTimeEnd ( RRHandle  handle,
double *  timeEnd 
)

Get the value of the current time end.

Example:

1 status = getTimeEnd (rrHandle, &timeEnd);
Parameters
[in]handleHandle to a RoadRunner instance
timeEndThe current value for the time end
Returns
Returns true if successful
bool getTimeStart ( RRHandle  handle,
double *  timeStart 
)

Get the value of the current time start.

Example:

1 status = getTimeStart (rrHandle, &timeStart);
Parameters
[in]handleHandle to a RoadRunner instance
[out]timeStartThe current value for the time start
Returns
Returns true if successful
bool oneStep ( RRHandle  handle,
const double  currentTime,
const double  stepSize,
double *  value 
)

Carry out a one step integration of the model.

Example:

1 status = OneStep (rrHandle, currentTime, timeStep, newTimeStep);
Parameters
[in]handleHandle to a RoadRunner instance
[in]currentTimeThe current time in the simulation
[in]stepSizeThe step size to use in the integration
[in]valueThe new time (currentTime + stepSize)
Returns
Returns true if successful
bool setConfigurationXML ( RRHandle  handle,
const char *  caps 
)

Set the simulator's capabilities.

Parameters
[in]handleHandle to a RoadRunner instance
[out]capsAn XML string that specifies the simulators capabilities
Returns
Returns true if successful
bool setNumPoints ( RRHandle  handle,
int  numberOfPoints 
)

Set the number of points to generate in a time course simulation.

Parameters
[in]handleHandle to a RoadRunner instance
[in]numberOfPointsNumber of points to generate in the time course simulation
Returns
Returns true if successful
bool setTimeCourseSelectionList ( RRHandle  handle,
const char *  list 
)

Set the selection list for output from simulate(void) or simulateEx(void)

Use getAvailableTimeCourseSymbols(void) to retrieve the list of all possible symbols.

Example:

1 setTimeCourseSelectionList ("Time, S1, J1, J2");

or

setTimeCourseSelectionList ("Time S1 J1 J2")

Parameters
[in]handleHandle to a RoadRunner instance
[in]listA string of Ids separated by spaces or comma characters
Returns
Returns true if successful
bool setTimeEnd ( RRHandle  handle,
double  timeEnd 
)

Set the time end for a time course simulation.

Parameters
[in]handleHandle to a RoadRunner instance
[in]timeEnd
Returns
Returns true if successful
bool setTimeStart ( RRHandle  handle,
double  timeStart 
)

Set the time start for a time course simulation.

Parameters
[in]handleHandle to a RoadRunner instance
[in]timeStart
Returns
Returns True if successful
RRCDataPtr simulate ( RRHandle  handle)

Carry out a time-course simulation. setTimeStart, setTimeEnd, setNumPoints, etc are used to set the simulation characteristics.

Parameters
[in]handleHandle to a RoadRunner instance
Returns
Returns an array (RRCDataPtr) of columns containing the results of the simulation including string labels for the individual columns. The client is responsible for freeing the resulting RRCDataPtr structure.
RRCDataPtr simulateEx ( RRHandle  handle,
const double  timeStart,
const double  timeEnd,
const int  numberOfPoints 
)

Carry out a time-course simulation based on the given arguments, time start, time end and number of points.

Example:

1 RRCDataPtr m;
2 
3 double timeStart = 0.0;
4 double timeEnd = 25;
5 int numberOfPoints = 200;
6 
7 m = simulateEx (rrHandle, timeStart, timeEnd, numberOfPoints);
Parameters
[in]handleHandle to a RoadRunner instance
[in]timeStartTime start
[in]timeEndTime end
[in]numberOfPointsNumber of points to generate
Returns
Returns an array (RRCDataPtr) of columns containing the results of the simulation including string labels for the individual columns. The client is responsible for freeing the resulting RRCDataPtr structure.