Battery Management System Calculation