\section{\label{sec:level1}Introduction}
Active matter is composed of particles that self propel by consuming energy from the environment, producing a persistent random motion. 
Due to the motion persistence, active particles accumulate on surfaces even when the particle-surface interaction is purely repulsive, a behavior which can be described as effective attraction \cite{Wittmann2016,Fily2017}.

A minimal model in which this behavior was studied is that of run-and-tumble particles (RTP), where a free particle moves in a straight line for an exponentially distributed random duration (run), and then changes its direction of motion to a new random direction (tumble). This model was originally suggested to describe the swimming of E. coli bacteria \cite{Schnitzer1993, Tailleur2008, Tailleur2009}.
Similar minimal models, which differ in the statistics of the particle speed and change of direction of motion, are active Brownian particles (ABP) \cite{Fily2012}, and active Ornstein-Uhlenbeck particles (AOUP) \cite{Maggi2015, Farage2015, Fodor2018rev}, which display similar surface accumulation.
In free space, RTPs, ABPs and AOUPs all perform a persistent random walk, which is diffusive at long time and length scales \cite{Fodor2018rev}. However, when confined, they display a nonequilibrium steady state density \cite{Tailleur2009, Elgeti2013,Yang2014,Fily2014,Ezhilan2015,Yan2015,Elgeti2015,Elgeti2016,Bechinger2016,Angelani2017,Wagner2017,Malakar2018,Das2018,Caprini2018,Duzgun2018,Sevilla2019}.
Most theoretical studies of confined active particles used simulations and approximate analytical treatment, including those of 2D and 3D RTPs in a channel \cite{Elgeti2015, Ezhilan2015}. Few models, including the 1D RTP with hard walls, which we study here, have an analytic steady state solution \cite{Paksa2016, Razin2017,Angelani2017,Malakar2018}.

While its steady state particle density can be described by an effective potential \cite{Fily2017,Sevilla2019}, the nonequilibrium nature of a confined active particle system can be quantified by its entropy production.
The entropy production rate (EPR, often called "entropy production") is zero in equilibrium and positive when detailed balance is broken, as signified by the existence of probability currents in the system's state space. It thus provides a quantification of the distance of a system from equilibrium \cite{Schnakenberg1976,Gaspard2004JCP, Gaspard2004JSP, Lan2012, Benjamin2010,Li2019, Busiello2019}.

The entropy production of active matter systems has been a recent topic of interest \cite{Ganguly2013, Chaudhuri2014, Fodor2016, Falasco2016,Nardini2017, Mandal2017, Marconi2017,Pietzonka2017,Shankar2018,Speck2018, Caprini2019,Dabelow2019, Szamel2019,Flenner2020,Chaki2018,Chaki2019,gr2020entropy}.
It has been calculated using different frameworks and at different levels of coarse graining, yielding different results \cite{Shankar2018,Mandal2017,Fodor2016,Pietzonka2017,Speck2018}.
The EPR for a single free active particle has been calculated analytically in \cite{Shankar2018}, and the result was shown to depend on whether the motion dynamics is overdamped and whether the self propulsion force is odd or even under time reversal. Most previous calculations of the EPR of interacting active systems have been approximate (such as field theory approaches \cite{Nardini2017,Caballero2020}) or numerical \cite{Nardini2017,Flenner2020,Speck2018}. In the following, we calculate exactly the EPR of an overdamped dry active particle which interacts with confining hard walls, from Fokker-Planck equations.

In this paper, we study the minimal system of a single RTP in a box in one dimension. The model is defined in Section \ref{sec:model_def}. In Section \ref{sec:stst}, we derive and study the limits of its nonequilibrium steady state. In Section \ref{sec:epr}, we develop an expression for the mesoscopic EPR corresponding to dynamics given by a Fokker-Planck equation with linear reaction terms, and use it to obtain an exact analytic result for the EPR of the system. We show that the EPR has maximal slope at a system size proportional to the persistence length of the particle motion. We define an entropy production density and show that it is maximal near the system edges, where the interaction between the particle and the walls causes breaking of time reversal symmetry.

