# Run-and-tumble motion in a linear ratchet potential: Analytic solution,
power extraction, and first-passage properties

Connor Roberts<EMAIL_ADDRESS>Department of Mathematics,
Imperial College London, 180 Queen’s Gate, London, SW7 2AZ, United Kingdom
Centre for Complexity Science, Imperial College London, SW7 2AZ, United
Kingdom  Zigan Zhen<EMAIL_ADDRESS>Department of Mathematics,
Imperial College London, 180 Queen’s Gate, London, SW7 2AZ, United Kingdom
Centre for Complexity Science, Imperial College London, SW7 2AZ, United
Kingdom

###### Abstract

We explore the properties of run-and-tumble particles moving in a piecewise-
linear “ratchet” potential by deriving analytic results for the system’s
steady-state probability density, current, entropy production rate,
extractable power, and thermodynamic efficiency. The ratchet’s broken spatial
symmetry rectifies the particles’ self-propelled motion, resulting in a
positive current that peaks at finite values of the diffusion strength,
ratchet height, and particle self-propulsion speed. Similar nonmonotonic
behaviour is also observed for the extractable power and efficiency. We find
the optimal apex position for generating maximum current varies with
diffusion, and that entropy production can have nonmonotonic dependence on
diffusion. In particular, for vanishing diffusion, entropy production remains
finite when particle self-propulsion is weaker than the ratchet force.
Furthermore, power extraction with near-perfect efficiency is achievable in
certain parameter regimes due to the simplifications afforded by modelling
“dry” active particles. In the final part, we derive mean first-passage times
and splitting probabilities for different boundary and initial conditions.
This work connects the study of work extraction from active matter with
exactly solvable active particle models and will therefore facilitate the
design of active engines through these analytic results.

††preprint: APS/123-QED

##  I Introduction

Active matter is composed of agents that consume energy from their environment
to exert mechanical forces [1]. These systems break detailed balance and are
thus impervious to the tools of equilibrium statistical mechanics [2]. Because
of the rich phenomenology they capture, even at the single-particle scale [3],
active matter models have become the most favoured route for exploring the
broader field of nonequilibrium systems [4].

A paradigmatic active matter model is the run-and-tumble (RnT) particle, which
idealises the piecewise-ballistic locomotion of E. coli bacteria [5]. RnT
particles are arguably the simplest of the canonical active particle models,
which also includes active Ornstein-Uhlenbeck particles [6, 7, 8] and active
Brownian particles [9, 10, 11]. This has led to extensive study of their
nonequilibrium steady-state distributions in confining potentials [12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22]. Notably, most results for these models are
obtained through simulations or under approximations [8, 21, 22, 6, 7, 23, 24,
25, 26, 27], including recent work concerning RnT particles subject to a
differentiable ratchet potential [28]. Only a handful of exact results for the
steady-state distributions of these models are documented in the literature,
and most of these are attributed to RnT particles in one dimension [15, 29,
16, 17, 18, 19, 30, 31].

When immersed in asymmetric environments, active particles display
unidirectional motion [32, 33, 34, 35, 36, 37, 38, 39, 40, 13, 41, 42]. The
emergence of such rectified motion has generated significant interest in
active engines, whose constituent active agents perform work on an external
load to store potential energy [43, 44, 45, 46]. The net current observed in
these systems is the hallmark of broken time-reversal symmetry, indicating a
system is operating far from equilibrium. Exactly “how far” is quantified by
the entropy production rate [6, 16, 47, 7], which was recently calculated for
RnT particles confined to an infinite-square well [17], but has yet to be
calculated for asymmetric potentials.

The nonequilibrium behaviour of active matter results in first-passage
properties that are significantly different to that of equilibrium systems.
For instance, the mean escape time of a Brownian particle from a potential
well depends only on the ratio of the relative height of the potential barrier
to the particle’s thermal energy [48]. In contrast, the mean escape time of
active particles can depend on the detailed shape of the potential [49].
Studying the first-passage properties of active matter is particularly
relevant to biology, which is often concerned with the time it takes motile
agents to reach certain locations, such as in chemotaxis [50]. For the
specific case of RnT particles, first-passage properties have been studied
both with [29] and without [50, 51, 52, 15] the presence of additive diffusive
noise. The noiseless case allows analytic results for run-and-tumble particles
to be obtained in the case of partially absorbing boundaries [50, 15],
encounter-based absorption [53, 54], and in the presence of symmetric
confining potentials [18]. However, even for the more general case of
nonnegligible diffusive noise, it is possible to obtain analytic expressions
for the first-passage time density on a semi-infinite line, as well as the
splitting probabilities and mean first-passage times on a finite interval
[29]. It is therefore of interest to see how the combination of asymmetric
potentials and diffusion, both of which will be considered here, generalise
these known results.

In the present work, we obtain exact analytic results for RnT particles in the
presence of an external piecewise-linear “ratchet” potential on a one-
dimensional ring. In addition, we consider the application of an external
counterforce, assuming the role of an external load, to the resulting
rectified motion. The counterforce allows for the study of work extraction and
is therefore relevant to the operation of active engines. This model of RnT
motion is implemented through the addition of active telegraphic noise to the
motion of an overdamped Brownian particle in a ratchet. This can describe
several physically equivalent nonequilibrium systems, discussed further in
Sec. II.

In what follows, the derivation and discussion of new results begin in Sec.
III with a calculation of the state-dependent probability densities at
stationarity, which are obtained by solving the governing coupled Fokker-
Planck equations of the system and then confirmed through Monte Carlo
simulations of the Langevin equation. From these densities, in Sec. IV, we
obtain the corresponding currents and observe nonmonotonic dependencies on the
system parameters, similarly to other nonequilibrium systems [55, 56, 57, 58].
Then, following the formalism outlined in Ref. [59], we derive the steady-
state entropy production rate in Sec. V, which paves the way for the study of
the power output and thermodynamic efficiency in Sec. VI. Finally, in Sec.
VII, we study the transport properties of this system, namely, the mean first-
passage times for the separate cases of absorbing and reflecting boundary
conditions and the splitting probabilities for the particle to exit from
either end of the ratchet.

Given the large number of quantities of interest, the aim of this work is not
to provide a full characterisation of the high-dimensional phase space in each
case, but to give an overview of the most interesting and relevant features.

##  II Model

Figure 1: Schematic representation of RnT particles subject to a periodic
ratchet potential $U(x)=U(x+\ell)$, Eq. (1), with maximum amplitude $U(a)=h$.
Due to the contribution imparted by the external force $f$, the overall drift
of an RnT particle alternates, with Poissonian rate $\gamma$, between $v-f$,
corresponding to the right-moving state $\sigma(t)=1$ (red sphere,
background), and $-(v+f)$, corresponding to the left-moving state
$\sigma(t)=-1$ (blue sphere, foreground).

We consider an RnT particle, whose self-propulsion speed $w(t)\in\\{v,-v\\}$,
where $v>0$, alternates or “tumbles” between two values with Poissonian rate
$\gamma$, while moving at position $x\in\left[0,\ell\right)$ in a piecewise-
linear ratchet potential of length $\ell$. The ratchet has maximum amplitude
$h$ at the apex $x=a$, and periodic boundary conditions at $x=0$ and $x=\ell$,
see Fig. 1. The particle is therefore subject to the potential,

$U(x)=\begin{cases}U^{[1]}(x)\equiv\frac{h}{a}x,&\quad 0\leq x<a\\\
U^{[2]}(x)\equiv\frac{h}{\ell-a}(\ell-x),&\quad a\leq x<\ell\end{cases}.$ (1)

Henceforth, any reference to the position $x=0$ can be assumed to also refer
to $x=\ell$, due to the periodicity, and we will thus refer only to the
former. Without loss of generality, in Secs. III-VI, we take $h\geq 0$ since
replacing $h\rightarrow-h$ simply generates the mirror-image of the ratchet,
i.e. $a\rightarrow\ell-a$, up to an (irrelevant) constant offset $-h$ after
translating space by $x\rightarrow x-a$. For $a\neq\ell/2$, the ratchet is
asymmetric and can therefore rectify the motion of the RnT particle. The
rectified motion results in a current which can be exploited to perform useful
work by applying a counterforce of magnitude $f$, such as an external load,
see Fig. 2. In the following, we take this counterforce to act to the left,
i.e. in the negative $x-$direction, corresponding to a potential $fx$, so that
work is done by the particle when both $f$ and the current are positive, and
there is thus still a net drift of particles to the right. We will consider
the overdamped regime where forces, such as from the ratchet or the external
counterforce, are equivalent to velocities (or external drifts) up to a factor
of the particle mobility, which we set to unity.

The present system has several physically equivalent interpretations depending
primarily on whether the breaking of detailed balance is attributed to
external forcing or particle motility. For instance, $f$ has been introduced
as a counterforce, but it could also be an asymmetry parameter of a biased RnT
motion with self-propulsion $\bar{w}(t)\in\\{v-f,-(v+f)\\}$, Fig. 1.
Alternatively, $f$ could be considered a property of the ratchet by defining
the potential $V(x)=U(x)+fx$, so that $-f$ is the tilt parameter of the tilted
ratchet potential $V(x)$ [60, 61, 62]. Similarly, the tumble rate $\gamma$
could be viewed as the switching rate of a time-fluctuating ratchet
$V(x,t)=\\{U(x)-(v-f)x,~{}U(x)+(v+f)x\\}$ acting on a Brownian particle. This
is the case for Brownian motors, whose underlying principle is the
rectification of thermal fluctuations through time-varying external forces
[63, 33, 44, 64]. Other interpretations also exist or can be devised from
suitable combinations of the above.

Figure 2: By applying an external counterforce of magnitude $f$, work $W$ can
be extracted from the rectified motion of an RnT particle. Here, the
counterforce is represented schematically as an external load being raised on
a pulley. However, more practical implementations could include rotatable
ratchet gears [38] or passive movable obstacles [45, 28].

We will occasionally draw on different interpretations when it offers
additional insight, but the focus of the present work is on the single
perspective of an RnT particle with symmetric self-propulsion
$w(t)\in\\{v,-v\\}$ moving in the potential $U(x)$, Eq. (1), whilst subject to
an additional external counterforce $f$. Regardless, the results presented in
this paper apply to all of the aforementioned interpretations as, in any case,
the motion of the particle is governed by the same Langevin equation in the
overdamped limit, i.e.

$\dot{x}(t)=-U^{\prime}(x)+v\sigma(t)-f+\sqrt{2D}\xi(t),$ (2)

where $t$ is time, $U^{\prime}(x)$ is the $x$-derivative of $U(x)$, the
telegraphic noise $\sigma(t)\in\\{1,-1\\}$ switches sign with rate $\gamma$,
the diffusion constant is $D$, and $\xi(t)$ is Gaussian white noise with
correlator $\langle\xi(t)\xi(t^{\prime})\rangle=\delta(t-t^{\prime})$. As is
the case for thermal fluctuations, the diffusion considered here is
translational and therefore superimposed on the active component of the
particle’s motion. Henceforth, we will refer to particles as being “right
movers” or in the “right-moving state” when $\sigma(t)=1$ and as “left movers”
or in the “left-moving state” when $\sigma(t)=-1$.

The corresponding Fokker-Planck equation to Eq. (2) reads

$\displaystyle\frac{\partial P^{[i]}_{R}(x,t)}{\partial t}$
$\displaystyle=D\frac{\partial^{2}P^{[i]}_{R}(x,t)}{\partial
x^{2}}-\left(v-f-U^{\prime[i]}\right)\frac{\partial P^{[i]}_{R}(x,t)}{\partial
x}-\gamma\left(P^{[i]}_{R}(x,t)-P^{[i]}_{L}(x,t)\right),$ (3a)
$\displaystyle\frac{\partial P^{[i]}_{L}(x,t)}{\partial t}$
$\displaystyle=D\frac{\partial^{2}P^{[i]}_{L}(x,t)}{\partial
x^{2}}-\left(-v-f-U^{\prime[i]}\right)\frac{\partial
P^{[i]}_{L}(x,t)}{\partial
x}-\gamma\left(P^{[i]}_{L}(x,t)-P^{[i]}_{R}(x,t)\right),$ (3b)

where $P_{R}^{[i]}(x,t)$ and $P_{L}^{[i]}(x,t)$ are the probability densities
at position $x$ and time $t$ of right movers and left movers respectively. The
superscript $[i]\in\\{[1],[2]\\}$ indicates the section of the ratchet on
which the probability densities $P_{R,L}^{[i]}(x,t)$ are valid. For the uphill
section (from the perspective of a right mover) $x\in\left[0,a\right)$, the
densities are given by $P_{R,L}^{[1]}(x,t)$, and for the downhill section
$x\in\left[a,\ell\right)$, the densities are given by $P_{R,L}^{[2]}(x,t)$.
Hence, each $U^{\prime[i]}$ of Eq. (1) is in fact constant, specifically
$U^{\prime[1]}=h/a$ and $U^{\prime[2]}=-h/(\ell-a)$, which has allowed the
constants $(\pm v-f-U^{\prime[i]})$ to be brought in front of
$\partial_{x}P_{R,L}^{[i]}(x,t)$ in Eq. (3).

Unless specified otherwise, the default parameter values used in the figures
throughout this paper are $\ell=1$, $a=0.9$, $h=4$, $D=1$, $v=1$, $\gamma=1$
and $f=0$. We have chosen these parameters as they correspond to the case
where the particle is confined to the potential minimum at $x=0$ when $D=0$,
since $v-f<h/a$ and $v+f<h/(\ell-a)$ represent the conditions for right movers
and left movers to be confined respectively. In this “confined” case, or
“locked” state [42, 65], an overall current can be generated only by diffusive
fluctuations that allow the particle to cross the top of the potential barrier
at $x=a$. We will treat this confined case extensively because of its
nontrivial behaviour that becomes apparent for $D>0$ (c.f. the trivial $D=0$
solution for the confined case in Appendix B and Ref. [39]), as well as its
greater relevance, such as to the activated escape of particles via noise-
induced transitions [49]. Finally, we have opted to keep the discussion of all
results in terms of physically meaningful dimensionful parameters,
$\ell,a,h,D,v,\gamma$ and $f$, rather than reducing the description of the
system to five dimensionless parameters whose role may be difficult to
ascertain.

##  III Probability densities

The probability densities at stationarity
$P_{R,L}^{[i]}(x)\equiv\lim\limits_{t\rightarrow\infty}P_{R,L}^{[i]}(x,t)$ are
derived from solving the coupled Fokker-Planck equations (3) with the left-
hand sides set to zero, i.e.
$\partial_{t}P_{R}^{[i]}(x)=\partial_{t}P_{L}^{[i]}(x)=0$. For the specific
case of $f=0$, the steady-state solution to Eq. (3) has been derived in the
context of molecular motors [33], and was used principally to investigate how
the steady-state current varies with the switching rate (equivalent to
$\gamma$ here) of the potential. However, this solution has never been studied
in the context of RnT motion. The current of an RnT particle moving in a
piecewise-linear potential has been studied for the less general case of $D=0$
[39]. However, to the best of our knowledge, a detailed study of the more
general $D>0$ solution for RnT particles does not exist in the literature.
Furthermore, we believe our subsequent derivations of the entropy production,
power output, thermodynamic efficiency and first-passage properties, as well
as the generalisation to $f\neq 0$, to all be novel results.

To obtain the steady-state probability densities, we make the ansatz
$P_{R,L}^{[i]}(x)=\mathcal{Z}_{R,L}^{[i]}\exp(\lambda^{[i]}x)$ [33].
Substituting this ansatz into Eq. (3) for $\partial_{t}P_{R,L}(x,t)=0$ results
in four linearly independent solutions for each of the particle species, right
movers and left movers, in each section of the ratchet, $i=1$ and $i=2$,
totalling 16 degrees of freedom. Each set of eigenvalues $\lambda^{[i]}$,
$i\in\\{1,2\\}$, is found by solving a quartic characteristic equation. One of
the eigenvalues in each set vanishes and so the probability densities have the
general solution

$P_{R,L}^{[i]}(x)=\mathcal{A}_{R,L}^{[i]}e^{\lambda_{\mathcal{A}}^{[i]}x}+\mathcal{B}_{R,L}^{[i]}e^{\lambda_{\mathcal{B}}^{[i]}x}+\mathcal{C}_{R,L}^{[i]}e^{\lambda_{\mathcal{C}}^{[i]}x}+\mathcal{D}_{R,L}^{[i]},$
(4)

with the 16 coefficients
$\mathcal{A}_{R}^{[1]},\mathcal{A}_{L}^{[1]},\mathcal{A}_{R}^{[2]},\dots,\mathcal{D}_{L}^{[2]}$
to be determined.

