One-particle engine with a porous piston

We propose a variation of the classical Szilard engine that uses a porous piston. Such an engine requires neither information about the position of the particle, nor the removal and subsequent insertion of the piston when resetting the engine to continue doing work by lifting a mass against a gravitational field. Though the engine operates in contact with a single thermal reservoir, the reset mechanism acts as a second reservoir, dissipating energy when a mass that has been lifted by the engine is removed to initiate a new operation cycle.


Model
We propose a model composed by a single particle of mass m and a piston of mass M inside a one dimensional container of length L whose ends are in contact with a heat bath at temperature T, as schematically shown in Fig. 1. The piston has pores in it such that when the particle is close enough, there is a probability p for it to cross to the other side of the container instead of colliding with the piston. We refer to p as the porosity of the piston. As with Szilard's model, a load mass M l can be hanged from the piston so that when it is pushed by the particle, www.nature.com/scientificreports/ the mass is lifted. If p is small enough, most of the time the particle will be able to push the piston to the opposite side of the container before crossing through the pore and lift the load mass in the process. Once the particle crosses, it will push the piston in the opposite direction. An external agent is charged with the task of removing the incoming high potential energy mass once the piston has reached one of the container's ends, while another agent prepares a new mass with low potential energy on the opposite side of the container, which will be coupled to the piston at a later instant. One can use feedback by measuring the state of the system to pinpoint the moment at which a mass has been removed from the system and use this information to place a new mass as soon as possible. To model the coupling between the piston and the hanging mass we assume that the mass is connected through an ideal string to a hook that the agent places at one of the ends of the container. Such a hook can couple to the piston by spending a small fixed amount of the kinetic energy of the piston. As the particle pushes the piston, the piston collides elastically with the mass hook, pushing it to the other side of the container until it gets removed past a given point a (see Fig. 1). When reaching point b, the piston hook couples with the mass hook at that point, dissipating once again the same arbitrary amount of kinetic energy.
The inner workings of the engine presented here can be understood in the context of nonequilibrium thermodynamics of feedback control 18 . Let us consider the system composed of the particle and the piston. Let x be phase-space point of the system composed of the particle position and momentum and the piston position and momentum. The Hamiltonian of the system is composed of the interaction between the piston and the particle, the fixed external interaction between the particle and the container walls and the potential interaction U pl (x, ) between the piston and the load masses. As the system evolves, this interaction potential switches between three different forms depending on the load masses, labelled by ∈ {L, R, U} , corresponding respectively to a load mass on the left side (L), load mass on the right side (R) or the piston is unhooked from the masses (U). If is kept fixed, i.e., the unhook and hooking mechanism is switched off, the system will attain thermal equilibrium with an equilibrium free energy F( ) . Due to the symmetry of reflection between left and right sides F(L) = F(R) , therefore the difference of free energy between two states where a load mass is hooked is F = 0.
When the hooking and unhooking mechanism is operating, a given function (t) can be though as a protocol controlling the dynamics of the system. But, contrarily to many small-scale systems studied in stochastic thermodynamics 19 , the protocol in this case is neither fixed nor deterministically applied to the system on each realization. Rather, the inner mechanisms of the engine described previously are responsible for switching at random times, which can be interpreted as a feedback mechanism as follows.
Suppose that at each time step, a measure without error is performed on the system to obtain x, from which the position of the piston and its kinetic energy are obtained. Then the following feedback control is performed: • If the piston is neither in any of the positions a or b shown in Fig. 1, then is unchanged from its current value. Note that there are actually two a positions and two b positions, located symmetrically at each side of the container: a L and b L at the left, and a R and b R at the right. • If the piston is in a position a L and = R or the piston is at a R and = L , then is changed to U (unhook).
• If the piston is in a position b L (or b R ) and has enough kinetic energy, and = U then is changed to L (or R) corresponding to the side the piston is at.
Similarly to Szilard's engine, there is an arbitrary amount of work that the external agents must perform to remove the masses that have been lifted and to bring new masses from the surroundings to the position at which they can be connected to the piston. We consider such agents as part of the surroundings and concentrate instead on the intrinsic capacity of the engine to perform work given that the protocol described previously is carried out by the agents. For simplicity, the new masses are introduced to the system with zero kinetic energy, as if they were drawn from a thermal reservoir at zero temperature.
It is not always possible to define cycles for engines at the nanoscale level in the same way as it is done macroscopically 20 . However, in our case we find it useful to define a cycle as the process that occurs between the The piston is initially connected to the right load mass and the particle bounces between the right thermal wall and the piston. (b) The particle pushes the piston to the left. (c) Once the piston gets to position a, the high energy load mass hanging from its right is removed and a new low energy one is placed on the right end of the container. (d) As the piston gets to point b it couples with the left load mass. Once the particle crosses to the left side through the pore it will push the piston to the right and the cycle repeats. www.nature.com/scientificreports/ coupling of a new load mass to the piston and the subsequent removal of an old one. Note that the duration of such a cycle ( t c ) is variable.

