Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gillespie algorithm #29

Open
bramvandijk88 opened this issue Feb 8, 2022 · 0 comments
Open

Gillespie algorithm #29

bramvandijk88 opened this issue Feb 8, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@bramvandijk88
Copy link
Owner

Add an option to use Gillespie algorithm, e.g. to update grid points. Requires:

  1. List of states
  2. List of reaction probabilities (function of states in 1)
  3. Reaction matrix (rows = reactions, cols = states)

Then, tau can be calculated based on the sum of probabilities:

let U = Math.random();
let tau = -Math.log(U)/sumprobs;

And a reaction can be sampled proportional to their relative probabilities too.

(example Gillespie I have already worked out outside of Cacatoo: https://jsfiddle.net/bramvandijk88/892nagLm/)

@bramvandijk88 bramvandijk88 added the enhancement New feature or request label Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant