## 5 Simulation Results and Discussion of the Developed Model  
The following section presents the description of the developed energy management control and diverse specified simulation procedures and simulation results. The developed model was implemented in the MATLAB/SIMULINK 2020b software and the block diagram of the developed system and EMS algorithm is shown in Appendix A. All circuit elements and machines are represented by their respective model blocks available in the software. Different parameters of the simulation are presented in Table 1. The developed EMS strategy controls the PV, wind, battery, and loads. The load is subdivided into three categories: industrial load (which is the high-priority load), residential load, and commercial load [46]. Figure 5 illustrates the PV outputs voltage and power as a function of the simulation time. The output voltage remains constant at 380 Vdc with very small ripples; the designed model allows a ripple with 0.9% variation from the steady state. The power generation stays constant at 149.68 kW. Figure 6 presents the universal bridge rectifier output voltage and output power of the wind model as a function of the simulation time. The steady states of the outputs are \begin{table}
\begin{tabular}{l l} \hline
**Unit** & **Specification** \\ \hline Photovoltaic & 150 kW, 380 V \\ Wind power & 150 kW, 380 V \\ Battery & 900 Ah, 380 V \\ DC bus voltage & 380 V \\ DC-DC converter & 380 V \\ Load demands & 280 kW \\ \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters. Figure 5: PV output power and voltage from the developed DC microgrid model. attained at approximately 2.2 s and remain constant after, with very small ripples. The output voltage is 380 V\({}_{\text{dc}}\), and the average value of the power generation is 148.78 kW. The developed EMS algorithm is designed in the Stateflow logical programming environment. In this section, different cases are considered. Table 2 summarizes the different operating modes of these cases. In this study, Load 1 is considered as the priority load, which is the industrial load. The operating mode of the Stateflow environment corresponds to that of a logical system; it is either 0 or 1. When the system is in operation mode, the output indicates 1, and when the output indicates 0, this means that the system is not in operation. **Case 1:** In this first case, the power supply is equal to the demand of the loads, as shown in Figure 7. The battery and the auxiliary load are disconnected from the system. The power is supplied to the loads and the battery SOC is assumed to be below its maximum capacity (100%). In this case, the battery SOC is kept at 50%. \begin{table}
\begin{tabular}{c l l} \hline \hline
**Operation** & \multicolumn{1}{c}{**Descriptions**} & \multicolumn{1}{c}{**Actions**} \\ \hline
1 & Loads connected & A1: Loads = ON; \\
2 & Load connected and battery charging & A2: Loads and battery = ON; \\
3 & Battery charging & A3: Battery = ON; \\
4 & Auxiliary load connected & A4: Damp load = ON; battery = OFF; \\
5 & Battery connected & A5: Battery = ON; Damp load = OFF; \\
6 & Battery discharging & A6: Battery = ON; \\
7 & Battery disconnected & A7: Battery = OFF; \\
8 & Load\({}_{1}\) and Load\({}_{3}\) connected & A8: Load, and Load\({}_{3}\) = ON; Load\({}_{2}\) = OFF; \\  & & battery = ON; \\
9 & Load\({}_{1}\) and battery connected & A9: Load\({}_{2}\) and Load\({}_{3}\) = OFF; Load\({}_{1}\) = ON; \\  & battery = ON; \\
10 & Load\({}_{2}\) and battery connected & A10: Load, and Load\({}_{3}\) = OFF; Load\({}_{2}\) = ON; \\
11 & Loads disconnected and battery connected & A11: Load = OFF; battery = ON; \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Action table for the energy management system. Figure 6: Wind output power and voltage from the developed DC microgrid model. The demand of the loads is fixed at 280 kW, and the power production from the RES is 281 kW. Therefore, the loads are supplied by the power generation without any interruption. Figure 8 presents the Stateflow transition state of this scenario.