Analysis of large distribution networks with distributed energy resources Análisis de grandes redes de distribución con recursos energéticos distribuidos

The connection of distributed energy resources (i.e., distributed generation and energy storage) and some special loads (e.g., electrical vehicle) raises new challenges in distribution system analysis. Intermittent and non-dispatchable generation units, time-dependent or asymmetrical loads require capabilities that until very recently were not available in distribution software packages; for instance, capabilities for probabilistic and time mode simulations. This paper presents the work made by the authors to adapt OpenDSS, a freely available distribution simulator, in order to perform these types of studies taking into account that the model of an actual distribution system is usually very large and complex. A goal of the paper is to present the usage of OpenDSS as either a stand-alone tool or as a COM DLL driven from MATLAB. Several applications have been developed to obtain yearly curve shapes aimed at representing time-varying loads and renewable energy sources (sun, wind) and to run OpenDSS in a distributed computing environment (e.g., multicore installation).


INTRODUCTION
Distribution system analysis has been traditionally perceived as the study of rather small radiallyconnected systems by means of dedicated simple power flow methods. This perception has dramatically changed during the last decade. Actual distribution systems are very complex, even more complex than transmission systems, and several software packages are presently available for realistic analysis of distribution systems. The list of essential capabilities implemented in current simulation packages for distribution system analysis may include the following items [1][2][3]: · mixture of three-phase, two-phase and singlephase distribution system component models; · capabilities to perform simulations of radial and meshed networks over periods of time (e.g., one year); · built-in ZIP models of end use loads; · representation of distributed generation and energy storage devices.
Basic issues addressed in most distribution system simulators include power flow solution methods, steady-state short circuit calculations, and reliability analysis. In general, dynamics analysis is not commonly implemented in tools for distribution system analysis, although some include harmonic analysis. In addition, modelling approaches generally ignore the secondary (LV) distribution system. Although present tools and techniques are designed for uniprocessors (e.g., single CPU) they can easily cope with rather large distribution systems (e.g., several thousands of nodes).
It is foreseen that the future (smart) distribution system will monitor, protect, and automatically optimize the operation of its interconnected elements to maintain a reliable and secure infrastructure that can meet future demand growth [4][5][6]. Such a grid will offer improved reliability, higher asset utilization, better integration of distributed energy resources (DERs) and new loads (e.g., plug-in hybrid electric vehicles), reduced operating costs, increased efficiency and conservation, and lower greenhouse gas emissions.
An important aspect of the future grid would be the high penetration of DERs which can be used for supporting voltage, reducing losses, providing backup power, improving local power quality and reliability, providing ancillary services, and deferring distribution system upgrade [7][8][9]. Aspects to be considered when analysing the connection of DERs are the great variety of generating and energy storage devices [8,10], the fact that some DER devices are connected to the utility network via a static converter [11], and the intermittent nature of some renewable sources.
DERs raise several challenges to distribution load flow calculations since they demand modelling capabilities for representing intermit-tent generators, energy storage devices, voltage-control equipment, or multi-phase unbalanced systems. In addition, studies of systems with non-dispatchable resources will require a probabilistic approach and calculations performed over an arbitrary time period that may range from several minutes to several years.
Load representation is another important issue since voltage-dependent loads with random variation and a duration curve must be also accounted for. These issues complicate the study since software tools have to combine new analysis capabilities with a high number of models for representing the various generation and energy storage technologies, besides the conventional distribution system components, and include capabilities for time mode calculations [10].
The essential requirements for future distribution system analysis software may be summarized as follows [12][13]: (1) perform fast solutions, (2) be able to capture and process voluminous amounts of simulation results, (3) have robust solution methods for simulating both radial and meshed networks, (4) be able to perform time series simulations with time steps as short as 1 second during periods of several years, (5) solve very large distribution networks, (6) be able to include higher voltage sub-transmission and transmission systems, (7) provide data on enduse patterns for better quantification of distribution system efficiency and improving automation simulations. The list of foreseen functionalities will include grid reconfiguration, state estimation, look-ahead analysis and visualization, contingencies analysis, and load forecasting. This paper is aimed at presenting the work carried out by the authors to implement some of the functionalities required for analysing large distribution systems with distributed generation. The simulation tool used for this purpose is OpenDSS, a freely available distribution system simulator, whose modelling and calculation capabilities allow users to represent the most important distribution components and perform studies considering both deterministic and probabilistic calculations [14].
The paper presents: (i) the application of OpenDSS to the study of distribution systems with renewable generation and time-varying loads, (ii) an introduction to the algorithms implemented in MATLAB by the authors for obtaining yearly curve shapes of loads and renewable generation (sun, wind), and (iii) the application of a MATLAB-OpenDSS link for optimum allocation of renewable generation in large distribution systems using a Parallel Monte Carlo approach.

