## 4 Methods  
### Mathematical Modeling of Rechargeable Lithium-Ion Battery State of Charge  
Mathematical modeling plays an important role in gaining in-depth knowledge of the dynamic behavior of rechargeable lithium-ion batteries, ultimately leading to improvements in their operational efficiency. By using the above power-energy reservoir model presented in Figure 1, the energy balance equation for the lithium-ion battery during charging/discharging can be modeled by Equation (2), which includes the entire process in the spatial domain: \(\forall x\in[0,L]\). \[HL\left(\beta_{ch}P_{ch}+\frac{P_{dis}}{\beta_{dis}}\right)=HL\left(\kappa \frac{dq}{dt}+U_{b}C_{0}\gamma(\mu\pm q)\right). \tag{2}\]  
To be more explicit, Equation (2) can help to capture charging or discharging scenarios, depending on the specific conditions applied, which we will provide later. In this framework, key parameters such as \(P_{ch}\) and \(P_{dis}\) quantify the rate of transfer of electrical energy into and out of the battery, while \(\beta_{ch}\) and \(\beta_{dis}\) characterize the efficiency of charging and discharging, respectively. The voltage \(U_{b}\) is the terminal voltage of the battery when it reaches its fully charging or discharging state, while \(q\) designates, under specific conditions, the state of charge added during charging or the state of charge removed during discharging so that \((\kappa dq/dt)\) indicates the contribution of the flow of energy stored or supplied per unit time, where \(\kappa\) signifies the energy capacity of the energy reservoir box. Furthermore, \(C_{0}\) represents the standard capacity, \(\gamma\) is the constant parameter that governs the energy transfer, and \(\mu\) stands for the initial state of charge when the battery is neither charging nor discharging. In the term \((\mu\pm q)\), the plus sign \((+)\) means that we are in a charging condition, while the minus sign \((-)\) means that we are in a discharging condition. The reason why \(P_{ch}\) is multiplied by \(\beta_{ch}\) is that when a battery is charged, not all the energy supplied is stored; some is lost in the form of heat due to internal resistance and other inefficiencies. The charging efficiency \(\beta_{ch}\) reflects the fraction of the energy supplied that is stored in the battery. If one supplies \(P_{ch}\) to the battery, the amount of energy stored in the battery is  
\[P_{store}=\beta_{ch}\times P_{ch}. \tag{3}\]  
This means that only a part of the input power is effectively converted into stored energy. The parameter \(P_{dis}\) is divided by \(\beta_{dis}\) because when discharging a battery, not all the stored energy can be converted back into useful output power; again, some of it is lost as heat due to inefficiencies. The discharging efficiency \(\beta_{dis}\) indicates the fraction of the stored energy that can be converted into useful output power. If the battery discharges power at a rate of \(P_{dis}\), the amount of stored energy consumed from the battery is  
\[P_{consumed}=\frac{P_{dis}}{\beta_{dis}}. \tag{4}\]  
This formula considers that more energy needs to be drawn from the battery than is available as useful output power due to losses during the discharging process. The parameters and units in Equation (2) are summarized in Table 1. \begin{table}
\begin{tabular}{l l l} \hline \hline
**Symbol** & **Quantity** & **Unit** \\ \hline \(\kappa\) & Energy capacity & Watt-minutes (W min) \\ \(q\) & Inlet/outlet state of charge & \% \\ \(\mu\) & Initial charging/discharging state of charge & \% \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameters and units. The charging and discharging power in Equation (2) can be expressed as the rates of change in energy with respect to time, as evidenced by Equations (5) and (6):  
\[P_{ch} =\frac{dE_{ch}}{dt}, \tag{5}\] \[P_{dis} =-\frac{dE_{dis}}{dt}. \tag{6}\]  
The negative sign in Equation (6) indicates that discharging power (\(P_{dis}\)) is the rate at which energy (\(E_{dis}\)) is released from the battery over time.