crn

Crates.iocrn
lib.rscrn
version0.1.2
sourcesrc
created_at2023-08-08 18:30:50.238981
updated_at2023-08-13 03:39:16.421268
descriptionStochastic and deterministic simulation of chemical reaction networks.
homepagehttps://github.com/marshallmoats/crn
repository
max_upload_size
id939419
size335,399
Marshall Moats (marshallmoats)

documentation

README

crn

Crates.io Documentation

crn can simulate both stochastic and deterministic CRNs with StoCrn and DetCrn, respectively.

To create your own CRN, first declare the initial counts of each molecule, and then add the reactions, each optionally followed by a rate parameter (10 in the first reaction):

let crn_string = "
a = 10;
b = 5;
c = 0;
a + b -> 2c : 10;
c -> 3b;
";

Pass the whole string to the parser:

let mut crn = StoCrn::parse(crn_string).unwrap()

Now let's simulate it for 3 seconds of virtual time:

let data = crn.simulate_history(3.0);

Some premade CRNs can be found in the presets module.

Run this for a graphical demonstration!

cargo run --release --example gui

Note: deterministic simulations tend to be unstable with large numbers -- I'm still working on this. Try scaling down all initial amounts (can be noninteger, unlike stochastic simulations) if you're having issues.

gui demo

Commit count: 0

cargo fmt