*3.4. Mathematical Modeling of the Battery*

The mathematical models of the battery focus mainly on *V*, *I* parameters. The current is determined by a change in the terminal voltage of the battery [36]. The transfer of electrons from one electrode to another leads to the generation of current. The open circuit voltage at the battery is determined from the potential difference between the positive and negative electrodes [37–40]. The charging/discharging of battery is expressed as

$$V\_{\text{discharge}} = E\_o - V\_{op}{}^+ - V\_{op} - IR\_{pol} \tag{33}$$

$$V\_{charge} = E\_o + V\_{op}{}^+ + V\_{op} + IR\_{pol} \tag{34}$$

$$V\_{battery} = E\_o - K \left[ \frac{Q}{Q - it} \right] i - R\_o i \tag{35}$$

$$V\_{battery} = E\_o - \left(\frac{K}{Soc}\right)i - R\_o i \tag{36}$$

$$V\_{\text{discharge}} = E\_o - Kd\_r \frac{\mathcal{Q}}{\mathcal{Q} - it} i\_1 - R\_o i - Kd\_v \frac{\mathcal{Q}}{\mathcal{Q} - it} it + e(t) \tag{37}$$

$$V\_{\text{charge}} = E\_o - \mathcal{K}c\_r \frac{\mathcal{Q}}{it + \lambda \mathcal{Q}} i\_1 - \mathcal{R}\_o i - \mathcal{K}c\_v \frac{\mathcal{Q}}{\mathcal{Q} - it} it + e(t) \tag{38}$$

$$e(t) = \text{Bi}[(e(t) + Au(t))]\tag{39}$$

$$V\_{\text{discharge}} = E\_o - K\_{dr} \frac{1}{\text{Soc}} \mathbf{i} - R\_o \mathbf{i} - K\_V (\frac{1}{\text{Soc}} - 1) + e(t) \tag{40}$$

Equation (35) can be rewritten using state of charge (*SoC*) due to the polarization ohmic voltage. Equations (37) and (38) are modified by the shepherd relation model. *E<sup>o</sup>* = open circuit voltage of a battery (V), *K* = polarization coefficient (Ω), *Q* = battery capacity (A/h), and *R* = internal resistance. Some of the limitations associated with Equations (37) and (38) are (i) ageing of battery and self-discharge, (ii) the battery capacity does not depend upon the amplitude of the current, and (iii) the temperature coefficient is not considered [35]. These limitations can be overcome by considering the

factors affecting the lifetime of the battery. The *SoC* condition is analyzed at every instant of time and is calculated with threshold capacity using

$$\text{Soc} = \text{Soc}\_{\text{in}} - \int\_0^t (i - \max(i\_{\mathcal{S}'} i\_d)) \frac{d\tau}{Q}. \tag{41}$$

The net power of the DC microgrid architecture is calculated by the summing of all the power of the energy sources.

$$P\_{\text{net}} = P\_{\text{PV}} + P\_{\text{Wind}} + P\_{\text{fuelcell}} + P\_{\text{diesel}} \tag{42}$$
