Because the net variation in state properties during a thermodynamic cycle is zero, it forms a closed loop on a PV diagram. A PV diagrams Y axis shows pressure (P) and X axis shows volume (V). The area enclosed by the loop is the work (W') done by the process:
This work is equal to the balance of heat (Q) transferred into the system:
Equation (2) is consistent with the First Law; even though the internal energy changes during the course of the cyclic process, when the cyclic process finishes the system's internal energy is the same as the energy it had when the process began.
If the cyclic process moves clockwise around the loop, then W will be positive, and it represents a heat engine. If it moves counterclockwise, then W will be negative, and it represents a heat pump.