Simulations
Mesoscale and smaller systems are commonly subject to diffusive effects and hydrodynamic interactions, as they are in general not found in vacuum. Such effects are important at the moment of thinking about a possible experimental realization. However, in this first study we are neglecting them to concentrate on the basic operation of a simple model of the engine. We perform event driven simulations 21 for ensembles of 200 systems using reduced mass (M), distance (l) and time (t) units defined as which, for the energy (E) and acceleration (g) gives For ease of notation the asterisks will be dropped in the following. To simulate the interaction of the particle with the thermal walls, every time it collides with one of the container's end walls, its recoil speed v is randomly drawn from the distribution 3 where β = (k B T) −1 , k B is the Boltzmann constant and T is the absolute temperature of the thermal walls.
The collisions between the particle and the piston are elastic and occur with probability 1 − p every time they meet each other, otherwise the particle crosses through the pore and both the piston and the particle continue with their trajectories without interacting. Once the piston reaches a return point, indicated by b in Fig. 1, a small fixed amount of energy is subtracted from its kinetic energy to overcome the energy barrier to couple the hook. The model assumes that this energy is dissipated. If the piston does not have enough kinetic energy then an elastic collision occurs. Lastly, as shown in Fig. 1, once a load mass is coupled to the piston, it is pushed by means of elastic collisions until it gets pass point a, where it is removed from the system. Between collisions the load mass moves under the influence of the external gravitational field.
The energy dissipated every time a coupling occurs, as well as the kinetic energy that gets out of the system along with the masses and their hooks, is accumulated in a variable E dis , that accounts for the energy dissipated by the process. The change in the gravitational potential energy of the load masses as they are lifted by the engine is accumulated in the variable W. The work done by the engine (particle + piston) on the load masses is −W . The change in kinetic energy of the particle each time a collision with one of the thermal walls occurs is accumulated in the variable Q, that accounts for the heat exchanged with the bath. Finally, the kinetic energy change of the piston during the collisions with the mass hooks is accumulated in the variable W (ph) which represents the work done by the hooks on the piston.
We compute the efficiency of the engine as the ratio between the power delivered by the engine on the hanging mass Ẇ t during a time t and the heat exchanged per unit of time Q t during the same lapse In addition to the total efficiency η t , we obtain the efficiency η (bp) t of the energy transfer between the heat bath and the piston as well as

