Skip to main content
. 2017 Dec 15;147(23):234101. doi: 10.1063/1.5002773

Algorithm 4.

Hybrid method.

1. Initialize the system. Assign molecules to the mesoscopic and microscopic subsets according to F(S, t). Setthe time t = 0. Let T be the length of the simulation.
2. Mesoscopic molecules are simulated with the NPM for Δt seconds. Microscopic molecules are frozen.
3. Simulate the microscopic molecules for Δt seconds with GFRD as implemented in Sec. IV B. The mesoscopicmolecules do not diffuse. Microscopic molecules can react with mesoscopic molecules that occupy thevoxel that the microscopic molecule currently resides in. The microscopic and mesoscopic molecules thusreact mesoscopically by sampling a next reaction time from an exponential distribution with the correctmesoscopic reaction rate.
4. Determine the simulation scale of each molecule by evaluating F(S, t).
5. For each mesoscopic molecule that transitioned to the microscopic scale:
(a) Set its scale to microscopic.
(b) Set the continuous position by sampling uniformly on the voxel that it currently occupies. For detailson how to sample the position, see Ref. 31.
6. For each microscopic molecule that transitioned to the mesoscopic scale:
(a) Set its scale to mesoscopic.
(b)Determine which voxel contains its current continuous position. This will be the molecule’s newmesoscopic voxel.
7. Add Δt to t.
8. Repeat 2-7 until t = T.