Entropy production for diffusion processes across a semipermeable interface

The emerging field of stochastic thermodynamics extends classical ideas of entropy, heat and work to non-equilibrium systems. One notable finding is that the second law of thermodynamics typically only holds after taking appropriate averages with respect to an ensemble of stochastic trajectories. The resulting average rate of entropy production then quantifies the degree of departure from thermodynamic equilibrium. In this paper we investigate how the presence of a semipermeable interface increases the average entropy production of a single diffusing particle. Starting from the Gibbs-Shannon entropy for the particle probability density, we show that a semipermeable interface or membrane $\calS$ increases the average rate of entropy production by an amount that is equal to the product of the flux through the interface and the logarithm of the ratio of the probability density on either side of the interface, integrated along $\calS$. The entropy production rate thus vanishes at thermodynamic equilibrium, but can be nonzero during the relaxation to equilibrium, or if there exists a nonzero stationary equilibrium state (NESS). We illustrate the latter using the example of diffusion with stochastic resetting on a circle, and show that the average rate of interfacial entropy production is a nonmonotonic function of the resetting rate and the permeability. Finally, we give a probabilistic interpretation of the interfacial entropy production rate using so-called snapping out Brownian motion. This also allows us to construct a stochastic version of entropy production.


I. INTRODUCTION
In recent years there has been a rapid growth of interest in stochastic thermodynamics, which uses tools from the theory of stochastic processes to extend classical ideas of entropy, heat and work to non-equilibrium systems [1][2][3][4].Examples include overdamped colloidal particles, biopolymers, enzymes, and molecular motors.One characteristic feature of such systems is that the second law of thermodynamics typically only holds after taking appropriate averages with respect to an ensemble of stochastic trajectories or over long time intervals.The resulting average rate of entropy production then quantifies the degree of departure from thermodynamic equilibrium.In addition, probabilistic methods such as Itô stochastic calculus, path integrals and Radon-Nikodym derivatives have been used to derive a variety of important fluctuation relations from the stochastic entropy evaluated along individual trajectories [5][6][7][8].These fluctuation relations have subsequently been generalized using martingale theory [9][10][11][12][13][14].
In this paper we consider the following problem: how does the presence of a semipermeable interface contribute to the average entropy production rate of a single diffusing particle?Diffusion through semipermeable membranes has a wide range of applications, including molecular transport through biological membranes [15][16][17], diffusion magnetic resonance imaging (dMRI) [18][19][20], drug delivery [21,22], reverse osmosis [23], and animal dispersal in heterogeneous landscapes [24][25][26].At the macroscopic level, the classical boundary condition for a semipermeable membrane takes the particle flux across the membrane to be continuous and to be proportional to the difference in concentrations on either side of the barrier.The constant of proportionality κ 0 is known as the permeability.The semipermeable boundary condi-tions are a particular version of the thermodynamicallyderived Kedem-Katchalsky (KK) equations [27][28][29][30].At the single-particle level, the resulting diffusion equation can be reinterpreted as the Fokker-Planck (FP) equation for the particle probability density, which is supplemented by the interfacial boundary conditions.In particular, suppose that a semipermeable interface S partitions R d into two complementary domains Ω ± with R d = Ω + ∪ Ω − ∪ S. If J (y, t) denotes the continuous flux across a point y ∈ S from Ω − to Ω + , then J (y, t) = κ 0 [p ( y − , t) − p(y + , t)]/2, where p(y ± , t) are the solutions on S ± = Ω ± ∩ S, where Ω denotes closure of a set Ω.
Starting from the Gibbs-Shannon entropy for the particle probability density p(x, t), x ∈ R d , we show in Sect.II that a semipermeable interface S increases the average rate of entropy production at a given time t by an amount I int (t) = ´S J (y, t) ln[p(y − , t)/p(y + , t)]dy.In other words, I int (t) is equal to the product of the flux through the interface and the logarithm of the ratio of the probability density on either side of the interface, integrated along S. It immediately follows that the entropy production rate vanishes at thermodynamic equilibrium, but can be nonzero during the relaxation to equilibrium.We illustrate the theory by calculating the average rate of entropy production for one-dimensional (1D) diffusion.In the 1D case, S reduces to a single point x = 0, say, so that Ω − = (−∞, 0 − ] and Ω + = [0 + , ∞).
In Sect.III we turn to a well-studied mechanism for maintaining a diffusing particle out of thermodynamic equilibrium, namely, stochastic resetting.Resetting was originally introduced within the context of a Brownian particle whose position X(t) instantaneously resets to a fixed position x 0 at a sequence of times generated from a Poisson process of constant rate r [40][41][42].There have subsequently been a wide range of generalizations at the single particle level, see the review [43] and references therein.One of the signature features of diffusion processes with resetting is that there typically exists a nonequilibrium stationary state (NESS) that supports nonzero time-independent fluxes.A number of recent studies have considered the stochastic thermodynamics of diffusive systems with resetting [44][45][46][47][48][49][50].One issue that emerges from these studies is that sharp resetting to a single point is a unidirectional process that has no time-reversed equivalent.This means that the average rate of entropy production calculated using the Gibbs-Shannon entropy cannot be related to the degree of timereversal symmetry breaking.This connection can be established by considering resetting to a random position [51] or Brownian motion in an intermittent harmonic confining potential [52].An additional subtle feature arises when considering the effects of resetting in the presence of a semipermeable interface [53][54][55].In particular, it is natural to assume that the interface screens out resetting, in the sense that a resetting event cannot cross the interface.This means that a particle on one side of the interface ∂M cannot reset to a point on the other side.Hence, it is not possible to have a non-zero stationary flux across the interface, since there is no countervailing reset current in the opposite direction.We bypass the screening effect in Sect.III by considering the example of single-particle diffusion on a ring with both stochastic resetting and a semipermeable interface.We derive an explicit expression for the resulting NESS and use this to calculate the various contributions to the average rate of entropy production in the stationary state, including those associated with resetting as well as those arising from the semipermeable interface.
Finally, in Sect.IV we present a probabilistic interpretation of I int based on so-called snapping out BM [31][32][33][34].The latter generates individual stochastic trajectories of the dynamics by sewing together successive rounds of partially reflected BMs that are restricted to either the left or right of the barrier.Each round is killed (absorbed) at the barrier when its boundary local time exceeds an exponential random variable parameterized by the permeability κ 0 .(The local time is a Brownian functional that specifies the contact time between a particle and a given boundary [35][36][37][38][39].) A new round is then immediately started in either direction with equal probability.It is the random switching after each killing event that is the source of the entropy production.We also use snapping out BM to construct a stochastic version of entropy production.Averaging the latter with respect to the distribution of sample paths recovers the results based on the Gibbs-Shannon entropy.Consider an overdamped Brownian particle diffusing in a 1D domain with a semipermeable barrier or interface at x = 0. Suppose that the particle is also subject to a force F (x, t).Let p(x, t) denote the probability density of the particle at position x at time t.The corresponding FP equation takes the form with the probability flux and the following pair of boundary conditions at the interface: where κ 0 is a constant permeability.(The arbitrary factor of 1/2 on the right-hand side of Eq. (2.1c) is motivated by the corresponding probabilistic interpretation of snapping out BM, see Sect.IV.)In addition, D is the diffusivity, γ is the friction coefficient, and the two quantities are related according to the Einstein relation Dγ = k B T .(In the following we set the Boltzmann constant k B = 1.)For simplicity, we take the diffusive medium to be spatially homogeneous.However, the domains (−∞, 0 − ] and [0 + , ∞) could have different diffusivities, for example.That is, D = D − for x < 0 and D = D + for x > 0 with D − ≠ D + ; the drag coefficients would also differ due to the Einstein relation.Finally, we assume that the force F (x, t) is continuous at the interface.In order to evaluate various thermodynamic quantities such as the average heat, work and entropy, we have to integrate with respect to x ∈ R. Since the probability density has a discontinuity at x = 0, we partition each integral into the two domains (−∞, 0 − ] and [0 + , ∞), and introduce the notation x = 0 FIG. 1. Brownian motion in R with a semipermeable interface at x = 0. (The two-dimensional representation is for illustrative purposes.) Continuity of the flux at x = 0 means that in most cases there is no contribution to the integral from the discontinuity.One notable exception occurs when we evaluate the average rate of entropy production.
In the 1D case we can always write the force as a gradient of a potential, F (x, t) = −∂ x V (x, t).This means that the average internal energy is and Using Eqs.(2.1a,b) and integration by parts, we have and Imposing flux continuity at the interface leads to a nonequilibrium version of the first law of thermodynamics: where W(t) is the average work done on the particle and Q(t) is the average heat dissipated into the environment with and If the potential is time-independent then we have the further simplification that there exists a unique equilibrium stationary state given by the Boltzmann-Gibbs distribution, Using the definitions of the probability fluxes, the integrand can be rewritten as In addition, imposing the permeability conditions shows that We thus obtain a generalization of the classical entropy production rate given by where  is the contribution to the entropy production from the semipermeable membrane, and is the average environmental entropy production rate due to heat dissipation, see Eq. (2.8).Since [p(0 − , t) − p(0 + , t)] and ln[p(0 − , t)/ ln p(0 + , t)] have the same sign, it follows that I int (t) ≥ 0, and hence the average total entropy production rate satisfies the second law of thermodynamics in the sense that The existence of the contribution I int is one of the main results of our paper.We will give a physical interpretation of this result in Sect.IV.