These coefficients are fixed by demanding each linearly independent term in
Eq. (4) individually satisfies Eq. (3) in the steady state, i.e. the resulting
prefactors after substitution of each $\exp(\lambda^{[i]}x)$ must be zero
[33]. This fixes half of the 16 degrees of freedom in Eq. (4). The remaining
half is fixed through continuity of the probability densities and currents for
each species across $x=0$ and $x=a$, as well as the normalisation condition
$\int_{0}^{\ell}\mathrm{d}x~{}P(x)=1$, where $P(x)=P_{R}(x)+P_{L}(x)$ is the
total probability density. Hence, in principle, the steady-state densities for
RnT particles in a piecewise-linear ratchet potential can be obtained in
closed form. However, solving 16 coupled equations unsurprisingly results in
unwieldy expressions for the coefficients
$\mathcal{A}_{R}^{[1]},\mathcal{A}_{L}^{[1]},\mathcal{A}_{R}^{[2]},\dots,\mathcal{D}_{L}^{[2]}$,
so the bulk of the calculations was performed using Mathematica. The resulting
solutions are too long to conveniently display as equations and so most of our
results are displayed as graphs alongside descriptions of their qualitative
behaviour in the main text. Nevertheless, we emphasise that all results
presented in this paper originate from exact expressions. In fact, any
observable that can be written exclusively in terms of the system parameters
and the coefficients
$\mathcal{A}_{R}^{[1]},\mathcal{A}_{L}^{[1]},\mathcal{A}_{R}^{[2]},\dots,\mathcal{D}_{L}^{[2]}$,
such as the steady-state current, Eq. (8), and the steady-state entropy
production rate, Eq. (21), can be written in closed form. The full details of
how the expressions for the densities were obtained are left to Appendix A. We
also derive the steady-state probability densities for the nontrivial $D=0$
case in Appendix B. This simplification ultimately leads to closed-form
expressions for the corresponding particle current that are compact enough to
be written down, see Eqs. (46)-(49).

Figure 3: (a) Steady-state probability densities $P(x),P_{R}(x),P_{L}(x)$, Eq.
(4), (b) and corresponding currents
$J,J_{R}(x),J_{L}(x),\mathcal{J}_{L\rightarrow R}(x)$, Eqs. (6)-(8), (c) for a
particular form of the ratchet potential $U(x)$, Eq. (1). The vertical dashed
lines indicate the position of the ratchet apex, $x=a$.

The solutions for the steady-state probability densities, Eq. (4), are plotted
in Fig. 3(a). The solutions for the densities were confirmed by Monte Carlo
simulations of the Langevin equation (2) by demonstrating the average density
of many ($10^{6}$) realisations of the stochastic dynamics converges to the
theoretical steady-state density $P(x)$ as $t\rightarrow\infty$, Fig. 4.

Figure 4: Time evolution of the overall probability density
$P(x,t)=P_{R}(x,t)+P_{L}(x,t)$ obtained from averaging $10^{6}$ stochastic
trajectories of an RnT particle subject to a ratchet potential $U(x)$, Eq.
(1). In each realisation, a particle is initialised with an equal probability
of being a right mover or a left mover at $x=\ell/2$ and $t=0$, i.e.
$P_{R}(x,0)$ = $P_{L}(x,0)=\delta(x-\ell/2)/2$, before it is evolved in time
by numerically integrating Eq. (2) in timesteps of $\mathrm{d}t=10^{-5}$. At
large times $t\rightarrow\infty$, the simulated densities converge to the
theoretical steady-state density $P(x)=P_{R}(x)+P_{L}(x)$, Eq. (4). The
vertical dashed line indicates the position of the ratchet apex, $x=a$.

In Fig. 3(a), particles are mostly aggregated around the minimum of the
ratchet and their density decays further up either slope. Left movers are more
likely to be found close to $x=0$ than right movers as their preferred
direction of motion is against the steeper slope of the potential resulting in
greater confinement. The strength of the confinement can be adjusted by
varying $h$. For $h\rightarrow 0$, the densities tend to uniform distributions
$P_{R}(x)=P_{L}(x)=1/(2\ell)$, since particles are unconfined. Uniform
densities are similarly obtained for $v\rightarrow\infty$,
$f\rightarrow\infty$ or $D\rightarrow\infty$ as these cases result in the
particle decoupling from the potential. For $h\rightarrow\infty$, particles
are confined to the point $x=0$ and so $P_{R,L}(x)\rightarrow\delta(x)/2$. In
the equilibrium limit, $v\rightarrow 0$ or $\gamma\rightarrow\infty$, the
density tends to a Boltzmann distribution
$P^{[i]}(x)\propto\exp({-(U^{\prime[i]}+f)x/D})$. In the limit
$\gamma\rightarrow 0$, right movers and left movers decouple and the solution
reduces to that of two drift-diffusive species in the ratchet potential
$U(x)$. Finally, taking $D\rightarrow 0$ with $f=0$ yields agreement with the
$D=0$ case studied in Ref. [39].

##  IV Currents

The currents for right movers and left movers are, respectively,

$\displaystyle J_{R}^{[i]}(x,t)$
$\displaystyle=\left(v-f-U^{\prime[i]}\right)P^{[i]}_{R}(x,t)-D\frac{\partial
P^{[i]}_{R}(x,t)}{\partial x},$ (5a) $\displaystyle J_{L}^{[i]}(x,t)$
$\displaystyle=\left(-v-f-U^{\prime[i]}\right)P^{[i]}_{L}(x,t)-D\frac{\partial
P^{[i]}_{L}(x,t)}{\partial x},$ (5b)

where, again, we define separate contributions for the different regions of
the ratchet (denoted by the superscript $[i]$) and we recall the
$U^{\prime[i]}$ are constant, see Sec. II. The Fokker-Planck equation (3) can
be rewritten as a continuity equation in terms of the currents defined in Eq.
(5),

$\displaystyle\frac{\partial P^{[i]}_{R}(x,t)}{\partial t}+\frac{\partial
J^{[i]}_{R}(x,t)}{\partial x}-\mathcal{J}_{L\rightarrow R}^{[i]}(x,t)$
$\displaystyle=0,$ (6a) $\displaystyle\frac{\partial
P^{[i]}_{L}(x,t)}{\partial t}+\frac{\partial J^{[i]}_{L}(x,t)}{\partial
x}+\mathcal{J}_{L\rightarrow R}^{[i]}(x,t)$ $\displaystyle=0,$ (6b)

where we have also defined the flux density of transitions from the left-
moving state to the right-moving state as

$\mathcal{J}_{L\rightarrow
R}^{[i]}(x,t)\equiv\gamma\left(P^{[i]}_{L}(x,t)-P^{[i]}_{R}(x,t)\right)=-\mathcal{J}_{R\rightarrow
L}^{[i]}(x,t).$ (7)

The overall current is given by $J(x,t)=J_{R}(x,t)+J_{L}(x,t)$. By summing
Eqs. (6a) and (6b), it can be seen that the stationary condition
$\partial_{t}P^{[i]}(x)=0$ implies the overall current at stationarity is
constant across space since this leads to $\partial_{x}J^{[i]}=0$. Hence, $J$
can be calculated from the probability densities on just a single section
$[i]$ of the ratchet since the other section must have the same current. If we
choose $i=1$, corresponding to $x\in[0,a)$, then the resulting expression for
$J=J_{R}^{[1]}(x)+J_{L}^{[1]}(x)$ can be simplified significantly by setting
$x=0$, yielding a closed expression in terms of the known coefficients
$\mathcal{A}_{R}^{[1]},\mathcal{A}_{L}^{[1]},\mathcal{A}_{R}^{[2]},\dots,\mathcal{D}_{L}^{[2]}$
from Eq. (4),

$J=\sum_{\mathcal{Z}=\mathcal{A}}^{\mathcal{C}}\left[v\mathcal{Z}_{-}^{[1]}-\left(f+\frac{h}{a}+D\lambda_{\mathcal{Z}}^{[1]}\right)\mathcal{Z}_{+}^{[1]}\right]-\left(f+\frac{h}{a}\right)\mathcal{D}^{[i]},$
(8)

where we have defined
$\mathcal{Z}_{\pm}^{[i]}\equiv\mathcal{Z}_{R}^{[i]}\pm\mathcal{Z}_{L}^{[i]}$
and have used that
$\mathcal{D}_{R}^{[i]}=\mathcal{D}_{L}^{[i]}\equiv\mathcal{D}^{[i]}$, see
Appendix A.

Figure 5: The currents for each species, $J_{R}(x)$ and $J_{L}(x)$, are
greater in magnitude close to the potential minimum at $x=0$ due to a
recycling of particles that tumble before crossing the potential barrier. When
in the right-moving state (red spheres, bottom), particles experience a weaker
effective potential $U_{\text{eff}}(x)=U(x)-(v-f)x$ than when in the left-
moving state (blue spheres, top), resulting in, on average, a greater number
of right movers diffusing up the slope before tumbling and returning back down
as left movers. Figure 6: Steady-state current $J$, Eq. (8), as a function of
the position of the ratchet apex $a$ for various external forces $f$. Maximum
current occurs for $a\rightarrow\ell^{-}$ using the default parameters defined
in Sec. II.

The currents, Eqs. (5) and (8), and flux density of transitions, Eq. (7), are
plotted in Fig. 3(b). The currents for each species, $J_{R}(x)$ and
$J_{L}(x)$, are greater in magnitude close to the potential minimum at $x=0$.
This results from particles that tumble before crossing the top of the
potential barrier at $x=a$ and so are recycled to the bottom of the potential,
e.g. right movers travel part way up the slope $U^{\prime[1]}$, spanning
$0\leq x<a$, before they tumble and return down the slope as left movers (and
vice versa for particles on the opposite slope $U^{\prime[2]}$). This
phenomenon is still present when particles are confined, e.g. we can still
have $J_{R}(x)>0$ on $U^{\prime[1]}$ despite $v-f<U^{\prime[1]}$. As
illustrated in Fig. 5, this is because particles experience different
“effective” potentials $U_{\text{eff}}(x)$ depending on their internal state.
Specifically, a right-mover can be viewed as a Brownian particle moving in an
effective potential $U_{\text{eff}}(x)=U(x)-(v-f)x$. Assuming $v-f>0$, right
movers experience a smaller $U^{\prime[1]}_{\text{eff}}$ than left movers.
This asymmetry in $U^{\prime[1]}_{\text{eff}}$ means, on average, a greater
number of right movers than left movers will diffuse up the slope
$U^{\prime[1]}$. When these additional right movers tumble, they will return
down the slope as left movers, resulting in a current for each particle
species just as in the unconfined case. As $D$ is decreased, these confined
currents become more localised around $x=0$ as the chance of a particle
crossing the potential barrier becomes increasingly unlikely.

Based on the mechanism described above and in Fig. 5, we expect each particle
to contribute $\sim\gamma$ to the currents $J_{R,L}(x)$. As will become
apparent for the entropy production in Sec. V, a particularly relevant case is
the form of the confined currents as $D\rightarrow 0$. In this equilibrium-
like case, the current obeys the Arrhenius law $J\sim\exp(-H/D)\approx 0$, see
inset of Fig. 9, where $H$ is the “effective” height of the potential adjusted
for particle activity [49]. Hence, we can assume particles almost never
overcome the potential barrier as $D\to 0$, and can thus approximate the
barrier height $h$ to be effectively infinite. Taking the slope
$U^{\prime[1]}$ as an example, the largest contribution to the left-moving
current $J_{L}(x)$ at a position $x$ will come from right movers that tumble
higher up the slope, and so
$|J_{L}^{[1]}(x)|\approx\gamma\int_{x}^{\infty}\mathrm{d}x^{\prime}~{}P_{R}^{[1]}(x^{\prime})$.
Since the confined case is effectively equilibrium, then the right-moving
probability density is given by a Boltzmann distribution
$P_{R}^{[1]}(x)\sim\exp(-x/l_{D})/l_{D}$, assuming relaxation to the steady
state occurs much faster than transmutation between species and where
$l_{D}=D/(U^{\prime[1]}-v+f)>0$ is the characteristic length scale of
diffusive spreading. Hence, when particles are confined, $0<v-f<U^{\prime[1]}$
and $v+f<|U^{\prime[2]}|$, the current in the limit of vanishing diffusion is

$\lim_{D\rightarrow 0}|J_{L}^{[1]}(x)|\sim\gamma e^{-\frac{x}{l_{D}}}.$ (9)

Since $J\rightarrow 0$ for $D\rightarrow 0$ in the confined case, then
$|J_{R}(x)|=|J_{L}(x)|$ and so $|J_{R}^{[1]}(x)|$ is also equal to the right-
hand side of Eq. (9). Similar arguments can be used to calculate the
contributions $J_{R,L}^{[2]}(x)$ to the confined currents on the other slope
$U^{\prime[2]}$ for $D\rightarrow 0$.

Figure 7: Position of the ratchet apex $a^{*}$ resulting in maximum current
$J$, Eq. (8), as a function of diffusion strength $D$. Maximum current occurs
for $a^{*}=\ell-h/(v+f)$ for $D\rightarrow 0$ and $a^{*}\rightarrow\ell^{-}$
for large $D$.

In Fig. 6, it can be seen that motion is rectified to the right ($J>0$) for
$a>\ell/2$ and is rectified to the left ($J<0$) for $a<\ell/2$ when $f=0$.
Contrary to that of the $D=0$ case studied in Ref. [39], where maximum
positive current occurs for $a=\ell-h/(v+f)$, we find for the parameters used
in Fig. 6 that maximum current occurs for $a\rightarrow\ell^{-}$, i.e. when
there is an infinitely steep slope $U^{\prime[2]}$ opposing the motion of left
movers. While taking $D\rightarrow 0$ in our model recovers the result of Ref.
[39], we observe in Fig. 7 that the position $a^{*}$ of the ratchet apex
resulting in maximum current occurs at some nontrivial
$\ell-h/(v+f)<a^{*}<\ell$ for small but finite diffusion, $D>0$. To see why,
consider first $a^{*}$ for the $D=0$ case, which arises by choosing the exact
$a$ at which left movers are only just confined by the potential, i.e.
$v+f=h/(\ell-a)$, in order to not increase the uphill distance the unconfined
right movers must traverse. However, for finite diffusion, $D>0$, left movers
are able to overcome the barrier to the left, even for $v+f<h/(\ell-a)$.
Hence, to achieve maximum current $J$ for $D>0$, one must increase $a$ to
hinder the left movers’ ability to overcome the barrier, while still bearing
in mind the compromise that applies to right movers in the $D=0$ case. As $D$
is increased further, $a^{*}$ also increases up until the “best” one can do to
minimise the left-moving current $J_{L}(x)$ is to set $a\rightarrow\ell^{-}$.

Figure 8: Steady-state current $J$, Eq. (8), as a function of the ratchet
height $h$ for various external forces $f$. For $h=0$, the current is given by
$J=-f/\ell$. The current vanishes for all $f$ as $h\rightarrow\infty$, due to
the confinement at $x=0$ being infinitely strong. The current peaks around
$h\approx 4$, reflecting a compromise in choosing a potential $U(x)$, Eq. (1),
that rectifies the symmetric RnT motion while not confining particles too
strongly.

For completeness, we provide a detailed derivation of the $D=0$ current $j$ in
Appendix B, resulting in closed-form expressions that are compact enough to be
written down, Eqs. (46)-(49). This derivation generalises the results of Ref.
[39] to include an additional linear external force $f\neq 0$ or,
equivalently, to allow for asymmetric self-propulsion speeds between right
movers and left movers.

The effect of varying the ratchet height $h$ on the current is plotted in Fig.
8. For vanishing height $h=0$, equivalent to the absence of a potential
$U(x)$, Eq. (1), the current is given by $J=-f/\ell$. As $h\rightarrow\infty$,
the current vanishes as particles become confined by infinitely steep slopes
at both sides of $x=0$. In between these extremes, $J$ peaks at a finite value
of $h$. This reflects that the potential $U(x)$ that optimises the current
must be suitably strong to rectify the symmetric RnT motion while not
confining particles too strongly.

Figure 9: Steady-state current $J$, Eq. (8), as a function of diffusion $D$
for various magnitudes of the slope $U^{\prime[1]}=h/a$ for fixed $a=0.9$ and
$f=0.02$. For $D\rightarrow\infty$, the current asymptotically approaches
$J=-f/\ell$. For $D\rightarrow 0$, the current vanishes if the particle is
confined, i.e. $v-f<U^{\prime[1]}$ and $v+f<|U^{\prime[2]}|$. For
$v-f>U^{\prime[1]}$, positive current is possible for $D=0$, as illustrated by
the line for $U^{\prime[1]}=0.5$. The inset log-log plot demonstrates that
agreement with the Arrhenius equation $J\sim\exp(-H/D)$ for small $D$ improves
with increasing confinement.