\section{\label{sec:model_def} Model Definition}
A point-like run-and-tumble particle moves at a constant speed $v$, as a result of a constant magnitude self propulsion force acting against friction in an overdamped regime.
With rate $\alpha$, a tumble event occurs and a new random direction of motion is chosen.
Note that in one dimension, since with probability $1/2$ the new direction of motion is equal to the previous one, the rate of change of direction is $\alpha/2$.
In addition to the active motion, the particle diffuses (due to the temperature or another source of white noise) with diffusion coefficient $D$.

In one dimension, a run-and-tumble particle can move in one of two directions: left or right. This allows writing two coupled Fokker-Planck (FP) equations for the density of right and left moving particles at position $x$ and time $t$ - $R(x,t)$ and $L(x,t)$ \cite{Schnitzer1993,Tailleur2008,Tailleur2009}:
\begin{equation} \label{eq:FP_particle_in_box}
\begin{array}{ll}
\partial_t R = D\partial_x^2R - v\partial_x R + \frac{\alpha}{2}(L-R) \equiv -\partial_x J_R+ \frac{\alpha}{2}(L-R)\\
\\
\partial_t L = D\partial_x^2L + v\partial_x L + \frac{\alpha}{2}(R-L) \equiv -\partial_x J_L+ \frac{\alpha}{2}(R-L)
\end{array}
\end{equation}

The probability currents associated with the right / left moving particles are 
\begin{equation} \label{eq:J_def}
\begin{array}{ll}
J_R(x,t) = v R - D\partial_x R  \\
\\
J_L(x,t) = -v L - D\partial_x L
\end{array}
\end{equation}

We consider here a RTP in a box - confined by hard walls at $x=\pm d$ (Fig.~\ref{fig:system_sketch}). Thus the particle density is described by Eq.~\ref{eq:FP_particle_in_box}, with reflecting boundary conditions, which mean the currents vanish at the walls: $J_L(\pm d)=J_R(\pm d)=0$.

\begin{figure}[htb]
\centering
\includegraphics[width=0.5\linewidth]{system_plot_1D_RTP_particle.pdf}
  \caption[]{System illustration: a run-and-tumble particle (RTP) in a 1D box.}
\label{fig:system_sketch}
\end{figure}

\section{\label{sec:stst} The Steady State density and current}
We define the total particle density $\rho = R + L$, and the difference $\sigma = R - L$.
The steady state ($\partial_t R = \partial_t L = 0$) solution of Eq.~\ref{eq:FP_particle_in_box}, which satisfies the no flux boundary conditions and the normalization condition of one particle in the box $\int_{-d}^d \! \rho(x) \, \mathrm{d}x=1$ is given by
\begin{equation} \label{eq:rho_sigma_sol}
\begin{array}{ll}
\rho(x) = \rho_0 \cosh(\frac{x}{\xi}) + \rho_1\\
\\
\sigma(x) = \rho_0 \sqrt{1+\mathrm{Pe}^{-1}}\sinh(\frac{x}{\xi})
\end{array}
\end{equation}
where $\xi = \sqrt{\frac{D^2}{v^2+\alpha D}}=\sqrt{\frac{1}{\mathrm{Pe} ( \mathrm{Pe}+1 )}}\ell_p$,  $\mathrm{Pe}=v^2\tau/D$ is the dimensionless Peclet number, $\tau=\alpha^{-1}$ is the persistence time, $\ell_p=v\tau$ is the persistence length, and the constants $\rho_0$ and $\rho_1$ are
\begin{equation} \label{eq:FP_sol_constants}
\begin{array}{ll}
\rho_1 = \frac{1}{2d} - \rho_0 \frac{\xi}{d} \sinh ( \frac{d}{\xi})
\\
\rho_0 = \frac{\mathrm{Pe}}{2 \left( \xi \mathrm{Pe} \sinh ( \frac{d}{\xi}) + d\cosh ( \frac{d}{\xi})\right)}
\end{array}
\end{equation}

