#file stochastic_decay.ode #stochastic implementation (Gillespie SSA) of a collection of spontaneously #decaying molecules. #Figure 7.38 #the network is simply X -> . with propensity a=k N_x, where N_x is the #number of molecules of X #set propensity parameter par k=1 # #set initial condition for molecule count X, and for elapsed time tr. # init X=100, tr=0 # #set reaction propensity # a=k*X # # set the update rule for tr # tr'=tr+log(1/ran(1))/a # #set the update rules for molecule abundance X'=X-1 # # set the total number of steps to be taken @ total=100 # # set the model as discete-time (update rule-based) @ meth=discrete # # set the plotting default to be X against tr @ xp=tr,yp=X, xlo=0,xhi=10,ylo=0,yhi=100 # done #