The working fluid can be used to output useful work if used in a turbine. Also, in thermodynamic cycles energy may be input to the working fluid by means of a compressor. The mathematical formulation for this may be quite simple if we consider a cylinder in which a working fluid resides. A piston is used to input useful work to the fluid. From mechanics, the work done from state 1 to state 2 of the process is given by: