Copyright (C) 2013 Martin Robinson (martin.robinson@maths.ox.ac.uk)
Point your browser to http://people.maths.ox.ac.uk/robinsonm/index.html for more information about the author and other work.
Tyche is a multiscale stochastic reaction-diffusion modelling software library. It consists of:
(a) an off-lattice (particle-based) model based on the Smoluchowski model, including diffusion, zeroth-order, unimolecular and bimolecular reactions.
(b) an on-lattice model based on the Next Subvolume Method (based in turn on the Gillespie algorithm). This models stochastic diffusion, and reactions of arbitrary order
(c) a coupling between the off-lattice and on-lattice models, suitable for domain decomposition problems. This implements the Adaptive Two-Regime method, detailed in the following paper:
Martin Robinson, Mark Flegg, Radek Erban, "Adaptive two-regime method: application to front propagation", submitted to Journal of Chemical Physics (http://arxiv.org/abs/1312.6338)
Interfaces
Tyche has both C++ and Python interfaces.
Example of Python interface
L = 0.5
D = 1
timesteps = 100000
max_t = 4.0/(2.0*num_particles**0.5);
mol_dt = max_t/timesteps
k2 = 1.0
k1 = 1.0
binding = 0.00303416
unbinding = 0.15*0.00303416
A = tyche.new_species(D)
B = tyche.new_species(D)
C = tyche.new_species(D)
bd = tyche.new_diffusion()
bd.add_species(A)
bd.add_species(B)
bd.add_species(C)
xlow = tyche.new_xplane(0,1)
xhigh = tyche.new_xplane(L,-1)
ylow = tyche.new_yplane(0,1)
yhigh = tyche.new_yplane(L,-1)
zlow = tyche.new_zplane(0,1)
zhigh = tyche.new_zplane(L,-1)
xminboundary = tyche.new_jump_boundary(xlow,[L,0,0])
xmaxboundary = tyche.new_jump_boundary(xhigh,[-L,0,0])
yminboundary = tyche.new_jump_boundary(ylow,[0,L,0])
ymaxboundary = tyche.new_jump_boundary(yhigh,[0,-L,0])
zminboundary = tyche.new_jump_boundary(zlow,[0,0,L])
zmaxboundary = tyche.new_jump_boundary(zhigh,[0,0,-L])
boundaries = tyche.group([xminboundary, xmaxboundary, yminboundary, ymaxboundary, zminboundary, zmaxboundary])
boundaries.add_species(A)
boundaries.add_species(B)
boundaries.add_species(C)
dr2 = tyche.new_bi_reaction(k1, A, B, [C], binding,unbinding, mol_dt,
[0,0,0], [L,L,L], [True, True, True],True)
dr3 = tyche.new_bi_reaction(k1, A, B, [C], mol_dt,
[0,0,0], [L,L,L], [True, True, True],True)
dr = tyche.new_uni_reaction(k2,C,[A,B],unbinding)
algorithm = tyche.group([bd,boundaries,dr2,dr,boundaries])
A.fill_uniform([0,0,0],[L,L,L],int(num_particles*L**3))
B.fill_uniform([0,0,0],[L,L,L],int(num_particles*L**3))
C.fill_uniform([0,0,0],[L,L,L],int(num_particles*L**3))
output_dt = max_t/100.0
time = 0;
print algorithm
for i in range(100):
print A,B,C
print 'time = ',time,' ',i,' percent done'
time = algorithm.integrate_for_time(output_dt,mol_dt)