C. Interfacial entropy production for pure diffusion
In the particular case of a time-independent force F (x) = −V ′ (x), the rate of entropy production vanishes in the limit t → ∞ since there are no fluxes at equilibrium.However, R tot (t) > 0 at finite times t.This result holds even for pure diffusion, where an explicit solution of Eqs.(2.1) can be obtained.The simplest way to proceed is to Laplace transform Eqs.(2.1), under the initial condition p(x, 0) = δ(x − x 0 ).For the sake of illustration we take x 0 > 0. It follows that where G(x, 0 ; s) is the Green's function of the modified Helmholtz equation supplemented by the interfacial conditions and with lim x→±∞ G(x, x 0 ; s) = 0. Eq. ( 2.21a) has the general solution ) with the pair of coefficients A(s) and B(s) determined by the supplementary conditions.Finally, inverting the resulting solution in Laplace space gives In the limit κ 0 → 0, we see that p(x, t) → 0 for x < 0 and p(x, t) → p + (x, t) for x > 0, with This is consistent with the fact that the interface becomes completely impermeable in the limit κ 0 → 0 and the particle started to the right of the interface.We thus recover the solution of the diffusion equation on the halfline with a totally reflecting boundary at x = 0.In order to determine what happens in the limit κ 0 → ∞, we use the asymptotic expansion We find that the interface becomes completely transparent and p(x, t) is given by the classical solution of free diffusion in R. In Fig. 2 we show sample plots of the interfacial entropy production rate I int (t), see Eq. (2.17), as a function of time t for various initial positions x 0 and permeabilities κ 0 .As expected, the effects of the interface at x = 0 are greater when x 0 is closer to the origin.
In addition, increasing the permeability κ 0 increases the initial rise of I int (t) but the effects of the interface decay more quickly.