Substituting the steady state density Eq.~\ref{eq:rho_sigma_sol} into Eq.~\ref{eq:J_def} gives the currents:
\begin{equation} \label{eq:J_stst_sol}
J_R(x) = \frac{v}{2} \left( -\rho_0 \mathrm{Pe}^{-1} \cosh(\tfrac{x}{\xi}) + \rho_1 \right) = -J_L(x)
\end{equation}

The particle spends time near the walls due to its persistence: when the particle's active force pushes it against a wall, it takes on average a time duration $2\tau$ to turn around. This results in a boundary region of increased density near each wall, which decays exponentially with length scale $\xi$ (Fig.~\ref{fig:system_stst_density_current}).
The boundary layer width $\xi$ is proportional to the persistence length of the particle motion $\ell_p$, with a dimensionless proportionality constant which is a function of the Peclet number.
The currents of R and L particles vanish at the walls as required by the boundary conditions, and grow in magnitude towards the system center (Fig.~\ref{fig:system_stst_density_current}(a)). Their sum, the total particle current in the system, vanishes ($J=J_R+J_L=0$).

A similar solution appears in \cite{Malakar2018}, and for the $D=0$ case in \cite{Paksa2016,Razin2017,Angelani2017}. The steady state density of the RTP in the box is notably similar to the  approximate solution for the density of ABPs in a 2D channel with hard walls derived in \cite{Yan2015,Duzgun2018}. 

In the limit of vanishing Peclet number $\mathrm{Pe} \to 0$, the thermal equilibrium result of uniform density $\rho(x)=1/2d$, which is the Boltzmann distribution inside the box, is restored.
The length scale of the surface accumulation in the $\mathrm{Pe} \ll 1$ limit is $\xi \simeq \sqrt{D \tau}$, while in the $\mathrm{Pe} \gg 1$ limit, $\xi \simeq D/v$. The accumulation length scale $\xi$ increases with the diffusion coefficient $D$, because diffusion causes wall-facing particles to spread over a nonzero length near the wall, instead of remaining at the wall. 
Without diffusion $D=0$, the length scale of the accumulation boundary region vanishes $\xi = 0$, and the particle density at the walls diverges as a macroscopic number of particles accumulate on each of the walls. This can be shown either by taking the limit of $D \to 0$ in the steady state solution above, or by writing coupled differential equations for the densities of left and right moving particles in the bulk and the numbers of particles accumulated on the walls. Both methods yield the same result (Appendix \ref{appendix:rho_limits}).
Working in the $D=0$ limit is often useful since it allows an analytical solution of some generalizations of the run-and-tumble model, such as ones with position dependent $v$ and $\alpha$ and source and sink terms \cite{Razin2017, Razin2017b}. Moreover, this limit is relevant for colloids and bacteria, where thermal diffusion is typically two orders of magnitude smaller than the effective active diffusion $v^2 \tau$ \cite{Marchetti2016}.

\begin{figure}[!htb]
\centering
\includegraphics[width=1\linewidth]{Fig2.pdf}
  \caption[]{The steady state density (Eq.~\ref{eq:rho_sigma_sol}) and current (Eq.~\ref{eq:J_stst_sol}) for $D=1$, $\alpha=1$, $d=5$. (a) Top: The densities of right/left moving particles $R/L$, and their sum - the total density $\rho$. Bottom: The current of right/left moving particles $J_{R/L}$, and their sum - the total current $J=J_R+J_L=0$. ($v=1$) (b) Particle density $\rho(x)$, for varying particle speed $v$. For a Brownian particle ($v=0$), the density profile is uniform. As the active velocity increases, a growing portion of the density is concentrated near the walls.}
\label{fig:system_stst_density_current}
\end{figure}


