Stirling Cycle 
This page requires understanding the Ideal Gas Law. If you are not familiar with it, please read and understand the material at this page before continuing. The Ideal Gas Law describes the relationship between pressure, volume, and temperature of gas in a closed system. It is written: P·V = n·R·T where n is the number of moles of gas and R is a constant associated with the particular gas or mix of gasses in the engine. R and n will both be constants for a given engine, and so their product, nR, will be a constant.
If you're not intimately familiar with the Carnot Cycle, take (another) break and study to gain that familiarity. Here are conceptual graphs of what's happening in a Stirling cycle engine:
The plots for a real engine wouldn't have the sharp corners, and would look more like a trapezoid than a parallelogram (see plot below), but these will work for our purposes. Notice that the Stirling cycle has four distinct transitions: 1 → 2 : Isothermal (constant temperature) Expansion The gas expands as heat energy is transferred into the hot head. As the gas expands it drives the fluid down, causing the engine volume to increase and the pressure to decrease. Assuming isothermal conditions, the heat transferred to the gas is exactly equal to the work done on the power piston. 2 → 3 : Isochoric (constant volume) Displacement (Cooling) The gas moves through the regenerator at the maximum engine volume. Heat is transferred from the gas to the regenerator, causing the pressure, temperature, and entropy of the gas to decrease. 3 → 4 : Isothermal (constant temperature) Compression The cooled gas contracts in the cold head, and heat energy is sunk to the cold head at constant temperature. Consequently, the engine volume decreases, while the engine pressure increases. Assuming isothermal conditions, the heat sunk to the surroundings is exactly equal to the work done by the power piston on the gas. 4 → 1 : Isochoric (constant volume) Displacement (heating) The gas moves back through the regenerator at the minimum engine volume. Heat is transferred from the regenerator back to the gas, causing the pressure, temperature, and entropy of the gas to increase.
T_{a} = starting temperature in Kelvins (ambient?)
P_{a} = starting hot head pressure (ambient?) A_{h} = hot head cross sectional area
Efficiency is less than or equal to (1 − T_{c} / T_{h} ) for all Carnot cycle engines.
Let's begin by calculating nR = P_{a}·V_{o} / T_{a} using the operating parameters for the engine at rest before any heat is applied. Once the value of nR has been calculated, we can use it anywhere needed in our calculations, and we never need to worry about the actual number of moles of gas nor the actual value of the gas constant for our gas mix.
The plot above was produced by a program using the following method of calculation.
At startup we have:
P_{0} = P_{a} Phase 0 → 1 (constant volume)
V_{1} = V_{o} Phase 1 → 2 (constant temperature)
T_{2} = T_{1} Phase 2 → 3 (constant volume)
V_{3} = V_{2} Phase 3 → 4 (constant temperature)
T_{4} = T_{3} Phase 4 → 1 (constant volume)
V_{1} = V_{4}
