Skip to main content
# Table 3

â€¢ Initialize all species and rate constants |
---|

â€¢ Compute all reaction rates |

â€¢ Loop: |

â€ƒâ€ƒâ€ƒ* Set Î¼ = sum of rates for the discrete reactions |

â€ƒâ€ƒâ€ƒ* if ( |

* R = a uniform random number in (0,1) |

* Set timeStep = -log( |

* Find which reaction occurred, update the species involved |

â€ƒâ€ƒâ€ƒ* else, |

* R = a uniform random number in [0,1] |

* timeStep = continuousTimeStep |

* if ( |

â€¢ Determine which discrete transition occurred: |

â€¢ Find the first value of |

â€¢ If , the forward reaction occurred, otherwise the backward reaction occurred |

* else, |

â€¢ No discrete reaction occurs, update is entirely due to continuous reactions (below) |

* end if ( |

â€ƒâ€ƒâ€ƒ* end if ( |

â€ƒâ€ƒâ€ƒ* Update the continuous species using the Langevin equation, with step size timeStep (where timeStep is either equal to continuousTimeStep or to the step size found by the Gillespie algorithm), using a semi-implicit numerical method |

â€ƒâ€ƒâ€ƒ* Update any rates that have been changed by the continuous reactions and the single discrete reaction |

â€ƒâ€ƒâ€ƒ* Break when user-defined total simulation time is reached |

â€¢ end loop |