\section{\label{sec:epr} The entropy production}
The steady state density of a particle in a box indicates that the system is out of equilibrium, since it is not the Boltzmann distribution, which is a uniform distribution inside the box.
Nevertheless, one can define an effective energy $E_{\text{eff}}(x)=-\beta^{-1} \log(\rho(x))$, for which the steady state particle distribution is the Boltzmann distribution $\rho(x)\propto \exp(-\beta E_{\text{eff}}(x))$. The effective interaction potential between the particle and the walls is attractive. This effective attraction between the particle and the wall is similar to the effective attraction between self propelled particles with repulsive interactions which causes them to create a dense cluster phase at large enough densities and active speeds in 2 and 3 dimensional systems. This phase transition is known as motility induced phase separation (MIPS) \cite{Cates2015,Farage2015,Marconi2015}.

Thus it is not possible to determine if the system is out of equilibrium by observing the steady state particle density. The fact that the total current $J=0$ is also consistent with the equilibrium-like picture.
However, when in addition to the particle positions, the direction of the active force is known, $R(x)$ can be distinguished from $L(x)$. This reveals the the existence of currents (Eq.~\ref{eq:J_stst_sol}, Figs.~\ref{fig:system_stst_density_current}a, \ref{fig:probability_flux_in_state_space}) and breaking of detailed balance.
The deviation of the system's steady state from equilibrium, associated with the severity of the violation of detailed balance, is quantified by the entropy production rate.

The Eqs.~\ref{eq:FP_particle_in_box} describe the diffusion and drift of particles of types R and L, along with a reaction that turns R particles into L and vice versa.
In the following, we derive the entropy production rate for such reaction-drift-diffusion FP equations. Similarly to the derivations in \cite{Schnakenberg1976} for a spatially discrete system defined by master equations, and  in \cite{Tome2006} for the FP equation with drift and diffusion terms, we show that the time derivative of the information/Gibbs entropy $S$ is a sum of two terms: $\dot{S}=\Pi-\Phi$. $\Pi$, which can be interpreted as the entropy production rate, is non-negative and vanishes if the system is in detailed balance. $\Phi$ is the entropy flux from the system to the environment \cite{Schnakenberg1976,Tome2006}.
Moreover, we find that the EPR $\Pi$ for a reaction-drift-diffusion FP equation is composed of separate contributions from the drift-diffusion in space and from the reaction.

The system states are $\mathcal{S}=(i,x)$ for $i=R/L$ and $-d \le x \le d$. The information entropy is given by
\begin{equation} \label{eq:gibbs_S}
\begin{array}{ll}

    S(t) = - \sum\limits_{\mathcal{S}} P(\mathcal{S},t) \log P(\mathcal{S},t) \\
    = -\int\limits_{-d}^d \mathrm{d}x R(x,t) \log R(x,t) - \int\limits_{-d}^d \mathrm{d}x L(x,t) \log L(x,t)
\end{array}
\end{equation}
where in the first line the summation over the continuous degree of freedom $x$ denotes an integral, and $P((R/L,x),t) \equiv R/L(x,t)$ as defined before.
We denote $S_R \equiv -\int_{-d}^d \mathrm{d}x R(x,t) \log R(x,t)$. Its time derivative is
\begin{equation}
\dot{S}_R = -\int_{-d}^{d} \mathrm{d}x \partial_t R (\log R - 1)
\end{equation}

By using Eq.~\ref{eq:FP_particle_in_box}, we get
\begin{equation} 
\dot{S}_R = -\int\limits_{-d}^{d} \mathrm{d}x (\partial_x J_R + J_{LR}) (\log R - 1)
\end{equation}
where $J_{LR}(x)=\frac{\alpha}{2}(R(x)-L(x))$ is the flux density from $R(x)$ to $L(x)$.
Using integration by parts and the boundary condition $J_R(\pm d)=0$, 
\begin{equation}\label{eq:S_R_dot}
\dot{S}_R = -\int\limits_{-d}^{d} \mathrm{d}x J_R \partial_x\log R + \int\limits_{-d}^{d} \mathrm{d}x J_{LR} (\log R - 1)
\end{equation}

From the definition of $J_R$, $D \partial_x \log R = v - J_R/R$, and therefore the first term in the right hand side of Eq.~\ref{eq:S_R_dot} is equal to
\begin{equation}
- \frac{v}{D}\int\limits_{-d}^d \mathrm{d}x J_R + \frac{1}{D}\int\limits_{-d}^d \mathrm{d}x \frac{J_R^2}{R} \equiv -\Phi_R + \Pi_R
\end{equation}

