The maximum work that can be obtained from a system initially at a higher temperature T than the environment at T0 is equal to the initial available energy minus the available energy at the final state. For an irreversible process, the actual work is always less than the maximum reversible work, with the difference equal to T0 times the entropy generation. The maximum work from a flow process is equal to the change in availability plus any heat input times 1 minus the ratio of environment to heat source temperatures.