{'fraction_non_alphanumeric': 0.033131124591693886, 'fraction_numerical': 0.024965002333177787, 'mean_word_length': 4.733279828785447, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Modeling and validation of lithium-ion battery with initial state of charge estimation

Received Sep 13, 2020 Revised Dec 18, 2020 Accepted Jan 6, 2021 The modeling of lithium-ion battery is an important element to the management of batteries in industrial applications. Various models have been studied and investigated, ranging from simple to complex. The second-order equivalent circuit model was studied and investigated since the dynamic behavior of the battery is fully characterized. The simulation model was built in Matlab Simulink using the Kirchhoff Laws principle in mathematical equations, while the battery's internal parameters were identified by using the BTS4000 (battery tester) device. To estimate the full state of charge (SOC), the initial state of charge (SOC0) must be identified or measured. Hence, this paper seeks for the SOC estimation by using experimental terminal voltage data and SOC with Matlab lookup table. Then, the simulated terminal voltage, as well as the SOC of the battery are compared and validated against measured data. The maximum relative error of 0.015V and 2% for terminal voltage and SOC respectively shows that the proposed model is accurate and relevant based on the error analysis.


INTRODUCTION
Nowadays, energy storage devices are gaining attention among researchers and they are also being manufactured as alternative energy storage devices for conventional energy sources [1][2][3][4][5]. There are many types of existing energy storage devices, such as supercapacitors, flywheel, fuel cells, and others. Battery is the most widely used energy storage device, which currently used as an alternative energy storage device, such as rechargeable batteries [6]. It also can be used as an alternative fossil fuel solution for future green energy technologies [7][8][9]. As energy storage device, battery is utilized in multiple applications, including portable electronics, electric vehicles, military, and many others [10]. Among other types of battery such as lead-acid, sodium nickel chloride (-1iCl), vanadium redox flow battery (VRFB), nickel-cadmium (NiCd), zinc-bromine flow battery (ZBFB) and sodium-sulfur (NAS), lithium-ion battery is the most advantageous option that served for researchers and manufacturers [11,12]. This is due to its high power density, high energy density, zero pollution to the environment, zero memory effect, long life cycle, low self-discharge, high voltage, and inexpensive [5,[13][14][15][16][17][18]. However, regardless of these advantages, this type of battery still requires a precise and reliable battery management system in order to operate safely with the desired output [19,20]. On the other hand, it is necessary to have a battery model as it helps in specifying its characteristics as well as improving a battery management system [21][22][23]. According to the latest literature, mathematical model, electrical model, chemical model, electrochemical model, thermal model, and electro-thermal model are among battery models that have been studied and discussed. All of these models have the capability to predict the performance of the battery depending on the simplicity, accuracy, and application of the model [21,24,25]. According to the latest works by [7,26,27] and, the most electrical battery model used is the second-order equivalent circuit model. The second-order equivalent circuit model has resistances, capacitances, and voltage sources, and these parameters capable to form a simple, efficient, easy mathematical model based on Kirchhoff laws, and help the researcher in investigating the process of charging and discharging lithium-ion battery. Based on the mathematical expressions of these parameters' physical meaning, the state of charge (SOC) can be estimated [23]. For electric vehicle application, the SOC estimation is classified as important parameters and indicator that describe the remaining of battery capacity, by determining the charge and discharge strategy that protect the battery from overcharging or overdischarging [28,29]. In the literature, there are many methods used to estimate the SOC such as Coulombscounting (CC), open-circuit voltage (OCV), Kalman filter (KF), neural network (NN), genetic algorithm (GA), fuzzy logic and many other [30]. According to the review of previous researchers, each method has its own advantages and disadvantages [31]. In the literature of [23], the estimation of the initial state of charge in the simulation model was set to1 when the battery was fully charged after calibration, and this is because BTS4000 has no capability to show the exact remaining of the battery during the first charge. Based on the literature, there is a lack of studies that focus on the estimation of initial state of charge if the battery is having an unknown SOC while using BTS4000. Hence, this paper chooses CC as a method to estimate the initial SOC of battery. Then, the estimation of the initial state of charge in the simulation model is proposed by using the experimental terminal voltage data with SOC using lookup table in Matlab. The next sections of this paper will discuss the model structure, identification of battery parameters, simulation model, validation results with discussion and conclusion.

Model structure
The model chosen in this paper aims to examine the lithium-ion battery based on a second-order equivalent circuit as proposed by many literatures including [26]. It has two branches elements of resistance and capacitance structure that can represent the dynamic behavior of the battery as well as carry out the identification of the internal parameters precisely.
The schematic diagram of the model shown in Figure 1 has an open circuit voltage (U OC ) with one internal resistance R 0 and two RC parallel networks. It describes the relationship between current and voltage during battery operation. Open circuit voltageU OC (OCV) signifies the internal voltage of the battery, and it is depending on the SOC. U 1 and U 2 are the voltage that drops across the RC networks. When R1 and C1 play their role as the resistance and capacitance of the first network, R2 and C2 are performed as the resistance and capacitance of the second network. The mathematical expression of the model can be described based on the Kirchhoff Law of the closed-loop circuit. Hence, the terminal voltage can be described as follows: The transient voltage drops across the RC networks can be expressed as follows: Where is the current of the battery, and are the capacitances and resistances across two networks, while i = 1, 2 represents the number of RC networks. Their voltage can be expressed as below:

Battery testing bench
The internal parameters of the battery are the resistances and capacitances during transient response and unknown due to their nonlinear functions of SOC of the battery. The experiment was set in order to identify these parameters according to discharge and charge profile of the battery. As shown in Figure 2, the testing bench included a NCRPF18650 battery, a BTS4000 with eight channels, an intermediate machine, a personal data collection computer, and a NETWARE software v7.5.6. The main functions of BTS4000 are to charge or discharge the battery, the current and voltage sensors, collect data from the circuits via DAQ, and transmit the control commands via the software to the connected battery terminals. The tester operates on the voltage range of 0 to 10V, a current range of 0 to 6A with a sampling frequency of 1 Hz for 0.5 C and 1C data collection, and a measurement error that less than 0.5 percent. The purposes of middle machine in network connections are to receive control commands from a personal computer, monitor the battery cycle, and finally upload the data from the experiment. The computer has the functions of controlling the cycle through Ethernet cables and storing the data in the software database. The lithium-ion battery is used in this experiment and its important parameters is summarized in Table 1.
In Table 1, the battery specification that used in this bench aims to test the capacity, nominal voltage, temperature range, and the standard current of charge and discharge based on the data sheet of the battery used in this experiment.

Identification of model parameters 2.3.1. Evaluating open circuit voltage (OCV)
Open-circuit voltage (OCV) is the terminal voltage of the battery that happened in an open-circuit condition, and it is equal to the electromotive force (emf) that used to calculate the energy contained in the battery [23]. During the charging and discharging phase in an open-circuit setting, the terminal voltage declined from reaching a stable voltage value. There is a clear relationship between SOC and OCV due to the connection that happened between the energy stored and the remaining capacity [32]. In order to evaluate the relationship between SOC and OCV, fourteen (14) experimental procedures has been applied as in [23], which can be identified as below: a) Charge the battery to 100% SOC with a standard charging current of 0.5C (1.35A), and followed by 4 hours rest. b) Discharge the battery to 0% SOC with a standard discharging current of 0.5C (1.35A) until 2.5V, and followed by 4 hours rest. c) Charge the battery to 100% SOC with a standard charging current of 0.5C (1.35A), and followed by 4 hours rest. d) Discharge the battery with 0.5C current rate to 90% SOC, and followed by 4 hours rest. e) Discharge the battery with 0.5C current rate to 80% SOC, and followed by 4 hours rest. f) Discharge the battery with 0.5C current rate to 70% SOC, and followed by 4 hours rest. g) Discharge the battery with 0.5C current rate to 60% SOC, and followed by 4 hours rest. h) Discharge the battery with 0.5C current rate to 50% SOC, and followed by 4 hours rest. i) Discharge the battery with 0.5C current rate to 40% SOC, and followed by 4 hours rest. j) Discharge the battery with 0.5C current rate to 30% SOC, and followed by 4 hours rest. k) Discharge the battery with 0.5C current rate to 20% SOC, and followed by 4 hours rest. l) Discharge the battery with 0.5C current rate to 10% SOC, and followed by 4 hours rest. m) Discharge the battery with 0.5C current rate to 5% SOC, and followed by 4 hours rest. n) Discharge the battery with 0.5C current rate to 0% SOC, and followed by 4 hours rest.
By applying the test procedures above, the open-circuit, voltage has been recorded in equilibrium, and the variation with SOC is graphed accordingly as per shown in Figure 3.
According to Coulombs-counting method, SOC can be expressed as: Where 0 ,is the initial state of charge, is the rated capacity, η is the columbic efficiency and

