How to Increase the Accuracy of the State of Charge Algorithms and the Lifetime of Batteries