# Biological Physics/How work, pressure, and volume are related
## The Ideal Gas Law

The first concept we will derive and study is the Ideal Gas Law. You may be familiar with the Ideal Gas Law in the form ${\it {PV}}={\it {nRT}}$ from a general chemistry course, where P is the pressure, V is the volume, n is the number of moles of particles, R is the Ideal Gas Constant, and T is temperature. This equation can be used to describe a closed system filled with ideal (non-interacting, randomly moving) gas particles.

### Derivation

Understanding and deriving this law from first principles is our first step to obtaining a grasp of thermal biophysics. Let's first write the Ideal Gas Law in a new manner. This is considered the more "physics-y" formulation of the Ideal Gas Law, and it is easier to derive. This new formulation is ${\it {PV}}={\it {Nk}}_{B}T$. The only difference between the two is that the latter contains an N that represents the number of particles in a system rather than the number of moles of particles. Also, the constant is no longer the Ideal Gas Constant R but Boltzmann's constant k$_B$. Boltzmann's constant relates energy with temperature at the level of each individual particle.
Consider a closed system of a cylinder and piston. The distance from the piston to the other side is x, and the area of the piston (and the other side of the cylinder) is A. The cylinder is filled with monatomic ideal gas particles that are moving ballistically and randomly around inside.
The cylinder in its current state is 3 dimensional. The particles are allowed to move up and down, left and right, and forward and backwards. However, imagine that we squeeze the cylinder down to an infinitely small tube such that the particles only have the ability to move only left and right. This greatly decreases the complexity of the proof as we only have to worry about one dimension rather than three.
It is at this point that we should state a few assumptions of the proof thus far. Assumptions are important to understand as they give us guidance to the validity, applicability, and general understanding of the proof and consequent concepts that are drawn from it. First, we assume that all particles are moving at the same speed. At first glance, this assumption seems preposterous. However, when taken as a whole, a large number of particles (think 1 x 10$^{23}$) do behave with an aggregate average speed. This idea of "average" is a concept that will reappear many times throughout statistical mechanics. This idea is only valid with large systems, but since that is what we are usually concerned with in thermal physics, then this assumption will hold.
The second assumption is that collisions are elastic and momentum is conserved. This means that when a particle with mass m and with velocity v collide with one of the ends of the container, then $p_{i}={\it {mv}}$ and $p_{f}=-{\it {mv}}$ where p$_i$ is the momentum of the particle before collision and p$_f$ is the momentum after collision.
You may recall that $F={\frac {\it {dp}}{\it {dt}}}$. So
    $\left|F\right|={\frac {\left|\Delta p\right|}{\Delta t}}$
    $\left|F\right|={\frac {\left|p_{f}-p_{i}\right|}{\Delta t}}$
    $\left|F\right|={\frac {\left|{\it {-mv}}-mv\right|}{\Delta t}}$
    $\left|F\right|=2\,{\frac {\it {mv}}{\Delta t}}$
You may be wondering what value we chose for Δt. We will let Δt be the time it takes for a particle to move from one end of the tube to the opposite end of the tube and collide. This restriction ensures that each and every particle collides exactly once with one side of the tube during time Δt. Here, we make our third assumption that half of the particles will collide with the left end and the other half will collide with the right end. The sum of the force imparted by each individual particle that collides with the right end would give the total force felt on the right end from the particles. Or, more succinctly $F_{\it {right}}=\Sigma \,\,{\frac {2m_{i}v_{i}}{\Delta t}}$ where i goes from 0 to only N/2 since only half of the particles collide on the right side in the allotted time. Also, it should be noted that $F_{\it {right}}=-F_{\it {left}}$ since the same number of particles collide on the left, but in opposite direction. This equation greatly simplifies down to
    $F_{\it {right}}={\frac {N}{2}}{\frac {\it {2mv}}{\Delta t}}$
    $F_{\it {right}}={\frac {\it {Nmv}}{\Delta t}}$
Recall that pressure on one end of the tube P is the total force felt at that end divided by the area of the end $P_{\it {right}}={\frac {F_{\it {right}}}{A}}$.
By substitution, $P_{\it {right}}={\frac {\it {Nmv}}{A\Delta t}}$. Since $V={\it {Ax}}$, then after solving for A, $P={\frac {\it {Nmvx}}{V\Delta t}}$ by substitution. Remember what x represents: the total length of one end to the other of the tube. Since Δt was the time it took for a particle to move from one end of the tube to the other, then it follows that $v={\frac {x}{\Delta t}}$. By substitution, $P={\frac {{\it {Nmv}}^{2}}{V}}$, or
    ${\it {PV}}={\it {Nmv}}^{2}$