Identification of battery parameters
The functions of battery parameters (Ro, R1, C1, R2, and C2) are nonlinear and depend on the relationship between SOC and OCV. The values of these parameters can be estimated when the battery reaches equilibrium and the behavior of transient variation response to the terminal voltage. According to [33], the variation of the terminal voltage during the equilibrium can be represented by the following equation: Where , 1 , 2 , and 1 , 2 are set as constant values. From the experiment, terminal voltage data during equilibrium has been collected into an excel file in each state of discharge (0,0.05,0.1,0.15,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.95,1). By using these data with (8) and apply least square method in Matlab fitting curve application, the constant values of , 1 , 2 , and 1 , 2 can be estimated. The curves fitting are displayed in Figures 4 and 5 respectively.
The accuracy of Matlab fitting curve for experimental data was at 95% confidence and the RMSE was at 0.00137. Comparing in (8) with (9), 3.029, 1 0.132, 2 0.03049, 1 54.62, 2 858.7. Thus, according to [33] it can be concluded that the internal parameters of battery can be obtained and calculated by using the following equations: The current of 1.35A used in battery current profile so the values of 0 , 1 , 1 , R2 and 2 can be calculated using (10)(11)(12)(13)(14). These procedures also applied to each state of discharge (0,0.05,0.1,0.15,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.95,1) so the polarization of resistance and capacitance can be calculated, listed and tabulated as equal to the detail that been shown in Table 2. In Table 2, the listed internal parameters can be used in simulation model for verification of model with experimental data.

