# Stochastic Predictive Energy Management of Multi-Microgrid Systems
## 6 Simulation Results  
In this section, to evaluate the effectiveness of the proposed approach, simulation analyses are carried out in a test system. The model is established in MATLAB/Simulink. The nominal voltage and frequency of the system are set to \(230\sqrt{2}V\) and \(50 Hz\), respectively. Matlab SimPower Systems is used to model the electrical system. The line impedance information is represented in Table 1.  
The simulated system consists of three RE-based MGs that are equipped with battery-based ESSs in size of 350, 300, and 400 kWh, respectively. The initial level of SOC is set to 50% of the nominal capacity, while the min and max SOC values are set to 20% and 80% of the battery nominal capacity, respectively. It is assumed that all MGs and the main grid are electrically connected and information can be exchanged among them to support bidirectional updates. Table 2 represents the predicted aggregated load profile of each MG during the optimization horizon and the forecast data for aggregated RESs production. To generate discrete random scenarios representing the uncertain nature of RESs production and consumer demand, Monte Carlo algorithm is used. Random scenarios are generated from normal distributions where the mean values are set to predicted data and standard deviations is assumed to 5% of the mean values for all MGs. Besides, \(H_{P}=H_{u}=3\) h and \(T=24\) h. The cost function is evaluated for a representative case where \(c_{i}=0.2\frac{\xi}{RW}\) and \(\lambda=2\frac{\xi}{RWh}\). Power flow analysis is conducted by CEMS using MATLAB SimPower System to specify the amount of power to be transferred through power lines. All electrical system requirements including voltage and frequency constraints, line capacity, and system losses are considered for deriving optimal power flows. A local \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **Symbol** & **Value** \\ \hline Frequency & \(f\) & 50 Hz \\ Nominal Voltage & \(V_{nom}\) & 230\(\sqrt{2}\) V \\ Line Impedance 1,2 & \(Z_{1,2}\) & \(R_{1,2}=0.4\Omega,L_{1,2}=1 mH\) \\ Line Impedance 1,3 & \(Z_{1,3}\) & \(R_{1,3}=0.4\Omega,L_{1,3}=1 mH\) \\ Line Impedance 1,4 & \(Z_{1,4}\) & \(R_{1,4}=0.4\Omega,L_{1,4}=1 mH\) \\ Line Impedance 2,3 & \(Z_{2,3}\) & \(R_{2,3}=1\Omega,L_{2,3}=1.7 mH\) \\ Line Impedance 2,4 & \(Z_{2,4}\) & \(R_{2,4}=1\Omega,L_{2,4}=1.7 mH\) \\ Line Impedance 3,4 & \(Z_{3,4}\) & \(R_{3,4}=0.7\Omega,L_{3,4}=1.5 mH\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Electrical system parameters. PI controller as represented in Figure 3 is designed that controls each inverter output in current control mode. The current proportional and integral terms are set to \(K_{pl}=20\) and \(K_{il}=50[s^{-1}]\), respectively. For simulation purposes, the main grid is modeled using an inverter, which is controlled in voltage control mode as illustrated in Figure 4. For the experimental tests this part will be replaced by grid simulator. The current and voltage proportional and integral terms are set to \(K_{pl}=15\), \(K_{pV}=20\), \(K_{il}=50[s^{-1}]\), and \(K_{iV}=50[s^{-1}]\), respectively. Using the proposed strategy for penalty cost allocation, the penalty coefficients have been calculated: \(s_{1}=0.3184\), \(s_{2}=0.3518\), \(s_{3}=0.3299\). Figure 5 shows the daily ESSs scheduling for the MGs including the normalized SOC and charging/discharging power of the batteries, respectively. Scheduled and realized exchanged power between the MMG system and the utility is also plotted in Figure 6. As it can be noted, the proposed EMS has a good tracking performance in following the power reference trajectories.