Stirling Engine Simulator (2D)

This 2D companion to the 3D Stirling engine simulator models the real alpha-type mechanism from first principles: a hot piston and a cold piston on crank throws 90° apart, gas pressure computed live from the ideal gas law as the hot and cold volumes change through the cycle, and a flywheel whose angular acceleration is driven purely by the resulting net torque. Nothing rotates on a script — set the reservoir temperatures and load, give the flywheel a kick, and watch it either spin up into a self-sustaining cycle or stall, while the live pressure-volume diagram traces the actual loop the gas is tracing in real time.