Results
As the engine is a system out of equilibrium featuring predominant fluctuations, we study the distribution of the efficiency 22,23 obtained from the simulations in order to estimate the macroscopic efficiency 3,24,25 where �·� denotes the ensemble average in the thermodynamic limit ( t → ∞ ). To achieve this, we make use of the large deviation function 26-28 defined as where P(η t ∈ [η, η + dη]) is the probability for η t to take a value between η and η + dη . The large deviation function describes the asymptotic behavior ( t → ∞ ) of the efficiency fluctuations, and its minimum, which is located at the most probable value, indicates the macroscopic efficiency of the engine η . To estimate J(η) , one can resort to the extrapolation procedure proposed by Proesmans and van den Broeck 25 , which assumes a general functional form for P t (η) having three fitting parameters, that can be determined by using three evaluations of P t (η) at finite times.
An example of the dynamics of the different components of the engine during a simulation is displayed in Fig. 2. It is observed in Fig. 2a that the piston bounces against the stops on each side of the engine while it collides with the particle. In the crossing events, in which the particle goes through the pore, one observes that the trajectory of the particle crosses that of the piston without bouncing back. Similarly, Fig. 2b shows how the piston pushes the hooks against the gravitational field by means of elastic collisions until the hook reaches the opposite end of the engine and then it is reset. Figure 3a shows the accumulated work done on the load mass and the heat exchanged between the thermal walls and the particle as a function of time for a single simulation. Note that in this simple model the amount of work done per cycle by lifting the load mass is constant and equal to M l gh , where h = 0.7 corresponds to the height that the mass is lifted restricted by the chosen geometry of the container, which can be seen in the plot as discrete jumps in the accumulated work. That the work per cycle is constant means that for fixed M l the power delivered in a cycle ( M l gh/t c ) is a function of t c only. The oscillations of the work observed over the base line www.nature.com/scientificreports/ correspond to the bounces of the hooks observed in Fig. 2b. Figure 3b shows the ensemble average of the heat and the work. The probability density function (pdf) of the time per cycle ( t c ) for a fixed load mass M l = 1 and various porosities is displayed in Fig. 4. The pdf presents several peaks before decaying. In contrast with systems like, for example, a gas within a piston that follows an isothermal process, where it is compressed from state A to state B and then expanded from B to A to complete a cycle taking always the same time, the maxima found in the pdf can be explained by the fact that many different events might occur within one of the cycles of the engine with porous piston. For example, the piston can simply couple a mass soon after it was introduced and pull it all the way up, or it might wiggle for a time, bounce against it without coupling to it and pick instead the mass in the opposite side of the container. These different types of cycle might have different characteristic times that reflect in the pdf as different peaks. The inset of Fig 4 shows that the average time ( t c ) gets to a minimum value near p = 0.2 and as the work delivered per cycle is constant in this setup, it can be said that the engine operates at maximum power for a value close to p = 0.2.
Similarly, Fig. 5 shows the pdf of t c for a fixed porosity p = 0.2 and various load mass values. In contrast with its dependence on p, the average cycle duration as a function of M l increases monotonically.
On the other hand, we obtained the pdf of the work performed by the engine on the load mass during a time window of length t. Figure 6a shows the pdf of the work W t normalized by M l gh when a time window of length t = 40t c is used for a fixed load mass and several values of the porosity. The periodic peaks observed are located at integer multiples of the work done during a single cycle. That the mode of the distributions in Fig. 6a is close  www.nature.com/scientificreports/ to W t /M l gh ≈ −40 tells us simply that the most probable scenario when the engine runs during a time that spans 40 times the average cycle duration, is for it to complete 40 cycles. In microscopic models of the Carnot engine it has been found that the pdf of the work presents a long tail towards zero, but it approximates a Gaussian in the quasistatic limit 3 , which sometimes has been used to approximate the distribution of the work 29,30 . To estimate the importance of these tails in the case of the engine with porous piston, we obtained a curve consisting of all the local minima observed in Fig. 6a and computed its logarithm, as shown in Fig. 6b. It is observed that the distribution deviates from a Gaussian as it presents the mentioned tail towards zero.
The inset in Fig. 6b presents the variance of the distributions obtained directly from the data, as well as from a Gaussian fit performed around the mode of the distribution. The variance values computed from the data are considerably higher that those obtained from the fit because of the large tail towards zero of the distribution, but this difference becomes smaller as p → 0 . Also, it is observed that the variance of the data gets to a maximum around the point at which the engine operates at maximum power. Figure 7a shows the pdf of W t , when a time window of length t = 40t c was used, for a fixed porosity and several values of the load mass. It is observed that, when normalized by M l gh , the amount of work done depends slightly on the load mass. As M l increases, the variance of the distribution decreases and it can be better fitted by a Gaussian function. As the pdf of t c is skewed towards large times and the accumulated work ( W t ) increases as more cycles fit within the time window, the pdf of W t is skewed towards small absolute values. Figure 7b shows the logarithm of the pdf of W t , where a deviation from a Gaussian behavior is also observed.  www.nature.com/scientificreports/ A closely related quantity to the variance of the work distribution is the entropy production. It has been shown for various systems that the latter is bounded from below by the inverse of the so-called precision, i.e., the ratio of the variance to the squared mean value of a current 31-33 , where t indicates the average entropy production during a time window of length t and the current measured is the work done by the engine on the load masses. Table 1 shows the precision as a function of averaging time t/t c . It is observed that for larger time windows there is less uncertainty in the value of the work. Assuming that the uncertainty relation given by Eq. (12) holds for this system, these precision values indicate a lower bound for the entropy production. Figures 8 and 9 show the pdf of the heat exchanged between the particle and the thermal walls. As the change in the accumulated heat is not done in discrete steps as those present on the accumulated work, the peaks observed at multiples of M l gh in the work distribution are absent and, more importantly, the mode of the distributions for the heat varies noticeably as the parameters p and M l are changed. It is this variation in heat absorption which produces the variation in the efficiency, as presented in the following paragraphs. Figure 10 shows an example of the pdf of η t , η (bp) t and η (pl) t obtained from the simulations. The bar plot refers to the actual efficiency per cycle of the engine, while the lines show the efficiency pdf computed for several time windows of size t. The distributions observed are heavily skewed towards small values of t, while both the spread and skewedness decrease as t → ∞ . The peak at η = 0 shows that for values of t near t c there is a high probability of the window falling within the same cycle doing almost no work, as shown in Fig. 3a. Note that the shape of these distributions is different from those of previously studied systems 22,24,25 , in that in most of those cases two maxima are present. The presence of the two maxima can be explained by the possibility for the systems to function either as an engine or a heat pump with certain probability 29 . However, due to the reset of the masses, the engine with porous piston cannot operate in a reverse fashion. The sudden change in the probability distribution of microstates that the reset produces amounts to a symmetry breaking 34 , and it has been observed that such events might affect the distributions and fluctuation relations that the system obeys 35 .  www.nature.com/scientificreports/ As explained in "Simulations", the macroscopic efficiency η was computed by means of the large deviation function (Eq. (11)) using several finite values of t and then extrapolating the asymptotic behavior. Figure 11 shows Eq. (11) as t goes from t c to 320t c for an ensemble of systems with parameters p = 0.2 and M l = 1.0 . The values for η are shown in Fig. 11 and were computed as an average of extrapolations using all possible combinations of ordered triplets of the curves, as described in Ref. 25 . Figures 12 and 13 plot the macroscopic efficiencies η , η (bp) and η (pl) as functions of the porosity and load mass, respectively. It is observed that η (bp) remains at 1, as on average all the energy that comes from the thermal walls goes to the piston. We also have that on average η =η (bp)η(pl) , and that the dissipation is taking place as the work provided by the piston is transformed into potential energy of the load masses, because part of the energy transferred is converted into kinetic energy of the load masses that is lost at the instant of their removal from the system.
The associated average power is also shown in Figs. 12 and 13, this time without the normalization by M l gh . As it was previously observed, for fixed M l = 1 the engine operates at maximum power around p = 0.2 . On the other hand, for fixed p = 0.2 the data show that the engine operates at maximum power for a load mass value around M l = 1.0.
According to the general theory of feedback control in non-equilibrium systems, 18 the work W done on the system between two states satisfies the generalized Jarzynski relation 36,37     www.nature.com/scientificreports/ where F is the free energy difference between the initial and final state and I c is the mutual information between phase-space point x and the outcome of its measure y. Here the measure is without error, therefore the average I c has its maximum value equal to the Shannon information H[X] of the trajectory X = {x(t)} with P[X] is probability of the trajectory X being realized. From the convexity of the exponential function one obtains If in both, the initial and final state, a load mass is hooked then F = 0 . In this point of view, the work that the machine is able to provide comes from the information obtained by measuring the piston position and performing the feedback control. Note that, contrarily to the Szilard engine, the position of the particle is not used in the feedback control.
To characterize how efficient the feedback control is, one can introduce the efficacy parameter 18 γ , which we obtain from our simulations and the relation For systems without feedback control γ = 1 , whereas for systems with feedback control γ > 1 . Figure 14 shows the efficacy, estimated as the average of exp(−βW h ) over the ensemble of simulations, with W h the work done during the intervals where the control parameter is either R or L, so that F = 0 . As expected from a feedback controlled system, the efficacy starts at 1 and increases from there as the time increases.