We identify $\Pi_R$ and $\Phi_R$ as the entropy production and entropy flux from the system to the environment due to the drift and diffusion of $R(x)$ \cite{Seifert2005,Tome2006}.
Similarly,
\begin{equation} \label{eq:S_L_dot}
\dot{S}_L = -\Phi_L + \Pi_L - \int\limits_{-d}^{d} \mathrm{d}x J_{LR} (\log L - 1)
\end{equation}
where $\Phi_L\equiv -\frac{v}{D}\int_{-d}^{d}\mathrm{d}x J_L$ and $\Pi_L\equiv \frac{1}{D} \int_{-d}^d \mathrm{d}x \frac{J_L^2}{L}$.

Summing Eq.~\ref{eq:S_R_dot} and Eq.~\ref{eq:S_L_dot}, we find
\begin{equation} \label{eq:S_dot}
\dot{S} = \dot{S}_R + \dot{S}_L = \Pi - \Phi
\end{equation}

where $\Pi$ and $\Phi$ are defined as follows:
\begin{equation} \label{eq:EP_components}
\begin{array}{ll}
\Pi \equiv \Pi_R + \Pi_L + \Pi_{RL} \\
\\
= \frac{1}{D}\int\limits_{-d}^d \mathrm{d}x \left(\frac{J_R^2}{R} + \frac{J_L^2}{L} \right) + \frac{\alpha}{2} \int\limits_{-d}^d \mathrm{d}x (R-L) \log (R/L)
\end{array}
\end{equation}

$\Pi$ is the total entropy production rate. It is non negative and thus satisfies the second law of thermodynamics. $\Pi_{R/L}$ is the entropy production due to drift and diffusion of $R/L$ particles, which generate the flux $J_{R/L}$.  It has the same form as the EPR of a drift-diffusion FP equation \cite{Seifert2005,Tome2006}. $\Pi_{RL}$ is given by

\begin{align}
\Pi_{RL} &\equiv \frac{\alpha}{2} \int\limits_{-d}^{d} \mathrm{d}x (R-L) \log (R/L) \\
&= \frac{\alpha}{2} \left(  D_{KL}(R||L) + D_{KL}(L||R) \right)
\end{align}
where $D_{KL}(f||g)$ is the Kullback-Leibler (KL) divergence of the functions $f$ and $g$.
$\Pi_{RL}$ is the entropy production due to the transitions $R(x) \rightleftharpoons L(x)$, according to the entropy production definition for discrete state systems \cite{Schnakenberg1976,Gaspard2004JSP}, integrated over the continuum of contributions from all $-d \le x \le d$. This symmetrized KL divergence quantifies the difference between the distributions $L(x)$ and $R(x)$, and vanishes when they are equal, as happens in equilibrium ($v=0$).

The second term in Eq.~\ref{eq:S_dot} is
\begin{equation}
\Phi \equiv \Phi_R + \Phi_L =  - \frac{v}{D}\int\limits_{-d}^{d} \mathrm{d}x (J_R - J_L) 
\end{equation}
This is the total entropy flux from the system to the environment, composed of symmetric contributions from $R$ and $L$.

In steady state, $\dot{S}=0$ and thus $\Pi=\Phi$. We can therefore calculate the EPR $\Pi$ by evaluating the simpler expression for $\Phi$. We obtain:
\begin{equation} \label{eq:EPR}
\Pi =  \alpha \frac{\frac{d}{\xi} \cosh \left( \frac{d}{\xi} \right) - \sinh \left( \frac{d}{\xi} \right)}{\mathrm{Pe}^{-1} \frac{d}{\xi} \cosh \left( \frac{d}{\xi} \right) + \sinh \left( \frac{d}{\xi} \right)}
\end{equation}

