Validation of a lithium-ion commercial battery pack model using experimental data for stationary energy management application

Background: A cost-effective solution for the design of distributed energy storage systems implies the development of battery performance models yielding a suitable representation of its dynamic behaviour under realistic operation conditions. Methods: In this work, a lithium-ion battery (LIB) is tested to be further modelled and integrated into an existing energy management control system. This specific LIB (5.0 kW /9.8 kWh) is integrated with a commercial inverter and solar photovoltaic (PV) system (3.3 kWp) as part of a microgrid that is also encompassing other energy storage technologies at the University of Évora, Pole of INIESC – National Research Infrastructure for Solar Energy Concentration. A testing protocol fully characterizes the battery and the inverter efficiency to describe their performance better. Then, a battery model is built upon both the existent LIB description and experimental fitting regression. The model allows obtaining the voltage curve, the internal resistance (i.e., to describe instantaneous voltage drop/rise and transients), and the state of charge (SOC) and/or energy capacity based on the current input. The developed model is validated through the comparison with the experimental results. Results: The model approach presented a higher voltage RMSE (root mean square error) of 5.51 V and an MRE (maximum relative error) of 5.68 % in the discharge state. Regarding SOC, the MRE obtained was approximately 6.82 %. In the charge state, the highest RMSE voltage was 5.27 V, with an MRE of 6.74 %. Concerning SOC, the MRE obtained was approximately 6.53 %. Conclusions: The developed model is validated through the comparison with experimental results. Based on computational effort, simplicity of use and the associated model error, the approach is validated to the regular conditions of the commercial battery pack to be incorporated in the next research step, following a bottom-up modelling approach for an increasingly more complex smart grid.


Introduction
In 2019, 2.9 gigawatts (GW) of energy storage worldwide were added, almost less than 30 % compared with 2018.The result is justified by the early maturity stage of some energy storage technologies -with presence in a few specific markets -and high dependence on support from appropriate policies 1 .In the electrical sector, the energy storage can be applied to different goals: meeting the demand and reliability in the grid peak hours or as an asset on the liberalised electricity markets, benefit from price arbitrage depending on the fluctuation in spot prices, from capacity credit as transmission congestion relief or resource suitability, or for ancillary resources as voltage or frequency regulation and spinning or non-spinning reserves 2 .On a smaller scale, these storage technologies can also directly benefit the consumer, namely, for solar photovoltaic (PV) self-consumption maximization, in the electricity shift from low demand to peak times or helping stabilize intermittent renewable energy sources (RES).They can also help in the demand-side management (DSM) or flexible power demand and in the smart-charging of electric vehicles (EVs) 3 .Energy storage comprises different technologies, and in this work, the electrical sector application of a lithium-ion electrochemical energy storage technology will be discussed.
Lithium-ion battery (LIB) continues to be the most deployed electrical energy storage (EES) technology, driven mainly by the downward trend in costs 4,5 .Characterized by a) high efficiencies, b) moderated lifetime, c) low volume and weight per kWh of storage, d) temperature sensibility, and by being associated with low maintenance compared to other battery technologies, LIB are the state-of-art technology for electric vehicles (EVs) with across-the-globe investments by large market player battery manufacturers 5 .It is a mature technology in the mobile device market, currently deployed in the automotive sector and is at an early stage in stationary applications.Nowadays, the automotive market is ten times greater than the grid-scale market.The research and development (R&D) efforts made and the diminishing costs of the EV batteries could boost the commercial and residential market.The search for alternative battery chemistries (post-lithium) to allow for better performance (power/energy rates, for example) could also offer a solution for the market, with possible declining battery costs.The ongoing scale-up allowed LIBs to present a downward trend regarding costs in the past years 1,4 , and they are forecasted to reach a cost potential of 70$/kWh in 2050 5 .The optimized cost reduction path goes along the further improvements of energy and economic indicators, such as the energy density, along the industrialization value chain.
A battery model is essential for designing and optimizing an electric power system and smart management.As non-ideal equipment, the battery response is affected by the state of charge or charge/discharge rates.The models allow for a more accurate analysis of the real system, which enriches the development of systems' analysis of performance and costs, allowing the faster application of commercial batteries in smarter residential markets.Predicting its performance allows estimating its use and durability, optimizing its energy use, and determining the applications that best fit the performance.Each microgrid equipment can be modelled, and the smaller the modelling error compared to the experimental performance, the better the description of the system's performance in real operating conditions.The traditional lithium-ion modelling approach generally relies on the existing models in MATLAB/Simulink.However, it is possible to identify some limitations of this modelling approach: the challenge in obtaining more accurate results (model is embedded in the code), difficulty in applying to

