calculating battery capacity