2
I. INTRODUCTION
Stochastic modelling has played an increasingly central
role in science since the advent of high speed computing.
There are, however, many categories of events that are
vital to the organization of long-term dynamics for which
the rate diminishes exponentially with system size (‘rare’
events) and computer simulations become unaffordable.
A typical approach in these scenarios is to employ impor-
tance sampling approaches in the stochastic simulation to
efficiently simulate the rare event of interest (see [1–3]).
In this work, for the particular case of stochastic chemical
reaction networks, we provide a deterministic alternative
for estimating the likelihood of rare events.
Stochastic nonlinear dynamical processes exhibiting
multistability, or multiple coexisting attractors, have
found several scientific applications ranging from mod-
elling climate change to population biology and the origin
of life [4–7], and are an active subject of interdisciplinary
research. A question of critical importance for any prac-
tical application of such a system is, how often does it
transition out of a stable attractor and what are the least-
improbable paths by which such a transition occurs? In
literature, the dynamics that arise due to the system’s
transitioning from one stable attractor to another and
the optimal path of transition is referred to as ‘switching
dynamics’ and ‘escape path’, respectively.
Many phenomena in biology, chemistry, physics or en-
gineering can be modelled as a chemical reaction network
(CRN). It is also well known that CRNs can exhibit a
host of dynamics, including limit cycles and multistabil-
ity [8]. Perhaps less well-known is the role of Hamilton-
Jacobi ray theory underlying stochastic CRN, and the
interpretation of escape paths as particular character-
istic curves that arise as a solution to the associated
Hamilton-Jacobi equation. In our work, we review the
necessary formalism and employ techniques from math-
ematical physics and numerical optimization to estimate
the escape paths for a multistable CRN. More precisely,
we first recognize that the escape paths are variational
(locally least-action) solutions to the action functional,
and subsequently use the functional to perform a gradi-
ent descent that converges on the desired path.
It must be noted that neither the recognition of the
escape path as a variational solution nor using the ac-
tion functional to perform gradient descent is novel to us
(for instance, see [9]), however, we differ from the earlier
work in a few ways. In the past, the use of Hamilton-
Jacobi theory to find the escape path for CRN has only
been made using the ‘shooting-method’, which relies on
integrating Hamilton’s equations of motion, rather than
a functional gradient descent approach that we present
here (see [10]). On the other hand, while the action func-
tional has been used for a gradient descent, to our best
knowledge, the form of the Hamiltonian assumed has
always been separable in momentum and position (see
[11, 12]). This form of the Hamiltonian, with other con-
straints on the functional form, makes it amenable to
finding an analytic form for the associated Lagrangian
which drastically simplifies the gradient descent. While
this assumption is typical for a Hamiltonian describing
mechanical energy in physics, it is far too restrictive for a
generic Hamiltonian in chemistry, as can be seen below:
HME(p, q) = K(p) + U(q),
HCRN(p, q) = X
yα,yβe(yβ−yα)·p−1kyα→yβqyα,(1)
where pand qare the momentum and position coordi-
nates, K(p)and U(q)are the kinetic and potential en-
ergy, and HME and HCRN (Eq. 16) are the Hamiltonians
for mechanical energy and chemical reaction networks
respectively. In our algorithm, however, we start from
the Hamiltonian, numerically solve for the Lagrangian
at each iteration and use it to calculate the descent di-
rection. While our algorithm is designed for stochastic
CRNs, it is amenable to generalization for other classes
of stochastic Hamiltonian dynamical systems.
The layout of the paper is as follows. In Section II,
we derive the Hamilton-Jacobi theory for stochastic pro-
cesses starting from a master equation and apply it to
stochastic CRN. We show that the Hamilton-Jacobi the-
ory of the non-equilibrium potential (NEP) arises natu-
rally as a result of a variational principle applied to the
action functional. In Section III, we propose an action
functional gradient descent (AFGD) algorithm that finds
the variational solution in the space of paths constrained
at end points for a given Hamiltonian value constraint.
We also explain how the algorithm can be used to find
least-improbable escape paths out of a stable attractor
and assign a value to the NEP along them. The details
of the implementation are provided in Appendix D, and
a MATLAB implementation is made available at [13].
In Section IV, we demonstrate the applications of the
AFGD algorithm on several CRNs. We first consider the
Selkov model, and compare the result of the algorithm
against the escape trajectory found by the ‘shooting-
method’ (Figure 9). We then define a class of high dimen-
sional birth-death models, namely ‘N-Schlögl model’, and
compare the results of the algorithm against a stochastic
simulation for the 2-Schlögl model (Figure 4). We also
use the algorithm on the six dimensional 6-Schlögl model,
and compare the result against the integration of Hamil-
ton’s equations of motion (Figure 21). Finally, in Section
V, we conclude with a discussion of our contribution and
potential avenues of future research.
II. FROM MASTER EQUATION TO
HAMILTON-JACOBI EQUATION FOR CRN
The application of Hamilton-Jacobi theory to chemical
reaction networks (CRNs) has a long history [10, 14]. In
this section, we review the necessary formulation needed
to understand the switching dynamics of stochastic chem-
ical reaction networks (Section II C) and to devise a vari-
ational algorithm for predicting the transitions (Section