Amendments from Version 1
• The third paragraph of Section 4.2.1 was detailed to explain better the approach used to achieve the presented values of Equations 7 and 8, namely energy capacities, voltages, and percentages (V, Q and n); • A paragraph was added to the Introduction (3rd paragraph of this version) with the motivation details, explaining the modelling type application's use and relevance.
• The penultimate paragraph of Section 2.2 details the academic contribution of the work.
• Figure 7 from the previous version is currently Figure 8.The axes of this figure were corrected.
• In Section 5 -Discussion -the fourth paragraph was extended.
• Figure 5 was added to detail the realization of the experiment and data registering to better address that phase of the work.
Any further responses from the reviewers can be found at the end of the article another programming language, and verifying if the model aligns with the experimental result of the general battery.This work contributes to constructing a database with pre-defined experimental setups and validated models that allow the easier optimization of the use of a commercial lithium-ion battery, accessible to any residential user.
This work is focused on the LIB characterization testing and modelling for real-time application in future battery control scenarios and energy management strategies.In the literature, the modelling of LIB for EV application is broad, but for stationary applications, e.g., solar photovoltaic systems (validated with experimental results), the scientific literature found is scarce.This work aims to use a model to represent the dynamic behaviour of the battery with an adequate error, considering the interface with the power electronics and validating it through results experimentally obtained to allow the possibility of model integration into a more complex control system or algorithm.In the medium term, the developed model will later be integrated with models of other storage technologies to optimize the control and global operation of a complex but flexible and intelligent grid system, allowing it to respond to the objectives of future electrical networks.
This paper is organized as follows: Section 2 delivers a bibliographic literature review on lithium-ion battery technology and the existing modelling approaches that better describes the LIB in focus in this work.Section 3 presents the methodology used: the experimental microgrid description, the LIB and inverter characterization testing plan, and the model's detailed description.Section 4 presents the results obtained, including the experimental data and the battery modelling results.Based on the methods used and the results obtained, a discussion is carried out in Section 5, followed by the conclusions of the work in Section 6.

Literature review
This section briefly describes the lithium-ion technology and the technology modelling approaches used throughout the bibliographic references.

The lithium-ion technology
The lithium-ion battery (LIB) was conceived and developed by the Japanese Asahi Kasei Corporation and released commercially in 1991 by Sony Corporation, followed by A&T Battery Co. in 1992 6 , especially for low-power portable applications.The technology was well accepted given its characteristics of high energy density, good performance, less heat generation, small dimension, lightweight (Wh/kg) 7 , and no memory effect, compared with nickel-cadmium or nickel-hydride batteries.The low atomic number of lithium is the cause of the high electrode potential, which results in higher energy density.Over 90% of the worldwide production of LIBs is based in Japan, Korea and China 8 .
Developing new high-energy-density lithium batteries has been challenging, requiring new anodes, cathodes, and nonaqueous electrolytes 6 .Generally, a lithium-ion battery has two electrodes and an organic electrolyte, nonaqueous, containing dissolved lithium salts.The cathode is lithium metal oxide and the anode is from graphitic carbon.Inside the cell, the materials are ionically and not electrically connected by an electrolyte, and it has an insulating membrane.The reaction occurs with a characteristic electrochemical potential difference (voltage).LIB cathode materials can be associated with a variety of multiple chemistries, such as lithium cobalt oxide (LCO), lithium nickel manganese cobalt oxide (NMC), lithium manganese oxide (LMO), nickel cobalt aluminium oxide (NCA), and lithium iron phosphate (LFP).Recently, besides graphite, the anode can be composed of lithium titanate (LTO).NMC is the typical chemistry used in grid-scale ESS 9 .Overall characteristics depend on the cell chemistry.However, it generally has higher gravimetric and volumetric energy density, high efficiency, high power capability, long cycle, and long calendar lifetime than other battery technologies 10 .
LIBs allow fast and slow charging-discharging operation states and have high energy densities and good power densities.The technology has a battery management system (BMS) which monitors its general operating conditions -a range previously defined by the manufacturer) due to sensibility to hightemperature operation and high depth of discharge (DOD).Those factors are usually linked to faster degradation conditions (ageing), permanent damage, or unsafe operation.The response time of this technology is usually in the millisecond's timescale, a fast response compared to the average of other battery technology types.It is also easily scalable in terms of power or energy.
In recent years, R&D has evolved using non-flammable and /or flame-retardant additives (non-flammable electrolytes) 6 .are sensitive to temperature.Usually, an active cooling system is integrated within the building/container of the battery (or in the EV refrigeration battery system) to reach its optimal temperature range (or move away from extreme temperature ranges).Generally, LIBs are designed to operate at about 21°C so that a heating-cooling active system can be used.
Improvements of this technology are related to its core aspects as energy storage, mainly from its competitiveness in the market since they are still associated with a high production cost.The technology still presents challenges in the 2 nd life usage or at the end-of-life /recycling process, being its salvage value lower than the processing cost 11 .After high-intensity applications, as in EVs application, LIBs present generally good condition to be further used in high energy density applications, such as in grid storage 12,13 .LIB recycling is limited at present, having recycling figures below 3% 14,15 , but this will be a vital issue in its future deployment.Different LIB technologies are recycled through similar processes to recover materials like lithium, copper, cobalt, nickel, iron, aluminium, and manganese.The level of toxicity of the substances used in LIB is lower than other battery technologies, and in some countries, these are still disposed of in landfills 15 .For LIBs, lithium appears to be the only critical raw material.In contrast, other critical elements are being studied to reduce their need to incorporate the battery, e.g., the use of manganese instead of critical cobalt is expected to be used for electrode coatings in the future 16 .

