MathSBML

MathSBML Home Page MathSBML Site Map

SBMLNDSolve


SBMLNDSolve[model, tmax, options] evaluates NDSolve on an SBML model, where model is the ouptput of SBMLRead, tmax is the duration of the NDSolve run, and options are any valid options for NDSolve.

Additional Notes and Limitations:

  1. Units are ignored by SBMLNDSolve.

  2. Events delays are currently not implemented in SBMLNDSolve. It is anticipated that this functionality will be added in a later version of SBMLNDSolve.

  3. If the model does not include events, SBMLNDSolve[model, tmax] returns the same thing as
    NDSolve[Join[SBMLODES /. model, SBMLIC /. model], 
            SBMLSpecies /. model, {t, 0, tmax}];,
    namely, a list of rules for each of the model variables as InterpolatingFunctions.

  4. If the model contains events, the simulator will iteratively call SBMLNDSolve, stopping at each event occurance to take the requested action (note delays are not yet implemented), and then restarting the solver. A collection of InterpolationSets will be returned.

  5. Minimal checking is done for badly formed events, If more than MaxEvents (default 100) occur over an entire simulation, or if more than MaxCloseEvents (default 10) occur within a time span of BadEventTimePrecision (default 10-7), the simulation is aborted.

  6. The inclusion of algebraic constraints (rules) along with differential equations to produce a system of Differential-Algebraic Equations requires Mathematica Version >= 5.0; version checking is performed dynamically, and a message will be printed if your model has a DAE but you are working with an earlier version of Mathematica.

SBMLNDSolve New in 1.0. SBML Level 2 compatibility new in v. 2.0. Event processing new in v. 2.3.0.


OptionDefaultDescription
BadEventTimePrecision10-7Precision for determining if events appear to be close enough together to imply the system may be in an infinite loop
MaxCloseEvents10Maximum number of events to allow to occur close together before assuming the model is trapped in an infinite loop. Succesive events must occur within a time span of BadEventTimePrecision to be considered simultaneous.
MaxEvents100Maximum number of events to allow during a single SBMLNDSolve run
traceFalseControls whether or not a message is printed to the screen when an event occurs

Example

This example does not include events. To see an example with events, go to the InterpolationSets page.


input:   s=SBMLRead["enz.xml"];
         n=SBMLNDSolve[s, 10];
output:  {{enzyme`A[t] -> InterpolatingFunction[{{0., 10.}}, <>][t], 
         enzyme`B[t] -> InterpolatingFunction[{{0., 10.}}, <>][t], 
         enzyme`X[t] -> InterpolatingFunction[{{0., 10.}}, <>][t], 
         enzyme`C[t] -> InterpolatingFunction[{{0., 10.}}, <>][t]}}


input:   SBMLPlot[n];
output:  
         
         - Graphics -

The SMBL file enz.html used in this example follows (or click here to download a zipped version).


<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2" level="2" version="1">
  <model id="enzyme">
  <listOfCompartments>
    <compartment id="cell"/>
  </listOfCompartments>
  <listOfSpecies>
    <species id="A" compartment="cell" initialConcentration="1" boundaryCondition="false" />
    <species id="B" compartment="cell" initialConcentration="0.999" boundaryCondition="false" />
    <species id="X" compartment="cell" initialConcentration="0.001" boundaryCondition="false" />
    <species id="C" compartment="cell" initialConcentration="0" boundaryCondition="false" />
  </listOfSpecies>
  <listOfReactions>
    <reaction id="R1" reversible="true" fast="false">
      <listOfReactants>
        <speciesReference species="A"/>
        <speciesReference species="B"/>
      </listOfReactants>
      <listOfProducts>
        <speciesReference species="X"/>
      </listOfProducts>
      <listOfModifiers/>
        <kineticLaw>
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
         <plus/>
              <apply>
              <times/>
                <ci>a</ci>
                <ci>A</ci>
                <ci>B</ci>
              </apply>
              <apply>
              <times/>
                <cn type="integer">-1</cn>
                <apply>
                <times/>
                  <ci>d</ci>
                  <ci>X</ci>
                </apply>
              </apply>
            </apply>
          </math>
        <listOfParameters>
          <parameter id="a" value="1"/>
          <parameter id="d" value="1"/>
        </listOfParameters>
      </kineticLaw>
    </reaction>
    <reaction id="R2" reversible="false" fast="false">
      <listOfReactants>
        <speciesReference species="X"/>
      </listOfReactants>
      <listOfProducts>
        <speciesReference species="B"/>
        <speciesReference species="C"/>
      </listOfProducts>
      <kineticLaw>
        <math xmlns="http://www.w3.org/1998/Math/MathML">
          <apply>
          <times/>
            <ci>k</ci>
            <ci>X</ci>
         </apply>
       </math>
       <listOfParameters>
         <parameter id="k" value="1"/>
       </listOfParameters>
     </kineticLaw>
   </reaction> 
 </listOfReactions>
</model>
</sbml>

[rev 03-15-04]