Matlab Code to Assess the Reliability of the Smart Power Distribution System Using Monte Carlo Simulation

Reliability of power systems is a key aspect in modern power system planning, design, and operation. The ascendance of the smart grid concept has provided high hopes of developing an intelligent network that is capable of being a self-healing grid, offering the ability to overcome the interruption problems that face the utility and cost it tens of millions in repair and loss. In this work, we develop a MATLAB code to examine the effect of the smart grid applications in improving the reliability of the power distribution networks via Monte Carlo Simulation approach. The system used in this paper is the IEEE 34 test feeder. The objective is to measure the installations of the Automatic Reclosers (ARs) as well as the Distributed Generators (DGs) on the reliability indices, SAIDI, SAIFI, CAIDI and EUE, and make comparisons with results from a previous study done by the authors using another approach. The MATLAB code should provide close results to the output of the previous research to verify its effectiveness.


Introduction
The application of Monte Carlo simulation (MCS) is a corner-stone in the sensitivity and quantitative probabilistic analysis.Among many of its great virtues is its powerful ability to accurately evaluate the reliability of the electrical grid, which allowed several studies to emerge in this arena.The deterministic approach in assessing the reliability of the power systems is criticized for not being sensitive to the stochastic nature of the grid as well as to customer demands and components failures, which may lead to either an overinvestment or catastrophic consequences.Therefore, the need for probabilistic evaluation of the electrical system behavior has been emphasized in the most recent decade.MCS, as a process of simulation, is strictly random and can be divided into two main types; sequential and non-sequential (random) Monte Carlo methods.The sequential MCS simulates the system operation as an up-and-down, where a system operating cycle is obtained by combining all the cycles of the system components in chronological order.This usually requires more computational efforts than the other approach, the non-sequential MCS, which simulates the system with a higher efficiency by choosing intervals randomly, yet cannot simulate the chronological aspect of the system behavior.The MCS process is central in the stochastic simulation using random variables, where it can simulate the electrical components considering the grid's behavior with the goal of evaluating its expected reliability parameters [1] [2].It also provides distribution information for the load point indices, system indices, and the energy not served costs [3] [4].
The goal of this work is to apply the Monte Carlo technique on the IEEE 34-node test system, shown in Figure 1, to evaluate the reliability of the distribution network using the applications of the smart grid concept considering different case scenarios.Specifically, we consider the impact of the automatic reclosers (ARs) as well as the distributed generators on the system with the optimal placement of the ARs on the feeder, as MCS helps in building an artificial history for each component operation for a simulation time, which was set in this work to be 2000 years.The work aims to compare the results obtained using MCS with results obtained previously for the same test system using another approach [5].The work also seeks to produce a sufficient MATLAB code that can be used to perform MCS analysis and provide the famous reliability indices SAIDI, SAIFI, CAIDI, EUE, and ASAI for any study-scale electrical test systems.The results should reflect the definition of the smart grid that identifies the ability of a system for a self-healing, self-interrupting of faults [6].Reference [7] shows diffe-

Concept of MCS
A Monte Carlo Simulation's Matlab code was developed at the University of Southern California by the authors of this paper to achieve the purpose of this study.The code can be found in Appendix of this work.The input data utilized in this work represents a real system data taken from reference [1], which was also used in the reliability study done by the authors in [5].The distribution system reliability in overall is evaluated using load point indices and system indices, which are the average failure rate (λ i ), average outage time (r), and the average annual unavailability (U).The method considered in the coding is the time-sequential MCS, which models the system recognizing the chronological order as the incidents occur on the system through the simulation time.An artificial history is generated using the random number generator which produces a uniform random number (between 0 and 1) for each component in the test system for the goal of providing a sequence of the operating-repairing cycle for it.

( )
We simulated the IEEE test system using the famous two-state Markov model shown in Figure 2 for all the non-source components in the feeder.The process is highly random in nature as we do not know for sure when, where and which component in the system will fail first with the fact that the behavior will be dif- failure process for a component due to contingency event that would take it out of operation.MCS randomly sample the up and down states for each element in the feeder which generates a simulated sequence for the component's history of operation and failure.This helps in producing an overall conclusion about the system behavior in general, and to identify the component that is prone to outages in particular.Figure 3 illustrates the concept of TTR and TTF for a component in any system.These times can be represented by random variables and simulated using gamma, exponential, normal, lognormal and Poisson distributions [7] [8].

