State of Charge calculation