  Simulating stochastic systems with feedback control is challenging due to the
complex interplay between the system's dynamics and the feedback-dependent
control protocols. We present a single-step-trajectory probability analysis to
time-dependent stochastic systems. Based on this analysis, we revisit several
time-dependent kinetic Monte Carlo (KMC) algorithms designed for systems under
open-loop-control protocols. Our analysis provides an unified alternative proof
to these algorithms, summarized into a pedagogical tutorial. Moreover, with the
trajectory probability analysis, we present a novel feedback-controlled KMC
algorithm that accurately captures the dynamics systems controlled by external
signal based on measurements of the system's state. Our method correctly
captures the system dynamics and avoids the artificial Zeno effect that arises
from incorrectly applying the direct Gillespie algorithm to feedback-controlled
systems. This work provides a unified perspective on existing open-loop-control
KMC algorithms and also offers a powerful and accurate tool for simulating
stochastic systems with feedback control.