Introduction
OpenDSS is a simulation tool for analysis of electric utility distribution systems, implemented as both a stand-alone executable program and a COM DLL that can be driven from some software platforms.
The executable version adds a basic user interface onto the solution engine to assist users in developing scripts and viewing solutions [14]. Built-in solution capabilities include snapshot and time mode power flow, harmonics, fault current study, dynamics, parametric and probabilistic studies.
OpenDSS can be used for distribution planning and analysis, using a general multi-phase AC circuit model, including models for renewable energy resources, energy storage devices, or unusual transformer configurations. Other solution techniques and capabilities (e.g., graphics) can be added through the COM interface [14][15][16]. This paper presents how this interface can be used to drive OpenDSS from MATLAB.
External tools can be used to generate load and intermittent generation (wind, solar) curve shapes, mainly when the period to be analyzed is too long (e.g., one year). Supporting tools can be also required when a probabilistic approach is to be used for generating random values of loads and generations according to a specific probability density function (e.g., Weibull). In the study presented in this section, these curves have been obtained by means of HOMER (Hybrid Optimization Model for Electric Renewables) [17][18]. This tool can synthesize load, wind and solar data over a period of one year using a variable time step. Time-varying curves generated with HOMER can be easily adapted for representing power demand and generation in an OpenDSS input file.
OpenDSS plotting capabilities can be used also for displaying input loadshapes and generation curves.
On the other hand, random values can be generated from within the simulator, without using any external support. The tool generates a great variety of output files, which can be easily manipulated to display simulation results (e.g., voltages, currents, powers, overloads, over-and undervoltages, or energy losses). Figure 1 shows the organization of tasks between tools, as used for this study. Figure 2 shows the diagram of the test distribution system [19]. It is based on the IEEE37 test feeder, which consists of three-phase underground cables operating at a nominal voltage of 4.8 kV. Characteristics of cable sections were presented in [20]. Notice that some renewable energy generation units are connected to this feeder.

Case studies and simulation results
Two different scenarios have been analyzed [19]: (i) test system with time-varying load; (ii) test system with probabilistic load. The two studies assume balanced loads. In both cases, calculations are made with and without generation.
Case Study 1 -Distributed Generation Impact: Table 1 shows the maximum node load demands. As mentioned above, to represent time-varying loads different yearly curve shapes were created using HOMER. Each of these shapes was then assigned to some feeder nodes. The calculations were performed by assuming that the power factor at each node load remains constant during the simulation period. Figure 3 shows the daily profile and the resulting power of one load shape during one month. Two renewable generators were connected to the system, as shown in Figure 2. A 400 kW wind power generator is connected to Node 740 and a 200 kW   photovoltaic generator is connected to Node 728. In both cases, the power factor of the injected power is unity. Figures 4 and 5 show the wind and solar resources at the distribution system location. As for the load shapes, HOMER capabilities were initially used to obtain the wind speed (see Figure 4) and the solar radiation (see Figure 5). These profiles were later used to derive the shapes of the power injected by both generators, see Figure 6.
The main goal of this first study is to compare results when using different approaches to represent loads, which (1) are assumed to be voltage independent, or (2) represented as constant impedances. Figure 7 shows some simulation results without generation. According to this figure, differences are not very important for the kVAs measured at Node 728.
However, the differences may be up to 10% for the power flow measured at the feeder head. According to Figure 8a, the values of the energy supplied during the entire year and without DG are respectively 8300 and 7723 MWh with the constant PQ model and the quadratic PQ (i.e., the results differ in about 7%); the minimum voltages with the two models are respectively 0.915 and 0.924 pu. Figure 8b shows that the differences with DG are again about 10%. As for the energy supplied from the substation, the values corresponding to each load model are now 7336 and 6792 MWh. That is, embedded generators take a 10% of the required energy, and the differences between models are again of about 7%. The connection of generators raises the minimum voltages to 0.922 and 0.930 pu.