D. Diffusion across a closed semipermeable membrane in R d
The expression (2.17) for the average rate of entropy production through a semipermeable interface generalizes to higher spatial dimensions.Suppose that M denotes a closed bounded domain M ⊂ R d with a smooth concave boundary ∂M separating the two open domains M and its complement M c = R d /M, see Fig. 3.The boundary acts as a semipermeable interface with ∂M + (∂M − ) denoting the side approached from outside (inside) M. Let p(x, t) denote the probability density function of an overdamped Brownian particle subject to a force field F(x).The multi-dimensional analog of the where n is the unit normal directed out of M. Using the FP Eq. (2.27) and performing an integration by parts according to the divergence theorem, we have We now decompose the various contributions to R sys along analogous lines to the 1D case.This leads to the higher dimensional version of Eq. (2.16): where is the contribution to the entropy production from the semipermeable membrane, and T .

E. Imperfect contacts and the chemical potential
A classical generalization of the permeable boundary condition (2.1c), or its higher-dimensional generalization (2.27c), is to include a directional asymmetry in the permeability, which can be interpreted as a step discontinuity in a chemical potential [27][28][29]56]: for 0 ≤ σ ≤ 1.This tends to enhance the concentration to the right of the interface.(If σ > 1 then we would have an interface with permeability κ 0 σ and bias 1/σ to the left.)The derivation of the average entropy production rate for a 1D diffusive process proceeds along similar lines as the symmetric case, leading to Eq. (2.16).However, the interfacial contribution (2.17) now takes the form which is not necessarily positive.In order to obtain the correct second law of thermodynamics, we decompose I int (t) as with (2.37) Suppose that there is a discontinuity in the chemical potential across the interface, with µ = µ − for x < 0 and µ = µ + for x > 0. We then make the identification σ = e (µ+−µ−)/T with µ + < µ − for σ < 1, such that The second term on the right-hand side represents the rate of reduction in the free energy due to the probability flux J (t) from a region with a high chemical potential µ − to a region with a low chemical potential µ + .This change in free energy contributes to the heat dissipated into the environment.Hence, redefining the environmental entropy according to we obtain the modified second law of thermodynamics (2.40)

