The Decaying-Dimerization Reaction Set consists of three species and four reaction channels.
S1 --c1--> 0
S1 + S1 --c2--> S2
S2 --c3--> S1 + S1
S2 --c4--> S3
Load package
Define parameters
parms <- c(c1=1.0, c2=0.002, c3=0.5, c4=0.04)
tf <- 10 # Final time
simName <- "Decaying-Dimerizing Reaction Set" # Name
Define initial state vector
Define state-change matrix
Define propensity functions
Run simulations with the Direct method
set.seed(1)
out <- ssa(
x0 = x0,
a = a,
nu = nu,
parms = parms,
tf = tf,
method = ssa.d(),
simName = simName,
verbose = FALSE,
consoleInterval = 1
)
ssa.plot(out, show.title = TRUE, show.legend = FALSE)
Run simulations with the Explict tau-leap method
set.seed(1)
out <- ssa(
x0 = x0,
a = a,
nu = nu,
parms = parms,
tf = tf,
method = ssa.etl(tau = 0.003),
simName = simName,
verbose = FALSE,
consoleInterval = 1
)
ssa.plot(out, show.title = TRUE, show.legend = FALSE)
Run simulations with the Binomial tau-leap method
set.seed(1)
out <- ssa(
x0 = x0,
a = a,
nu = nu,
parms = parms,
tf = tf,
method = ssa.btl(),
simName = simName,
verbose = FALSE,
consoleInterval = 1
)
ssa.plot(out, show.title = TRUE, show.legend = FALSE)
Run simulations with the Optimized tau-leap method