# Optimal Energy Management within a Microgrid: A Comparative Study
## 2 Model for Microgrid Components
### Photovoltaic Modules  
Figure 4 shows the schematic model of a photovoltaic module connected to the \(k\)th node through a DC/AC converter [24]. The implicit expression showed in Equation (12) models the behavior of the DC current in \(I_{CD\,k}^{t_{z}}\) panel terminals, where \(I_{ph}\), \(I_{0}\), \(V_{CD\,k}^{t_{z}}\), \(R_{s}\), \(n_{s}\), and \(n_{\text{p}}\) represent the current of the photovoltaic panel, the current of saturation, the DC voltage in the module terminals, the resistance in series, and the number of cells in series and in parallel, respectively. The term \(R_{s}\) is evaluated from Equation (13), where \(V_{oc}\), \(V_{mp}\), \(I\), and \(I_{mp}\) represent the open circuit voltage, the voltage of the point of maximum power, short circuit electricity, and maximum power point electricity, respectively. Terms \(I_{sc}\) and \(V_{oc}\) are evaluated through Equations (14) and (15), respectively, where \(I_{sc,stc}\), \(G\), \(G_{stc}\), \(k_{i}\), \(T\), \(T_{stc}\), \(V_{oc,stc}\), and \(k_{v}\) represent the short circuit electricity standard under conditions of test, irradiance under test, electricity temperature coefficient, temperature of the panel, standard temperature under test, standard low open circuit voltage conditions test, and voltage and temperature coefficient, respectively.  
\[I_{CD\,k}^{t_{z}}=\left[I_{ph}-I_{0}\left(\exp\left(\frac{\frac{V_{CD\,k}^{t_ {z}}}{n_{s}}+\frac{I_{CD\,k}^{t_{z}}}{n_{p}}R_{S}}{V_{CD}^{t_{z}}}\right)-1 \right)\right]n_{p};\forall t_{z}\in T \tag{12}\]  
Figure 4: Schematic model of a photovoltaic module.  
\[I_{\text{SC}}(T,G)=I_{\text{SC},stc}-\frac{G}{G_{\text{{stc}}}}\left[1+\frac{k_{i }}{100}(T-T_{\text{{stc}}})\right] \tag{14}\]  
\[V_{\text{{oc}}}(T)=V_{\text{{oc}},stc}\left[1+\frac{k_{\text{{p}}}}{100}(T-T_{ \text{{stc}}})\right] \tag{15}\]  
In this work, the photovoltaic module parameters involved in Equations (12)-(15) were taken from the features of the polycrystalline module ATERSA A-222P [25]. Moreover, a good forecast of solar irradiance curves is considered to be available.  
According to the model in Figure 4, the injected power in DC terminals (generated by module) can be expressed directly as  
\[P_{CD\ k}^{l_{z}}\left(V_{CD\ k}^{l_{z}},I_{CD\ k}^{l_{z}}\right)=I_{CD\ k}^{l_ {z}}V_{CD\ k}^{l_{z}};\forall l_{z}\in T \tag{16}\]  
Moreover, the balance of power between the AC and DC terminals of the inverter must also be fulfilled. If the losses of the converter are rejected, then  
\[P_{CA\ k}^{l_{z}}\left(V_{k}^{l_{z}},V_{m}^{l_{z}},\theta_{k}^{l_{z}},\theta_{ m}^{l_{z}}\right)=P_{CD\ k}^{l_{z}}\left(V_{CD\ k}^{l_{z}},I_{CD\ k}^{l_{z}}\right); \forall t_{z}\in T \tag{17}\]  
where \(P_{CA\ k}^{l_{z}}\) is the active power injected at the terminals of the primary transformer coupling module; \(V_{k}^{l_{z}}\) and \(\theta_{m}^{l_{z}}\) are the magnitude and the angle, respectively, of the voltage phasor for such terminals; and \(V_{m}^{l_{z}}\) and \(\theta_{m}^{l_{z}}\) represent the same but for the secondary terminals. Therefore, \(P_{CA\ k}^{l_{z}}\) in Equation (17) is formulated explicitly by means of Equation (7), but considering the matrix of conductances and susceptances of Equation (9). It is important to mention that, due to being considered a DC/AC converter multipulse with 48 pulses, the following relationship must also hold [26]:  
\[V_{CD\ k}^{l_{z}}=\frac{\pi}{16}V_{k}^{l_{z}};\forall t_{z}\in T. \tag{18}\]  
It is important to highlight that the decision variables introduced by the photovoltaic module are \(\left[V_{CD\ k}^{l_{z}},I_{CD\ k}^{l_{z}}\right]\in y_{\text{MF}}\left(\forall t _{z}\in T\right)\), whereas \(\left[V_{k}^{l_{z}},V_{m}^{l_{z}},\theta_{k}^{l_{z}},\theta_{m}^{l_{z}}\right] \in y_{RD}\left(\forall t_{z}\in T\right)\).