The current $J$ similarly peaks at finite values of $v$ and $D$, the latter of
which is plotted in Fig. 9. As $v\rightarrow\infty$ or $D\rightarrow\infty$,
the particle decouples from the potential such that $J\rightarrow-f/\ell$.
This is also the case for when the external force dominates, i.e.
$|f|\rightarrow\infty$. The behaviour of $J$ for $D\rightarrow 0$ depends on
whether the particle is confined. If the particle’s self-propulsive force is
not large enough to penetrate the potential barrier, i.e. $v-f<U^{\prime[1]}$
and $v+f<|U^{\prime[2]}|$, then the particle is confined to the potential well
at $x=0$ and thus $J=0$, see Fig. 9. If the particle is unconfined,
$v-f>U^{\prime[1]}$ or $v+f>|U^{\prime[2]}|$, then there is a nonzero current
$J>0$ as $D\rightarrow 0$.

For $\gamma=0$, the overall current $J$ is the average for that of uncoupled
drift-diffusive right movers and left movers. For $\gamma\rightarrow\infty$,
the current tends to $J\rightarrow-f/\ell$ since particles are no longer
persistent, and the dynamics reduce to that of a purely diffusive particle
moving in the potential $U(x)+fx$.

##  V Entropy production

The entropy production rate $\dot{S}_{\mathrm{int}}$ quantifies the degree to
which time-reversal symmetry is broken and therefore distinguishes between
nonequilibrium, $\dot{S}_{\mathrm{int}}>0$, and equilibrium,
$\dot{S}_{\mathrm{int}}=0$, systems. In the present system, there are several
sources of symmetry breaking, such as asymmetric overall drift speeds due to
the external force $f$, and that particles tend to run faster down the sides
of the ratchet potential $U(x)$, Eq. (1), when the force due to the potential
is aligned with the particle’s own self-propulsion speed $v$, similarly to RnT
particles in a harmonic potential [16]. Starting from the Gibbs-Shannon
entropy [66], we take a well-established approach [59, 67, 17] to obtain an
exact expression for the entropy production rate at stationarity, Eq. (21).

The Gibbs-Shannon entropy for the present system is defined as

$S(t)=-\sum_{k=R,L}\int_{0}^{\ell}\mathrm{d}x~{}P_{k}(x,t)\log\left(\frac{P_{k}(x,t)}{\bar{P}}\right),$
(10)

where $\bar{P}$, with $\left[\bar{P}\right]=1/\ell$, is for dimensional
consistency in the logarithm but will drop out of the final expression for
$\dot{S}_{\mathrm{int}}$. The time derivative of Eq. (10) is

$\dot{S}(t)=-\sum_{k=R,L}\int_{0}^{\ell}\mathrm{d}x~{}\frac{\partial
P_{k}(x,t)}{\partial
t}\left(\log\left(\frac{P_{k}(x,t)}{\bar{P}}\right)+1\right).$ (11)

After relating $\partial_{t}P_{k}(x,t)$ in Eq. (11) to the currents
$J_{k}(x,t)$ and $\mathcal{J}_{L\rightarrow R}(x,t)$ through the continuity
equations, Eq. (6), integrating by parts, and dropping boundary terms due to
the periodic boundary conditions, we eventually obtain

$\begin{split}\dot{S}(t)=-\int_{0}^{\ell}\mathrm{d}x\Bigg{(}&\sum_{k=R,L}\frac{J_{k}(x,t)}{P_{k}(x,t)}\frac{\partial
P_{k}(x,t)}{\partial x}\\\ &+\mathcal{J}_{L\rightarrow
R}(x,t)\log\left(\frac{P_{R}(x,t)}{P_{L}(x,t)}\right)\Bigg{)}.\end{split}$
(12)

Using the definition of the currents, Eq. (5), $\partial_{x}P_{k}(x,t)$ in Eq.
(12) can be rewritten to yield

$\begin{split}&\dot{S}(t)=\int_{0}^{\ell}\mathrm{d}x\Bigg{[}\sum_{k=R,L}\frac{J_{k}^{2}(x,t)}{DP_{k}(x,t)}+\frac{f+U^{\prime}(x)}{D}J(x,t)\\\
&-\frac{v}{D}\left(J_{R}(x,t)-J_{L}(x,t)\right)+\mathcal{J}_{L\rightarrow
R}(x,t)\log\left(\frac{P_{L}(x,t)}{P_{R}(x,t)}\right)\Bigg{]},\end{split}$
(13)

where we have used that $J_{R}(x,t)+J_{L}(x,t)=J(x,t)$.

At this point, we separate the time derivative of the entropy into the
contributions $\dot{S}(t)=\dot{S}_{\mathrm{int}}(t)-\dot{S}_{\mathrm{ext}}(t)$
and identify the positive-definite terms in Eq. (13) as those corresponding to
the internal entropy production rate of the system $\dot{S}_{\mathrm{int}}(t)$
[47, 67, 17]. We thus have

$\dot{S}_{\mathrm{int}}(t)=\dot{S}_{R}(t)+\dot{S}_{L}(t)+\dot{S}_{R\leftrightarrow
L}(t)$ (14)

where

$\dot{S}_{R/L}(t)\equiv\int_{0}^{\ell}\mathrm{d}x~{}\dot{s}_{R/L}(x,t)\equiv\int_{0}^{\ell}\mathrm{d}x~{}\frac{J_{R/L}^{2}(x,t)}{DP_{R/L}(x,t)}$
(15)

is the entropy production of right/left movers and $\dot{s}_{R/L}(x,t)\equiv
J_{R/L}^{2}(x,t)/(DP_{R/L}(x,t))$ is the local entropy production _density_ of
right/left movers at position $x$ and time $t$ [17, 16]. Similarly,

$\begin{split}\dot{S}_{R\leftrightarrow
L}(t)&\equiv\int_{0}^{\ell}\mathrm{d}x~{}\dot{s}_{R\leftrightarrow L}(x,t)\\\
&\equiv\int_{0}^{\ell}\mathrm{d}x~{}\mathcal{J}_{L\rightarrow
R}(x,t)\log\left(\frac{P_{L}(x,t)}{P_{R}(x,t)}\right)\end{split}$ (16)

is the entropy production due to transitions between right movers and left
movers, with $\dot{s}_{R\leftrightarrow L}(x,t)=\mathcal{J}_{L\rightarrow
R}(x,t)\log\left(P_{L}(x,t)/P_{R}(x,t)\right)$ its local density. Note that
$\dot{S}_{R\leftrightarrow L}(t)\geq 0$ for all $t$ since
$\mathcal{J}_{L\rightarrow R}(x,t)$, Eq. (7), and
$\log\left(P_{L}(x,t)/P_{R}(x,t)\right)$ are both positive when
$P_{L}(x,t)>P_{R}(x,t)$ and both negative when $P_{L}(x,t)<P_{R}(x,t)$.

Figure 10: Steady-state entropy production densities for right movers
$\dot{s}_{R}(x)$, Eq. (15), left movers $\dot{s}_{L}(x)$, Eq. (15),
transitions between states $\dot{s}_{R\leftrightarrow L}(x)$, Eq. (16)
(inset), and their sum
$\dot{s}_{\mathrm{int}}(x)=\dot{s}_{R}(x)+\dot{s}_{L}(x)+\dot{s}_{R\leftrightarrow
L}(x)$. The vertical dashed lines indicate the position of the ratchet apex,
$x=a$.

The steady-state entropy production densities, as defined by
$\lim\limits_{t\rightarrow\infty}\dot{s}_{R/L}(x,t)\equiv\dot{s}_{R/L}(x)$ and
$\lim\limits_{t\rightarrow\infty}\dot{s}_{R\leftrightarrow
L}(x,t)\equiv\dot{s}_{R\leftrightarrow L}(x)$ in Eqs. (15) and (16)
respectively, are plotted in Fig. 10 for the same parameters as in Fig. 3. We
find the overall contribution from right movers to the steady-state entropy
production $\dot{s}_{R}(x)$ is larger than that from left movers
$\dot{s}_{L}(x)$ in the case where motion is rectified to the right, i.e.
$J>0$ as a result of $a>\ell/2$. This is expected since left movers are more
confined than right movers for $a>\ell/2$ and $f=0$. The entropy production
densities for both states, $\dot{s}_{R}(x)$ and $\dot{s}_{L}(x)$, are most
concentrated around $x=a$, where the magnitude of the current per particle
$J/P(x)$, i.e. the mean local velocity, is greatest. The total entropy
production density $\dot{s}_{\mathrm{int}}(x)$ has a local maximum at $x=0$ as
a result of the entropy production from transitions between states
$\dot{s}_{R\leftrightarrow L}(x)$, Eq. (16). The confinement due to the
ratchet results in a higher concentration of particles around $x=0$, see Fig.
3(a), and thus a greater number of symmetry-breaking tumble events, which
produces a local peak in the entropy production density. The density for
transitions between states $\dot{s}_{R\leftrightarrow L}(x)$, essentially the
Kullback-Leibler divergence of $P_{R}(x)$ and $P_{L}(x)$ [68], has another
local maximum in the bulk. In the case of the default parameters used in Fig.
10, this local maximum occurs between $x=\ell/4$ and $x=\ell/2$, coinciding
with a large local difference between the probability densities for each
species, $P_{R}(x)$ and $P_{L}(x)$, as seen in Fig. 3.

Figure 11: Steady-state entropy production rate $\dot{S}_{\mathrm{int}}$, Eq.
(21), as a function of the ratchet height $h$ for various external forces $f$.
In the absence of a ratchet, $h=0$, the entropy production is given by
$\dot{S}_{\mathrm{int}}=(v^{2}+f^{2})/D$ (inset), whilst
$\dot{S}_{\text{int}}\rightarrow 0$ as $h\rightarrow\infty$ for all $f$.

After identifying the terms contributing to the internal entropy production
rate $\dot{S}_{\text{int}}(t)$, Eq. (14), the remaining terms in $\dot{S}(t)$,
Eq. (13), are identified as the entropy flux lost from the system to the
environment, i.e.

$\begin{split}\dot{S}_{\mathrm{ext}}(t)=\frac{1}{D}\int_{0}^{\ell}\mathrm{d}x~{}\big{[}&v(J_{R}(x,t)-J_{L}(x,t))\\\
&-\left(f+U^{\prime}(x)\right)J(x,t)\big{]}.\end{split}$ (17)

At stationarity, $\dot{S}=0$ implies
$\dot{S}_{\mathrm{int}}=\dot{S}_{\mathrm{ext}}$, where
$\dot{S}\equiv\lim\limits_{t\rightarrow\infty}\dot{S}(t)$ etc. Thus, it is
convenient to evaluate the steady-state entropy production
$\dot{S}_{\mathrm{int}}$ through the simpler expression for the steady-state
entropy flux $\dot{S}_{\mathrm{ext}}$, Eq. (17), whence we obtain

$\dot{S}_{\mathrm{int}}=\frac{1}{D}\int_{0}^{\ell}\mathrm{d}x~{}\left[v\left(J_{R}(x)-J_{L}(x)\right)-(f+U^{\prime}(x))J\right].$
(18)

Then, using that $J$ is constant across space, Eq. (8), and $U(x)$ is
periodic, Eq. (1), we obtain

$\dot{S}_{\mathrm{int}}=\frac{v}{D}\int_{0}^{\ell}\mathrm{d}x~{}\left(J_{R}(x)-J_{L}(x)\right)-\frac{f\ell
J}{D}.$ (19)

After reinserting the expressions for the individual currents $J_{R,L}(x)$
from Eq. (5), and applying the normalisation
$\int_{0}^{\ell}\mathrm{d}x~{}P(x)=1$ and periodic boundary conditions
$P_{R,L}(0)=P_{R,L}(\ell)$, Eq. (19) becomes

$\dot{S}_{\mathrm{int}}=\frac{v^{2}}{D}-\frac{f\ell
J}{D}-\frac{v}{D}\int_{0}^{\ell}\mathrm{d}x~{}U^{\prime}(x)\left(P_{R}(x)-P_{L}(x)\right),$
(20)

which, in the absence of an external counterforce $f$ and ratchet potential
$U(x)$, Eq. (1), recovers the entropy production rate of a free particle
$v^{2}/D$ (in the case where its internal state is known at all times) [47].
Finally, splitting the integral in Eq. (20) into separate contributions for
each region of the ratchet and inserting the expressions for the probability
densities, Eq. (4), we obtain an expression in terms of the known coefficients
$\mathcal{A}_{R}^{[1]},\mathcal{A}_{L}^{[1]},\mathcal{A}_{R}^{[2]},\dots,\mathcal{D}_{L}^{[2]}$,

$\begin{split}\dot{S}_{\mathrm{int}}&=\frac{v^{2}}{D}-\frac{f\ell
J}{D}-\frac{v}{D}\sum_{\mathcal{Z}=\mathcal{A}}^{\mathcal{C}}\Bigg{(}\frac{h}{a}\mathcal{Z}_{-}^{[1]}\frac{e^{\lambda_{\mathcal{Z}}^{[1]}a}-1}{\lambda_{\mathcal{Z}}^{[1]}}\\\
&~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}-\frac{h}{\ell-a}\mathcal{Z}_{-}^{[2]}\frac{e^{\lambda_{\mathcal{Z}}^{[2]}\ell}-e^{\lambda_{\mathcal{Z}}^{[2]}a}}{\lambda_{\mathcal{Z}}^{[2]}}\Bigg{)},\end{split}$
(21)

where we have used $\mathcal{D}_{R}^{[i]}=\mathcal{D}_{L}^{[i]}$, see Appendix
A, and have adopted the same shorthand notation, i.e.
$\mathcal{Z}_{-}^{[i]}\equiv\mathcal{Z}_{R}^{[i]}-\mathcal{Z}_{L}^{[i]}$, used
in Eq. (8).

The entropy production $\dot{S}_{\mathrm{int}}$, Eq. (21), is plotted in Fig.
11 against the height $h$ of the ratchet. For $h=0$, the entropy production
reduces to $\dot{S}_{\mathrm{int}}=(v^{2}+f^{2})/D$, see inset of Fig. 11,
which is that of a free RnT particle $v^{2}/D$ plus a positive semidefinite
contribution $f^{2}/D$ for all $f$ due to the asymmetry in the overall drift
speeds breaking time-reversal symmetry. The entropy production monotonically
decreases with $h$, tending to $\dot{S}_{\mathrm{int}}\rightarrow 0$ as
$h\rightarrow\infty$ since particles become confined to the potential minimum
at $x=0$ and therefore the system contains only stationary particles that are
trivially at equilibrium.

Figure 12: Steady-state entropy production rate $\dot{S}_{\mathrm{int}}$, Eq.
(21), as a function of diffusion $D$ for various magnitudes of the slope
$U^{\prime[1]}=h/a$ for fixed $a=0.9$ and $f=0$. The entropy production
vanishes as $D\rightarrow\infty$, while for $D\rightarrow 0$,
$\dot{S}_{\text{int}}$ diverges or remains finite depending on whether the
particle is confined, i.e. whether $v-f<U^{\prime[1]}$ and
$v+f<|U^{\prime[2]}|$.

As is typically the case for RnT particles [17, 16], $\dot{S}_{\text{int}}$
monotonically increases with $v$ and diverges as $v\rightarrow\infty$. For
$D\rightarrow\infty$, the entropy production vanishes
$\dot{S}_{\text{int}}\rightarrow 0$ since any differences between the
deterministic components of the forward and time-reversed trajectories of the
RnT particle are washed out by diffusive noise. For $v\rightarrow 0$,
$\dot{S}_{\text{int}}$ tends to a positive value due to there still being a
current from the remaining drift $-f$.

