Created 2/20/23
This stochastic simulation is mainly for visualization purposes. It illustrates the nature of a second order system without resorting to mathematics.
Particles representing drug molecules move randomly between two areas (depicting two compartments, such as plasma and tissue) through two individually adjustable directional transfer paths (K12 and K21). One area has a user-adjustable exit analogous to drug clearance in the circulation (Kel).
Because of the stochastic nature of the simulation, plots from two consecutive runs with identical user-adjustable settings will be slightly different, as opposed to repeatable outputs with a similar deterministic simulation. The plots driven by the stochastic simulation display exponential behavior but are rough, especially when the number of particles becomes small.
We recommend the Google Chrome web browser to use the simulator at this link.