Simulation model
Since the parameters of required model have been obtained in Table 2, the simulation model for the second-order equivalent circuit can be built by using Matlab Simulink with the application of output of (1) to (14). The simulation of the battery for the second-order equivalent circuit model and sub-models of the model components are shown in Figures 6 and 7 respectively. These components consist of sub-modules of SOC calculation, SOC0 calculation, internal parameters lookup table, and terminal voltage calculation. In Figure 6, the current profile used in the simulation is the current pulse of 1.35A, specifically to discharge the battery by 5% and 10% of its final value (which is the same data used in experiment for terminal voltage validation purpose). Figure 7 shows the simulation model of SOC validation with the comparison of its measured data. The experimental data of capacity and current are obtained from experiment that presented in workspace. In Figure 8, the sub-modules of terminal voltage calculation were built based on (1) to (4 terminal voltage is output of the voltage difference that happened between the OCV and the voltage across the capacitance and resistance. In Figure 9, the calculation of SOC is built based on Coulombs-counting method that described in (6). The rate limiter is set between 0 and 1 in order to avoid charge and discharge of the battery, and show the accuracy of the simulation model. Figure 10 shows the initial state of charge (SOC0) calculation. It has enabled the function, which aimed to get the value of SOC0 during the second of zero simulation and avoid from updating its value during the full simulation. The terminal voltage data that obtained from workspace was compared with OCV lookup table that used to measure the final SOC. Integral function of current and SOC used with application of (7) had allowed the value of SOC0 as to be estimated.

. Battery calibration
In this experiment, the test procedures as above have been applied in charging and discharging the battery for capacity calibration. The current profile used is displayed precisely in Figure 11. Figure 11 shows the current profile that is used for battery calibration in order to collect the terminal voltage data of battery for SOC0 estimation. After the battery has fully charged and discharged by current amount of 1.35 A, the battery then discharged by 10% and 5%of its SOC and left for four hours rest in order to reach equilibrium status. Figure 12 shows the experimental data of battery terminal voltage based on the current profile that used in Figure 11. The cut off voltage has reached 2.5 V during zero state of charge, and it reached 2.7 V when being discharged by pulse. These voltage data will be used for initial SOC estimation in the next sections.

Current pulse discharge validation A. Current profile
For modeling validation, the terminal voltage and SOC play their role as the main parameters and deeply discussed in this paper. To validate the model, a current profile is used in order to discharge the battery by 1.35 A with unknown SOC. The current profile is displayed in Figure 13.

B. Initial and final SOC results
In this paper Coulombs-counting method is used for SOC estimation. The data of terminal voltage, SOC and lookup table in Matlab with the application of (7), the initial state of charge (SOC0) was estimated. The constant value of SOC0 estimated in simulation with the SOC is shown in Figure 14. Figure 14 shows that the initial and final SOC during the first charge show the value of the remaining capacity of the battery at almost 90%. The researchers believe that the SOC0 shown in red line will be constant during the full simulation model. The final SOC changed from 90% to almost 5% of its final value based on the current pulse used. For showing the accuracy of the proposed method of SOC0 estimation, this paper used another enable function in order to record the initial SOC for the whole simulation. The SOC is compared and plotted with initial SOC as shown in Figure 15. In Figure 15, the final and initial SOC are plotted and compared in order to identify the detail of changes that occur at each level of SOC as well as aware with the previous value of SOC to show the accuracy of SOC0 estimation method.

C. Battery terminal voltage results
As a continuous process of model validation with the SOC0 estimated in previous section, the terminal voltage of simulation and experimental data are comparedand in Figure 16. The error between experimental and simulated model in Figure 17 shows the accuracy of the second-order equivalent circuit model for lithium-ion battery with average RMSE error of 0.1V. By comparing this results with the paper studied by [26], the initial state of charge was set in his study to 90% rather than estimated and the terminal voltage average RMSE error was 0.2733%. In this paper, the initial state of charge was estimated and used to validate the terminal voltage with better error rate, which validate the proposed methods studied of this paper.

Static validation
To verify the accuracy of the model, constant discharge current was performed. The battery was discharged at a constant current of 1C (2.7 A) to its cutoff voltage of 2.5 V. For the simulation model, the initial SOC was estimated based on (7), and the model was run afterwards.

A. Terminal voltage validation
During constant discharging current of the battery for one hour, the simulated model was compared with experimental data of battery terminal voltage. The terminal voltage results and its errors are shown in Figures 18 and 19 respectively. The comparison in Figure 18 illustrates that the curves are approximately similar. during 0 to 2000 second, terminal voltage is lower in case of experimental voltage (as compare to simulated voltage), while 2000 to 3500 second it is just reverse due to the increase of internal resistance of the battery by time. In Figure 19, the maximum relative error between simulated and measured voltage of the battery is 0.015 V, which simultaneously prove the accuracy of model. In the literature conducted by [23], the second-order equivalent circuit model validation using Coulombs-counting method was used for SOC estimation and the value of SOC0 was set to 0.3. In this paper, the SOC0 was estimated and by comparing the error rate of terminal voltage, reported by [23], the maximum relative error was 0.0452. In this paper, however, it was 0.015 and better in overall error rate in graphs reported. This clearly show that the estimation method of SOC0 was valid and more accurate for validation of battery terminal voltage. Figure 19. Output error in constant discharging process

B. SOC validation
The SOC of the battery is the key indicator parameter of the remaining capacity of the battery, specifically for battery development and its application. In this paper, the SOC was estimated by using Coulombs-counting method and validated with experimental data. The comparison between the estimated model and the experimental results is shown in Figure 20.
In Figure 20, the red line shows the CC method in simulation, while the green line shows the measurement data from the experiment. It can be clearly seen that in Figure 20 during 0 to 3000 second, state of charge (%) is lower in case of CC method (as compare to (Reference) while 3000 to 3500 second it is just reversed due to the constant rated capacity used in simulation model compared to the experimental capacity data obtained from experiment as function of time. The average RMSE error is 2.409 %, which acknowledges that the model was precise with a simple method of SOC estimation as compared to the complicated methods reported in the literature such as the proposed observer which investigated by [26]with their average error of almost 5%.

CONCLUSION
The lithium-ion battery second-order circuit model characterizes the electrical behavior of lithiumion battery in terms of terminal voltage and SOC parameters. These parameters were investigated by discharging the battery through pulse and constant discharging methods. Firstly, this study managed to find an accurate method of model parameter identification for battery internal parameters. Then the estimation of initial SOC in the simulation model was proposed by using terminal voltage data and SOC with Matlab lookup table and CC method. After that, the simulation model of terminal voltage and SOC validated with measured battery voltage and SOC. Furthermore, the error analysis for terminal voltage and SOC are calculated with almost 0.015V and 2% respectively. Based on the validation between the measured and simulated terminal voltage and SOC, the error shows that the electrical model as second-order represents the dynamic behavior of the battery. In addition, the obtained results satisfies the precision of the model proposed, so it can be used for a further battery management system and application.