As for the current $J$ in Sec. IV, the $D\rightarrow 0$ limit of
$\dot{S}_{\text{int}}$ depends on whether the particle is confined, i.e.
whether $v-f<U^{\prime[1]}$ and $v+f<|U^{\prime[2]}|$. In typical systems of
RnT particles [17, 16], the entropy production diverges as $D\rightarrow 0$,
since the dynamics become more deterministic and it thus becomes easier to
distinguish between forward and time-reversed trajectories. However, in the
present case, this effect competes with the increasing confinement of the
particles as $D\rightarrow 0$ for $v-f<U^{\prime[1]}$ and
$v+f<|U^{\prime[2]}|$. This results in the entropy production
$\dot{S}_{\text{int}}$ remaining finite in the confined case, but diverging in
the unconfined case, as $D\rightarrow 0$, see Fig. 12. It is somewhat
remarkable that the confining case results in $\dot{S}_{\text{int}}>0$ for
$D\rightarrow 0$ as one may naïvely expect $\dot{S}_{\text{int}}$ to vanish if
the particles are confined. However, the nonvanishing entropy production as
$D\rightarrow 0$ is a result of the confined currents, $J_{R}(x)$ and
$J_{L}(x)$, discussed in Sec. IV. There, it was argued the magnitude of these
currents scales approximately as $|J_{R,L}^{[1]}(x)|\sim\gamma\exp(-x/l_{D})$,
Eq. (9), for $D\rightarrow 0$ on the slope $U^{\prime[1]}$, where
$l_{D}=D/(U^{\prime[1]}-v+f)$. Inserting Eq. (9) into Eq. (19), we obtain for
the entropy production in the confined case,

$\begin{split}\lim_{D\rightarrow
0}\dot{S}_{\mathrm{int}}&\sim\lim_{D\rightarrow
0}\gamma~{}\frac{v}{D}\int_{0}^{a}\mathrm{d}x~{}e^{-\frac{x}{l_{D}}}+\int_{a}^{\ell}\mathrm{d}x~{}\dots\\\
&\sim\gamma~{}\frac{v}{U^{\prime[1]}-v+f}+\dots~{},\end{split}$ (22)

where $\dots$ indicates additional nondiverging contributions from the
confined currents on the $i=2$ section of the ratchet, spanning $a\leq
x<\ell$. Eq. (22) demonstrates that $\dot{S}_{\text{int}}$ remains finite as
$D\rightarrow 0$ in the confined case, see also Fig. 12.

In Fig. 12, we also observe that $\dot{S}_{\mathrm{int}}$ has two local
extrema in its dependence on $D$ in the confined case. As an explanation, we
first note in Fig. 9 that $J\sim\exp(-H/D)\approx 0$ for small $D$ in the
confined case and picks up abruptly as $D$ is increased. Thus, it is expected
that $\dot{S}_{\text{int}}$ should initially decrease with $D$ in the confined
case since the particle dynamics become less deterministic with no significant
gain in the overall current $J$ until diffusion-mediated barrier crossings
significantly increase in frequency. As $D$ is increased further, the onset of
the rapid increase in $J$ results in a similar increase in
$\partial\dot{S}_{\text{int}}/\partial D$, as can be seen by comparing Figs. 9
and 12 (allowing for the minimal effect of the slight difference in external
forces $f$ used in each figure). The entropy production
$\dot{S}_{\mathrm{int}}$ thus attains a local minimum as $D$ is increased as
there becomes an appreciable rise in diffusion-mediated barrier crossings that
generate a current $J$. However, as $D$ is increased further, the particle
eventually decouples from the potential $U(x)$, Eq. (1), and so
$\dot{S}_{\text{int}}$ must decrease with $D$ again as $D$ becomes large. As a
result, the entropy production also attains a local maximum in the confined
case before eventually decaying like that of a free particle, i.e.
$\dot{S}_{\mathrm{int}}\sim 1/D$, see inset of Fig. 12.

For $a<\ell/2$, we found the entropy production $\dot{S}_{\text{int}}$ is a
monotonically increasing function of the external force $f$ since increasing
the external force enhances the existing bias of the system to rectify motion
to the left which, in turn, increases the degree to which time-reversal
symmetry is broken. In the confined case, $v-f<U^{\prime[1]}$ and
$v+f<|U^{\prime[2]}|$, for $a>\ell/2$, increasing the external force $f$
initially decreases the overall bias $J>0$ of the system, and so the entropy
production $\dot{S}_{\text{int}}$ attains a global minimum at finite $f$
before increasing with $f$ again. As $|f|\rightarrow\infty$, the entropy
production tends to $\dot{S}_{\text{int}}\rightarrow f^{2}/D$ as the external
force dominates over the ratchet force $U^{\prime}(x)$ and the self-propulsion
$v$.

For $\gamma\rightarrow 0$, the entropy production $\dot{S}_{\text{int}}$
reduces to the average for that of uncoupled drift-diffusive right movers and
left movers moving in a potential $U(x)+fx$. The entropy production also
monotonically increases with $\gamma$ and asymptotically approaches a value
$\dot{S}_{\text{int}}\leq(v^{2}+f^{2})/D$ as $\gamma\rightarrow\infty$.

##  VI Power output and efficiency

Figure 13: Steady-state power output $\dot{W}$, Eq. (23), as a function of the
external force $f$ for various magnitudes of the slope $U^{\prime[1]}=h/a$ for
fixed $a=0.9$. Maximum power output occurs for a slope $U^{\prime[1]}\approx
6$ for the default parameters defined in Sec. II. The power output $\dot{W}$
and thermodynamic efficiency $\eta$ (inset) are nonzero for external forces
$0<f<f_{\mathrm{stall}}$. The stall forces in this case are
$f_{\mathrm{stall}}\approx 0.054,0.083,0.112,0.138$ for each
$U^{\prime[1]}=4,5,6,7$ respectively.

By applying an external force $f>0$ (in the negative $x$-direction, see Sec.
II), work $W$ can be extracted from an RnT particle provided $J>0$. The
average rate of work, i.e. power, extracted from the particle in the steady
state is

$\dot{W}=J\ell f,$ (23)

where $\dot{W}>0$ indicates work is being done _by_ the particle. The
dependence of $\dot{W}$ on the system parameters is thus the same as for that
of the current $J$, Eq. (8), for constant $f$ and $\ell$. Hence, much of the
asymptotic behaviour of the extractable power, Eq. (23), can be readily
obtained from that of the current $J$ in Sec. IV, and we therefore omit this
repetitive discussion. The only qualitatively different behaviour for
$\dot{W}$ is obtained by varying the external force $f$, which is plotted in
Fig. 13 alongside the thermodynamic efficiency
$\eta\equiv\dot{W}/P_{\mathrm{in}}=\dot{W}/(\dot{W}+D\dot{S}_{\mathrm{int}})$
[45] for gradients $U^{\prime[1]}=h/a$ close to that achieving maximum
extractable power for the default parameters defined in Sec. II. For these
particular parameters, the current is approximated by $J\approx
J_{0}(1-f/f_{\mathrm{stall}})$ for $f_{\mathrm{stall}}\neq 0$, where
$f_{\mathrm{stall}}$ is the stall force at which the current vanishes, $J=0$,
i.e. the point at which the force from the external load exactly cancels the
current generated by the rectified motion. Hence, for these parameters where
the approximation $J\approx J_{0}(1-f/f_{\mathrm{stall}})$ holds, the maximum
extractable power $\dot{W}$, Eq. (23), and in turn the maximum efficiency
$\eta$, occur for $f\approx f_{\mathrm{stall}}/2$, as seen in Fig. 13. In the
absence of an external force $f=0$, no work $W$ is produced and the efficiency
of the power extraction is thus also $\eta=0$. For $f<0$, work is done on the
particle and so $\dot{W}<0$ and $\eta<0$. For $f=f_{\mathrm{stall}}$, we have
$\dot{W}=0$ and $\eta=0$ because of the absence of a current $J=0$, and for
forces greater than the stall force $f>f_{\mathrm{stall}}$, work is done on
the particle because the current generated by the force $f$ outweighs that
generated by the rectification, causing the particle to be “dragged
backwards”. As $|f|\rightarrow\infty$, the power $\dot{W}\rightarrow-f^{2}$
and thus the efficiency $\eta\rightarrow-\infty$ since
$D\dot{S}_{\text{int}}\rightarrow f^{2}$, see Sec. V.

Figure 14: Steady-state efficiency $\eta$ as a function of the external force
$f$ for various heights $h$ of the ratchet and for particle parameters $v=10$,
$\gamma=1$, and $D=0.1$. For $h\gtrsim 4$, there is a range of external forces
for which $\eta\approx 0$.

In Fig. 13, the efficiency is small $\eta<1\%$ for the default parameter
values defined in Sec. II since, in this confined case, a current $J$ can be
generated only by rare diffusion-mediated barrier crossings. However, the
efficiency $\eta$ is vastly improved in the case where the particle is not
confined by the potential $U(x)$, Eq. (1), and for small diffusion $D$. Using
our default system parameters $L=1$ and $a=0.9$, this is illustrated in Fig.
14 for particle parameters $v=10$, $\gamma=1$, and $D=0.1$, corresponding to a
Péclet number $\mathrm{Pe}=v^{2}/(D\gamma)=1000$ on the order of that of an E.
coli bacterium 111The typical run speed and tumble rate of an E. coli are
$v\approx 15~{}\mu\mathrm{m}~{}\mathrm{s}^{-1}$ and $\gamma\approx
1~{}\mathrm{s}^{-1}$ respectively [75]. The _thermal_ diffusion constant $D$
of an E. coli can be calculated from the Stokes-Einstein equation
$D=k_{B}T/(6\pi\eta_{\text{vis}}r)$. By approximating an E. coli as a sphere
of radius $r=1~{}\mu\mathrm{m}$ immersed in water (of dynamic viscosity
$\eta_{\text{vis}}\approx 10^{-3}~{}\mathrm{Pa}~{}\mathrm{s}$), this gives
$D\approx 0.2~{}\mu\mathrm{m}^{2}~{}\mathrm{s}^{-1}$ at room temperature
$T=300~{}\mathrm{K}$. Thus, the Péclet number of an E. coli is on the order of
$\mathrm{Pe}=v^{2}/(D\gamma)\approx 1000$. These parameters are seen to result
in a much higher efficiency of $\eta\approx 35\%$ for $h=3$ and $f\approx 5$.
However, these parameters are by no means those that result in the maximum
possible efficiency $\eta$ for this system. In fact, arbitrarily high
efficiencies can be obtained by taking $D\to 0$ and $\gamma\to 0$ while
choosing the ratchet parameters in such a way that left movers are confined,
$v+f<|U^{\prime[2]}|$, but right movers are not, $v-f>U^{\prime[1]}$, and
choosing an external force $f$ slightly smaller than the stall force
$f_{\mathrm{stall}}$ to minimise dissipation $D\dot{S}_{\mathrm{int}}$ while
maintaining positive power output $\dot{W}$. In this case, there is a
“ratchet-and-pawl” effect where, in the absence of tumbling $\gamma=0$, right
movers produce useful work $W$ against the external force $f$, while left
movers are confined to $x=0$ and therefore do not contribute negatively to the
efficiency $\eta$. This highlights, however, the limitations of so-called
“dry” active matter considered here, for which hydrodynamic interactions are
neglected and thus particles do not dissipate energy while stuck at walls [1].
We expect the efficiency $\eta$ of this system would be lower for the more
realistic case of “wet” active matter where momentum is conserved through
hydrodynamic interactions.

In Fig. 14, for $h=4$ and $h=5$, we observe a range of external forces $f$ for
which the efficiency is $\eta\approx 0$. This is possible for external forces
that satisfy $f_{\mathrm{stall}}<f<h/(\ell-a)-v$, as these are larger than the
stall force, resulting in motion to the right being suppressed, but still
small enough that the combination of the external force $f$ and self-
propulsion $v$ is not enough to overcome the potential barrier to the left,
and so motion to the left is also suppressed. In the case of small but
nonvanishing diffusion $D$ in Fig. 14, there is still an appreciable chance of
the particle overcoming the barrier as a result of diffusive fluctuations and
so the range of forces $f$ for which $\eta\approx 0$ does not extend the
entire way to $f=h/(\ell-a)-v$.

Figure 15: Schematic representation of configuration (ii) in Sec. VII, used to
study the mean first-passage time of RnT particles in a ratchet potential with
a reflecting boundary at $x=\ell$ and an absorbing boundary at $x=0$.
Configuration (i) is the same as configuration (ii) but with the reflecting
boundary at $x=\ell$ replaced by an absorbing boundary.

Regarding the maximum power $\dot{W}$, Eq. (23), that can be extracted from
this system, it is known in the case of $D=0$ that maximum current $j$, and
hence maximum power $\dot{W}$, is achieved by taking $h\rightarrow 0$ and
$\ell\rightarrow 0$ for fixed $a=\ell-h/(v+f)>\ell/2$ [39], corresponding to
an optimal ratchet on a ring of vanishing circumference that a particle
circumnavigates infinitely quickly. However, this diverging $D=0$ current $j$
fails to take into account the finite size of the particles which would
restrict the ratchet height $h$ and length $\ell$ from becoming too small.
Instead, for given particle parameters $v$ and $\gamma$, and physically
appropriate values of $h$ and $\ell$, one could find the optimal power
$\dot{W}$ in the $D=0$ case by using that maximum current occurs for an apex
position $a=\ell-h/(v+f)$, which leaves the external force $f$ as the only
remaining parameter to be optimised.

##  VII First-passage properties

In this section, we calculate the mean first-passage times $\tau_{R,L}(x)$ and
splitting probabilities $\Pi_{R,L}(x)$ for an RnT particle in a ratchet
potential $U(x)$, Eq. (1), on a bounded interval $x\in[0,\ell]$. Firstly, the
mean first-passage times can be calculated for the cases of (i) two absorbing
boundary conditions at $x=0$ and $x=\ell$, and (ii) a single reflecting
boundary at $x=\ell$ and an absorbing boundary at $x=0$, Fig. 15. We define
the mean first-passage times $\tau_{R/L}(x)$ as the average time it takes the
RnT particle to be absorbed at a boundary, and thus leave the system, given
the particle was initialised in the right/left-moving state at position
$x\in[0,\ell]$. The mean first-passage times can be shown to satisfy the
backward equations [70]

$\displaystyle-1$
$\displaystyle=D\frac{\mathrm{d}^{2}\tau_{R}^{[i]}(x)}{\mathrm{d}x^{2}}+\left(v-f-U^{\prime[i]}\right)\frac{\mathrm{d}\tau_{R}^{[i]}(x)}{\mathrm{d}x}-\gamma\left(\tau_{R}^{[i]}(x)-\tau_{L}^{[i]}(x)\right),$
(24a) $\displaystyle-1$
$\displaystyle=D\frac{\mathrm{d}^{2}\tau_{L}^{[i]}(x)}{\mathrm{d}x^{2}}+\left(-v-f-U^{\prime[i]}\right)\frac{\mathrm{d}\tau_{L}^{[i]}(x)}{\mathrm{d}x}-\gamma\left(\tau_{L}^{[i]}(x)-\tau_{R}^{[i]}(x)\right),$
(24b)

with boundary conditions (i) $\tau_{R,L}^{[1]}(0)=\tau_{R,L}^{[2]}(\ell)=0$,
and (ii) $\tau_{R,L}^{[1]}(0)=0$ and
$\partial_{x}\tau_{R,L}^{[2]}(x)|_{x=\ell}=0$, for each system configuration.
The solutions for the mean first-passage time have the form

$\tau_{R,L}^{[i]}(x)=\tilde{\mathcal{A}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{A}}^{[i]}x}+\tilde{\mathcal{B}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{B}}^{[i]}x}+\tilde{\mathcal{C}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{C}}^{[i]}x}+\tilde{\mathcal{D}}_{R,L}^{[i]}+\frac{x}{f+U^{\prime[i]}}~{},$
(25)

where, compared to the general solution for the probability densities
$P_{R,L}^{[i]}(x)$ in Eq. (4), an additional term that is linear in $x$ arises
from the particular solution to the nonhomogeneous Eq. (24), see Appendix C.1.
Again, as for the probability densities $P_{R,L}^{[i]}(x)$ in Sec. III, we fix
the 16 coefficients
$\tilde{\mathcal{A}}_{R}^{[1]},\tilde{\mathcal{A}}_{L}^{[1]},\tilde{\mathcal{A}}_{R}^{[2]},\dots,\tilde{\mathcal{D}}_{L}^{[2]}$
by substituting each linearly independent term in Eq. (25) into Eq. (24),
before applying boundary conditions and continuity conditions, see Appendix
C.1.

For configuration (i), the presence of two absorbing boundaries allows us to
also calculate the splitting probabilities $\Pi_{R,L}(x)$ for the system. The
splitting probabilities are the probabilities of a particle being absorbed at
the left-hand boundary $x=0$ (before being absorbed at the right-hand boundary
$x=\ell$) given it was initialised as a right mover $\Pi_{R}(x)$ or as a left
mover $\Pi_{L}(x)$ at position $x\in[0,\ell]$. The splitting probabilities at
the opposite boundary $x=\ell$ are readily obtained from $1-\Pi_{R,L}(x)$ and
their discussion is therefore omitted. Similarly to the mean first-passage
times $\tau_{R,L}(x)$, Eq. (25), the splitting probabilities obey the backward
equations [70]