III. STOCHASTIC RESETTING ON CIRCLE WITH A SEMIPERMEABLE INTERFACE
We now turn to an example that supports an NESS in the large time limit by combining diffusion across a semipermeable interface with stochastic resetting.In previous work we considered scenarios similar to the one shown in Fig. 4(a) [53,55].We assumed that the semipermeable interface acts as a screen for resetting in the sense that a particle located in M cannot reset to a point x 0 ∈ M c and vice versa.This means that although the NESS is characterized by non-zero stationary fluxes in both domains, the net flux across the interface is zero.The last result can be understood as follows.Suppose, for concreteness, that the stationary interfacial flux J * is positive so that there is a net flow of probability from M to M c .The screening effect of the interface means that there is no reset flux in the opposite direction, which is impossible for a stationary state with p * (x) > 0 unless J * = 0.The vanishing of the interfacial flux can also be confirmed by explicitly calculating the NESS [53,55].
Therefore, in contrast to our previous work, we consider a Brownian particle diffusing on a circle of circumference L. The circle is topologically equivalent to a finite interval [0, L] with a semipermeable interface at x = {0 + , L − }.The particle is taken to reset at a rate r to a random position y ∈ (0, L) generated from the density σ 0 (y).The presence of the semipermeable interface means that σ 0 (y) does not have to be a periodic function.In Fig. 4(b) we show the example of resetting to a single point x 0 , which is obtained by taking σ 0 (y) = δ(y − x 0 ).Since the particle cannot reset by crossing the semipermeable interface, it resets in the anticlockwise direction when X(t) ∈ [0 + , x 0 ) and resets in the clockwise direction when X(t) ∈ (x 0 , L − ].For a random reset location, the probability density p(x, t), x ∈ [0, L], evolves according to the equation together with the interfacial conditions (A factor of 1/2 has been absorbed into κ 0 .)

