Heating and cooling methods of lithium batteries