$\displaystyle 0$
$\displaystyle=D\frac{\mathrm{d}^{2}\Pi^{[i]}_{R}(x)}{\mathrm{d}x^{2}}+\left(v-f-U^{\prime[i]}\right)\frac{\mathrm{d}\Pi^{[i]}_{R}(x)}{\mathrm{d}x}-\gamma\left(\Pi^{[i]}_{R}(x)-\Pi^{[i]}_{L}(x)\right),$
(26a) $\displaystyle 0$
$\displaystyle=D\frac{\mathrm{d}^{2}\Pi^{[i]}_{L}(x)}{\mathrm{d}x^{2}}+\left(-v-f-U^{\prime[i]}\right)\frac{\mathrm{d}\Pi^{[i]}_{L}(x)}{\mathrm{d}x}-\gamma\left(\Pi^{[i]}_{L}(x)-\Pi^{[i]}_{R}(x)\right),$
(26b)

which are homogeneous, meaning the solutions $\Pi^{[i]}_{R,L}(x)$ to Eq. (26)
can be obtained in a similar manner to that of the homogeneous Eq. (3), i.e

$\Pi_{R,L}^{[i]}(x)=\check{\mathcal{A}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{A}}^{[i]}x}+\check{\mathcal{B}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{B}}^{[i]}x}+\check{\mathcal{C}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{C}}^{[i]}x}+\check{\mathcal{D}}_{R,L}^{[i]},$
(27)

where expressions for the 16 coefficients
$\check{\mathcal{A}}_{R}^{[1]},\check{\mathcal{A}}_{L}^{[1]},\check{\mathcal{A}}_{R}^{[2]},\dots,\check{\mathcal{D}}_{L}^{[2]}$
are found by applying the boundary conditions $\Pi_{R,L}^{[1]}(0)=1$ and
$\Pi_{R,L}^{[2]}(\ell)=0$, as well as analogous continuity conditions to that
of the mean first-passage times $\tau_{R,L}^{[i]}(x)$, see Appendix C.2.

(a)  (b)  (c)

Figure 16: Comparison between simulations (markers) and theoretical results
(lines) for mean first-passage times $\tau_{R/L}(x)$, Eq. (25), in the case of
(a) absorbing boundaries at $x=0$ and $x=\ell$, and (b) an absorbing boundary
at $x=0$ and a reflecting boundary at $x=\ell$, and for (c) splitting
probabilities $\Pi_{R/L}(x)$, Eq. (26), for initialisation of an RnT particle
as a right/left mover. As in Fig. 4, simulations were performed by numerically
integrating the Langevin equation (2) in timesteps of $\mathrm{d}t=10^{-5}$.
The simulation data were obtained from the average time it takes the particle
to escape the interval, in the case of (a) and (b), and the proportion of
times it escapes through $x=0$, in the case of (c), for $10^{5}$ realisations
at each $x/\ell=0,0.01,\dots,1$. The vertical dashed lines indicate the
position of the ratchet apex, $x=a$. The theoretical results, Eqs. (25) and
(27), are in good agreement with simulations.

(a)  (b)  (c)

Figure 17: Mean first-passage times $\tau(x)$, Eq. (25), and corresponding
splitting probabilities $\Pi(x)$ (insets), Eq. (27), for varying (a) the
diffusion constant $D$, (b) the height of the ratchet $h$, and (c) the
position of the ratchet peak $a$, in the case of absorbing boundaries at $x=0$
and $x=\ell$. In (a) and (b), vertical dashed lines indicate the position of
the ratchet apex, $x=a$. In (c), the apexes are indicated by star data points
for each curve.

In Fig. 16(a), we plot the mean first-passage times $\tau_{R,L}(x)$, Eq. (25),
using our default parameter values, Sec. II, for absorbing boundaries at $x=0$
and $x=\ell$. Both $\tau_{R}(x)$ and $\tau_{L}(x)$ are skewed to the right
compared to a symmetric distribution, which is the case for a Brownian
particle in free space, i.e. the maximum mean first-passage times both occur
for $x>\ell/2$, due to the asymmetry $a>\ell/2$ of the system. This asymmetry
becomes more pronounced as the distance $|a-\ell/2|$ from the symmetric
potential is increased, see Fig. 17(c). The ratchet breaks the symmetry in the
mean first-passage times $\tau_{R,L}(x)$ of an RnT particle in the absence of
a potential, which satisfies $\tau_{R}(x)=\tau_{L}(\ell-x)$ [29], but is
restored upon taking $h\rightarrow 0$, Fig. 17(b). As a result of $a>\ell/2$,
a particle initialised on the slope $U^{\prime[1]}$, i.e. at $x\in[0,a)$,
experiences an average force to the left, assuming $v-f<U^{\prime[1]}$, and
thus has a higher chance to escape through the left-hand boundary $x=0$ than
for the free case. This is seen in the splitting probabilities $\Pi(x)$
plotted in Fig. 16(c), where an equal chance of escaping through either
boundary, i.e. $\Pi(x)=0.5$, occurs at $x=x_{\text{eq}}\approx 3\ell/4$. For
our default parameters, Sec. II, this point $x_{\text{eq}}$ also approximately
coincides with the point where the mean first-passage times for right movers
and left movers are the same, i.e.
$\tau_{R}(x_{\text{eq}})\approx\tau_{L}(x_{\text{eq}})$, Fig. 16(a). As $D$ is
increased, the effect of the ratchet on the mean first-passage times
$\tau_{R,L}(x)$ is diminished, resulting in an average time to exit the
interval that is symmetric about $x=\ell/2$, Fig. 17(a). Similarly, the large
diffusion limit $D\to\infty$ results in the familiar form $\Pi(x)=1-x/\ell$
for the splitting probability, see inset of Fig. 17(a).

The bounded interval also allows us to explore the first-passage properties
for the case $h<0$, which is no longer degenerate, as in Secs. II-VI, since
the boundaries break translational symmetry. The resulting inverted potential
for $h<0$ has the character of a confining potential well, rather than a
potential barrier, similarly to the potential $U(x)\sim|x|$ considered in
Refs. [18, 71]. However, in the present case, our framework allows us to
explore a more general asymmetric variation of this piecewise-linear potential
well. As seen in Fig. 17(b), $h<0$ results in an overall increase in the mean
first-passage time $\tau(x)$, as well as concave distributions in the region
$a\leq x\leq\ell$ for both $\tau(x)$ and the splitting probability $\Pi(x)$,
compared to the convex curves that occur in this region when $h>0$ due to the
favourable gradient towards the right-hand boundary.

For configuration (ii), where the absorbing boundary at $x=\ell$ is replaced
with a reflecting boundary, the mean first-passage time of a right mover is
trivially greater than that of a left mover for any initial position due to
the initial self-propulsion of a right mover always being directed away from
the only available exit to the interval, Fig. 16(b). This is also reflected in
the splitting probabilities $\Pi_{R,L}(x)$ in Fig. 16(c), where the
probability for the particle to exit at the left-hand boundary at $x=0$ is
always greater for an initial left mover than an initial right mover.

Finally, for completeness, in Appendix C.3 we demonstrate how to derive the
“conditional splitting probabilities” $\pi_{X|Y}(x_{0})$ for a particle
initialised in state $Y\in\\{R,L\\}$ at $x=x_{0}$ to leave through the left-
hand boundary at $x=0$ in the self-propulsion state $X\in\\{R,L\\}$. This
generalises what was first derived in Ref. [72] to incorporate piecewise-
linear potentials $U(x)$, Eq. (1). In the free case [72], conditional
splitting probabilities allow for the study of particles that exit an interval
via diffusive fluctuations even when the particle’s self-propulsion favours
escape at the opposite boundary, e.g. when a right mover exits through the
left-hand boundary at $x=0$. The derivation of the conditional splitting
probabilities here can be used to study the combined role that diffusion and a
potential play in this phenomenon.

##  VIII Conclusion

We have studied in detail the motion of run-and-tumble particles in a
piecewise-linear “ratchet” potential $U(x)$, Eq. (1), that are also subject to
an external counterforce $f$ for the purpose of extracting useful work. We
derived the stationary probability densities $P_{R,L}(x)$, Eq. (4), in Sec.
III and Appendix A for both right-moving and left-moving particle species,
Fig. 3(a), and confirmed the numerically simulated time-dependent densities
converge to these expressions as $t\rightarrow\infty$, Fig. 4.

From the densities $P_{R,L}(x)$, we calculated the corresponding steady-state
currents $J_{R}(x)$, $J_{L}(x)$, and $J=J_{R}(x)+J_{L}(x)$, Eq. (8), in Sec.
IV and analysed how they depend on the system’s parameters. We found the
current $J$ peaks at a finite value of the ratchet potential height $h$ and
decays to zero as $h\to\infty$, Fig. 8. The current $J$ displays similar
nonmonotonic dependencies on the magnitude of the particle’s self-propulsion
speed $v$ and the translational diffusion $D$. Depending on the strength of
the diffusion $D$, the position of the apex $a$ resulting in maximum current
$J$ occurs between $a=\ell-h/(v+f)$ for $D=0$ and $a\rightarrow\ell^{-}$ for
large $D$, Fig. 7. As $D\rightarrow 0$, the current $J$ either remains finite
or vanishes depending on whether the particle is confined, Fig. 9, i.e.
whether $v-f<h/a$ and $v+f<h/(\ell-a)$, representing confinement conditions
for right movers and left movers respectively. Simple closed-form expressions
were obtained for the $D=0$ current in both the unconfined, Eq. (46), and
confined, Eq. (48), cases in Appendix B. The currents for each particle
species, $J_{R}(x)$ and $J_{L}(x)$, are greater in magnitude close to the
potential minimum at $x=0$ due to particles that tumble before crossing the
potential barrier, see Fig. 3(b). This phenomenon is still present even when
particles are confined because of weaker “effective” potentials that particles
experience as a result of their self-propulsion, Fig. 5. While many ratchet
models exhibit current reversals [73], where particles preferentially flow
against the steeper slope of the potential, we do not observe any such
phenomenon in the present system. This is in agreement with the findings of
Ref. [58], where there is no current reversal for overdamped active particles
moving in a piecewise-linear potential, but there is for underdamped active
particles. Hence, introducing inertia into the present system could result in
a current reversal and thus allow power extraction from a “negative” load,
$f<0$, i.e. an external force applied in the opposite direction to that
considered here, which could be explored in future work.

In Sec. V, we derived the steady-state entropy production rate
$\dot{S}_{\mathrm{int}}$, Eq. (21), and entropy production densities
$\dot{s}_{R}(x)$, $\dot{s}_{L}(x)$, and $\dot{s}_{R\leftrightarrow L}(x)$,
Eqs. (15) and (16), for each particle species. The total entropy production
density
$\dot{s}_{\mathrm{int}}(x)=\dot{s}_{R}(x)+\dot{s}_{L}(x)+\dot{s}_{R\leftrightarrow
L}(x)$ is greatest at the apex $x=a$ of the ratchet where the mean local
velocity of particles is greatest, Fig. 10. The steady-state entropy
production $\dot{S}_{\mathrm{int}}$ was found to decrease monotonically with
the height $h$ of the potential, Fig. 11. Remarkably, the entropy production
$\dot{S}_{\mathrm{int}}$ can have a nonmonotonic dependence on $D$ and, in the
limit $D\rightarrow 0$, remains finite when the particle is confined due to
the resulting scaling of the currents for each particle species, Fig. 12. We
would expect to see similar behaviour for the entropy production of run-and-
tumble particles in confining potentials of the form $U_{p}(x)\sim|x|^{p}$ for
$p=1$, studied in Ref. [18] for the case $D=0$. Therefore, studying the
entropy production of run-and-tumble particles subject to potentials of the
form $U_{p}(x)\sim|x|^{p}$ for $D>0$ would be an interesting avenue for
further research. It would also be interesting to consider smooth ratchet
potentials, where particles can become confined to a finite region rather than
a single point, to verify whether entropy production diverges in the confined
case as $D\rightarrow 0$. Furthermore, throughout this paper we have
calculated average values for our observables of interest. A study of higher-
order moments, such as fluctuations of the entropy production, would be
interesting to consider for future work.

The system studied in this work can be interpreted as an autonomous engine
extracting work $W$ from a run-and-tumble particle. For such an “active
engine” we studied the extractable power $\dot{W}$, Eq. (23), and the
thermodynamic efficiency $\eta$ in Sec. VI. Poor efficiencies $\eta<1\%$ are
observed in the case where the particle is confined by the potential $U(x)$,
Eq. (1), and therefore able to generate a current $J$ only via diffusive
fluctuations, Fig. 13. However, efficiencies $\eta$ arbitrarily close to
$100\%$ are possible for $\gamma\rightarrow 0$ and $D\rightarrow 0$ in the
case where right movers are unconfined, $v-f>U^{\prime[1]}$, but left movers
are confined, $v+f<|U^{\prime[2]}|$, as this prevents left movers from
dissipating wasted energy (at least when particles are modelled as “dry”
active matter). It would be interesting to calculate the maximum efficiency
$\eta$ of this system in the case of “wet” active matter where momentum is
conserved through hydrodynamic interactions.

Finally, in Sec. VII and Appendix C, we derived the mean first-passage times
$\tau_{R,L}(x)$, Eq. (25), and splitting probabilities $\Pi_{R,L}(x)$, Eq.
(27), for this system under different boundary conditions and explored how
they depend on the system’s parameters, Figs. 16 and 17.

###### Acknowledgements.

We are grateful to Gunnar Pruessner, Thibault Bertrand, Ziluo Zhang, Jacob
Knight, Luca Cocconi, Henry Alston, and Sinead O’Brien for useful discussions.
C.R. acknowledges support from the Engineering and Physical Sciences Research
Council (Grant No. 2478322). Z.Z. acknowledges support from the Department of
Mathematics, Imperial College London. C.R. and Z.Z. contributed equally to
this work.

##  Appendix A Derivation of steady-state probability densities
$P_{R,L}^{[i]}(x)$

To solve the coupled Fokker-Planck equations, Eq. (3), for the steady-state
probability densities $P_{R,L}^{[i]}(x)$, we rewrite Eq. (3) as a four-
dimensional first-order ODE system for both $i=1$ and $i=2$. Introducing
$\eta^{[i]}_{R,L}(x)\equiv P^{\prime[i]}_{R,L}(x)$, the steady-state Fokker-
Planck equations, i.e. Eq. (3) with $\partial_{t}P_{R,L}^{[i]}=0$, can be
rewritten as

$\mathbf{y}^{\prime}(x)=\mathsf{A}\mathbf{y}(x),$ (28)

where $\mathbf{y}^{\prime}$ is the derivative of $\mathbf{y}$ with respect to
$x$, and we have defined

$\mathbf{y}(x)=\begin{pmatrix}P_{R}^{[i]}(x)\\\ \eta_{R}^{[i]}(x)\\\
P_{L}^{[i]}(x)\\\
\eta_{L}^{[i]}(x)\end{pmatrix}\quad\text{and}\quad\mathsf{A}=\begin{pmatrix}0&1&0&0\\\
\frac{\gamma}{D}&\frac{v-f-U^{\prime[i]}}{D}&-\frac{\gamma}{D}&0\\\ 0&0&0&1\\\
-\frac{\gamma}{D}&0&\frac{\gamma}{D}&\frac{-v-f-U^{\prime[i]}}{D}\end{pmatrix}.$
(29)

As Eq. (28) is linear and homogeneous for both $i=1$ and $i=2$, we make the
ansatz $P_{R,L}^{[i]}(x)=\mathcal{Z}_{R,L}^{[i]}\exp(\lambda^{[i]}x)$, where
the $\lambda^{[i]}$ are the eigenvalues of $\mathsf{A}$. After substituting
this ansatz into Eq. (28), the eigenvalues $\lambda^{[i]}$ are found to
satisfy a quartic characteristic equation (arising from two coupled quadratic
equations),

$D^{2}(\lambda^{[i]})^{4}+(\lambda^{[i]})^{3}\left(2Df+2DU^{\prime[i]}\right)+(\lambda^{[i]})^{2}\left(-2\gamma
D+f^{2}+2fU^{\prime[i]}+\left(U^{\prime[i]}\right)^{2}-v^{2}\right)-\lambda^{[i]}\left(2\gamma
f+2\gamma U^{\prime[i]}\right)=0.$ (30)