A. Average entropy production
We begin by calculating the average rate of entropy production, and show that there are contributions from the interface and the resetting protocol, We then calculate these contributions in the NESS.Substituting Eqs.(3.1a) into the formula (2.12) for the average rate of en- tropy production gives where J(x, t) = −D∂p(x, t)/∂x and The integral on the right-hand side of Eq. (3.2) can be analyzed along identical lines to the case of no resetting.Since there are no forces, we find that with Hence, there are contributions from both the semipermeable interface and resetting.
In the special case σ 0 (x) = δ(x − x 0 ) (resetting to a fixed location x 0 ), we have Following along analogous lines to Ref. [3] we define R reset (t) = −I r (t) and rewrite Eq. (3.4) as As highlighted in the introduction, resetting to a single point is a unidirectional process that has no time-reversed equivalent.This means that the average rate of entropy production calculated using the Gibbs-Shannon entropy cannot be related to the degree of time-reversal symmetry breaking.On the other hand, as shown in Ref. [51], such a connection can be made in the case of a regular resetting density σ 0 (x) > 0. The contribution I r (t) is now decomposed as where K[p|q] is the Kullback-Leibler divergence of any two measures p, q on R: Using Jensen's inequality for convex functions it is straightforward to prove that K[p|q] ≥ 0. Hence, we can rewrite the entropy production equation as where B. Non-equilibrium stationary state (NESS) In contrast to the system without resetting, there exists a nonequilibrium stationary state (NESS) for which there are non-zero stationary fluxes J * (x) and J * , both of which contribute to the average rate of entropy production.Setting all time derivatives to zero in Eqs.(3.1) gives For the moment, suppose that σ 0 (x) = δ(x − x 0 ).The general solution of Eq. (3.11a) then takes the form with η = √ r/D.There are four unknown coefficients and four supplementary conditions.The first pair arises from the conditions at x 0 : that is The second pair follow from the interfacial conditions (3.11b): After some algebra we find that ) and where (3.17) In Figs.5(a,b) we plot the solutions p * − (0, x 0 ) and p * + (L, x 0 ) on either side of the semipermeable interface as a function of r and x 0 , respectively.We fix the space and time units by setting L = D = 1.A number of observations can be made.First, if x 0 = 0.5 then p * − (0, x 0 ) = p * + (L, x 0 ) for all resetting rates r ≥ 0. This is a consequence of the symmetry of the configuration under the reflection x → 1 − x.This symmetry no longer holds when x 0 ≠ 0.5 and r > 0. That is, p * − (0, x 0 ) > p * + (L, x 0 ) for x 0 ∈ (0, 0.5) and there is now an exchange symmetry p * − (0, x 0 ) ↔ p * + (L, x 0 ) under reflection.Second, for fixed x 0 ∈ (0, L), the discontinuity across the interface is a nonmonotonic function of r, since the stationary state is at equilibrium when r = 0 and the density at the interface vanishes in the limit r → ∞.On the other hand, the discontinuity is a monotonically decreasing function of x 0 ∈ (0, 0.5).These results are reflected in plots of the average entropy production rate at the interface, with J * (x 0 ) = κ 0 [p * − (0, x 0 ) − p * + (L, x 0 )], see Fig. 6.We also find that I * int is a nonmonotonic function of the permeability κ 0 , as illustrated in Fig. 7.This follows from the fact that I * int vanishes in the limits κ 0 → 0 and κ 0 → ∞.In the first limit, the circle becomes topologically equivalent to a finite interval with totally reflecting boundaries at both end, whereas in the second limit the interface becomes totally transparent.
Let us now turn to a resetting protocol in which the particle resets to a random point according to the density Note that σ 0 (y, x 0 ) → δ(x − x 0 ) in the limit ξ 0 → ∞ and σ 0 (y, x 0 ) → 1/L in the limit ξ 0 → 0. The corresponding NESS is where ±η − ξ 0 for x > x 0 .In Fig. 8 we plot the corresponding interfacial entropy production rate I * int as a function of r for different values of the decay parameter ξ 0 in the definition of the resetting position density given by Eq. (3.19).Since σ 0 (x) becomes a uniform distribution in the limit ξ 0 → 0, it follows that I * int → 0 by symmetry.On the other hand, in the limit ξ 0 → ∞, we recover the curve obtained for resetting to x 0 .Finally, Eq. (3.10) implies that for 0 < ξ 0 < ∞, there is also a positive contribution to the average entropy production rate from resetting.

The stationary version takes the form
Example plots of I * r as a function of r and ξ 0 are shown in Fig. 9.As expected, I * r blows up in the limit ξ 0 → ∞ since the corresponding Kullback-Leibler divergences become singular.