Discussion
By modifying Szilard's engine with the replacement of the piston by a porous one, the engine can convert heat into work without the need to store information about the position of the particle with respect to the piston. If the engine is not coupled to an external system on which to perform work, one can expect it to wiggle constantly as it exchanges heat back and forth with the thermal walls. However, the coupling of the engine with another system on which to do work introduces the possibility for energy dissipation.
We chose to couple the engine to a system similar to the one proposed in Szilard's original model, where work is done by lifting a small mass against a gravitational field. Energy is dissipated because once the load mass is removed from the system one does not take away merely the potential energy gained during the process, but also any kinetic energy that the load mass happens to have at that instant. This reset operation amounts to a symmetry breaking 34,35 , and as with engines in which an autonomous agent ultimately has to discard heat to a low temperature reservoir 17 , in this case the mechanical agent that places the new, low-energy load masses with zero kinetic energy, acts as a low temperature reservoir at T low = 0 in the sense that it takes away all the kinetic energy from them. In addition, we chose to use a feedback control by unhooking and hooking a new load mass when the piston passes through positions a and b respectively. As observed previously in a thermal ratchet system 18 , such a feedback allows for an efficacy parameter γ > 1 . In this case, the feedback reduces the amount of time that the system of spends with no mass hanging from the piston, enabling a greater power output.
If it were possible to take the system to a quasi-static limit at which the masses arrive to the extraction point with a velocity close to zero, one could expect that the amount of dissipated energy would also be very small.   www.nature.com/scientificreports/ Although the system is not driven by an external parameter which can be made to change infinitely slowly, it is observed that as the load mass is increased, keeping all the other parameters constant, the efficiency of the engine does increase while the power decreases past a certain point. The effect of the porosity of the piston on the efficiency seems to be more modest, achieving slightly better efficiency and less power output at higher values of p. Finally, an approximate maximum in the power output of the engine was observed as a function of both, the load mass and the porosity of the piston. The power decreases as one moves away from these maxima in both directions, towards small and large values of parameters p and M l , respectively.

Data availability
The code and datasets used and/or analysed during the current study are available from the corresponding author on reasonable request.