 Welcome to thermodynamics 3, energy, and the first law. Before we get to the first law, we should probably state the zeroth law for completeness. Following Goodstein, let's declare that the concept of temperature makes sense. If that seems self-evident, well, that's why it's the zeroth law. It was an underlying assumption as the other three laws of thermodynamics were developed and codified. Suppose we have two bodies, A and B, that are not in thermal contact. We place a third body, C, in thermal contact with both A and B, and allow them to come to thermal equilibrium, so that A and C are in equilibrium, and B and C are in equilibrium. By the zeroth law, we can conclude that bodies A and B are in equilibrium with each other, even though they are not in thermal contact. Here's a variation, bodies A and B are not in thermal contact. We place a third body, C, in contact with A, and allow them to come to equilibrium. Moving C into contact with B, and allowing them to come to equilibrium, we find that there is no change in the state of body C. If C is a thermometer, then we will have measured the same temperature of bodies A and B. By the zeroth law, we can conclude that A and B are in equilibrium, even though they are not in thermal contact, and have never been in simultaneous contact with a third body. Bodies with the same temperature are in equilibrium. The concept of temperature makes sense. Now we can tackle the first law. The first law of thermodynamics can be formulated in many ways. One is as a summary of hard earned experience. Max Planck gives an example in his treatise on thermodynamics. He writes, It is impossible to construct an engine which will work in a cycle and produce continuous work or kinetic energy from nothing. There is no free energy. A more explicitly thermodynamic statement is given by Rudolf Clausius in his The Mechanical Theory of Heat. In all cases in which work is produced by the agency of heat, a quantity of heat is consumed which is proportional to the work done, and conversely, by the expenditure of an equal quantity of work and equal quantity of heat is produced. Sometimes the first law is equated to the law of energy conservation in a statement such as the energy of a closed system is conserved, or energy cannot be created or destroyed only transformed. These are all scientifically valid statements. However, in the context of thermodynamics, Clausius's version, which explicitly references heat, is the most useful. Let's divide the universe into two pieces. A finite piece we call the system and everything else we call the environment. We denote by q heat added to the system from the environment, and by w worked on the system by the environment. q denotes the internal energy of the system. All three of these quantities have units of energy, joules. Then the first law reads delta u equals q plus w. The change of the system's internal energy equals the energy added to the system as heat plus the energy added in the form of work. Any of these three quantities can be positive or negative. A negative q, negative heat added to the system, corresponds to positive heat being transferred from the system to the environment. A negative w, negative work done on the system, corresponds to the system doing positive work on the environment. A positive or negative delta u indicates that the internal energy has increased or decreased. To avoid ideas like negative heat and negative work, we can add a subscript to denote the direction of transfer. q sub s denotes heat transferred to the system from the environment, while q sub e is heat transferred to the environment from the system. Likewise, w sub s is worked on on the system by the environment, and w sub e is worked on on the environment by the system. This gives us different formulations of the first law. Change in internal energy equals heat added to the system plus work done on the system, or heat added to the system minus work done on the environment, or work done on the system minus heat transferred to the environment. We can use whichever version is most convenient in a particular application. Now let's consider how we can use a piston to convert thermal energy to mechanical work. For our purposes, a piston is a solid object that moves back and forth inside a cylindrical tube. One end is in contact with a gas sample that forms our system, and the other is connected to a machine. Here's a piston system shown in cross-section. Gray indicates a thermally insulated solid. We assume no heat is transferred to or from the piston or cylinder, and that the piston cylinder fit is gas tight. X denotes the piston's vertical position. The bottom of the cylinder is sealed by a solid heat reservoir at temperature T. We assume the reservoir has infinite heat capacity so that any amount of heat can be transferred to or from it without changing its temperature. Inside the cylinder is a quantity of ideal monatomic gas at the same temperature as the reservoir and colored yellow. The volume of the gas equals the piston's cross-sectional area times the distance X. Gas pressure produces a force on the piston. If the gas expands and this force acts through a displacement delta X, then work WE approximately equal to F delta X is done on the environment. Approximately, because the force is not constant, it varies with X. Because the gas is in thermal equilibrium with a heat reservoir, it's temperature and therefore its internal energy does not change. Heat QS flows from the reservoir to the gas to maintain its temperature. By the first law, the work done by the gas must equal the heat transferred to the gas. Therefore, the system has converted heat into mechanical work. The process can be reversed, allowing mechanical energy to be converted to thermal energy. If an external force pushes on the cylinder and acts through a distance delta X, work WS approximately equal to F delta X is done on the gas. Again, the gas's temperature and internal energy do not change. And heat energy QE flows from the gas to the reservoir. By the first law, the work done on the gas must equal the heat transferred from the gas to the environment. Therefore, the system has converted mechanical work into heat. Let's use our single-atom gas model to see how this energy conversion works. First, we'll focus on conversion between internal energy and work in the absence of heat flow. Our atom will bounce between two vertical walls. The left is fixed, while the right moves, representing a piston. The top panel will simulate expansion, while the bottom panel will simulate compression. The atom has an initial velocity, representing the initial temperature of the gas. Each time the atom bounces off the receding wall, it slows down, as some of its kinetic energy is expended doing work against the piston, resulting in a lowering of the gas temperature. For compression, the flow of energy is reversed. The piston does work on the atom, increasing its kinetic energy, and hence the temperature of the gas. These are so-called adiabatic processes in which there is no transfer of heat. For adiabatic expansion, internal energy is converted to work, and the gas cools. For adiabatic compression, work is converted to internal energy, and the gas heats. Now, let's connect the fixed wall to a heat reservoir at some fixed temperature. This allows the gas to absorb or expel heat, so as to maintain this temperature. We will simulate this by resetting our atom's velocity to a fixed value each time it bounces off the wall. During the expansion, the atom slows down each time it bounces off the moving wall, but speeds up each time it interacts with the fixed wall. Energy is transferred from the reservoir to the gas, and from the gas to the piston. For compression, the process is reversed. The atom speeds up each time it bounces off the moving wall, and slows down each time it interacts with the fixed wall. Energy is transferred from the piston to the gas, and from the gas to the reservoir. In these constant temperature, or isothermal processes, there is no change in the gas's internal energy. In expansion, heat added to the system is converted to work done on the environment. For compression, work done on the system is converted to heat transferred to the environment.