IV. PROBABILISTIC INTERPRETATION OF THE ENTROPY CONTRIBUTION Iint
In Sect.II we analyzed Brownian motion across a semipermeable interface using a Fokker-Planck description of the distribution of sample paths.In order to understand the origins of the interfacial entropy production term I int , see Eq. (2.17) and its higher-dimensional analog (2.32), we turn to a probabilistic description of individual trajectories based on so-called snapping out Brownian motion [31][32][33][34].Here we only cover the essential elements necessary for interpreting I int in 1D.Extensions of the probabilistic framework to higher-dimensional interfaces can be found in Ref. [34].

A. Snapping out Brownian motion
The dynamics of snapping out BM is formulated in terms of a sequence of killed reflected Brownian motions in either [31][32][33][34].Let T n denote the time of the n th killing (with T 0 = 0).Immediately after the killing event, the position of the particle is taken to be where Y n is an independent Bernoulli random variable with where I is the indicator function.The local time L + n (t) is a Brownian functional that tracks the amount of the time the particle is in contact with the right-hand side of the interface over the time interval [T n , t].It can be proven that the local time exists, and is a continuous, positive increasing function of time.The SDE for X(t), t ∈ (T n , T n+1 ), is given by the so-called Skorokhod equation for reflected BM in the half-line Ω + : for t ∈ (T n , T n+1 ), where W (t) is a Wiener process with W (0) = 0. Formally speaking, so that each time the particle hits the interface it is given a positive impulsive kick back into the domain.The time of the next killing is then determined by the condition where l is an independent randomly generated local time threshold with On the other hand, if X(T + n ) = 0 − then the next round of reflected BM takes place in the domain Ω − .The corresponding SDE is with t ∈ (T n , T n+1 ), X(t) ∈ Ω − , and In summary, the dynamics of snapping out BM consists of sewing together successive rounds of reflected BM, each of which evolves according to the SDE (4.3) or (4.7), see Fig. 10.Each round is killed when the local time at the right-hand or left-hand side of the interface exceeds an exponentially distributed random threshold.(The threshold is independently generated each round.)Following each round of killing, an unbiased coin is thrown to determine which side of the interface the next round occurs.It is this randomization that accounts for the term I int appearing in Eq. (2.16).That is, I int is given by the product of the flux J (t) across the interface, which specifies the effective rate of randomization, and the corresponding entropy difference ln p(0 − , t) − ln p(0 + , t).Of course, this assumes that snapping out BM generates sample paths whose distribution is given by the solution of the corresponding FP Eq. (2.1).We sketch the basic proof based on renewal theory.For an alternative proof in 1D see Ref. [31] and for the generalization to higher spatial dimensions see Ref. [34].Let p(z, t) denote the probability density of snapping out BM for p(x, 0) = δ(x − x 0 ) and x 0 > 0. Let q(z, t|x 0 ) be the corresponding solution for partially reflected BM in Ω + .(It is straightforward to generalize the analysis to the case of a general distribution of initial conditions g(x 0 ) that spans both sides of the interface.)The densities p are related to q according to the last renewal equation [33,34] p(x, t) = q(x, t|x 0 ) (4.10a) The first term on the right-hand side of Eq. (4.10a) represents all sample trajectories that have never been absorbed by the barrier at x = 0 ± up to time t.The corresponding integrand represents all trajectories that were last absorbed (stopped) at time t − τ in either the positively or negatively reflected BM state and then switched to the appropriate sign to reach x with probability 1/2.Since the particle is not absorbed over the interval (t − τ, t], the probability of reaching x ∈ Ω + starting at x = 0 ± is q(x, τ |0).The probability that the last stopping event occurred in the interval (t−τ, t−τ +dτ ) irrespective of previous events is κ 0 dτ .A similar argument holds for Eq.(4.10b).The renewal Eqs.(4.10) can be used to express p in terms of q using Laplace transforms.First, p(x, s) = q(x, s|x 0 ) + κ 0 2 q(x, s|0)[p(0 + , s) + p(0 − , s)], x > 0, (4.11a) p(x, s) = κ 0 2 q(|x|, s|0)[p(0 + , s) + p(0 − , s)], x < 0. (4.11b) Setting x = 0 ± in equation (4.11), summing the results and rearranging shows that p(0 + , s) + p(0 − , s) = q(0, s|x 0 ) 1 − κ 0 q(0, s|0) .(4.12) Substituting back into equations (4.11) yields the explicit solution p(x, s) = q(x, s|x 0 ) + κ 0 q(0, s|x 0 )/2 1 − κ 0 q(0, s|0) q(x, s|0), x > 0, (4.13a) p(x, s) = κ 0 q(0, s|x 0 )/2 1 − κ 0 q(0, s|0) q(|x|, s|0), x < 0. (4.13b) Calculating the full solution p(x, t) thus reduces to the problem of finding the corresponding solution q(x, t|x 0 ) of partially reflected BM in Ω + .As we have shown elsewhere, this then establishes that p(x, t) satisfies the interfacial conditions (2.1c).
Finally, note that it is also possible to incorporate the directional asymmetry of Eq. (2.34) into snapping out BM [34].This is achieved by introducing a bias in the switching between the positive and negative directions of reflected BM following each round of killing.More specifically, the independent Bernoulli random variable Y n in Eq. (4.1) now has the biased probability distribution x > 0 (4.14a)