In the equilibrium limit $\mathrm{Pe}=0$, the entropy production vanishes $\Pi=0$. As $\mathrm{Pe}$ grows, the entropy production grows. For $\mathrm{Pe} \gg 1$, $\Pi \simeq \alpha \left(1-d/\xi \coth(d/\xi)\right)$, which diverges for vanishing $\xi$ - as $D\to0$, $v \to \infty$ or $\alpha \to \infty$.
The divergence occurs since in this limit, there are wall-facing particles accumulated on the walls. These particles have a nonzero rate of transition to the state with opposite propulsion force direction, while the reverse probability flux vanishes since the number of particles at the wall with propulsion force away from it is zero (Appendix \ref{appendix:rho_limits}).

\begin{figure}[!tb]
\centering
\includegraphics[width=1\linewidth]{state_space_current.pdf}
  \caption[]{Probability flux in state space. Black lines represent the continuum of $R$ and $L$ states for $-d\le x \le d$. There is a flux $J_{R/L}$ between the continuum of $R/L$ states (orange arrows), and a flux density $J_{RL}(x)$ of discrete transitions from the state $L(x)$ to the state $R(x)$ for each $-d\le x \le d$ (blue arrows). The existence of probability flux in state space indicates the breaking of detailed balance and a nonzero production of entropy.}
\label{fig:probability_flux_in_state_space}
\end{figure}

The EPR depends on the system half length $d$ and the accumulation length scale $\xi$ only through their dimensionless ratio $d/\xi$. The EPR vanishes in the small system limit $d/\xi \to 0$, and monotonically increases as $d$ is increased.
In the infinitely large system $d \to \infty$ limit, $\Pi \to v^2/D$  which is the entropy production of a free particle (as calculated in \cite{Shankar2018} for overdamped, time reversal symmetry even propulsion).

The rate of change of the EPR as the system size is varied, $\partial_d\Pi$, is maximal for $d_{\text{max}}=\xi f(\mathrm{Pe})$, where $f(\mathrm{Pe})$ is a constant close to one for $\mathrm{Pe} \le 1$, and grows logarithmically with $\mathrm{Pe}$ for $\mathrm{Pe} \gg1$ (Appendix \ref{appendix:EP_derivative}). The fact that the EPR slope with respect to $d$ is maximal for a system size proportional to $\xi$ is interesting in light of previous findings in nonequilibrium systems were the EPR or its slope were maximal near (or divergent at) a critical point \cite{Benjamin2010, Gaspard2004JCP,Tome2012}. While this 1D system does not undergo a phase transition, $d \approx \xi$ is a transition point between two regimes in which the system is qualitatively different: at $d\gg \xi$ the system is much larger than the particle persistence length $\ell_p$ and thus in the bulk the particle motion is diffusive at long time and length scales, with diffusion constant $D+v^2\tau$. Once the system size - a length scale introduced by the particle interaction with the walls - becomes of the order of $\xi$, the system is dominated by the boundary physics.

Since the boundary accumulation of the particle on the walls resembles that of particles on each other in MIPS, it would be interesting to see if a similar maximum in the EPR or its slope occurs near the critical volume in 2 and 3 dimensional systems of interacting active particles that undergo MIPS.

\begin{figure}[!tb]
\centering
\includegraphics[width=1\linewidth]{Fig3.pdf}
  \caption[]{Entropy production of a RTP in a 1D box. (a) The entropy production rate $\Pi$ (Eq.~\ref{eq:EPR}) and (b) $\partial_{d} \Pi$ as a function of $d/\xi$, for varying $\mathrm{Pe}$ values ($\alpha=1$). The derivative $\partial_{d} \Pi$ is maximal at $d_{\text{max}}/\xi=f(\mathrm{Pe})$ (independent of $\alpha$ and $\xi$), and decays to zero away from $d_{\text{max}}$.  (c) The entropy production density and its three components (Eq.~\ref{eq:EP_density_components}) for $v=1$, $\alpha=1$, $D=1$, $d=5$. It is maximal at the walls. (d) The EPR density $\pi(x)$ with $v,\alpha,d$ as in c and varying $D$. There is a qualitative change in the shape of $\pi(x)$ as the diffusion coefficient $D$ varies.}
