Thermal-Electrochemical Modeling and State of Charge Estimation for Lithium Ion Batteries in Real-Time Applications