B. Stochastic entropy production
The probabilistic formulation of snapping out BM can also be used to construct a stochastic version of entropy production.For the sake of illustration, we focus on the 1D unbiased case.Let X(t) be the position of the Brownian particle at time t and consider the stochastic system entropy The second-term on the right-hand side of Eq. (4.16) takes into account the entropy change due to an infinitesimal change in particle position that does not cross the interface.Hence, the Dirac delta functions in Eq. (4.17) are the local time impulses that reflect the particle at x = 0 ± , and the factors [1 − κ 0 dt/2] represent the probability that reflection occurs.The third term on the righthand side of Eq. (4.16) can be understood as follows.If the particle is located at x = 0 ± then the probability of the reflected BM being killed in the interval [t, t + dt] is κ 0 dt, after which there is a probability of 1/2 that it switches to the other side of the interface.This results in an entropy change equal to ∆S sys = ± ln[p(0 − , t)/p(0 + , t)], whose sign depends on the crossing direction.A similar interpretation applies to the fourth term.In terms of the probability flux J(x, t), we have where dS env (X(t), t) is the the infinitesimal change in the environmental entropy.In order to determine the average entropy production rate we need to take expectations with respect to the white noise process.This is simplified by converting from Stratonovich to Itô calculus [1].In particular, to leading order in dt, J(X(t), t) Dp(X(t), t) since J(0 − , t) = J(0 + , t).Hence, we can rewrite Eq. (4.18) as We now average each term in Eq. (4.19) with respect to the white noise process using the following identity for any integrable function g(X(t)): V. DISCUSSION In this paper we showed how the presence of a semipermeable interface S increases the average rate of entropy production of a single diffusing particle by an amount that is equal to the product of the flux through the interface and the logarithm of the ratio of the probability density on either side of the interface, integrated along S. We illustrated the theory using the example of diffusion with stochastic resetting on a circle, and showed that the average rate of interfacial entropy production in the NESS is a nonmonotonic function of the resetting rate and the permeability.Finally, we presented a probabilistic interpretation of the interfacial entropy production rate that is based on snapping out BM.The latter represents individual stochastic trajectories as sequences of partially reflected BMs that are restricted to one side of the interface or the other.When a given round of partially reflected BM is terminated, a Bernoulli random variable is used to determine which side of the interface the next round takes place.We identified this switching process as the source of interfacial entropy production.Moreover, we showed how a biased switching process is equivalent to a directionally biased interface arising from a jump discontinuity in the chemical potential.The latter contributes to the dissipation of heat into the environment.Snapping out BM also allowed us to construct a stochastic version of entropy production defined along individual trajectories.Averaging with respect to the distribution of trajectories recovered the expression for the average rate of entropy production obtained from the Gibbs-Shannon entropy.
One direction for future work would be to relate the stochastic entropy for diffusion through a semipermeable interface to the ratio of forward and backward path probabilities [1,3].More specifically, a fundamental result of stochastic thermodynamics is that for many continuous stochastic processes, the total stochastic or instantaneous entropy production can be expressed as ] . (5.1) Such a relationship provides a basis for deriving a variety of fluctuation relations [1,3].The corresponding average production rate in steady state is then (5.2) One way to establish a result of the form (5.1) is to use path integrals.Within a path integral framework, one could treat diffusion as a random walk on a lattice in which a semipermeable barrier is represented in terms of local defects [57][58][59][60].
Finally, note that in this paper we considered a mesoscopic model of diffusion through a semipermeable interface, which involved phenomenological parameters such as the permeability κ 0 and the directional bias σ.These also appeared as parameters in snapping out BM, with κ 0 determining the rate at which each round of partially reflected BM is killed and σ specifying the bias of the switching Bernoulli process.Another direction of future work would be to develop a microscopic model of a semipermeable interface that identifies the biophysical mechanisms underlying κ 0 , σ, and interfacial entropy production.Along these lines, we have recently proposed a more general model of snapping out BM, in which each round of partially reflected BM is killed according to a more general threshold distribution than the exponential (4.6) [33,34].The corresponding effective permeability becomes a time-dependent function that can have heavy tails.

