Minimum Joule heating dissipated in the charging process of a rechargeable battery