Lithium iron phosphate or lithium titanate for energy storage