## 4 Case Study  
Based on a real case, the microgrid included: 9 \(\times\) 1.2 MVA diesel units and 2 \(\times\) 560 kWh batteries, which are interconnected through 4 \(\times\) 550 kVA inverters (2 inverters per battery). The total battery power was then 2.2 MVA. The rated power of the PV plant was 10 MW, similar to the one presented in [24]. The minimum accepted frequency was \(f^{mn}=\) 49.0 Hz. Table 1 shows the problem parameters.  
Three scenarios were simulated. The load consumption was the same for all scenarios and shown in the result plots. The difference between the three scenarios was reflected in the available PV power profile. In the first case, after 12:30, the available PV profile presented large variations. The second  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Parameter** & **Value** & **Parameter** & **Value** & **Parameter** & **Value** \\ \hline \(n_{TEMS}\) & 288 & \(Cap^{bat}\) & 1120 kWh & \(p^{mmB}\) & \(-\)2200 kW \\ \(n_{Tintra}\) & 10 & \(SOC^{i}\) & 0.9 & \(p^{mmD}\) & 0.3-1100 kW \\ \(N_{d}\) & 9 & \(\eta^{bat}\) & 0.9 & \(p^{mmD}\) & 1100 kW \\ \(N_{s}\) & 5 & \(p^{mxB}\) & 2200 kW & \(marge_{dies}\) & 2000 kW \\ \hline \hline \end{tabular}
\end{table}
Table 1: Parameters for the EMS optimization problem.  
scenario had lower PV variability, but it was not a fully sunny day. Finally, the last case consisted of a sunny day with not appreciably fast PV power variations. The simulation results are shown in Figure 6 for the first case, in Figure 7 for the second case and in Figure 8 for the last case. Note that the simulation considered the execution cycle explained in Section 3.3 and the EMS outputs were introduced to the dynamic model.  
For each scenario, the top plot depicts the active power of microgrid's devices as well as the power demand and the available PV power. In the middle plot, the SOC and the connections of diesel units can be observed. Then, the bottom plot shows the frequency response of the microgrid in blue, being the green lines the frequency droop dead-band (out of this range, the PV plant and the batteries provide frequency support). It can be observed that, for the three scenarios, the battery was discharged at the beginning of the day to be able to charge during the hours of high PV power. In addition, as could be expected, the active power of diesel generators and the connected units followed a trend complementary to the PV power generation. Thus, during the peak PV production hours, the amount of connected diesel generators was lower, as well as their production. It is also shown that the frequency deviations were kept inside the acceptable range. Comparing the total PV energy generated to the available PV energy for the three scenarios, the relative amount of used PV energy was 94.57%, 84.46% and 94.98%, respectively. The second scenario had the lowest PV profitability, but note that, in this case, the maximum available PV power was higher than the load in some periods.  
During the times 13:00-15:00, the frequency exceeded the droop dead-band several times. Thus, the PV and battery provided frequency support. This happens because, during this period, the number of connected diesel generators was small (low inertia). Hence, either the large PV fluctuations or the connection of new generators injecting active power produced a frequency transient. While the frequency may have exceeded the frequency droop dead-band (green lines), it did not exceed the minimum value of 49 Hz.  
Figure 6: Simulation results for the first scenario (high PV power variability after the midday).