Now, we will invoke a principle that you may not have heard of before. According to the Equipartition Theorem, any quadratic degree of freedom may store an average of $1/2\,k_{B}T$ of energy. Since the velocity term is quadratic, then it follows the Equipartition Theorem. The Equipartition Theorem is not a theorem that is proven here; it will simply be assumed true. There are many degrees of freedom that need to be considered for these particles: translational, rotational, and vibrational motion. Since we have restricted ourselves to a one-dimensional system, then there is only one translational degree of freedom. There are in fact no degrees of rotational freedom. This may seem strange, but it is a phenomenon that arises from Quantum Mechanics. Since the particles are monatomic and spherical, it is impossible to distinguish one rotational configuration from another. This means that these rotational states admit no extra degree of freedom. There is no degree of freedom that arises from vibrational motion since the particles are monatomic. Therefore, the kinetic energy KE of the particle contains only 1 term ${\it {KE}}=1/2\,{\it {mv}}^{2}$. Since the kinetic energy is quadratic, then by the Equipartition Theorem $1/2\,{\it {mv}}^{2}=1/2\,k_{B}T$, or with a little simplification ${\it {mv}}^{2}=k_{B}T$. By substitution back into the pressure equation above, ${\it {PV}}={\it {Nk}}_{B}T$.

### The Difference between n and N

Be sure that you do not get confused with the difference between n and N. The number of moles in the ideal gas is denoted by n while the number of particles is denoted by N. To a physicist, it is usually more helpful to think in terms of the particles rather than the number of moles. This will become exceptionally clear when we begin to study the amount of disorder in a system.

## Work

Now imagine an outside force is exerted on the piston. When a force is applied onto the system, the piston compresses by a certain distance Δx. You may remember from an earlier physics class that Work can be calculated as $W=F\Delta x$. Since $F=PA$, then by substitution $W={PA}\Delta x$. Since AΔx is just the change in volume ΔV, then $W={P}\Delta V$. Essentially, work shows the amount of energy that enters or leaves the system whenever the piston moves in or out. The primary focus in Thermal Physics is to keep track of the total energy in a system. It seems that one exchange of energy between systems is through the work that is either done on or being done by the system. Another type of energy that needs to be monitored is the amount of heat that enters or leaves the system. Ultimately, work and heat energy are the only two quantities to keep track of to determine the total change in energy. This gets us to the First Law of Thermodynamics
    $U(totalenergy)=Q(heat)+W(work)$
More often than not, it may be more prevalent to measure a change in the energy of the system
    $\Delta U=Q+W$,
where the deltas (Δ) have been left off of the right side because heat and work are not necessarily conserved quantities.

### Isothermal Processes

An isothermal process is a process that occurs while temperature remains constant. First, recall the state equation of an ideal gas ${\it {PV}}={\it {Nk}}_{B}T$ or $P={\frac {{\it {Nk}}_{B}T}{V}}$. Also, recall that work in a system for constant temperature is $W=P\Delta V$. Since it is possible for both volume and pressure to change, and pressure can be written as a function of volume, then work can be written as a function dependent on volume $W={\frac {{\it {Nk}}_{B}T\Delta V}{V}}$. Now, if you take small increments of $\Delta V$ or $dV$ and then added them all up to obtain the total change in volume, then work could be calculated as$\int _{Vi}^{Vf}{\frac {Nk_{B}T}{V}}\,dV$. Since an isothermal process is being considered, then $Nk_{B}T$ is constant and can be pulled out of the integral. After integrating, $W={\it {Nk}}_{B}T\left(\ln \left(V_{f}\right)-\ln \left(V_{i}\right)\right)$. By rules logarithms, $W={\it {Nk}}_{B}T\ln \left({\frac {V_{f}}{V_{i}}}\right)$. For such an isothermal process (where the temperature remains constant), all of the energy that enters or leaves a system can be found with this work equation.

### All about Perspective

When the piston is compressed, we perform work on the system and the volume decreases. As can be seen from the above equation, a final volume that is smaller than the initial volume will give a negative value. This means that if we want to determine whether energy is entering (positive work) or leaving (negative work) a system, then the work equation needs to have a sign flipped $W=-{\it {Nk}}_{B}T\ln \left({\frac {V_{f}}{V_{i}}}\right)$. Or once again from the rules of logarithms, $W={\it {Nk}}_{B}T\ln \left({\frac {V_{i}}{V_{f}}}\right)$. This illustrates an important concern in thermal physics. It is imperative that the energy being discussed is qualified in terms of the ‘’system’’ or its ‘’surroundings’’. In most cases, a negative value stands for energy leaving the system and a positive value indicates energy entering the system. This being the case, our equation for work must be written as $W=-P\Delta V$ to ensure that compression (decrease in volume) leads to positive work on the system.