Physics
Thermodynamics calculator: first law, transformations, Carnot
Pick the relation and clear the quantity you are after: the calculator inverts the formula for you. Temperatures here are absolute and go in kelvin, because they appear as values and not only as differences.
The first law counts, the second law limits
The first law of thermodynamics is bookkeeping: energy given to a gas either stays inside as internal energy or leaves as work, and ΔU = Q − W says nothing more than that. The classic transformations are the four ways of sending one of those terms to zero. At constant volume there is no work and all the heat raises the temperature; at constant pressure the work is simply p·ΔV; at constant temperature the internal energy does not change and every joule taken in comes back out as work; with no heat exchanged the gas pays for its work out of its own internal energy and cools. Recognising which case is in front of you is the first step of any exercise.
The adiabatic deserves a second look, because it is the only one where pressure, volume and temperature all change together. The law p·V^γ = constant is steeper than Boyle's: compressing a gas does not merely squeeze it, it heats it, and the pressure rises for both reasons. The index γ is the ratio of the two molar heats, 1.67 for a monatomic gas and 1.4 for air. It is why a diesel engine lights its fuel without a spark, and why a bicycle pump is hot after twenty strokes.
The second law adds no sum but a prohibition. Heat goes spontaneously from hot to cold and never the other way, and from that it follows that no heat engine can turn all the heat it takes in into work: some of it always has to be dumped into the cold reservoir. Carnot fixes the limit at 1 − T_c/T_h, with absolute temperatures, and no cleverness of construction gets past it. Hence entropy, ΔS = Q/T, which measures how much of that heat is now unavailable: the same heat delivered at a lower temperature produces more entropy, that is, more energy that can never be used again.
Common mistakes
- Getting the sign of the work wrong. With the convention ΔU = Q − W, the work is positive when the gas expands; a compression has to be entered with a minus sign.
- Using degrees Celsius in formulas that want absolute temperatures. Carnot efficiency and entropy need kelvin: 27 °C is 300.15 K, not 27.
- Applying p·V = constant to an adiabatic transformation. There the law is p·V^γ = constant, and the difference is far from small: compress air to a quarter and the pressure does not quadruple but rises nearly sevenfold.
- Confusing a real efficiency with Carnot's. Carnot's is only the theoretical ceiling between two temperatures; a real engine always comes in below it, and if the arithmetic says otherwise the data are wrong.
- Forgetting that ΔU is zero in an isothermal. If the temperature does not change, the heat absorbed and the work done are the same number, and looking for one without the other is wasted effort.
Frequently asked questions
What sign does the work take in the first law?
On this page, as in the commonest convention, W is positive when the gas does work on its surroundings, that is when it expands. The first law is then written ΔU = Q − W. If the gas is being compressed, enter a negative work.
Why does all the heat become work in an isothermal?
Because the internal energy of an ideal gas depends only on the temperature: if the temperature does not change, ΔU is zero. The first law then leaves Q = W, so every joule taken in comes back out as work.
Why does compressing a gas quickly heat it up?
Because a fast compression is effectively adiabatic: there is no time to exchange heat, so the work done on the gas all goes into its internal energy and the temperature rises. This is the principle of the diesel engine, and the reason a bicycle pump gets hot.
Why does no heat engine reach 100%?
Because an engine returning all the heat it takes in as work would violate the second law. There always has to be a cold reservoir to dump part of the heat into, and the maximum efficiency is Carnot's: 1 − T_c/T_h, with the temperatures in kelvin.
How do you raise the Carnot efficiency?
By making the hot reservoir hotter or the cold one colder. Since what counts is the ratio of absolute temperatures, gaining twenty degrees on an 800 K boiler is worth far less than gaining twenty on a 300 K condenser.
How this calculation works
First law with work counted positive when done by the gas: ΔU = Q − W. Isobaric work: W = p·ΔV, negative under compression. Isothermal work for an ideal gas: W = n·R·T·ln(V₂/V₁) with R = 8.314 J/(mol·K); since ΔU = 0, Q = W as well. Internal energy: ΔU = n·c_V·ΔT, with c_V = (f/2)·R for f degrees of freedom, that is 3R/2 for a monatomic gas and 5R/2 for a diatomic one. Reversible adiabatic transformation: p₁V₁^γ = p₂V₂^γ, with γ = c_p/c_V; the work done is W = (p₁V₁ − p₂V₂)/(γ − 1), and the ratio p₂V₂/(p₁V₁) is the ratio of the absolute temperatures. Efficiency of a heat engine: η = W/Q_h = 1 − Q_c/Q_h, with 0 < η < 1. Carnot efficiency, the upper limit between two reservoirs: η = 1 − T_c/T_h, temperatures in kelvin. Change in entropy for a reversible exchange at constant temperature: ΔS = Q/T.