1 FIG. 2 .
FIG. 2. Single-particle diffusion across a closed semipermeable interface in R. Plots of the average interfacial entropy production rate as a function time for (a) various resetting positions x0 and fixed permeability κ0 = 1 and (b) various κ0 for fixed x0 = 1.

FIG. 4 .
FIG.4.Screening effect of a semipermeable membrane for a diffusing particle with resetting.(a) Closed semipermeable membrane ∂M in R d with a resetting point x0 ∈ M c .Although the particle can diffuse across ∂M in either direction, it cannot reset to x0 whenever it is within M. (b) Single particle diffusing on a circle with a semipermeable interface at {0, +, L − }, and resetting to a point x0.Let X(t) denote the current particle position.If X(t) ∈ [0 + , x0) then it can only reset in the anticlockwise direction, otherwise it can only reset in the clockwise direction.

1 FIG. 5 . 4 FIG. 6 .
FIG. 5. Single-particle diffusion on a ring with resetting to the same location x0.The ring is mapped to the interval [0, L] with a semipermeable interface at x = {0 + , L − }.Plots of the stationary densities p * (0 + ) (solid curves) and p * (L − ) (dashed curves) on either side of the interface as a function of (a) the resetting rate r for fixed x0 and (b) the resetting position x0 for fixed r.Other parameter values are D = κ0 = L = 1.The thin solid line in (a) is the stationary density when x0 = 0.5; by symmetry the density is continuous across the interface.

25 FIG. 7 . 5 FIG. 8 .
FIG. 7. Single-particle diffusion on a ring with resetting to the same location x0 = 0.25.Plots of the average rate of interfacial entropy production I * int as a function of the permeability κ0 and different values of r.Other parameter values are the same as Fig. 5.

FIG. 9 .
FIG. 9. Single-particle diffusion on a ring with resetting to a random location that is distributed according to the probability density (3.19) parameterized by ξ0.Plots of the average rate of resetting entropy production I * r as a function of (a) r for different values of ξ0 and (b) ξ0 for different values of r.Other parameters are D = L = 1, κ0 = 1 and x0 = 0.25.

FIG. 10 .
FIG. 10.Snapping out BM. (a) Single-particle diffusing across a semipermeable interface at x = 0. (b) Decomposition of snapping out BM into the random switching between two partially reflected BMs in the domains Ω±.
and introduce the boundary local time[35][36][37][38][39] The average system entropy at time t is defined by 16, t) − J(0 + , t) = 0.(4.22)Takingexpectation of the Wiener process in the Itô product terms also gives zero.Hence, combining the various results recovers Eq. (2.16), indicating that we can reverse the order of integration and differentiation so that