The mechanical equivalent of heat and the first law