## 3 Proposed Methodology
### Microgrid Design
#### 3.4.1 Available Energy Resources--Electrical Model  
In different universities around the world,penetration of photovoltaic (PV) solar energy has been studied to determine the effects in the power system, such as voltage variations and power injections. These studies have found that MGs produce variations in frequency and voltage, as expected; however, the variations are within admissible values. It is important to mention that PV technology is an excellent option to use, since many studies [15; 16; 17] demonstrate its. Benefits regarding environmental, electrical, and economical aspects. * Photovoltaic System Model  
Through photovoltaic technology, a current is produced by the movement of electrons when exposing cells to sun irradiance, generating electrical power. The main factors that influence the generated energy from the PV are the sun irradiance and temperature. After a through literature review, it was found that the most used models to represent \begin{table}
\begin{tabular}{l l l l} \hline \hline
**Europe** & **Latin America** & **Middle East** & **North America** \\ \hline Leader in development and use. & \begin{tabular}{l} 1/4 energy is \\ produced with \\ renewable energy \\ \end{tabular} & \begin{tabular}{l} Numerous countries \\ are global leaders \\ \end{tabular} & \begin{tabular}{l} Production of 63\% \\ with hydro in \\ Canada. \\ \end{tabular} \\ \hline Increasing & \begin{tabular}{l} Dynamic renewable \\ energy market \\ \end{tabular} & \
\begin{tabular}{l} Better socio-economic \\ benefits \\ \end{tabular} &
\begin{tabular}{l} US, leader in PV \\ generation. Iconic \\ projects in renewable \\ energy \\ \end{tabular} \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Use of the Renewable Resources in the World. solar photovoltaic modules are the single and two diode models. Different variations of these models were found, being the simplified single diode (SSD), the single-diode model (SDM), the two-diode model the most relevant. Recently the three diode model (TDM) has been presented [18]. The block diagram used to represent the PV system model is shown in Figure 2.  
For this work, the SDM was selected because it is the most helpful in terms of accuracy vs complexity. The solar panels are modeled as an injection of sinusoidal current. Equation (1) represents the mathematical model of the SDM [19]. \[I_{pv}=I_{ph}-I_{0}\left[e^{\left(\frac{\Psi\Psi_{pv}}{N_{s}RTA}\right)}-1\right] \tag{1}\]  
where \(I_{pv}\) denotes the output current of the PV cell, \(V_{pv}\) corresponds to output voltage of the PV cell. \(I_{0}\) and \(I_{ph}\) are the diode reverse saturation current and the photogenerated current, respectively. \(q\) represents the electron charge. \(N_{s}\) is the number of cells, \(K\) is the Boltzman constant, \(T\) is the absolute temperature (in \(K\)) of the pn-junction, and \(A\), represents the diode ideality factor. * Combined Heat and Power Model  
After considering several models, the combined heat and power (CHP) model proposed in [20] was chosen. The Rowen model was selected after conducting a study in the Microgrids Laboratory in collaboration with Sandia National Lab due to its simplicity in implementation. More detail of the model is presented in [19]. The model implemented in Simulink consists of a compressor and turbine, fuel system, acceleration, temperature, and governor control. Figure 3 shows a general diagram of the CHP model. Figure 3: General Representation of CHP Model. Figure 2: PV Block Diagram. * Energy Storage Model  
The energy storage system (ESS) complements the PV generators. It represents an additional initial cost in the MG project. The ESS supplies energy to the MG in cloudy days or at night when PV systems are not working. Currently, there are different methods and mechanisms for storage energy, for example batteries, fuel cells, supercapacitors, and flywheels. Those technologies offer considerable benefits to the grid, such as fossil fuel reduction [21]. However, this research uses ion-lithium batteries as an energy storage system.