Analysis of the internal crystallization of lithium batteries