KMC algorithm¶
Form and maintain a list of all possible rates rj in system
rjfor allj=1,2,…,MM – number of possible events
Calculate the cummulative function
Rm=m∑j=1rj,for allm=1,2,…,MGenerate random number ρ1∈[0,1)
Select event i
Ri−1≤ρ1RM<RiCarry out event i
Generate random number ρ2∈(0,1)
Compute time increment Δt
Δt=−ln(ρ2)RMUpdate time: t=t+Δt
Update list of events and goto next step