MCS Simulation Process
References [2] [6] [9] provided guidance on the MCS process that was utilized in this work.The process can be simply briefed as follow: 1) Generate a random value for each of the component using the random number generator.The variable obtained for each component take the value between (0, 1) with equal likelihood.2) Determine the component in the grid with the minimum TTF.Otherwise, go to step 7. 5) Calculate the number and duration of failures for each load point per year.6) Calculate the average value of the load point failure rate and duration for the sample years.7) Calculate SAIDI, SAIFI and system indices and record the average values of the results.8) Return to step 2 if the simulation time is less than the specified total simulation years.Otherwise, record the results as final outcomes and end the simulation.

Modeling the Test System in Matlab Considering
Smart Grid Technologies

Case 1(A): Installation of One Automatic Recloser (AR) in the Feeder
The results of modeling the test system in our MATLAB code are provided in Table 1.The application of the smart grid technologies on the reliability of the  distribution feeder is weighed based on the outcomes (of using the sequential Monte Carlo) that show the impact of the smart grid applications (the autorecloser in this case) versus the conventional (main) scheme of the test system in Figure 1.As shown in Figure 4, the installation of an automatic recloser will yield a reduction in both SAIDI and SAIFI as to the scenario of having the regular system.The best improvement is when we consider this automatic recloser to be installed between nodes 832 -858 in the electrical feeder, where we noticed a Figure 4 shows the impact of the installation of one automatic recloser on the test feeder considering different scenarios and locations, while Figure 5 shows a line graph for the reduction in energy not served index per each option considered.By making a comparison between the results obtained from the analytical method and brute force in the study done by the authors in [5], and the ones obtained using this MCS MATLAB code, we find a very close effect for the installation of the automatic recloser in each option provided in the table.For example, we notice that there is 4.5% difference in the obtained SAIDI in both studies; the analytical method provided us with 9.32% reductions while MCS show a 13.82% for installing the automatic sectionalizing device between nodes 832 -858 particularly.The difference in percentage goes little higher in SAIFI but still under acceptable margins, where there is a difference of 7% only in the two studies.The same also applies for EUE, which its concept was obtained mainly from the Lawrence Berkeley National laboratory [10], where there is only a 4.3% difference between the percentages of improvement in both techniques.These results tell us that both methods are efficient and provided similar outcomes regarding evaluating the reliability of the given system after applying the smart grid applications.

Case 1(B): Installation of Two-Automatic Recloser (AR) in the Feeder
We want to examine in our work the effect of the installation of two automatic reclosers and try to identify if such move will yield more improvement and cost savings.In this case study, we modified the test system to include an automatic recloser in between nodes 832 -858, and then model the modified system to investigate any further improvements in the reliability indices if we want to add another AR in the test system.Table 2 shows the obtained results for this case study, with the reliability indices for each scenario when we model using the MATLAB code that we built for the purpose of our work.The best option clearly is to install the second AR in between 834 -860, where this option will yield in 21.85% improvement in SAIDI from the base case where no ARs are considered.
Also in this option, SAIFI witness 22.06% decrease from the baseline scenario.
This significant reduction in the interruption/year is contributed to the system's ability to isolate the faulted area of the feeder once an outage occurs, and be able to restore service and maintain it for the healthy part of the feeder.The virtues of modeling the system using MCS is its ability to offer the best location for the ARs considering the artificial data it made for each component of up and down history.Figure 6 shows the results of different scenarios for the installation of a second AR using our MCS MATLAB code, comparing them with the baseline case of having no AR at all in the system.