The solutions $\lambda^{[i]}$ to Eq. (30) are too long to display conveniently
as equations. However, one of the solutions to Eq. (30) is $\lambda^{[i]}=0$
for both $i\in\\{1,2\\}$, and so the general solution to the matrix
differential equation (28) is

$P_{R,L}^{[i]}(x)=\mathcal{A}_{R,L}^{[i]}e^{\lambda_{\mathcal{A}}^{[i]}x}+\mathcal{B}_{R,L}^{[i]}e^{\lambda_{\mathcal{B}}^{[i]}x}+\mathcal{C}_{R,L}^{[i]}e^{\lambda_{\mathcal{C}}^{[i]}x}+\mathcal{D}_{R,L}^{[i]},$
(31)

where
$\lambda_{\mathcal{A}}^{[i]},\lambda_{\mathcal{B}}^{[i]},\lambda_{\mathcal{C}}^{[i]}$
are the other three nonzero solutions (for a given $[i]$) to the quartic
equation (30).

It remains to calculate the 16 coefficients
$\mathcal{A}_{R}^{[1]},\mathcal{A}_{L}^{[1]},\mathcal{A}_{R}^{[2]},\dots,\mathcal{D}_{L}^{[2]}$
in Eq. (31). First, the ratios of the coefficients
$\mathcal{A}_{R}^{[i]}/\mathcal{A}_{L}^{[i]}$, representing half of the
degrees of freedom, are fixed from substituting Eq. (31) into Eq. (28) and
requiring the resulting prefactor of each linearly independent
$\exp(\lambda^{[i]}x)$ term to vanish. This results in

$\frac{\mathcal{Z}_{R}^{[i]}}{\mathcal{Z}_{L}^{[i]}}=\frac{\gamma}{\gamma+\left(v-f-U^{\prime[i]}\right)\lambda_{\mathcal{Z}}^{[i]}-D(\lambda_{\mathcal{Z}}^{[i]})^{2}},\quad\text{and}\quad\mathcal{D}_{R}^{[i]}=\mathcal{D}_{L}^{[i]},$
(32)

where $\mathcal{Z}\in\\{\mathcal{A},\mathcal{B},\mathcal{C}$}. The remaining
eight degrees of freedom are fixed through normalisation as well as continuity
of the probability densities $P_{R,L}^{[i]}(x)$ and currents
$J_{R,L}^{[i]}(x)$, Eq. (5), for each species across $x=0$ and $x=a$.
Specifically, the continuity conditions are

$\displaystyle P_{R,L}^{[1]}(0)$ $\displaystyle=P_{R,L}^{[2]}(\ell),$ (33a)
$\displaystyle J_{R,L}^{[1]}(0)$ $\displaystyle=J_{R,L}^{[2]}(\ell),$ (33b)
$\displaystyle P_{R,L}^{[1]}(a)$ $\displaystyle=P_{R,L}^{[2]}(a),$ (33c)
$\displaystyle J_{R,L}^{[1]}(a)$ $\displaystyle=J_{R,L}^{[2]}(a).$ (33d)

Finally, we also have the normalisation condition

$\int_{0}^{a}\mathrm{d}x\left(P_{R}^{[1]}(x)+P_{L}^{[1]}(x)\right)+\int_{a}^{\ell}\mathrm{d}x\left(P_{R}^{[2]}(x)+P_{L}^{[2]}(x)\right)=1.$
(34)

Only 15 of the resulting 16 equations from Eqs. (32) and (33) are linearly
independent. After removing any one of these equations, the steady-state
densities $P_{R,L}^{[i]}(x)$ for RnT particles moving in a piecewise-linear
ratchet potential $U(x)$, Eq. (1), can be obtained in closed form by solving
the remaining Eqs. (32), (33) and (34) for the coefficients
$\mathcal{A}_{R}^{[1]},\mathcal{A}_{L}^{[1]},\mathcal{A}_{R}^{[2]},\dots,\mathcal{D}_{L}^{[2]}$.

##  Appendix B Derivation of $D=0$ steady-state probability densities
$p_{R,L}^{[i]}(x)$ and currents $j_{R,L}^{[i]}(x)$

Here, we derive the steady-state probability densities $p_{R,L}^{[i]}(x)$ and
currents $j_{R,L}^{[i]}(x)$ for $D=0$. We set $D=0$ in Eq. (3) so that the
coupled Fokker-Planck equations in the absence of diffusion become

$\displaystyle\frac{\partial p^{[i]}_{R}(x,t)}{\partial t}$
$\displaystyle=-\left(v-f-U^{\prime[i]}\right)\frac{\partial
p^{[i]}_{R}(x,t)}{\partial
x}-\gamma\left(p^{[i]}_{R}(x,t)-p^{[i]}_{L}(x,t)\right),$ (35a)
$\displaystyle\frac{\partial p^{[i]}_{L}(x,t)}{\partial t}$
$\displaystyle=-\left(-v-f-U^{\prime[i]}\right)\frac{\partial
p^{[i]}_{L}(x,t)}{\partial
x}-\gamma\left(p^{[i]}_{L}(x,t)-p^{[i]}_{R}(x,t)\right).$ (35b)

The currents for right movers and left movers then become, respectively,

$\displaystyle j_{R}^{[i]}(x,t)$
$\displaystyle=\left(v-f-U^{\prime[i]}\right)p^{[i]}_{R}(x,t),$ (36a)
$\displaystyle j_{L}^{[i]}(x,t)$
$\displaystyle=\left(-v-f-U^{\prime[i]}\right)p^{[i]}_{L}(x,t).$ (36b)

To solve the coupled Fokker-Planck equations (35) in the steady state,
$\partial_{t}p_{R,L}^{[i]}=0$, we again rewrite them in a matrix form as a
two-dimensional system of first-order ODEs for both $i=1$ and $i=2$, i.e.

$\hat{\mathbf{y}}^{\prime}(x)=\hat{\mathsf{A}}\hat{\mathbf{y}}(x),$ (37)

where

$\hat{\mathbf{y}}(x)=\begin{pmatrix}p_{R}^{[i]}(x)\\\
p_{L}^{[i]}(x)\end{pmatrix}\quad\text{and}\quad\hat{\mathsf{A}}=\begin{pmatrix}-\frac{\gamma}{v-f-U^{\prime[i]}(x)}&\frac{\gamma}{v-f-U^{\prime[i]}(x)}\\\
\frac{\gamma}{-v-f-U^{\prime[i]}(x)}&-\frac{\gamma}{-v-f-U^{\prime[i]}(x)}\end{pmatrix}.$
(38)

As Eq. (37) is homogenous, we again make the ansatz
$p_{R,L}^{[i]}(x)=\hat{\mathcal{Z}}_{R,L}^{[i]}\exp(\hat{\lambda}^{[i]}x)$,
where $\hat{\lambda}^{[i]}$ are the eigenvalues of $\hat{\mathsf{A}}$. The two
eigenvalues are found to be

$\hat{\lambda}_{\mathcal{A}}^{[i]}=\frac{2\gamma~{}(f+U^{\prime[i]})}{(-v+f+U^{\prime[i]})(v+f+U^{\prime[i]})}\quad\text{and}\quad\hat{\lambda}_{\mathcal{B}}^{[i]}=0.$
(39)

The general solutions to the matrix ODE (37) are then

$\displaystyle p_{R,L}^{[1]}(x)$
$\displaystyle=\hat{\mathcal{A}}_{R,L}^{[1]}e^{\hat{\lambda}_{\mathcal{A}}^{[1]}x}+\hat{\mathcal{B}}_{R,L}^{[1]}+\hat{\mathcal{C}}_{R,L}\delta(x),$
(40a) $\displaystyle p_{R,L}^{[2]}(x)$
$\displaystyle=\hat{\mathcal{A}}_{R,L}^{[2]}e^{\hat{\lambda}_{\mathcal{A}}^{[2]}x}+\hat{\mathcal{B}}_{R,L}^{[2]},$
(40b)

where the $\delta(x)$ term is due to the possibility of particles becoming
trapped at $x=0$ in the absence of diffusion. There are 10 coefficients
$\hat{\mathcal{A}}_{R}^{[1]},\hat{\mathcal{A}}_{L}^{[1]},\hat{\mathcal{A}}_{R}^{[2]},\dots,\hat{\mathcal{B}}_{L}^{[2]},\hat{\mathcal{C}}_{R},\hat{\mathcal{C}}_{L}$
in Eq. (40), but only 9 of these need to be fixed at any given time since
$\hat{\mathcal{C}}_{R}$ and $\hat{\mathcal{C}}_{L}$ are both nonzero only in
the case where the particle is completely confined, i.e. $v-f<U^{\prime[1]}$
and $v+f<|U^{\prime[2]}|$. In this case, the solutions are trivially given by
$p_{R,L}(x)=\delta(x)/2$. Therefore, to fix the 9 coefficients that are
nonzero, we first substitute Eq. (40) into the Fokker-Planck equation (35),
and require the resulting prefactor of each linearly independent
$\exp(\hat{\lambda}^{[i]}x)$ to vanish, resulting in

$\frac{\hat{\mathcal{A}}_{R}^{[i]}}{\hat{\mathcal{A}}_{L}^{[i]}}=\frac{\gamma}{\gamma+(v-f-U^{\prime[i]}(x))\hat{\lambda}_{\mathcal{A}}^{[i]}}\quad\text{and}\quad\hat{\mathcal{B}}_{R}^{[i]}=\hat{\mathcal{B}}_{L}^{[i]},$
(41)

and leaving 5 degrees of freedom to fix.

Continuity in the densities $p_{R,L}^{[i]}(x)$ is no longer a viable condition
to fix the degrees of freedom since the absence of diffusion ceases to smooth
out the solutions to Eq. (37), resulting in the densities becoming
discontinuous at $x=0$ and $x=a$. The form of the solutions depends on the
relations between the self-propulsion $v$ and the slopes of the potential,
$U^{\prime[1]}=h/a$ and $U^{\prime[2]}=-h/(\ell-a)$, in particular whether or
not the particle is confined. For instance, the particle could climb over both
slopes of the potential, i.e. $v-f>U^{\prime[1]}$ and $v+f>|U^{\prime[2]}|$,
only one slope, $v-f>U^{\prime[1]}$ or $v+f>|U^{\prime[2]}|$, or be completely
confined, $v-f<U^{\prime[1]}$ and $v+f<|U^{\prime[2]}|$. At $x=0$, if the
particle is confined by the barrier to the left, $v+f<|U^{\prime[2]}|$, then
there is a $\delta(x)$ contribution to the left-moving density
$p_{L}^{[1]}(x)$ with prefactor $\hat{\mathcal{C}}_{L}$. A tumbling event from
a left mover to a right mover thus results in an instantaneous contribution
$\gamma\hat{\mathcal{C}}_{L}$ to the right-moving current $j^{[1]}_{R}(x)$ at
$x=0$. Similarly, if the particle were instead confined to the right,
$v-f<U^{\prime[1]}$, then there would be a $\delta(x)$ contribution to the
right-moving density $p_{R}^{[1]}(x)$ with prefactor $\hat{\mathcal{C}}_{R}$,
and therefore a contribution $-\gamma\hat{\mathcal{C}}_{R}$ to the left-moving
current $j^{[1]}_{L}(x)$ at $x=0$. Hence, in the case where the particle is
confined only to the left, $v+f<|U^{\prime[2]}|$ and $v-f>U^{\prime[1]}$, the
continuity conditions are

$\displaystyle j^{[1]}_{R}(0)$
$\displaystyle=j^{[2]}_{R}(\ell)+\gamma\hat{\mathcal{C}}_{L},$ (42a)
$\displaystyle j_{R}^{[1]}(a)$ $\displaystyle=j_{R}^{[2]}(a),$ (42b)
$\displaystyle p_{L}^{[1]}(a)$ $\displaystyle=0,$ (42c) $\displaystyle
p_{L}^{[2]}(a)$ $\displaystyle=0,$ (42d)

where, since the particle cannot cross the left barrier, there is no
contribution to the left-moving probability density $p_{L}(x)$ at $x=a$.
Similarly, in the case where the particle is instead confined only to the
right, $v+f>|U^{\prime[2]}|$ and $v-f<U^{\prime[1]}$, the continuity
conditions are

$\displaystyle j^{[1]}_{L}(0)$
$\displaystyle=j^{[2]}_{L}(\ell)-\gamma\hat{\mathcal{C}}_{R},$ (43a)
$\displaystyle j_{L}^{[1]}(a)$ $\displaystyle=j_{L}^{[2]}(a),$ (43b)
$\displaystyle p_{R}^{[1]}(a)$ $\displaystyle=0,$ (43c) $\displaystyle
p_{R}^{[2]}(a)$ $\displaystyle=0.$ (43d)

Finally, if the particle can overcome both barriers, $v-f>U^{\prime[1]}$ and
$v+f>|U^{\prime[2]}|$, then the continuity conditions are

$\displaystyle j^{[1]}_{R,L}(0)$ $\displaystyle=j^{[2]}_{R,L}(\ell),$ (44a)
$\displaystyle j_{R,L}^{[1]}(a)$ $\displaystyle=j_{R,L}^{[2]}(a).$ (44b)

The remaining degree of freedom is then fixed through the normalisation
condition,

$\int_{0}^{a}\mathrm{d}x\left(p_{R}^{[1]}(x)+p_{L}^{[1]}(x)\right)+\int_{a}^{\ell}\mathrm{d}x\left(p_{R}^{[2]}(x)+p_{L}^{[2]}(x)\right)=1.$
(45)

The overall current $j=j_{R}(x)+j_{L}(x)$ has a closed-form expression that is
compact enough to be written down. In the case where the particle is
unconfined and therefore able to cross both barriers, $v+f>|U^{\prime[2]}|$
and $v-f>U^{\prime[1]}$, the current is given by

$j_{\leftrightarrow}=\frac{2\gamma(af+h)^{2}(af-f\ell+h)^{2}\left(e^{\kappa+\delta\ell}-e^{\delta
a}\right)}{\theta(e^{\delta
a}-e^{\kappa+\delta\ell})+h^{2}\ell^{2}v^{2}(e^{\kappa}-1)(e^{\delta
a}-e^{\delta\ell})},$ (46)

where

$\displaystyle\delta$
$\displaystyle=\frac{2\gamma(a-\ell)(af-f\ell+h)}{(af-f\ell+h)^{2}-v^{2}(a-\ell)^{2}},$
(47a) $\displaystyle\kappa$ $\displaystyle=\frac{2\gamma
a^{2}(af+h)}{(af+h)^{2}-a^{2}v^{2}},$ (47b) $\displaystyle\theta$
$\displaystyle=2\gamma\ell(af+h)(af-f\ell+h)(a(af+2h)-\ell(af+h)).$ (47c)

However, when the particle is confined only to the left, $v+f<|U^{\prime[2]}|$
and $v-f>U^{\prime[1]}$, the current is given by

$j_{\not\leftarrow}=\frac{2\gamma(af+h)^{2}(af-f\ell+h)^{2}}{\tilde{\theta}_{1}e^{-\kappa}+\tilde{\theta}_{2}e^{\delta(\ell-a)}+\tilde{\theta}_{3}-\theta},$
(48)

where

$\displaystyle\tilde{\theta}_{1}$
$\displaystyle=(af-f\ell+h)^{2}(a(f+v)+h)^{2},$ (49a)
$\displaystyle\tilde{\theta}_{2}$
$\displaystyle=-(af+h)^{2}(h+(a-\ell)(f+v))^{2},$ (49b)
$\displaystyle\tilde{\theta}_{3}$ $\displaystyle=h\ell^{2}v^{2}(2af+h)-2h\ell
v(af+h)(af+h-f\ell)-2h\ell av^{2}(af+h).$ (49c)

Finally, the overall current $j_{\not\rightarrow}$ in the case where the
particle is confined only to the right, $v+f>|U^{\prime[2]}|$ and
$v-f<U^{\prime[1]}$, can be found by inverting the overall sign in Eq. (48)
and replacing $a\rightarrow\ell-a$ in Eqs. (48) and (49) above.

##  Appendix C Derivation of first-passage properties

###  C.1 Mean first-passage times $\tau_{R,L}^{[i]}(x)$

