calculating energy output