Heat capacity and energy calculations