| SimBiology® | ![]() |
| On this page… |
|---|
When to Use Stochastic Solvers Stochastic Simulation Algorithm (SSA) Explicit Tau-Leaping Algorithm Implicit Tau-Leaping Algorithm |
Models with a small number of molecules can realistically be simulated stochastically that is, allowing the results to contain an element of probability, unlike a deterministic solution. The stochastic simulation algorithms provide a practical method for simulating reactions which are stochastic in nature. Depending on the model, stochastic simulations may take more computation time than deterministic simulations.
If you use a stochastic solver to simulate a model, the software ignores any rate, assignment, or algebraic rules if present in the model.
Using the stochastic simulation algorithm for a system is equivalent to solving the Chemical Master Equation for the system. The Chemical Master Equation is otherwise impossible to solve for most practical problems. Thus, the stochastic simulation algorithm provides a practical method for simulating stochastic systems. The algorithm simulates one reaction at a time based on the propensity function for each reaction.
Advantage:
This algorithm is exact.
Disadvantages:
Since it evaluates one reaction at a time, it may be too slow for large problems.
If the number of molecules of any of the reactants is huge, it may take a long time to complete the simulation.
Since the stochastic simulation algorithm may be too slow for a lot of practical problems, this algorithm has been designed to speed up the simulation at the cost of some accuracy. The algorithm treats each reaction channel as being independent of the others. It automatically chooses a time interval such that the relative change in the propensity function for each reaction is less than the user-specified error tolerance. After selecting the time interval, the algorithm computes the number of times each reaction channel fires during the time interval and makes the appropriate changes to the concentration of various chemical species involved.
Advantages
This algorithm can be orders of magnitude faster than the SSA.
This algorithm can be used for large problems (provided the problem is not numerically stiff).
Disadvantages
Some accuracy is sacrificed for speed.
Not good for stiff models.
The error tolerance needs to be specified in such a manner that the resulting time steps are of the order of the fastest time scale.
Like the explicit tau-leaping algorithm, the implicit tau-leaping algorithm is also an approximate method of simulation designed to speed-up the simulation at the cost of some accuracy. It can handle numerically stiff problems better than the explicit tau-leaping algorithm. For deterministic systems, a problem is said to be numerically stiff if there are "fast" and "slow" time scales present in the system and the "fast modes" are stable. For such problems, the explicit tau-leaping method performs well only if it continues to take small time steps that are of the order of the fastest time scale. The implicit tau-leaping method can potentially take much larger steps and still be stable. The algorithm treats each reaction channel as being independent of others. It automatically chooses a time interval such that the relative change in the propensity function for each reaction is less than the user specified error tolerance. After selecting, the algorithm computes the number of times each reaction channel fires during the time interval and makes the appropriate changes to the concentration of various chemical species involved.
Advantages
This algorithm can be much faster than the SSA. It is also usually faster than the explicit-tau leaping algorithm.
It can be used for large problems and also for numerically stiff problems.
The total number of steps taken is usually less than the explicit-tau leaping algorithm.
Disadvantages
Some accuracy is sacrificed for speed.
There is a higher computational burden for each step as compared to the explicit-tau leaping algorithm. This leads to a larger CPU time per step.
This method often damps out the perturbations off the slow manifold leading to a reduced state variance about the mean.
Ensemble runs are ensemble simulations that you can use in conjunction with the stochastic solvers to gather data from multiple stochastic runs of the model. Ensemble runs let you investigate fluctuations in the behavior of a stochastic model over repeated simulations.
In contrast, scans are multiple simulations of the model performed with varying values of parameters or initial amounts of species. You can specify the range for the parameter or the species, and each simulation is performed with a different value of the parameter or species amount within the specified range. Scans let you see changes in the model's behavior with respect to changes in species amounts, or parameter values.
You can perform ensemble simulations using the stochastic solvers to gather data from multiple stochastic runs of the model.
The following functions let you perform ensemble runs at the command line:
sbioensemblerun – Performs a stochastic ensemble run of the MATLAB® model object.
sbioensembleplot – Shows a 2D distribution plot or a 3D shaded plot of the time varying distribution of one or more specified species.
sbioensemblestats – Gets mean and variance as a function of time for all the species in the model used to generate ensemble data by running sbioensemblerun.
In the MATLAB desktop, from the Analysis menu select Add Analysis Task to model_name > Run ensemble simulation.

The desktop adds Ensemble Run in the Project Explorer and opens the Ensemble Run pane.
See the context-sensitive
SimBiology Desktop Help for more information on how to set up ensemble runs. To access SimBiology Desktop Help, select Help > SimBiology Desktop Help.
[1] Gibson M.A., Bruck J. (2000), "Exact Stochastic Simulation of Chemical Systems with Many Species and Many Channels," Journal of Physical Chemistry, 105:1876-1899.
[2] Gillespie D. (1977), "Exact Stochastic Simulation of Coupled Chemical Reactions," The Journal of Physical Chemistry, 81(25): 2340-2361.
[3] Gillespie D. (2000), "The Chemical Langevin Equation," Journal of Chemical Physics, 113(1): 297-306.
[4] Gillespie D. (2001), "Approximate Accelerated Stochastic Simulation of Chemically Reacting Systems," Journal of Chemical Physics,115(4):1716-1733.
[5] Gillespie D., Petzold L. (2004), "Improved Leap-Size Selection for Accelerated Stochastic Simulation," Journal of Chemical Physics, 119:8229-8234
[6] Rathinam M., Petzold L., Cao Y., Gillespie D. (2003), "Stiffness in Stochastic Chemically Reacting Systems: The Implicit Tau-Leaping Method," Journal of Chemical Physics, 119(24):12784-12794.
![]() | Stiff Deterministic Solvers | Sundials Solvers | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |