# A Comparison of Energy Management System for a DC Microgrid
## 3 DC Microgrid Model
### Specific Model of the DC Microgrid  
The specific model of the DC microgrid is explicitly formulated in this section for an autonomous DC microgrid. For this purpose, the objective function is expressed in extended form in the Equation (17),  
\[F_{T}=\sum_{t_{i}=1}^{t_{end}}\sum_{j=1}^{N_{pc}}a_{j}+b_{j}\Big{(}p^{t_{i}}_{ kj}\Big{)}+c_{j}\Big{(}p^{t_{i}}_{kj}\Big{)}^{2} \tag{17}\]  
Note that Equation (17) denotes that the objective is to minimize the cost of the total energy photovoltaic system during the period of time T to supply the demand curves predicted \(p^{t_{i}}_{lm}\forall m,t_{i}\in T\).  
The set of equality constraints \(n(x)\) is expressed in Equation (14) and correspond to the equations of the active power balance of the nodes of the DC microgrid \(\Delta p^{t_{i}}_{Ri}\), these constraints are written in the first block of Equation (18) where the lower limit \(\forall jem\) means each element \(j\) is connected to the node m. For example, in this block we have the sum of the charge \(p^{t_{i}}_{Scj}\) and discharge powers \(p^{t_{i}}_{Scj}\) of the storage system, the sum of the power of the photovoltaic panel \(p^{t_{i}}_{pvj}\) and the powers injected \(p^{t_{i}}_{lj}\) into the nodes of the microgrid. In the third block of Equation (18) is expressed the equations of active power balance in node of photovoltaic panel \(\Delta p^{t_{i}}_{CDk}\)[9].  
\[n^{t_{i}}\Big{(}x^{t_{i}}\Big{)}=\left\{\begin{array}{l}0=\sum\limits_{ \forall jem\in m}p^{t_{i}}_{Scj}+\sum\limits_{\forall jem\in m}p^{t_{i}}_{Sdj} +\sum\limits_{\forall jem\in m}p^{t_{i}}_{pvj}-\sum\limits_{\forall jem\in m}p ^{t_{i}}_{lj}\\ \Delta I^{t_{i}}_{CDk}=I^{t_{i}}_{CDk}-f_{CDk}\Big{(}V^{t_{i}}_{CDk}\Big{)}=0, \\ \Delta p^{t_{i}}_{CDk}=p^{t_{i}}_{CDk}(V,I)-\Delta p^{t_{i}}_{CDk}\Big{(}V^{t_ {i}}_{CDk},I^{t_{i}}_{CDk}\Big{)}=0,\end{array}\right\}\forall t_{i}\in T \tag{18}\]  
The only inequality constraints function \(z(x)\) introduced in the optimization problem are those due to the storage system, because the batteries have finite charge and discharge capacity that can vary between a minimum of 20% and a maximum of 100% depending on the battery material. Therefore, the SOC is modulated over the period \(T\) through Equation (19) [21].  
\[z^{t_{i}}\Big{(}x^{t_{i}}\Big{)}=\left\{soc^{min}_{Sj}\leq soc^{t_{i}}_{Sj} \leq soc^{max}_{Sj}\right\}\forall j\in\forall t_{i}\in T \tag{19}\]The inequality constraints variable \(x\) is set up of the set decision variables that must have admissible values for the operation of the microgrid. The decision variables must be limited to appropriate values throughout the time interval \(T\), the inequality constraints variable is expressed in Equation (20).  
\[\left\{\begin{array}{l}\underline{x}_{R}\leq x_{R}^{t_{i}}\leq\overline{x}_{ R}\\ \underline{x}_{pv}\leq x_{pv}^{t_{i}}\leq\overline{x}_{pv}\\ \underline{x}_{S}\leq x_{S}^{t_{i}}\leq\overline{x}_{S}\end{array}\right\}\forall t _{i}\in T \tag{20}\]  
The microgrid has a set of decision variables associated with each node, which are the magnitude of the voltage as well as the powers exchanged with the different energy sources, such as \(\mathrm{x}_{\mathrm{R}}=\left[\mathrm{V}_{\mathrm{j}}^{\mathrm{t_{i}}},\, \mathrm{p}_{\mathrm{R}}^{\mathrm{t_{i}}}\right]\), \(\forall\mathrm{t_{i}}\in\mathrm{T}\), whereas the decision variables batteries are \(\mathrm{x}_{\mathrm{S}}=\left[\mathrm{V}_{\mathrm{j}\mathrm{i}}^{\mathrm{t_{i} }},\,\mathrm{soc}_{\mathrm{s}\mathrm{j}}^{t_{i}},\,\mathrm{p}_{\mathrm{S} \mathrm{k}\mathrm{k}}^{\mathrm{t_{i}}},\,\mathrm{p}_{\mathrm{S}\mathrm{k}}^{ \mathrm{t_{i}}}\right]\forall\mathrm{t_{i}}\in\mathrm{T}\). Finally, the photovoltaic modules decision variables are \(\mathrm{x}_{\mathrm{PV}}=\left[\mathrm{V}_{\mathrm{CD}\,\mathrm{i}}^{\mathrm{ t_{i}}},\,\mathrm{p}_{\mathrm{CD}}^{t_{i}}\right]\forall\mathrm{t_{i}}\in\mathrm{T}\).