As the coupled ODEs for the mean first-passage time $\tau_{R,L}^{[i]}(x)$, Eq.
(24), are similar to the coupled Fokker-Planck equations (3) for the steady-
state probability density $P_{R,L}^{[i]}(x)$, the procedure for solving Eq.
(24) follows similarly to solving Eq. (3) in Appendix A. However, Eq. (24) is
nonhomogeneous and so we must also find a particular solution satisfying the
equation. Again, Eq. (24) can be rewritten as a four-dimensional system of
first-order ODEs for both $i=1$ and $i=2$. As in the previous appendices,
introducing $\tilde{\eta}^{[i]}_{R,L}(x)=\tau_{R,L}^{\prime[i]}(x)$ allows Eq.
(24) to be written as

$\tilde{\mathbf{y}}^{\prime}(x)=\tilde{\mathsf{A}}\tilde{\mathbf{y}}(x)+\tilde{\mathbf{b}}$
(50)

where

$\tilde{\mathbf{y}}(x)=\begin{pmatrix}\tau_{R}^{[i]}(x)\\\
\tilde{\eta}_{R}^{[i]}(x)\\\ \tau_{L}^{[i]}(x)\\\
\tilde{\eta}_{L}^{[i]}(x)\end{pmatrix},\quad\tilde{\mathsf{A}}=\begin{pmatrix}0&1&0&0\\\
\frac{\gamma}{D}&\frac{-v+f+U^{\prime[i]}}{D}&-\frac{\gamma}{D}&0\\\
0&0&0&1\\\
-\frac{\gamma}{D}&0&\frac{\gamma}{D}&\frac{v+f+U^{\prime[i]}}{D}\end{pmatrix}\quad\text{and}\quad\tilde{\mathbf{b}}=\begin{pmatrix}-1\\\
0\\\ -1\\\ 0\end{pmatrix}.$ (51)

First, the solution to the homogeneous equation is found by substituting the
ansatz
$\tau_{R,L}^{[i]}(x)=\tilde{\mathcal{Z}}_{R,L}^{[i]}\exp(\tilde{\lambda}^{[i]}x)$
into Eq. (50) to obtain a quartic equation for the eigenvalues
$\tilde{\lambda}^{[i]}$,

$D^{2}(\tilde{\lambda}^{[i]})^{4}-(\tilde{\lambda}^{[i]})^{3}\left(2Df+2DU^{\prime[i]}\right)+(\tilde{\lambda}^{[i]})^{2}\left(-2\gamma
D+f^{2}+2fU^{\prime[i]}+\left(U^{\prime[i]}\right)^{2}-v^{2}\right)+\tilde{\lambda}^{[i]}\left(2\gamma
f+2\gamma U^{\prime[i]}\right)=0,$ (52)

which differs to Eq. (30) only in the sign of the eigenvalues, i.e.
$\lambda^{[i]}\rightarrow-\tilde{\lambda}^{[i]}$. As in Appendix A, one
eigenvalue for each of $i=1$ and $i=2$ vanishes and so the solution to the
homogeneous part of Eq. (50) has the same form as for $P_{R,L}^{[i]}(x)$ in
Eq. (31), i.e.

$\tau_{R,L}^{[i]}\Big{|}_{\text{H}}(x)=\tilde{\mathcal{A}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{A}}^{[i]}x}+\tilde{\mathcal{B}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{B}}^{[i]}x}+\tilde{\mathcal{C}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{C}}^{[i]}x}+\tilde{\mathcal{D}}_{R,L}^{[i]}.$
(53)

Next, it is easily verified that the particular solution satisfies

$\tau_{R,L}^{[i]}\Big{|}_{\text{P}}(x)=\tilde{\mathcal{E}}_{R,L}^{[i]}x+\tilde{\mathcal{F}}_{R,L}^{[i]},$
(54)

and after substituting Eq. (54) into Eq. (50), we obtain

$\displaystyle(v-f-U^{\prime[i]})\tilde{\mathcal{E}}_{R}^{[i]}-\gamma(\tilde{\mathcal{E}}_{R}^{[i]}x+\tilde{\mathcal{F}}_{R}^{[i]}-\tilde{\mathcal{E}}_{L}^{[i]}x-\tilde{\mathcal{F}}_{L}^{[i]})$
$\displaystyle=0,$ (55a)
$\displaystyle(-v-f-U^{\prime[i]})\tilde{\mathcal{E}}_{L}^{[i]}-\gamma({\mathcal{E}}_{L}^{[i]}x+\tilde{\mathcal{F}}_{L}^{[i]}-\tilde{\mathcal{E}}_{R}^{[i]}x-\tilde{\mathcal{F}}_{R}^{[i]})$
$\displaystyle=0.$ (55b)

As Eqs. (55a) and (55b) are valid for all $x\in[0,\ell]$, then we have that

$\tilde{\mathcal{E}}_{R}^{[i]}=\tilde{\mathcal{E}}_{L}^{[i]}$ (56)

and

$\displaystyle(v-f-U^{\prime[i]})\tilde{\mathcal{E}}_{R}^{[i]}-\gamma(\tilde{\mathcal{F}}_{R}^{[i]}-\tilde{\mathcal{F}}_{L}^{[i]})$
$\displaystyle=0,$ (57a)
$\displaystyle(-v-f-U^{\prime[i]})\tilde{\mathcal{E}}_{L}^{[i]}-\gamma({\mathcal{F}}_{L}^{[i]}-\tilde{\mathcal{F}}_{R}^{[i]})$
$\displaystyle=0.$ (57b)

Adding Eqs. (57a) and (57b), then combining with Eq. (56), yields

$\tilde{\mathcal{E}}_{R}^{[i]}=\tilde{\mathcal{E}}_{L}^{[i]}=\frac{1}{f+U^{\prime[i]}}.$
(58)

Absorbing the constant $\tilde{\mathcal{F}}_{R,L}^{[i]}$ into
$\tilde{\mathcal{D}}_{R,L}^{[i]}$, the full solution to Eq. (50) is therefore

$\tau_{R,L}^{[i]}(x)=\tau_{R,L}^{[i]}\Big{|}_{\text{H}}(x)+\tau_{R,L}^{[i]}\Big{|}_{\text{P}}(x)=\tilde{\mathcal{A}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{A}}^{[i]}x}+\tilde{\mathcal{B}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{B}}^{[i]}x}+\tilde{\mathcal{C}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{C}}^{[i]}x}+\tilde{\mathcal{D}}_{R,L}^{[i]}+\frac{x}{f+U^{\prime[i]}}.$
(59)

As for the probability densities $P_{R,L}^{[i]}(x)$ in Appendix A, the ratios
$\tilde{\mathcal{Z}}_{R}^{[i]}/\tilde{\mathcal{Z}}_{L}^{[i]}$, where
$\tilde{\mathcal{Z}}\in\\{\tilde{\mathcal{A}},\tilde{\mathcal{B}},\tilde{\mathcal{C}},\tilde{\mathcal{D}}\\}$,
are fixed by requiring each linearly independent term in Eq. (59) to satisfy
Eq. (50), resulting in

$\frac{\tilde{\mathcal{Z}}_{R}^{[i]}}{\tilde{\mathcal{Z}}_{L}^{[i]}}=\frac{\gamma}{\gamma-\left(v-f-U^{\prime[i]}\right)\tilde{\lambda}_{\mathcal{Z}}^{[i]}-D(\tilde{\lambda}_{\mathcal{Z}}^{[i]})^{2}},\quad\text{and}\quad\tilde{\mathcal{D}}_{R}^{[i]}=\tilde{\mathcal{D}}_{L}^{[i]}.$
(60)

The remaining degrees of freedom are then fixed from the boundary conditions
and continuity conditions,

$\displaystyle\tau_{R,L}^{[1]}(0)$ $\displaystyle=0,$ (61a)
$\displaystyle\tau_{R,L}^{[1]}(a)$ $\displaystyle=\tau_{R,L}^{[2]}(a),$ (61b)
$\displaystyle\frac{\mathrm{d}\tau_{R,L}^{[1]}(x)}{\mathrm{d}x}\Big{|}_{x=a}$
$\displaystyle=\frac{\mathrm{d}\tau_{R,L}^{[2]}(x)}{\mathrm{d}x}\Big{|}_{x=a},$
(61c) and
$\text{(i)}\quad\tau_{R,L}^{[2]}(\ell)=0,\quad\text{or}\quad\text{(ii)}\quad\frac{\mathrm{d}\tau_{R,L}^{[2]}(x)}{\mathrm{d}x}\Big{|}_{x=\ell}=0,$
(61d)

depending on whether the system has (i) an absorbing boundary or (ii) a
reflecting boundary at $x=\ell$ (see, for instance, Ref. [74]).

###  C.2 Splitting probabilities $\Pi_{R,L}^{[i]}(x)$

To derive the splitting probabilities $\Pi_{R,L}^{[i]}(x)$, we define
$\check{\eta}^{[i]}_{R,L}(x)=\Pi_{R,L}^{\prime[i]}(x)$ and
$\check{\mathbf{y}}(x)=(\pi_{R}^{[i]}(x),\check{\eta}_{R}^{[i]}(x),\pi_{L}^{[i]}(x),\check{\eta}_{L}^{[i]}(x))$
such that the governing equations (26) for the splitting probabilities
$\Pi_{R,L}^{[i]}(x)$ can be written as a four-dimensional system of first-
order ODEs,
$\check{\mathbf{y}}^{\prime}(x)=\tilde{\mathsf{A}}\breve{\mathbf{y}}(x)$,
where $\tilde{\mathsf{A}}$ is the same operator acting on the mean first-
passage times $\tau_{R,L}^{[i]}(x)$ above, Eq. (51). Thus, the splitting
probabilities $\Pi_{R,L}^{[i]}(x)$ obey the same (backward) equations as for
that of the mean first-passage times $\tau_{R,L}^{[i]}(x)$, Eqs. (50)-(51),
aside from being homogeneous, i.e. $\tilde{\mathbf{b}}=\mathbf{0}$. Hence, the
splitting probabilities have the same form of general solution as for the
homogeneous part to the mean first-passage times, Eq. (53), but with different
coefficients, i.e.

$\Pi_{R,L}^{[i]}(x)=\check{\mathcal{A}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{A}}^{[i]}x}+\check{\mathcal{B}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{B}}^{[i]}x}+\check{\mathcal{C}}_{R,L}^{[i]}e^{\tilde{\lambda}_{\mathcal{C}}^{[i]}x}+\check{\mathcal{D}}_{R,L}^{[i]},$
(62)

where the eigenvalues $\tilde{\lambda}^{[i]}$ are the same as those obtained
through solving Eq. (52) and the ratios
$\check{\mathcal{Z}}_{R}^{[i]}/\check{\mathcal{Z}}_{L}^{[i]}$, where
$\check{\mathcal{Z}}\in\\{\check{\mathcal{A}},\check{\mathcal{B}},\check{\mathcal{C}},\check{\mathcal{D}}\\}$,
also satisfy equations analogous to that of the mean first-passage times
$\tau_{R,L}^{[i]}(x)$, i.e. Eq. (60). The remaining degrees of freedom in the
general solution for the splitting probabilities $\Pi_{R,L}^{[i]}(x)$, Eq.
(62), are fixed from the boundary conditions and continuity conditions,

$\displaystyle\Pi_{R,L}^{[1]}(0)$ $\displaystyle=1,$ (63a)
$\displaystyle\Pi_{R,L}^{[2]}(\ell)$ $\displaystyle=0,$ (63b)
$\displaystyle\Pi_{R,L}^{[1]}(a)$ $\displaystyle=\Pi_{R,L}^{[2]}(a),$ (63c)
$\displaystyle\frac{\mathrm{d}\Pi_{R,L}^{[1]}(x)}{\mathrm{d}x}\Big{|}_{x=a}$
$\displaystyle=\frac{\mathrm{d}\Pi_{R,L}^{[2]}(x)}{\mathrm{d}x}\Big{|}_{x=a},$
(63d)

recalling that we define $\Pi_{R/L}(x)$ to be the probabilities for a
right/left mover to exit at the left-hand boundary of the system at $x=0$.

###  C.3 Conditional splitting probabilities $\pi_{X|Y}^{[i]}(x)$

The splitting probabilities $\Pi_{R,L}^{[i]}(x)$ calculated above can be
generalised to be conditioned on the particle’s self-propulsion state as it
exits the interval. Following the calculation in Ref. [72], we define
$\pi_{X|Y}(x_{0})$ as the “conditional splitting probability” for a particle
initialised in state $Y\in\\{R,L\\}$ at $x=x_{0}$ to leave through the left-
hand boundary at $x=0$ in the self-propulsion state $X\in\\{R,L\\}$. Hence,
there are four conditional splitting probabilities that exist for each
boundary, obtained from every possible permutation of $X,Y\in\\{R,L\\}$.
Introducing $\breve{\eta}^{[i]}_{X|Y}(x)=\pi_{X|Y}^{\prime[i]}(x)$, the
conditional splitting probabilities satisfy
$\breve{\mathbf{y}}^{\prime}_{R,L}(x)=\tilde{\mathsf{A}}\breve{\mathbf{y}}_{R,L}(x)$
where $\tilde{\mathsf{A}}$ is the same operator, defined in Eq. (51), acting
on the “unconditional” splitting probabilities $\Pi_{R,L}^{[i]}(x)$ and mean
first-passage times $\tau_{R,L}^{[i]}(x)$ above, and
$\breve{\mathbf{y}}_{R,L}(x)=(\pi_{R,L|R}^{[i]}(x),\breve{\eta}_{R,L|R}^{[i]}(x),\pi_{R,L|L}^{[i]}(x),\breve{\eta}_{R,L|L}^{[i]}(x))$.
Hence, the conditional splitting probabilities satisfy two different sets of
coupled ODEs, one for each conditional exit state. As these ODEs are the same
as for that of the unconditional splitting probabilities, Eq. (26), they thus
have the same general solution given in Eq. (62), i.e.

$\pi_{X|Y}^{[i]}(x)=\breve{\mathcal{A}}_{X|Y}^{[i]}e^{\tilde{\lambda}_{\mathcal{A}}^{[i]}x}+\breve{\mathcal{B}}_{X|Y}^{[i]}e^{\tilde{\lambda}_{\mathcal{B}}^{[i]}x}+\breve{\mathcal{C}}_{X|Y}^{[i]}e^{\tilde{\lambda}_{\mathcal{C}}^{[i]}x}+\breve{\mathcal{D}}_{X|Y}^{[i]},$
(64)

where $X,Y\in\\{R,L\\}$ and the eigenvalues $\tilde{\lambda}^{[i]}$ are found
through solving Eq. (52). The coefficients
$\breve{\mathcal{A}}_{X|Y}^{[1]},\breve{\mathcal{A}}_{X|Y}^{[2]},\dots,\breve{\mathcal{D}}_{X|Y}^{[2]}$
are fixed in the same manner as for the mean first-passage times
$\tau_{R,L}^{[i]}(x)$ and splitting probabilities $\Pi_{R,L}^{[i]}(x)$ above,
by requiring each linearly independent term to satisfy the ODEs before
applying boundary conditions and continuity conditions. The boundary
conditions of the ODEs are

$\displaystyle\pi^{[1]}_{R|R}(0)=\pi^{[1]}_{L|L}(0)$ $\displaystyle=1,$ (65a)
$\displaystyle\pi^{[1]}_{R|L}(0)=\pi^{[1]}_{L|R}(0)$ $\displaystyle=0,$ (65b)
$\displaystyle\pi^{[2]}_{R|R}(\ell)=\pi^{[2]}_{L|L}(\ell)$ $\displaystyle=0,$
(65c) $\displaystyle\pi^{[2]}_{R|L}(\ell)=\pi^{[2]}_{L|R}(\ell)$
$\displaystyle=0,$ (65d)

and the continuity conditions are analogous to that of the unconditional
splitting probabilities in Eq. (63), i.e.

$\displaystyle\pi^{[1]}_{R,L|R}(a)$ $\displaystyle=\pi^{[2]}_{R,L|R}(a),$
(66a) $\displaystyle\pi^{[1]}_{R,L|L}(a)$
$\displaystyle=\pi^{[2]}_{R,L|L}(a),$ (66b)
$\displaystyle\frac{\mathrm{d}\pi_{R,L|R}^{[1]}(x)}{\mathrm{d}x}\Big{|}_{x=a}$
$\displaystyle=\frac{\mathrm{d}\pi_{R,L|R}^{[2]}(x)}{\mathrm{d}x}\Big{|}_{x=a},$
(66c)
$\displaystyle\frac{\mathrm{d}\pi_{R,L|L}^{[1]}(x)}{\mathrm{d}x}\Big{|}_{x=a}$
$\displaystyle=\frac{\mathrm{d}\pi_{R,L|L}^{[2]}(x)}{\mathrm{d}x}\Big{|}_{x=a}.$
(66d)

