Calculation of Available Energy