Case Study 2 -Probabilistic Load Flow Calculations:
Load and generation values are generally estimated or calculated with some uncertainties, in which case a probabilistic calculation may be considered. A load flow based on the Monte Carlo method is an option implemented in OpenDSS. Table 2 shows the probability density functions assumed for loads and generations, as well as the parameters selected for each load and each generator. Notice that a Weibull distribution is generally assumed for the wind speed [21]. This distribution is further used to derive the power generation from the power curve of the wind turbine, taking into account air density ratio [18], [22], [23].
Figures 9 and 10 show the distributions of the load for a given node and the wind power generation after using 1000 samples. The resulting distributions for the power supplied from the substation terminals after using 1000 samples with and without distributed generation are shown in Figure 11.
An additional study with 5000 samples was carried out. Although the results after increasing the number of samples were more accurate, they did not significantly change. For instance, the mean power supplied from the substation per phase without distributed generation is respectively 406 and 407 kVA after 1000 samples and 5000 samples, being the standard deviations 10.6 and 9.8 kVA, respectively.
When the generators are connected to the system, then the mean value of the power from the substation decreases to 314 and 315 kVA after simulating respectively 1000 samples and 5000 samples, being the standard deviations 12.2 and 10.6 kVA. These results can be used as a proof that 1000 cases are usually enough for this study.

Introduction
Three different algorithms have been imple-mented in MATLAB to respectively obtain yearly node load profiles, synthetic photovoltaic and wind generation curves. The main features are summarized below.

Node load profiles
Load profiles describe hourly behavior of system node demands. They are generated using realistic base load curves, including the combination of different types of curves. Base load curves represent typical behavior of different types of customers.
In this study load curve information were taken

Node Probability Density Function Parameters
Loads Gaussian/ Normal Mean = 50% of the peak load Standard deviation = 5% of the peak load (see Table 1) Wind generation Weibull Mean = 200 kW Standard deviation = 5% of the mean power generation Photovoltaic generation Gaussian/ Normal Mean = 100 kW Standard deviation = 5% of the mean power generation performing studies with power distribution systems it is necessary to count with different sets of curves, since it is not logical to assume that all clients, even those within the same category, will follow the same pattern. Therefore, it is necessary to generate new curves to be used for different types of studies.
The new curves will be created using the base load curves to ensure that they reflect the behavior of real costumers. The procedure for the synthetic generation of load curves [25] is as follows: 1. Choose a base load curve. 2. Determine yearly trend using Fourier series. 3. Obtain weekly cycles using average values. 4. Reconstruct daily average cycles. 5. Generate an approximate curve overlaying the effect of yearly trend, weekly cycles and daily average cycles. 6. Calculate the error of the approximate curve. 7. Estimate the probability density function (PDF) of the error for every hour and month of the year. 8. Generate random error values using the probability density function of the error. 9. Aggregate generated errors to the approxima-te curve.

PV generation curves
OpenDSS has a built-in representation that incorporates the PV array and inverter into a single model adequate for distribution system studies, and is useful for simulations with time steps greater than 1s. The model assumes the inverter is able to find the maximum power point (mpp), being the active power a function of the irradiance, temperature, rated power at the mpp (Pmpp) at a selected temperature and an irradiance of 1.0 kW/m 2 , and the efficiency of the inverter at the operating power. Figure 12 shows a simplified scheme of this model [3], [26]. Notice that the PV model uses the panel operating temperature, not the environment temperature.
A new custom-made PV module has been developed based on the available model to provide hourly values of the active and reactive power generated by the PV array. The user has to specify the rated voltage and power of the PV array, the rated power of the inverter, the efficiency curve for the inverter, the pu variation of the Pmpp as a function of the  from [24]. They have been classified into several categories: Residential, small loads, low power factor, high and medium power factor, large loads.
Those curves have been obtained through measurements of real customers. However, when cell temperature at 1 kW/m 2 irradiance, while the module internally calculates the yearly curves of irradiance and panel temperature by means of two following procedures [27]: 1. Generation of the yearly curve of solar irradiance. The procedure has been divided into three main steps: (i) calculation of the daily clearness index, (ii) calculation of the hourly clearness index for a given day, (iii) calculation of the hourly solar irradiance. 2. Generation of the yearly curve of panel temperature. The procedure implemented to obtain the panel temperature has been also divided into three steps: (i) calculation of minimum and maximum daily temperatures, (ii) calculation of hourly temperatures, (iii) calculation of average panel temperatures.
To obtain these curves the user has to specify the average monthly clearness index, the slope angle and the geographical coordinates (latitude, longitude, and time zone) of the panel, the normal operating cell temperature and the average monthly values of the minimum and maximum temperatures.