Case 2: Installation of 1 MW DG Unit on the Feeder
We emphasize in this work that the DG units are considered great tools to enhance the reliability of the distribution grid, by providing the energy to the distribution feeder during the islanding scenario when a major outage hits an electrical network.Previous studies have extensively covered the integration of the DG units in the distribution grid [11] [12] [13] [14].References [15] [16] investigate the ability of DG units to operate parts of the electrical infrastructures as microgrids during major outages.In our work, we investigate modeling a 1MW distributed generator, connected to node 890, where around 30% of the customers are connected.The DG unit could be sized based on the need, whereas in this feeder, a 1 MW DG unit provides approximately the same benefits that could be added by the installation of a higher MW capacity DG unit as the demand on that load point is 1.7 MW.We model different case scenarios when connecting a DG unit to the system to find reliability benefits of installing the DG units along with the ARs, and the results for these scenarios are shown in Table 3.The results of the base case illustrate the need for the automatic reclosers/CBs when we install a DG to the distribution system; otherwise, there would be no benefit since a fault on that feeder will certainly block the connection of the DG units during outages (Figure 7 and Figure 8).
The best option will be the installation of one automatic recloser between nodes 852 -832 will improve SAIDI by 60.15%, a change from 6.80 to 2.71 hours/year.SAIFI will experience a great reduction as well from 15.23 to 6.07 occurrence/year, accounting around 60% in improvement as well.In the case of any contingency event, the DG unit will provide the system the ability to operate as a small microgrid, providing service to the unaffected parts of the feeder and improving the system indices.It is worth mentioning that the results using MCS show similar reduction percentage for SAIDI when modeling the same system using the analytical technique and the software that is based on brute force me-Figure 6. SAIFI and SAIDI for case TWO ARs.thod, where there less than 6% in the difference between the reliability indices in the two studies.

Conclusions
Monte Carlo technique is one of the most powerful, efficient methods to evaluate the reliability of the power distribution grids.In this work, we simulate the IEEE 34 node test system using the MSC technique, through a MATLAB code that was written by the authors of this paper and shown in Appendix A of this work.After modeled the IEEE feeder, shown in Figure 1, we made a comparison with a previous study done on the same system but with using another approach.
Based on the results, we found that the MCS provided similar results with those obtained using analytical technique [5] and DISREL, an intelligent based program that builds on the brute force concept.The study using the developed MCS MATLAB code shows the impact of the smart grid technologies in improving the reliability indices of the test feeder.
The study shows different scenarios of applying the auto reclosers and the DG units in various parts of the feeder.Furthermore, the automatic reclosers, once installed optimally in the grid as proposed by the software, significantly improve the reliability of the power distribution network by isolating the healthy parts of the system automatically, which maintain the service to a substantial number of customers and reduce the repair time.The distributed generators, although dated back to the late 1970's, are now considered to be one of the applications that define the smart grid concept.The results of integrating them in the distribution feeder show the advantages of using reliable, assumed dispatchable, DG units near load center.Along with the installation of the automatic recloser, the DGs provide the opportunity of operating the distribution grid as a microgrid, allowing service to continue to parts in the network, something will be greatly admired especially during major outages and blackouts.Also, the study provided in this work shows the amount of energy (in kW) that is saved for the utility in this real life test feeder, through the EUE index which measures the reduction in the energy-not-served for each case option.Also, the comparison of these results with that one obtained previously on the same test feeder using the same real-life inputs shows the MCS MATLAB code we developed is effective, and serves as a tool that can be used in evaluating the reliability of distribution feeders when applying small modifications only.That reflects the difference from the test system used in this study.

Figure 2 .
Figure 2. The two-state model of a component.

3 )
Convert the generated values into TTF, TTR for each component in the system.Determine the outage duration for each failed load point indices.4) Generate a new random number for the failed component and convert it into a new TTF.If the simulation time is less than a year then return to step 2.

Figure 3 .
Figure 3.The operating/failure time of a component.

13 .
82% improvement in SAIDI [from 6.80 to 5.89 hours/year], 15.76% for SAIFI [from 15.23 to 12.83 occurrence/year] and 13.64% for EUE [from 10,709 to 9248 kW/year].The improvement in the reliability indices is a result of the fact that the auto-recloser would have the virtue of isolating the fault and restore the service to the healthy parts of the feeder, which also contribute to the quick identification of the faulted area which eventually reduces the repair hours.These two factors significantly improve the reliability indices overall and save much of energy, money, and efforts to the utilities.

Table 1 .
Results of installing one automatic recloser to the test system.

Table 2 .
The results of modeling the test system with two ARs.

Table 3 .
Results obtained for installing 1MW DG unit.