Standards for battery operation
The following standards are the currently most relevant in force for the technology: ▪ UL 1642 17  Furthermore, the general standards for secondary batteries are highlighted in the following: ▪ UL 2054 19 is a reference for household and commercial batteries to understand the considerations made for residential sector application, regarding construction and testing for the electrical, mechanical, enclosure, fire, and environmental performance and conditions, and marking.
▪ IEC 61427-1 and IEC 61427-2 refer to the photovoltaic off-grid and on-grid applications, respectively, and IEC 62933-5-2 describes the safety requirements for grid integrated EES systems -electrochemical based systems 18 .
Policies and the regulatory framework for batteries are still under development.For instance, the European Parliament is currently preparing the proposal for a regulation on batteries and waste batteries, including raw materials, carbon footprint and end-of-life handling, setting the sustainability requirements for EES technologies 20 .The regulation is missing for different application scenarios.Critical aspects must be addressed regarding aspects of the integration, testing and operation of this technology, such as the controls and BMSs, temperature, degradation and safety measures.

Modelling a lithium-ion battery
LIB models are being emphasized in the current battery's panorama [21][22][23][24][25] , most of them fostered by the research in the automotive sector field [26][27][28] .A battery model predicts the performance of the battery unit to be used on a simulation framework, allowing the optimization of the system itself and its integrated control within a microgrid.Generally, it starts at a single-cell level, progressing to a unit system description, using the nominal energy capacity and voltage characteristics.The efficiency losses due to racking, hardware for control and safety, and power converter elements should also be considered.
The voltage curve depends on the battery state of charge, operating current, resistance, and energy capacity.The internal resistance increases over time, conducting to a decreasing usable voltage range.Operating the battery at higher currents is related to a higher rate of voltage decrease, reducing the available bulk capacity.The thermal behaviour could be described using a heat transfer coefficient with the environment for instantaneous thermal effects on capacity and resistance.The temperature effect is usually described as a function of ambient temperature and operating current, resulting in a resistance parameter.
A brief review of available LIB models was made, and different approaches were found.In article 29 , a description of LIB models and parameter identification techniques is made; the authors of 22 compared different LIB models; in reference 28, the authors present LIB models for automotive applications, and the authors of 21 provide a review of models for generic batteries.Modelling approaches based on MATLAB/Simulink are presented in studies 27,30,31  The voltage equation modelling is based on the charging and discharging efficiency.Three main approaches are found in the literature: Shepherd's battery model, electric circuit models, and the modified Shepherd's battery model.These three approaches are briefly presented below.

Electric circuit models (ECMs).
Equivalent electric circuit models can be applied to describe different battery technologies 21 .The ECMs for lithium-ion batteries found in the literature review showed satisfactory output results, following simple and fast algorithms and representing the battery in permanent and transient states 27,31,35 .Their suitability for stationary applications is considered a good approach.The model shown in Figure 1 has a constant voltage source in series with a resistor and is the straightforward ECM representation.
The current i b represents the dynamic internal current, R o represents the ohmic internal resistance, V b is the battery voltage in its terminals, and V oc is the applied input voltage 21 .The battery voltage is obtained through the simple circuit analysis of this equivalent circuit, expressed in Equation ( 1).
Among the ECMs, it is possible to find simple models, Theveninbased models, impedance-based models, combined ECM and generic based models 21 .The presented model includes the determination of the SOC as a function of the open-circuit voltage (V OC ), and others could also include bias effects.Although more accurate, capacitors represent significant additional computational times.