Wind generation curves
The general procedure for the synthetic generation of wind power generation curves uses the procedure proposed in [17] and [28] to obtain the yearly wind speed variation. Once these values are estimated it can be necessary perform a height correction. The power produced by the turbine/generator can be calculated using wind-power curves as those shown in Figure 13. The corrected wind speed values are evaluated in the curve in order to obtain the corresponding power values. Finally, a correction taking into account air density is made at each wind turbine location.

Simulation procedure
The algorithms used for the generation of system curves have been encapsulated inside a module that allows users to generate the information required for analysis of power distribution systems. Each individual submodule will require certain parameters; most of them must be specified by the user, whereas others will be inherited from other modules. The sequence of steps followed by the application to create system curves is as follows: 1. Input energy resources (sun, wind) data. 2. Generate solar irradiance curves. 3. Generate operation temperature curves for PV panels. 4. Generate node load profiles. 5. Generate wind speed curves. 6. Create files containing system curves.
During the simulation process the user can choose among different execution modes based on the generation of yearly curve shapes: (i) generation of a base set of curves; (ii) generation of a new set of curves: (iii) partial generation of a new set of curves; (iv) use of external (already available) curves.
Once the above information has been generated, the user has to define the name of master input files for the system under study, choose one of the execution modes, depending on the available information, to obtain the required yearly curves, and simulate the system.

Introduction
The goal is to select ratings and location of generation units to minimize the annual energy losses measured at the supplying substation terminal. Given the actual configuration and operation of the distribution system (i.e., it is three-phase and may run under unbalanced conditions), the nature of the load (e.g., it is voltage-dependent and time-varying) and the intermittent nature of some generation, a rigorous study requires a probabilistic approach and calculations performed over a time period that may range up to several years.
Although some works have been performed in this field using probabilistic methods [29], [30], not much has been done with a full model; e.g., a model such as that mentioned above for the distribution system, load and DG. Several stra-tegies have been proposed to optimally allocate DG. A very complete and detailed review of works in this field was presented in [31].
The Monte Carlo method is a natural approach when uncertainties are involved and some variables are random, although it is evident that its application to a system of actual size when using an advanced representation and considering a multi-objective method is very costly in terms of computer time. However, multicore computers and software that takes advantage of their capabilities can be used to significantly reduce the computing time.
This section presents the application of a Monte Carlo method using a parallel computing environment for optimum allocation of DG when the goal is to minimize energy losses. Figure 14 shows the diagram of the test system. It is a 1000-node three-phase single-feeder distribution system with a distributed load. Notice that the model includes the substation transformer and a simplified representation of the high-voltage system. The phase conductors of the line are in a flat configuration. The normal thermal limit is 400 A, while the emergency limit is 600 A. The values used for the test system are as follows:
Although this system configuration is unrealistic, it has been chosen because the solution to this problem is well known when the load is constant, voltage independent and uniformly distributed. The optimum allocation of capacitor banks in a distribution feeder with uniformly distributed load has been thoroughly analyzed [32]. A similar conclusion is derived when the goal is to minimize losses by installing generation units that only inject active power [33].
That is, this test system configuration can be useful for validating test cases whose result is obtained by means of a Monte Carlo method.