## References

  * Marchetti  _et al._ [2013] M. C. Marchetti, J. F. Joanny, S. Ramaswamy, T. B. Liverpool, J. Prost, M. Rao, and R. A. Simha, Hydrodynamics of soft active matter, Rev. Mod. Phys. 85, 1143 (2013).
  * Tailleur and Cates [2008] J. Tailleur and M. Cates, Statistical mechanics of interacting run-and-tumble bacteria, Phys. Rev. Lett. 100, 218103 (2008).
  * Elgeti  _et al._ [2015] J. Elgeti, R. G. Winkler, and G. Gompper, Physics of microswimmers—single particle motion and collective behavior: a review, Rep. Prog. Phys. 78, 056601 (2015).
  * Gompper  _et al._ [2020] G. Gompper, R. G. Winkler, T. Speck, A. Solon, C. Nardini, F. Peruani, H. Löwen, R. Golestanian, U. B. Kaupp, L. Alvarez, _et al._ , The 2020 motile active matter roadmap, J. Phys. Condens. Matter 32, 193001 (2020).
  * Schnitzer [1993] M. J. Schnitzer, Theory of continuum random walks and application to chemotaxis, Phys. Rev. E 48, 2553 (1993).
  * Fodor  _et al._ [2016] É. Fodor, C. Nardini, M. E. Cates, J. Tailleur, P. Visco, and F. van Wijland, How Far from Equilibrium Is Active Matter?, Phys. Rev. Lett. 117, 038103 (2016).
  * Martin  _et al._ [2021] D. Martin, J. O’Byrne, M. E. Cates, É. Fodor, C. Nardini, J. Tailleur, and F. van Wijland, Statistical mechanics of active Ornstein-Uhlenbeck particles, Phys. Rev. E 103, 032607 (2021).
  * Maggi  _et al._ [2015] C. Maggi, U. M. B. Marconi, N. Gnan, and R. Di Leonardo, Multidimensional stationary probability distribution for interacting active particles, Sci. Rep. 5, 1 (2015).
  * Wagner  _et al._ [2017] C. G. Wagner, M. F. Hagan, and A. Baskaran, Steady-state distributions of ideal active Brownian particles under confinement and forcing, J. Stat. Mech. Theory Exp. 2017, 043203 (2017).
  * Das  _et al._ [2018] S. Das, G. Gompper, and R. G. Winkler, Confined active Brownian particles: theoretical description of propulsion-induced accumulation, New J. Phys. 20, 015001 (2018).
  * Caraglio and Franosch [2022] M. Caraglio and T. Franosch, Analytic solution of an active brownian particle in a harmonic well, Phys. Rev. Lett. 129, 158001 (2022).
  * Tailleur and Cates [2009] J. Tailleur and M. E. Cates, Sedimentation, trapping, and rectification of dilute bacteria, Europhys. Lett. 86, 60002 (2009).
  * Zhen and Pruessner [2022] Z. Zhen and G. Pruessner, Optimal ratchet potentials for run-and-tumble particles, arXiv.2204.04070 (2022).
  * Roberts and Pruessner [2022] C. Roberts and G. Pruessner, Exact solution of a boundary tumbling particle system in one dimension, Phys. Rev. Res. 4, 033234 (2022).
  * Angelani [2017] L. Angelani, Confined run-and-tumble swimmers in one dimension, J. Phys. A Math. Theor. 50, 325601 (2017).
  * Garcia-Millan and Pruessner [2021] R. Garcia-Millan and G. Pruessner, Run-and-tumble motion in a harmonic potential: field theory and entropy production, J. Stat. Mech. Theory Exp. 2021, 063203 (2021).
  * Razin [2020] N. Razin, Entropy production of an active particle in a box, Phys. Rev. E 102, 030103 (2020).
  * Dhar  _et al._ [2019] A. Dhar, A. Kundu, S. N. Majumdar, S. Sabhapandit, and G. Schehr, Run-and-tumble particle in one-dimensional confining potentials: steady-state, relaxation, and first-passage properties, Phys. Rev. E 99, 032132 (2019).
  * Basu  _et al._ [2020] U. Basu, S. N. Majumdar, A. Rosso, S. Sabhapandit, and G. Schehr, Exact stationary state of a run-and-tumble particle with three internal states in a harmonic trap, J. Phys. A Math. Theor. 53, 09LT01 (2020).
  * Frydel [2022a] D. Frydel, Positing the problem of stationary distributions of active particles as third-order differential equation, Phys. Rev. E 106, 024121 (2022a).
  * Ezhilan  _et al._ [2015] B. Ezhilan, R. Alonso-Matilla, and D. Saintillan, On the distribution and swim pressure of run-and-tumble particles in confinement, J. Fluid Mech. 781, R4 (2015).
  * Elgeti and Gompper [2015] J. Elgeti and G. Gompper, Run-and-tumble dynamics of self-propelled particles in confinement, Europhys. Lett. 109, 58003 (2015).
  * Fox [1986] R. F. Fox, Uniform convergence to an effective fokker-planck equation for weakly colored noise, Phys. Rev. A 34, 4525 (1986).
  * Farage  _et al._ [2015] T. F. Farage, P. Krinninger, and J. M. Brader, Effective interactions in active brownian suspensions, Phys. Rev. E 91, 042310 (2015).
  * Marconi  _et al._ [2016] U. M. B. Marconi, N. Gnan, M. Paoluzzi, C. Maggi, and R. Di Leonardo, Velocity distribution in active particles systems, Sci. Rep. 6, 1 (2016).
  * Jung and Hänggi [1987] P. Jung and P. Hänggi, Dynamical systems: a unified colored-noise approximation, Phys. Rev. A 35, 4464 (1987).
  * Marconi and Maggi [2015] U. M. B. Marconi and C. Maggi, Towards a statistical mechanical theory of active fluids, Soft matter 11, 8768 (2015).
  * Derivaux  _et al._ [2022] J.-F. Derivaux, R. L. Jack, and M. E. Cates, Rectification in a mixture of active and passive particles subject to a ratchet potential, J. Stat. Mech. Theory Exp. 2022, 043203 (2022).
  * Malakar  _et al._ [2018] K. Malakar, V. Jemseena, A. Kundu, K. V. Kumar, S. Sabhapandit, S. N. Majumdar, S. Redner, and A. Dhar, Steady state, relaxation and first-passage properties of a run-and-tumble particle in one-dimension, J. Stat. Mech. Theory Exp. 2018, 043215 (2018).
  * Frydel [2022b] D. Frydel, The run-and-tumble particle model with four-states: Exact solution at zero temperature, Phys. Fluids 34, 027111 (2022b).
  * Breoni  _et al._ [2022] D. Breoni, F. J. Schwarzendahl, R. Blossey, and H. Löwen, A one-dimensional three-state run-and-tumble model with a ‘cell cycle’, Eur. Phys. J. E 45, 83 (2022).
  * Doering and Gadoua [1992] C. R. Doering and J. C. Gadoua, Resonant activation over a fluctuating barrier, Phys. Rev. Lett. 69, 2318 (1992).
  * Astumian and Bier [1994] R. D. Astumian and M. Bier, Fluctuation driven ratchets: molecular motors, Phys. Rev. Lett. 72, 1766 (1994).
  * Pavliotis [2005] G. A. Pavliotis, A multiscale approach to Brownian motors, Phys. Lett. A 344, 331 (2005).
  * Galajda  _et al._ [2007] P. Galajda, J. Keymer, P. Chaikin, and R. Austin, A wall of funnels concentrates swimming bacteria, J. Bacteriol. 189, 8704 (2007).
  * Wan  _et al._ [2008] M. B. Wan, C. J. Olson Reichhardt, Z. Nussinov, and C. Reichhardt, Rectification of Swimming Bacteria and Self-Driven Particle Systems by Arrays of Asymmetric Barriers, Phys. Rev. Lett. 101, 018102 (2008).
  * Angelani  _et al._ [2009] L. Angelani, R. Di Leonardo, and G. Ruocco, Self-Starting Micromotors in a Bacterial Bath, Phys. Rev. Lett. 102, 048104 (2009).
  * Di Leonardo  _et al._ [2010] R. Di Leonardo, L. Angelani, D. Dell’Arciprete, G. Ruocco, V. Iebba, S. Schippa, M. P. Conte, F. Mecarini, F. De Angelis, and E. Di Fabrizio, Bacterial ratchet motors, Proc. Natl. Acad. Sci. U.S.A. 107, 9541 (2010).
  * Angelani  _et al._ [2011] L. Angelani, A. Costanzo, and R. Di Leonardo, Active ratchets, Europhys. Lett. 96, 68002 (2011).
  * Reichhardt and Reichhardt [2017] C. J. O. Reichhardt and C. Reichhardt, Ratchet Effects in Active Matter Systems, Annu. Rev. Condens. Matter Phys. 8, 51 (2017).
  * Koumakis  _et al._ [2014] N. Koumakis, C. Maggi, and R. Di Leonardo, Directed transport of active particles over asymmetric energy barriers, Soft matter 10, 5695 (2014).
  * Muhsin and Sahoo [2023] M. Muhsin and M. Sahoo, Inertial active ratchet: Simulation versus theory, Phys. Rev. E 107, 054601 (2023).
  * Jülicher  _et al._ [1997] F. Jülicher, A. Ajdari, and J. Prost, Modeling molecular motors, Rev. Mod. Phys. 69, 1269 (1997).
  * Parrondo  _et al._ [1998] J. M. R. Parrondo, J. M. Blanco, F. J. Cao, and R. Brito, Efficiency of Brownian motors, Europhys. Lett. 43, 248 (1998).
  * Pietzonka  _et al._ [2019] P. Pietzonka, É. Fodor, C. Lohrmann, M. E. Cates, and U. Seifert, Autonomous engines driven by active matter: Energetics and design principles, Phys. Rev. X. 9, 041032 (2019).
  * Sekimoto [1997] K. Sekimoto, Kinetic Characterization of Heat Bath and the Energetics of Thermal Ratchet Models, J. Phys. Soc. Jpn. 66, 1234 (1997).
  * Cocconi  _et al._ [2020] L. Cocconi, R. Garcia-Millan, Z. Zhen, B. Buturca, and G. Pruessner, Entropy production in exactly solvable systems, Entropy 22, 1252 (2020).
  * Kramers [1940] H. A. Kramers, Brownian motion in a field of force and the diffusion model of chemical reactions, Physica 7, 284 (1940).
  * Woillez  _et al._ [2019] E. Woillez, Y. Zhao, Y. Kafri, V. Lecomte, and J. Tailleur, Activated Escape of a Self-Propelled Particle from a Metastable State, Phys. Rev. Lett. 122, 258001 (2019).
  * Angelani  _et al._ [2014] L. Angelani, R. Di Leonardo, and M. Paoluzzi, First-passage time of run-and-tumble particles, Eur. Phys. J. E. 37, 1 (2014).
  * Le Doussal  _et al._ [2019] P. Le Doussal, S. N. Majumdar, and G. Schehr, Noncrossing run-and-tumble particles on a line, Phys. Rev. E 100, 012113 (2019).
  * Angelani [2015] L. Angelani, Run-and-tumble particles, telegrapher’s equation and absorption problems with partially reflecting boundaries, J. Phys. A Math. Theor. 48, 495003 (2015).
  * Bressloff [2022] P. C. Bressloff, Encounter-based model of a run-and-tumble particle, J. Stat. Mech. Theory Exp. 2022, 113206 (2022).
  * Bressloff [2023] P. C. Bressloff, Encounter-based model of a run-and-tumble particle II: absorption at sticky boundaries, J. Stat. Mech. Theory Exp. 2023, 043208 (2023).
  * Semeraro  _et al._ [2023] M. Semeraro, G. Gonnella, E. Lippiello, and A. Sarracino, Diffusion properties of a Brownian ratchet with Coulomb friction, Symmetry 15, 200 (2023).
  * Rizkallah  _et al._ [2023] P. Rizkallah, A. Sarracino, O. Bénichou, and P. Illien, Absolute Negative Mobility of an Active Tracer in a Crowded Environment, Phys. Rev. Lett. 130, 218201 (2023).
  * Bijnens and Maes [2021] B. Bijnens and C. Maes, Pushing run-and-tumble particles through a rugged channel, J. Stat. Mech. Theory Exp. 2021, 033206 (2021).
  * Ai and Li [2017] B.-Q. Ai and F.-G. Li, Transport of underdamped active particles in ratchet potentials, Soft Matter 13, 2536 (2017).
  * Seifert [2005] U. Seifert, Entropy production along a stochastic trajectory and an integral fluctuation theorem, Phys. Rev. Lett. 95, 040602 (2005).
  * Reimann  _et al._ [2001] P. Reimann, C. Van den Broeck, H. Linke, P. Hänggi, J. M. Rubi, and A. Pérez-Madrid, Giant Acceleration of Free Diffusion by Use of Tilted Periodic Potentials, Phys. Rev. Lett. 87, 010602 (2001).
  * Lindner  _et al._ [2001] B. Lindner, M. Kostur, and L. Schimansky-Geier, Optimal diffusive transport in a tilted periodic potential, Fluct. Noise Lett. 01, R25 (2001).
  * Berx  _et al._ [2023] J. Berx, A. Bose, R. Golestanian, and B. Mahault, Reentrant condensation transition in a model of driven scalar active matter with diffusivity edge, Europhys. Lett. 142, 67004 (2023).
  * Makhnovskii  _et al._ [2004] Y. A. Makhnovskii, V. Rozenbaum, D.-Y. Yang, S. Lin, and T. Tsong, Flashing ratchet model with high efficiency, Phys. Rev. E 69, 021102 (2004).
  * Magnasco [1993] M. O. Magnasco, Forced thermal ratchets, Phys. Rev. Lett. 71, 1477 (1993).
  * Lindner  _et al._ [1999] B. Lindner, L. Schimansky-Geier, P. Reimann, P. Hänggi, and M. Nagaoka, Inertia ratchets: A numerical study versus theory, Phys. Rev. E 59, 1417 (1999).
  * Shannon [1948] C. E. Shannon, A mathematical theory of communication, Bell Syst. Tech. J. 27, 379 (1948).
  * Alston  _et al._ [2022] H. Alston, L. Cocconi, and T. Bertrand, Non-equilibrium thermodynamics of diffusion in fluctuating potentials, J. Phys. A Math. Theor. 55, 274004 (2022).
  * Kullback and Leibler [1951] S. Kullback and R. A. Leibler, On information and sufficiency, Ann. Math. Stat. 22, 79 (1951).
  * Note [1] The typical run speed and tumble rate of an E. coli are $v\approx 15~{}\mu\mathrm{m}~{}\mathrm{s}^{-1}$ and $\gamma\approx 1~{}\mathrm{s}^{-1}$ respectively [75]. The _thermal_ diffusion constant $D$ of an E. coli can be calculated from the Stokes-Einstein equation $D=k_{B}T/(6\pi\eta_{\text{vis}}r)$. By approximating an E. coli as a sphere of radius $r=1~{}\mu\mathrm{m}$ immersed in water (of dynamic viscosity $\eta_{\text{vis}}\approx 10^{-3}~{}\mathrm{Pa}~{}\mathrm{s}$), this gives $D\approx 0.2~{}\mu\mathrm{m}^{2}~{}\mathrm{s}^{-1}$ at room temperature $T=300~{}\mathrm{K}$. Thus, the Péclet number of an E. coli is on the order of $\mathrm{Pe}=v^{2}/(D\gamma)\approx 1000$.
  * Van Kampen [1992] N. G. Van Kampen,  _Stochastic processes in physics and chemistry_ , Vol. 1 (Elsevier, 1992).
  * Demaerel and Maes [2018] T. Demaerel and C. Maes, Active processes in one dimension, Phys. Rev. E 97, 032604 (2018).
  * Cocconi  _et al._ [2022] L. Cocconi, J. Knight, and C. Roberts, Optimal power extraction from active particles with hidden states, arXiv.2211.16377 (2022).
  * Reimann and Elston [1996] P. Reimann and T. C. Elston, Kramers Rate for Thermal Plus Dichotomous Noise Applied to Ratchets, Phys. Rev. Lett. 77, 5328 (1996).
  * Ahmad  _et al._ [2022] S. Ahmad, K. Rijal, and D. Das, First passage in the presence of stochastic resetting and a potential barrier, Phys. Rev. E 105, 044134 (2022).
  * Molaei  _et al._ [2014] M. Molaei, M. Barry, R. Stocker, and J. Sheng, Failed escape: solid surfaces prevent tumbling of Escherichia coli, Phys. Rev. Lett. 113, 068103 (2014).