Shepherd's battery model. Shepherd's battery model is a
widely known model that describes a battery's terminal voltage over the current inputs.It is generally described through a constant current discharge, expressed in Equation ( 2) 27 , Where, V b is the terminal voltage of the battery, in V, at instant t.
E 0 is the battery constant voltage, in V.
K is the polarization constant, in V/Ah.
Q is the battery energy capacity, described in units of Ah.
it is the discharge energy capacity, in Ah.
R 0 is the battery internal resistance, in Ω.
The voltage equation parameters -E 0 , K, R 0 -can be obtained through the relation established on three points of the battery discharge curve given by the manufacturer (( Shepherd's model is usually studied in the literature to describe the automotive battery behaviour.

Shepherd model modified versions
Where V batt_ch represents the charge voltage and V batt_dis represents the discharge voltage.The rest of the parameters present in Equation ( 3) and Equation ( 4) (E 0 , K, A, B) can be determined through the manufacturer discharge curve and are directly determined with the use of the equations in Table 1, shown below.
The three points of the discharge curve are used (see Figure 2).to calculate the voltage-current curve.In the work developed by the authors of 31, the proposed model considers this approach, including the battery lifetime.Moreover, the authors test the model within a SOC operating range in the linear region of the battery discharge curve (to operate within the 20-85 % SOC range) and consider the temperature operating range to be maintained within the -10°C to 45°C range.

Methods
In this work, the authors aim to develop a model for a commercial LIB that allows its real-time description for stationary applications.An experimental setup is developed to characterize the battery, and further model validation against the experimental data acquired is carried out.The methodology follows the steps described in Figure 3, which details the input parameters subjacent to the model construction and development.
The following subsections describe the key aspects of the experimental data acquisition and the model approach.

University of Évora microgrid infrastructure
The LIB characterization process aims at verifying the performance and dynamic behaviour of the selected battery: 5.0 kW/ 9.8 kWh (189 Ah) LIB energy storage from the LG Chem manufacturer 36 , model RESU 10, with a nominal voltage of 48 V.The LIB and the SMA Sunny Island 37 4.4M inverter (3.3 kW nominal power) are integrated into one of the University of Évora (UÉvora) microgrids.The integration consisted of connecting the systems to the grid, installing AC meters, DC measurement devices and temperature sensors (in the battery's two surface parts -above and lateral and environmental temperature).The next step consisted in establishing a communication set with the inverter through the Modbus TCP/IP protocol (see Section 3.2 for further details).The current microgrid schematic is shown in Figure 4, including a 3.3kW solar amorphous photovoltaic installation, a 3.0 kW/ 7.6 kWh sodium-nickel chloride battery, and a 3.0 kW/ 3.0 kWh 2 nd life lithium-ion battery, and monitoring equipment (AC and DC meters and temperature sensors) on each relevant point of the microgrid.This research infrastructure was designed for the systems' operation study and development, where a communication and control platform were developed.The manufacturer data 38 of the commercial battery is displayed in Table 2.

Model parameter Description Equation representation
A, Exponential Voltage Amplitude Constant, in V The amplitude of the exponential region.
Charge at the end of the exponential zone of the battery's discharge curve.The scalar value of 2.3 was used in 31 to improve the fit to the specific battery used.

e x p
B Q = K, Polarization Constant, in V/Ah Calculated using V full and the end of the nominal zone of the discharge curve.The scalar value of 0.065 was used in 31.
The internal resistance of the battery at steady-state current.υ is the efficiency of the battery, and V nom and Q nom are the nominal values for voltage (V) and energy capacity (Ah), respectively, of the curve (see Figure 2).
Represents the value when the battery is close to completely discharged and no current is flowing.

LIB and inverter testing description
In the consulted bibliography, battery testing procedures generally consist of a battery discharge at a constant current, known as C-rate 27,31 .It is generally encountered in literature for the batteries' description to normalize it with the battery capacity, which might be variable.The test consists of discharging the battery at a calibrated current relative to its maximum capacity, which led the battery modelling to be developed based on the manufacturer discharge curve at constant current, one of the most widespread models found in the literature 27,31,39 .
In the absence of both a manufacturer curve and the option of testing the LIB at a fully controlled constant current discharge (due to the inability to control all the inverter parameters, which satisfies the relation of power-voltage-current at each instant), the charge and discharge curves were obtained through the available points of control of the battery inverter, which is the alternating current (AC) delivery point.This case consists of the battery testing procedure with an E-rate 40 -measuring the power rate at which a battery is discharged relative to its maximum capacity, in Wh.
The experimental tests and respective data acquisition are presented in the following paragraphs.The outlined test plan considers the manufacturer's operating conditions (see Table 2), with a 20-90% SOC range.The operation of the battery within the referred range includes a safety margin closely related to the depth of discharge (DOD) and the technology degradation.
The air-conditioning unit controls the environment temperature within 15-25°C.
A battery-inverter communication control was developed to conduct the testing plan and real-time data monitoring.The communication is based on the Modbus TCP/IP protocol 41,42 , with the help of the LabVIEW 2014 programming environment (the communication can be established in a similar routine through open-sourced software such as Python).In that sense, the inverter needs to be connected to the Ethernet, detaining an IP address.It relies on the Modbus mapping addresses available from the inverter manufacturer, SMA Sunny Island 4.4M 42 , that is available from reference 42 ("Technical Information -Modbus® Interface", and consult the .xlsxfile choosing the model of the inverter).Through the communication establishment, the inverter is asked to, periodically (at 2-second intervals), retrieve and send commands (based on the power profiles at the AC point connection).An example of the communication establishment is detailed in Figure 5.
The data acquisition is achieved by reading the parameters of the inverter from the high precision AC wattmeter 43 , and the measuring precision datalogger 44 .The acquired parameters include current, voltage, power, temperatures, and battery and inverter alarms.
The battery cycling tests were conducted after assuring reliable data measurement acquisition and optimization of the control program (definition of timeframe, prioritization of specific readings, organizing the different equipment readings).The cycling corresponded to about 30 complete charge-discharge cycles at predefined constant power levels throughout the SOC range (from nominal power to low operating power: 330-3300).The obtained average data for each power level is made available in Underlying data 45 .An example of a full charge and discharge battery test is shown in Figure 6, at a constant power level of 2.7 kW, throughout the mentioned SOC range.
The inverters operate at different power levels and according to a power-related efficiency profile.Given the integrated battery-inverter use, it is essential to consider the efficiency curve of the inverter, which varies throughout its power range (either charging or discharging).For that reason, it is relevant to acquire its experimental efficiency curves since they will impact the overall battery system results.
To evaluate the performance of the SMA Sunny Island   of power was variable.The protocol consisted of operating the inverter at different rates of its nominal power (5% to 100% rate) during periods of 15 minutes.DC and AC electrical parameters were monitored.The test's main objective was to calculate the charge and discharge efficiencies over the power operating levels, presented in the next section of this work (Section 4).

LIB modelling application
Using the previously obtained experimental data to describe the LIB, a LIB model was developed considering modelling adaptations of Shepherd's model, described in Section 2.2.3.
The authors of 31 describe the battery through the manufacturer-provided curves.In the present work, the battery is described by the results of the experimental testing at different constant power levels over the complete charging and discharging operating states.The modified version of Shepherd's model was computed to obtain the dynamic battery behaviour, using Equation (3) and Equation ( 4), considering the dynamic current over the state of charge range at a particular power level.
In addition, the state of charge parameter of the battery at each instant t is generally estimated by the following Equation ( 5) and Equation ( 6), Where Q is the total energy capacity of the battery, and the Δt is the difference of the step time: t -1 (last instant of t) and t.The Q values are bounded by its real defined range of minimum and maximum energy capacity values.Using the model described in Section 2.2.3 to describe the LIB understudy better, some adaptations were made.In Equation (3), a multiplication factor of 0.65 for Q was used instead of the 0.1 described.Regarding the rest of the parameters, the used time constant inverse of 2.3/Q exp Ah -1 was maintained, and a polarization constant with a scalar value of 7.3 was used instead of 0.065 (see Table 1).For the obtained voltage to be described by Equation (3) and Equation ( 4), the curve has a constant fit of a scalar value of +41.2 (obtained through the observation of a mismatch of the initially computed voltage curve and experimental voltage values obtained).
The model was computed using MATLAB (2017b) programming and is fully reproducible through alternative software, e.g.Python (see Software availability 46 ).As a first approach, the operation of the battery at constant power levels, acquired experimentally, was chosen to validate it.The model was used to suit both charge and discharge curves from the experimental values, given the need to describe the overall battery behaviour.
For the intermediate power values, a technique of regression fittings was used, taking advantage of the MATLAB fitting tool (also existing in alternative software, such as the open-sourced software Python).
The proposed model uses the current as input to represent the LIB voltage behaviour.Regarding the practical model application within a more extensive model regarding all microgrid systems (and to implement energy management strategies), it is generally helpful to have the battery output in terms of the energy and power domains.The cp-rate can be defined by the rate of constant power that will cause the battery to discharge in a certain amount of time, as explained in 31.

LIB ageing model.
The battery lifetime depends on the operation conditions based on temperature, SOC and total energy throughput (electrochemical operating ranges), charge and discharge rates 47 and the total number of cycles.In the case of the present work, particular emphasis will be given to the description of the battery in its current state through the validation of the model approach against the experimental results.7.

Results
This section summarizes the main output results of this work, firstly concerning the battery pack and inverter characterization performance, and secondly, the developed model which fits the experimental data previously obtained.

Battery testing and inverter results
Based on the methodology described in Section 3, the battery and inverter characterization data were obtained, and the battery performance indicators were calculated (see Underlying data 45 ).The characterization included the realization of at least three cycles for each power level to obtain greater precision and accuracy within the results.
Concerning the inverter charge efficiency (coulombic), it was possible to obtain an average value of 94.8 %, with an STD of 1.4, and regarding discharge, the obtained average value was 95.6 % with an STD of 2.7.The efficiencies defined by the manufacturer are an IEC efficiency of 94.0 % and a maximum efficiency of 95.3 %. Figure 8 presents the data from the inverter manufacturer in the technical document (a) 48 and the experimental data obtained for different power levels for discharge (b) and charge (c).
Regarding the battery, the charge and discharge efficiencies calculation was based on the DC measurements acquired throughout the tests, presented in Table 3. Figure 9 presents the average battery efficiency at each power level and the correspondent STD.The experimental results made it possible to obtain an overall average battery efficiency of 84.6 % with an STD of 7 %.In Figure 9, the influence of the inverter efficiency dependency on power rating is noticeable.
The tests performed allowed the calculation of other battery indicators besides efficiencies, such as energy capacities, energy densities, full charge and discharge spent times, response times, and typical discharge power.These indicators are presented in Table 4.
The experimental acquired voltage-current data in function of the battery energy capacity (or SOC) were used to validate the modelling approach of the following Subsection (4.2). Figure 10 exemplifies some of the experimental results obtained.

Modelling approach to the overall battery operating states
In the literature is common to find references on the battery modelling for one C-rate 27,31 or one E-rate 40 .However, it lacks a solution to describe the battery behaviour over its overall operating frame required to meet the aim of this work: the use for smart power applications' management.The validation of a single power level charge and discharge curve, chosen as the nominal power, was conducted.Regarding the rest of the data validated with different power levels, it was possible to find a regression fit for each, based on the variation of the three extracted points from the curves but keeping all the other variables constant.Below, the approach is detailed.

Battery behaviour representation for a single power level.
The voltage curve was profiled and used for later model validation for the nominal inverter power level, 3300 W, over the defined SOC range and at a constant ambient temperature of 20°C (measured).For both experimental curves of charge and discharge -the contrary to the manufacturer curves as the modified Shepherd's model defined -the three extracted points of voltage and energy capacity are hereinafter enunciated for the charge in Equation ( 7 And discharge in Equation ( 8 Where n exp_c is a percentage of the Q full to obtain the value of Q exp in the case of charge, and n exp_d in the case of discharge.The n nom is a percentage of the Q full to obtain the value of Q nom .In the case of the discharge state, the same percentage is given both for charge and discharge. The values of Eq. ( 7) and Eq. ( 8) were obtained by implementing an iterative cycle.The three values of voltage should obey three conditions: they should be different from each other,   obey the order V full >V exp >V nom , and should be in the range of 49 to 61 V.The iterative cycle is initiated with three guessed values made variable within the range of centesimal digits.The iterative cycle tests different values among the conditions referred, and the obtained curves are then compared with the experimental curve, where the one with the minor error compared with experimental values is used, and the guessed three points (V, Q) are its the correspondent values (presented in Eq. ( 7) and ( 8) for inverter nominal power).Then, the correspondent energy capacity (Q full , Q exp , Q nom ) for that voltage value is obtained.The same procedure took place for the attributed values n exp_c , n exp_d and n nom but now within the 0.1 to 1 range.
This power level's charge and discharge voltage curve presented a root mean square error (RMSE) of near 0.1 V and a maximum relative error of near 1.0 %.The obtained SOC values presented a maximum relative error of near 2.5 %.The experimental and simulated voltage curves for this power level are shown in Figure 11.

Battery behaviour representation for all power levels (regression fit).
Figure 11 shows the battery voltage curve over the different states of charge and SOC vs energy capacity of a single power level.For an overall battery description, distinct experimental power level curves should be tested within the   simulated model.For the model to describe the different operating power levels of the battery, the three points of voltage and energy capacity (see Equation (7), Equation ( 8) and Figure 2) correspond to the experimental charge and discharge curves of each power level (or different current level), should be extracted (guessed).In that sense, the following approach aims to adjust the simulated model curves of each power level to the experimental results obtained, as Equation ( 9) indicates, Equation ( 9) was used to check the existence of a relationship of Y and Z with the extracted points (guessed) that better describe each power level experimental data.As firstly made to the first power level (Section 4.2.1), points from the experimental curves of each power level were guessed, and afterwards, the values of Y and Z that better fit that data are obtained.A curve-fitting on the best-guessed values that described the battery's experimental data was achieved with the help of the MATLAB curve fitting tools (also existing in alternative software, such as the open-sourced Python), both for charge and discharge operation state.Through the curve fitting, it was possible to find a function that describes the values of Y and Z that should be added/subtracted to the initial guessed three points of the curves.The functions' representations are shown in Figure 12.The guessed values that better described the three extracted points were compared with the best-fit function in these figures.The determination of Y and Z for both charge and discharge states offer, in this way, a full battery behaviour description within the experimental values obtained.To observe the voltage regression fit accuracy of the simulated values against the experimental acquired values, Table 5 and Table 6 present the RMSE and maximum relative errors of each fitting point with its correspondent experimental value for discharge and charge operating states, respectively.The obtained regressions allow the battery's description through its distinct operation states in the regular operating conditions.The state of charge at each of the power level obtained values can be observed in Table 7.The developed model is made available in Software availability 46 .

Discussion
In this work, a commercial LIB battery pack was the object of experimental tests through its complete charge and discharge at constant levels of a power testing plan.The manufacturer data helped to track the operating range limits and, in the testing, the definition of the overall condition.The establishment of inverter communication allowed the battery testing under controlled conditions.For that reason, the testing output is influenced by this unit.The LIB testing results, which enabled the energetic performance calculation presented in Table 4 and Figure 9, follow the expected results for the tested technology 49,50 .The values obtained for the inverter efficiencies are close to the manufacturer-provided data, with a calculated STD of 2.7 %.
A LIB model is commonly found in literature, mostly based on the MATLAB/Simulink pre-existing model 27,29,30,51 .The reproduction/justification of the model to be applied for a stationary application which could fit the obtained experimental data was not found.Thus, in this work, the authors based the modelling approach on one of the modified Shepherd's models and adapted it to describe the real-time battery dynamic behaviour of the battery integrated into the microgrid.
The results obtained within the model approach used show satisfactory adequacies for all the values experimentally obtained with the LIB.In the discharge state, the higher voltage RMSE is 5.51 V, and the maximum relative error (MRE) is 5.68 %.
The MRE obtained for the SOC is about 6.82 %.In the charge state, the highest RMSE for voltage is 5.27 V and an MRE of 6.74 %.The MRE obtained for SOC is 6.53 %.Given the equation fitting and the experimental data errors obtained, generally, the model describes the battery behaviour.The standby operation (self-discharge and inverter auxiliary consumption) will also be considered in future work for the final complete model.
The temperature effects were not fully considered in this approach.The higher the charge and discharge rates and ambient temperatures, the higher the internal resistance and generally, more heat is generated by the Joule effect.In this case, voltage and energy capacity are affected.The lack of details regarding this present battery composition makes it more challenging to include parameters that could describe those effects.The battery is operated under a controlled ambient temperature range, and the authors believe that the obtained figures for the curves include the slight temperature variations within the obtained errors.Moreover, the temperature dependence variation within the series resistance impacts LIB lifetime.This phenomenon will be approached in further research by considering the model describing the battery behaviour over time (to be used in future energy and economic assessments) and including temperature and SOC effects in the resistance calculation and the temperature and cycling effects in the calculation of battery energy capacity.
The achieved model describes, with small computational effort and fast runtime, the main characteristics of the battery, which facilitates its application within larger models of energy management strategies.The model is validated with different power levels and experimental battery data, improving its modelling of the battery behaviour with variable input profiles.
Similarly to most commercially available LIBs, the LIB manufacturer does not provide information regarding the internal construction, missing information such as the number of cells, parallel and series connections, voltage equalization algorithms, or temperature control algorithms.Missing important information limits the modelling accuracy, generating a higher error in the simulation results.Nevertheless, the maximum error obtained is considered low, being the model accurate to represent the battery performance, even with relevant battery data not being provided by the manufacturer.

Conclusions
This work applies and validates a model to a 9.80 kWh (189 Ah) lithium-ion commercial battery pack behaviour -voltage-current curves, energy capacity and SOC profiles with real-time variation -to give a potential modelling application to optimization and predictive microgrid programming control (including additional assets and corresponding models, such as PV systems), specifically for commercial and residential applications.
The correspondence between the general voltage-current models and the operating conditions matching the battery is usually a complex task.In this work, a LIB and inverter experimental setup was built to characterize performance and behaviour with precision monitoring.Communication was established with the battery inverter, enabling it to send real-time commands and get readings.This setup allowed performing the necessary characterization tests under real operating conditions.
Several curve fittings representing the battery behaviour under different operating states with a lower error were obtained.Charge and discharge errors were calculated and observed in Table 5, Table 6, and Table 7, with a maximum relative error of 6.74 % for simulated voltage.
Future work development will include applying this model within a larger simulation model, considering other systems present in the residential and commercial sectors.Further development should also include an ageing model and an energy management strategy, contributing to the technical and economic evaluation.Lithium-ion battery technology will continue to increase within its typical application in the automotive market, with the expectation that the technology will also be used in a second market for stationary applications.Accurate models for stationary application of LIB will provide significant advantages to the market uptake, in particular, for the residential and commercial sectors.

Reference Source
As the corresponding author, I would like to take the opportunity to thank you for your helpful comments resulting from the revision of the work "Validation of a lithium-ion commercial battery pack model using experimental data for stationary energy management application".The suggestions offered were considered and performed to address the Professor's concerns better, hoping the revised manuscript would better suit this field of expertise.In the following, the authors enunciate the changes and refinements made in the revised work to the Professors' comments through a numbered list.Thank you for the comment.We have added a paragraph to the Introduction (currently the 3rd paragraph) with the motivation details.We have explained this modelling type application's use and relevance in this field of research. 1.
The authors believe the approach can be reproducible to other battery packs to model the lithium-ion battery performance compared to experimental results.The academic contribution is further detailed in Section 2.2. of this work (in the penultimate paragraph). 2.
Figure 7 from the previous version is currently Figure 8.The axes were corrected.3.
In Section 5 -Discussion -the fourth paragraph was extended to better approach the theme.In the case of the present work, the authors believe it fulfils the proposed modelling objectives based on the existing LIB modelling approaches (referenced in the bibliography).

4.
Figure 5 was added to detail the realization of the experiment and data registering to better address that phase of the work.The experiment is focused on four main steps: the existence of physical equipment: battery compatible with an inverter that allows the modbus communication; the communication establishment with the inverter through modbus TCP/IP; the execution of complete charge and discharge cycles (considering the chosen depth of discharge), controlling different points of the AC power setpoint; and the execution of real-time measurements of current, voltage, SOC, temperature, and their data acquisition and file saving.

5.
The authors hope the revised manuscript better suits the field of research and want to sincerely thank you for your interest in our research, allowing us to revise our work.The article proposes the application of a model for lithium ion batteries in stationary applications, and its experimental validation from data obtained in tests at different power levels.The commercial battery system is integrated with an inverter and solar photovoltaic (PV) system as part of a microgrid.The battery and the inverter are fully characterized through the implementation of a testing protocol aiming at better describing the battery performance.Then, a battery model is built upon both the existent LIB description and experimental fitting regression, for real-time predictive optimization control development.Considering the predetermined efficiency of the inverter, the model allows to obtain the voltage curve, the series resistance (i.e., to describe instantaneous voltage drop/rise and transients), and the state of charge (SOC) and/or energy capacity, based on the current input.The developed model is validated through the comparison with the experimental results.
The applied methodology and the experimental procedure is clear and convincing.The results show that the maximum error obtained is considered low, indicating the model accuracy for describing the battery performance, even with important battery data not being provided by the manufacturer.
However, there are some minor comments that can help to better understand the application of the model to this particular case.For example, it is not clear how the values of the Equations 7 and 8 are obtained from the experimental curve corresponding to the 3.3 kW power level test.It should be advisable to include such charge-discharge curve and mark on it the values of V full , Qf ull , V exp , Q exp , V nom and Q nom , as well as the assumptions made to estimate the percentages ne xp_c and n exp_d provided in Tables 5 and 6.
Moreover, it should be advisable to explain more deeply how the SOC has been calculated to guarantee that the tests start at 20%, taking into account that if the Equation 5 is used, it would be necessary to know the capacity of the battery below this lower limit.

If applicable, is the statistical analysis and its interpretation appropriate? Yes
Are all the source data underlying the results available to ensure full reproducibility?Yes Are the conclusions drawn adequately supported by the results?Yes Competing Interests: No competing interests were disclosed.
Reviewer Expertise: Energy storage, microgrids I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.

.
Shepherd's battery model can be modified to better describe the dynamic battery behaviour through an exponential function, previously presented in the work developed by the authors of 31 .The modified Shepherd's model charge and discharge voltage curves are based on Equation (2) and are represented below in Equation (3) and Equation (4).

Figure 1 .
Figure 1.Equivalent circuit representation to the lithium-ion battery model.

Figure 3 .
Figure 3. Methodology to describe the lithium-ion battery under study.LIB, lithium-ion battery; SOC, state of charge.

Figure 2 .
Figure 2. Example of an ideal discharge curve, where the three points can be extracted: the (V full , Q full ) are the voltage (V) and energy capacity (Ah) of the completely charged battery; the (V exp , Q exp ) are the voltage (V) and energy capacity (Ah) at the end of the exponential zone; and (V nom , Q nom ) are the voltage (V) and energy capacity (Ah) at the end of the nominal zone.This image has been reproduced with permission from 27.

Figure 4 .
Figure 4. General schematic of the equipment and control platform of the microgrid of the Renewable Energies Chair at the University of Évora.In the figure, PV is the solar photovoltaic generation; AC is alternating current; TCP/IP is the Transmission Control Protocol/Internet Protocol (to allow communication on a network); RS-232 is a protocol for the exchange of data (generally used in the serial ports of the computers).
4.4M inverter, a test control was implemented in the LabVIEW 2014 programming interface, fully reproducible through open-source software, e.g., Python.It used Modbus TCP/IP and was achieved by the mapping of addresses given by the inverter manufacturer (in this case, SMA) 42 .The test control made was similar to the previous, where only the remaining time at a certain level

Figure 6 .
Figure 6.Complete battery charge-discharge cycle at a constant power level of 2.7 kW at the alternating current delivery point, from 20-90 % state of charge range.

Figure 5 .
Figure 5. Communication establishment with the inverter to perform the charge-discharge tests.

Figure 7 .
Figure 7. Complete model of the lithium-ion battery technology approach.In this figure, A is the exponential voltage amplitude constant (V); B is the time constant inverse (Ah); K is the polarization constant (V/Ah); E 0 is the battery constant voltage (V); N cell the number of cells in series; SOC is the state of charge of the battery; R 0 is the series resistance of the equivalent model (Ω); V oc is the open-circuit voltage (V) and V b is the battery terminals voltage (V).

Figure 8 .
Figure 8. Inverter efficiency curve as a function of the power level (a) given by the manufacturer 48 , (b) from the experimental results of discharge, and (c) from the experimental results of charge.In this figure, (a) has been reproduced with permission from 48.

Figure 9 .
Figure 9. Battery efficiency at each level of power, and respective standard deviation results.

Figure 10 .
Figure 10.Lithium-ion battery voltage and current data from the experimental test plan, for complete charge-discharge cycles, at different constant power levels (due to readiness, only few power levels are represented).

Figure 11 .
Figure 11.Model validation simulated vs experimental results for the 3300 W level of power: (a) discharge voltage-State of Charge (SOC) curve, (b) discharge SOC-energy capacity curve, (c) charge voltage-SOC curve, and (d) charge SOC-energy capacity curve.

Figure 12 .
Figure 12.Y and Z regression fitting values obtained for the charge and discharge operating states, in function of the power levels of the battery operation.
No competing interests were disclosed.Reviewer Report 23 February 2022 https://doi.org/10.21956/openreseurope.15429.r28534© 2022 López E. This is an open access peer review report distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.Eduardo López 1 Instituto Nacional de Técnica Aeroespacial -INTA (National Institute of Aerospace Technology), Mazagón, Spain 2 Instituto Nacional de Técnica Aeroespacial -INTA (National Institute of Aerospace Technology), Mazagón, Spain

Table 2 . Reference operating conditions and main characteristics available by the manufacturer of the LG Chem Resu10 48 V LIB 38 .
EnergeticNominal energy / useful kWh 9.8 (25°C, 100% SOC) / 8.8Nominal power / maximum / peak (in 3 s) kW 3.3 / 5.0 / 7.0 The main goal is to have the battery model in its current operational state, validating this model approach with the experimental results.Nevertheless, the LIB ageing effects should be included in the modelling used for real-time predictive optimization control modelling for wider timeframes of simulation.There is no standard model for LIB ageing, although this model should describe the fade mechanisms triggered by cycling patterns, storage, and others.Lifetime fade or degradation (capacity decrease) and cycling fade affect the performance and battery lifetime, impacting its financial results (given the high upfront cost).
The present work approach allows for updating the values of internal resistance (depending on temperature and state of charge) and energy capacity (depending on temperature, T, and cycle count, N cell ) based on the National Renewable Energy Laboratory (NREL) lifetime model47.This model will be included in detail in further work application of this model.The final complete LIB long-term use model is shown in Figure ), ),

Table 6 . Comparison of the simulated against experimental voltage values on charge state, and respective errors (root mean square error (RMSE) and minimum and maximum relative errors).
Where, n exp_c is a percentage of the Q full to obtain the value of Q exp in the case of charge curve; n nom is a percentage of the Q full to obtain the value of Q nom ; Y c and Z c are the values to be added to the voltage and energy capacity, respectively, extracted charged curves.

Table 5 . Comparison of the simulated against experimental voltage values on discharge state, and respective errors (root mean square error (RMSE) and minimum and maximum relative errors).
Where, n exp_d is a percentage of the Q full to obtain the value of Q exp in the case of discharge curve; n nom is a percentage of the Q full to obtain the value of Q nom ; Y d and Z d are the values to be added to the voltage and energy capacity, respectively, extracted discharged curves.

Energy storage technologies and real life applications -A state of the art review
. Appl Energy.2016; 179: 350-377.