Monte carlo procedure
The target of the study is to minimize energy losses and the procedure presented here may be defined as a Monte Carlo method aimed at estimating the location and size of one or more generation units to minimize the system losses.
Input data includes system parameters, and time variation of loads and generations. Random variables to be generated during the application of the Monte Carlo method are locations and sizes of the generation units. Note that this can be rigorously made by considering that the generation pattern depends of the area/node where the generator is located. Generation units are either PV arrays or wind power systems. It is assumed that the solar radiation is the same for each system node, but the wind speed can be different because the altitude over sea level is not the same for each system node. Although DG units can inject both active and reactive power, in this work all generators, irrespectively of their technology, will only inject active power.
The implemented procedure may be summarized as follows [15], [34]: 1. Generate the random values for locations and sizes of generators, and assign a shape to each generator, depending on the location. 2. Perform the load flow calculation. Neglect the case if one of the following conditions is satisfied: (i) the voltage at one or more nodes is out of the accepted range of values, (ii) the current through one or more system sections is above the thermal limit. 3. Stop the procedure when the specified number of runs is reached.
The implementation in OpenDSS when using parallel computing, is shown in Figure 15, and is valid for any number of cores. MATLAB capabilities are used to distribute Monte Carlo runs between cores. The procedure is based on the library of MATLAB modules developed by M. Buehren [35]. Load and intermittent generation (solar, wind) curves were generated by means of the MATLAB modules detailed in the previous section.

Optimum allocation of generation units
The allocation of generation is made taking into account constraints for some operating conditions (i.e., all voltages must be between 1.05 and 0.95 pu, the thermal limit of 400 A for line conductors cannot be exceeded), so those combinations of active powers and distances for which at least one limit is exceeded are neglected.
A reverse power flow through the substation transformer is a condition that can be considered since some utilities do not accept power supply from the lower voltage level; however, this condition will significantly limit the power of the generation unit to be selected. One reason behind this conclusion can be easily understood from the information shown in Figure 16: during weekends the power demand decrease significantly while solar and wind generation remain basically the same and only small generators would be acceptable to avoid reverse power flow.
The study aimed at optimally locating two or more generation units is made by considering that the overall active power of the generation units cannot exceed the total rated active power of the feeder load. Figure 17 shows the results when the goal is to allocate a single generation unit. Note that the resulting surface is very similar in both cases, but the optimum allocation is different. This can be  Figure 15. Block diagram of the implemented procedure [15], [27].
easily understood by comparing the generation curves shown in Figure 16. Table 3 shows the results obtained after applying the procedure with different number of runs when one, two, four and eight units are to be allocated. On one hand, these results clearly prove that the number of runs has to be increased with the number of generation units to be allocated. On the other hand, the results show some significant differences between the values to be allocated when the generation is of photovoltaic type or wind type, and that the required ratings of the wind power generation units are below those required for solar power generation.
This conclusion can also be easily understood by looking at the curves for solar and wind generation; since the generation patterns are very different, see Figure 16, the optimum values will also be different. Another interesting conclusion is that the optimum   An important aspect is the CPU time required to simulate the test system when using a singlecore installation and the reduction of simulation time that can be achieved when using parallel computing. Simulation times required with a single-core installation vary from about 2.5 days when allocating a single generation unit (5000 runs) to more than 2.5 months when allocating 8 units (160000 runs). Table 4 provides the computing times when using 60 cores and a summary of the main results. These results show that the achieved reduction of simulation time is significant and almost proportional to the number of cores. The table also shows the results derived from a pseudo Monte Carlo method presented in [15]. The new approach is based on the fact that not much difference between energy losses should be expected when the combination of the random values gives a point that is closely located to a previously obtained and simulated point. That is, after checking the Euclidean distance between the new combination of values and those previously simulated, it is decided whether the new combination is worth simulating or should be skipped. For more details on this refinement see reference [15].
A conclusion from the refined method usage is that the simulation time is shorter when allocating eight units than when allocating four units. The reason for this result is that the number of combinations to be discarded increases as the number of units to be allocated increases.

CONCLUSIONS
This paper has presented the application of OpenDSS to the analysis of large distribution systems with distributed generation. OpenDSS offers a flexible and powerful platform for load flow analysis with capabilities for special studies, such as impact analysis of renewable energy sources and electrical vehicles, annual losses and unserved energy studies, probabilistic load flow calculations, or even power flow visualization [19]. A requirement for simulating distribution systems with distributed renewable generation during a given period of time is the possibility of generating realistic curve shapes for loads and renewable generation.
This document has sumamrized the work carried out by the authors to develop and implement MATLAB modules for obtaining those curve shapes. OpenDSS can be driven from an external tool by taking advantage of its COM DLL capability. The paper has also presented how this option can be used to drive OpenDSS from MATLAB to estimate the optimum allocation of distributed generation. The study is based on a Monte Carlo approach and uses MATLAB capabilities to run OpenDSS in a parallel multi-core environment. Simulation results prove that such a study can be carried out in an affordable time by increasing the number of CPU cores.