Thermodynamic modeling of compressed air energy storage for energy and reserve markets