\label{fig:entropy_production}
\end{figure}

From Eq.~\ref{eq:EP_components}, the entropy production is given by an integral over the system length of a quantity that we can identify as an entropy production density and denote it by $\pi(x)$. As with the total EPR $\Pi$, we can consider the three separate contributions to the EPR density of the current of the right moving current $J_R$, the current of left moving particle states $J_L$, and the probability current between the states $R(x)$ and $L(x)$ for each $x$, denoting them $\pi_R(x)$, $\pi_L(x)$ and $\pi_{RL}(x)$ respectively:
\begin{equation} \label{eq:EP_density_components}
\begin{array}{ll}
\pi_{R}(x) \equiv \frac{J_R^2}{DR} \vspace{2mm}\\
\pi_{L}(x) \equiv \frac{J_L^2}{DL} \vspace{2mm}\\
\pi_{RL}(x) \equiv \frac{\alpha}{2} (R-L)\log(R/L)
\end{array}
\end{equation}

$\pi_{RL}(x)$ is symmetric, and peaks near the walls, where the difference $R-L$ is the largest. For $\xi \ll d$, it vanishes in the bulk, where $R(x)\approx L(x)$. $\pi_R(x)$ and $\pi_L(x)$ are asymmetric mirror images of each other (as are R and L) which vanish at the walls and peak in the bulk where the current magnitude per particle density is largest. The total entropy production density is concentrated at the walls (Fig.~\ref{fig:entropy_production}c,d), consistent with the fact that time reversal symmetry is violated by the particle interaction with the walls. This resembles the findings of \cite{Nardini2017}, where the entropy production density for a cluster of active particles in the motility induced phase separation regime was found to be maximal at the interface, which could function similarly to a wall for the fluid phase on one of its sides.


\section{Discussion}
A RTP in a 1D box is an analytically solvable minimal system in which the nonequilibrium physics of active particles can be studied at the mesoscopic level described by Fokker-Planck equations. While a single active particle in free space undergoes effective diffusion at large time and length scales, in the case of the infinite potential well the interaction of the particle with the hard walls breaks detailed balance also at the coarse grained level \cite{Tailleur2009}. We showed here that the violation of detailed balance in this system can be quantified by analytically calculating the entropy production rate from a Fokker-Planck description.

We obtained an expression for the entropy production rate in the system which is an integral over local quantities resulting from local detailed balance breaking, and can be interpreted as an entropy production density. This density is maximal near the walls, similarly to the results of \cite{Nardini2017} for interacting particles in 2D, in which the entropy production density was shown to be maximal at the boundary of a particle cluster in system at MIPS.

We found that the EPR derivative as a function of the box size is maximal at a size proportional to the length scale of the boundary region of increased density near the walls.
This result, and similar findings in other nonequilibrium systems \cite{Benjamin2010, Gaspard2004JCP,Tome2012}, suggest that the behavior of the entropy production and its derivatives may provide an interesting characterization of active systems at regimes of qualitative change of behavior, and specifically at criticality. In particular, it would be interesting to measure these quantities as a control parameter, such as the system volume, is varied across the motility induced phase separation transition, since that phenomenon resembles the surface accumulation displayed by a confined active particle: In MIPS, below the critical volume, the system separates into dense clusters and a dilute fluid phase. The  mechanisms for clustering, in which the active particles appear to effectively attract each other, is similar to the effective attraction of the RTP in a 1D box to the walls and results from the persistence of their motion.

Indeed, it was recently found that within a field theory of active phase transitions, the EPR diverges at criticality \cite{Caballero2020}. In addition, \cite{Flenner2020} recently showed that the entropy production rate as defined by \cite{Fodor2016} has a maximum as a function of the persistence time in a system of AOUPs in 3D. In light of our results for the entropy production of a confined RTP, we suggest that the maximum may be a signature of a qualitative transition in the system behavior.


\begin{acknowledgments}
I thank Raphael Voituriez, David Van Valen and Rob Phillips for useful discussions, and Yuval Baum for a critical reading of the manuscript.
\end{acknowledgments}

