Measurement of heat capacity by fitting the whole temperature response of a heat-pulse calorimeter