Multicriterial evaluation and optimization of an algorithm for charging energy storage elements