## 3 Industrial Consumption, BESS, and Grid Modelling
### BESS Model
#### 3.2.2 Battery Model  
The battery model controlled by the VSC is represented as an equivalent circuit model which, as mentioned above, sacrifices accuracy in favour of generality. Nevertheless, equivalent circuit models account for errors lower than 5% [28], sufficient for obtaining general conclusions. The battery equivalent circuit is depicted in Figure 6, where \(u\) is the instantaneous battery voltage [V], \(i\) is the battery current [A] (\(i\) > 0 discharging; \(i\) < 0 charging), \(I_{SELF}\) is the self-discharge current, \(R_{OHM}\) is the ohmic internal resistance [\(\Omega\)], \(R_{POL}\) is the polarization internal resistance [\(\Omega\)], and \(C_{POL}\) is the polarization capacitor [F]. Figure 4: Flow diagram for the VSC high-level control. Figure 5: VSC low-level control model in MATLAB Simulink. The lithium-ion battery model used in this paper is a modification of the MATLAB Simulink model in [30]. The battery equivalent circuit is based on the Shepherd equation [31], which was experimentally validated later in [32]. The Shepherd model keeps the error between 1% and 5% and it can be parametrizable without testing the battery in the laboratory: it suffices with the manufacturer datasheet information. For the work developed in this paper, both voltage/runtime and thermal models have been parametrized via a least-square method. Data can be obtained from typical manufacturer's curves: voltage-capacity curve as a function of different C rates (with constant temperature), and voltage-capacity curve at different temperatures (with constant C rate). The detailed parametrization process is described in [33]. The voltage/runtime equations that govern the model, considering thermal dependencies, can be written as follows:  
\[E(SoC,T)=E_{0}(T)-K(T)\cdot Q_{MAX}(T)\cdot(\frac{100}{SoC}-1)+A\cdot e^{(-B \cdot Q_{MAX}(T)\cdot(1-\frac{SoC}{100}))} \tag{2}\]  
\[R_{POL-DISCHARGE}(SoC,T)=K(T)\cdot\frac{100}{SoC} \tag{3}\]  
\[R_{POL-CHARGE}(SoC,T)=K(T)\cdot\frac{1}{1.1-\frac{SoC}{100}} \tag{4}\]  
\[E_{0}(T)=E_{0}(T_{0})-\frac{dE}{dT}\cdot(T-T_{0}) \tag{5}\]  
\[Q_{MAX}(T)=Q_{MAX}(T)-\frac{dQ}{dT}\cdot(T-T_{0}) \tag{6}\]  
\[K(T)=K(T_{0})-e^{\kappa(\frac{1}{T}-\frac{1}{T_{0}})} \tag{7}\]  
\[R_{OHM}(T)=R_{OHM}(T_{0})-e^{\beta(\frac{1}{T}-\frac{1}{T_{0}})} \tag{8}\]  
where \(E\) is the open-circuit nonlinear voltage (V), \(E_{0}\) is the open-circuit constant voltage (V), \(K\) is the polarization parameter (Ah\({}^{-1}\)), \(Q_{MAX}\) is the maximum capacity (Ah), \(A\) is the exponential voltage constant (V), \(B\) is the exponential capacity constant (Ah\({}^{-1}\)), \(T\) is the temperature (K), \(T_{0}\) is the parameter reference temperature (K), and \(SoC\) is the state of charge (%). Figure 6: Battery equivalent circuit model. The thermal model comprises two different parts: a heat generation model and a heat evacuation model. The heat generation model can be expressed as follows [34]:  
Figure 5:0  
where \(H\) is the generated heat (W), and \(dE/dT\) the change of the equilibrium potential with temperature (V\(\cdot\)K\({}^{-1}\)). The heat evacuation model occurs due to convection and radiation mechanisms, the latter being negligible [35]. Assuming that the temperature in the battery is uniform (reasonable approximation according to [36]), the following expression is obtained [35]:  
Figure 5:1  
Figure 5:2  
where \(m\) is the mass of the battery (kg), \(c_{p}\) is the specific heat capacity (J\(\cdot\)kg\({}^{-1}\cdot\)K\({}^{-1}\)), \(h\) is the convective heat transfer coefficient (W\(\cdot\)m\({}^{-2}\cdot\)K\({}^{-1}\)), \(Ar\) is the external surface area (m\({}^{2}\)), and \(R_{OUT}\) is the equivalent thermal resistance with the ambient (K\(\cdot\)W\({}^{-1}\)). Hence, the temperature variation can be calculated as:  
Figure 5:3  
where \(t_{th}\) is the thermal time constant (s), and \(s\) is the Laplace complex frequency parameter. The ageing estimator implemented in the battery model comprises two parts: a cycling ageing model and a calendar ageing model.