Next Article in Journal
Enhancing Edge-Assisted Federated Learning with Asynchronous Aggregation and Cluster Pairing
Previous Article in Journal
Failure Mechanism Information-Assisted Multi-Domain Adversarial Transfer Fault Diagnosis Model for Rolling Bearings under Variable Operating Conditions
Previous Article in Special Issue
Modeling of Induction Motors and Variable Speed Drives for Multi-Domain System Simulations Using Modelica and the OpenIPSL Library
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Combined Use of Python and DIgSILENT PowerFactory to Analyse Power Systems with Large Amounts of Variable Renewable Generation

by
Javier Jiménez-Ruiz
*,
Andrés Honrubia-Escribano
and
Emilio Gómez-Lázaro
Renewable Energy Research Institute, Department of Electrical, Electronic, Automatic and Communications Engineering of ETSII-AB, University of Castilla-La Mancha (UCLM), 02071 Albacete, Spain
*
Author to whom correspondence should be addressed.
Electronics 2024, 13(11), 2134; https://doi.org/10.3390/electronics13112134
Submission received: 12 April 2024 / Revised: 16 May 2024 / Accepted: 29 May 2024 / Published: 30 May 2024

Abstract

:
Over the last decade considerable efforts have been made to reduce greenhouse gas emissions, leading to the significant development and implementation of renewable energy plants across all power systems in the world. Wind energy has consolidated its position as one of the two key energy sources (in conjunction with solar photovoltaics) to achieve completely green power systems. Integrating wind energy into power systems is a more complicated task compared to traditional generation systems, as wind energy relies on a variable energy source characterised by high variability. Several tools currently exist to simulate the effect of wind energy generation in power systems, but they often lack the versatility demanded by researchers. This paper analyses how both Python 3.11 and DIgSILENT PowerFactory 2024 can be used synergistically to assess the implementation of wind power plants, highlighting how the use of these two tools combined can be of great interest for both researchers and grid operators.

1. Introduction

In recent years, the integration of wind energy into power systems has served as a crucial step towards achieving complete net-zero emissions power systems, with wind becoming one of the main energy sources in several countries around the world. According to several predictions, by 2050, energy consumption is expected to grow by 14% compared to 2020 levels [1], leading to the urgent need to produce energy devoid of greenhouse gas emissions. This increase in energy demand is due to both the increase in the global population and the growing efforts to electrify most industries in order to reduce the use of combustion engines. This situation has led not only to an increase in the overall demand of energy, but also to a change in the demand profile due to the introduction of these new loads. If the future impact of electric vehicles is also considered, the necessity of implementing new power sources is urgent [2]. According to the Global Wind Energy Council, 77.6 GW of new wind power capacity was installed in 2022, bringing the accumulated installed capacity to 906 GW [3] (Figure 1). The distribution of newly installed capacity is not equal across the world, with the new capacity having mainly been installed in China, USA, Brazil, Germany and Sweden [4]. In the particular case of the European Union (EU), the concern for reducing pollution and implementing environmentally friendly policies has generated the implementation of strict regulations aimed at lowering greenhouse gas emissions resulting from energy generation. By 2030, the EU has stated that a total capacity of 323 GW of wind capacity should be installed, with 100 GW corresponding to offshore wind farms [5]. Wind energy has become one of the main sources of energy in several countries, especially in Europe. Such is the case in Spain, where wind energy led the power mix in 2023 as the renewable energy source with the greatest weight in annual energy production, covering 22.2% of the electrical demand [6].
Even though onshore wind power has been the predominant technology in the last decade, offshore wind power is gaining increasing prominence in the global energy mix. This trend is expected to continue as offshore wind technology advances and becomes more economically viable, further consolidating its position as a significant contributor to the world’s energy portfolio. Among some of the advantages of offshore wind farms are the availability of large flat areas, higher wind speeds and less turbulence [7]. In 2022, offshore wind capacity hit a new record, accomplishing a cumulative installed value of 64.3 GW [4]. Nevertheless, as can be clearly observed in Figure 2, this capacity has been mainly installed in China and in Europe (predominantly in the UK and Germany).
To integrate this large amount of wind energy into electrical systems, it is crucial to carefully analyse the impact that wind farms have on power systems. As wind power plants rely on a highly variable source of energy, it is of extreme importance to quantify said variability and mitigate its effects, such as curtailments [8,9]. Wind speed variability is a great drawback when it comes to implementing these systems in power grids, as it is both a significant challenge when operating power systems and a great source of uncertainty when evaluating the associated economic costs [10], which negatively impact the reliability of electrical systems. Power system reliability analysis has been a fundamental aspect of electrical engineering, aiming to assess the ability of a power system to deliver electricity to consumers without interruption. Predictive reliability assessment of a power system is usually used to determine if failures are prone to happen in an electrical grid. This method involves both historical component outage data (as more data are available the predictions will be more accurate) and mathematical models. This method can be further divided into simulation and analytical methods [11]. Machine learning algorithms are also currently being used to enhance power reliability assessment, as they can rapidly adapt to the specific characteristics of the power system they are trained on, hence providing fast and accurate results concerning the reliability of the electrical grid [12,13]. In order to evaluate the effects of renewable power generation systems on electrical networks, two methods are typically used, stochastic analysis and quasi-dynamic analysis. These two methods complement each other, providing valuable insights into the variability of renewable energy generation in power systems and assessing the dynamic behaviour of power systems with high integration of renewable energy sources.
Stochastic methods rely on using statistical tools to study how variable renewable energy systems will behave taking into account uncertainties such as weather variability. These methods help manage the risk associated with variability in renewable generation, hence helping to integrate renewable energy into the grid while ensuring reliable power supply. One of the most widespread tools for evaluating how power systems with high penetration of variable renewable energy will behave is Monte Carlo simulations. With this method, a large number of random situations are generated, taking into account the stochastic models of each component of the power grid (wind speed is typically characterised by the use of Weibull distributions [14]). As a result of the law of large numbers, as more random situations are considered, results will converge towards the real behaviour of the system [15]. As these simulations require multiple random samples, this method was previously impractical in power system studies. However, as computing capacity and new optimisation algorithms have been developed, these types of simulations are now widely used in a great number of fields, including power system analysis [16]. More complex stochastic models to address the uncertainty of variable renewable generation are being developed [17], the aim of which is to improve renewable power management by taking energy storage systems into account, hence overcoming the main drawback of wind energy [18].
Quasi-dynamic simulations, on the other hand, work by performing a series of load flow simulations using time dependent data. Load flow analysis is a fundamental tool for assessing the operation of a power system under normal steady-state conditions. Essentially, it provides a snapshot of the power system at a specific point in time. This analysis is crucial for various critical aspects of power systems, including power forecasting, state control, and reliability enhancement. The primary output of load flow calculations is the voltage magnitude and angle at each node. Subsequently, the active and reactive power flows across all devices connecting the buses, as well as the energy losses, are determined [19]. If power flow analyses are conducted sequentially, taking into account the values of each input variable of our system for each point in time, the dynamic behaviour of a system can be studied. This method is known as quasi-dynamic analysis which is used to simulate the dynamic behaviour of power systems over time, focusing on the interactions between all the components present in power systems. This tool is hence primarily used to perform medium-to-long-term simulation studies. In order for this method to produce accurate results, large amounts of data are required. Nevertheless, if sufficient data are available, not only can quasi-dynamic simulations be used to simulate the behaviour of a singular power grid, but power generation and electric demand can be forecast by using machine and deep learning algorithms [20,21], thus helping to handle the uncertainty associated with renewable energy sources, especially wind generation [22].
Given these circumstances, it is of great importance to have the appropriate tools to simulate scenarios in which large amounts of renewable energy sources are connected to the power grid. In order to simulate the behaviour of power grids, both researchers and power grid operators use software such as Siemens PTI PSS E (version 2024) or DIgSILENT PowerFactory 2024 [23]; while these software platforms provide many tools designed to study power systems, they can often feel limited when approaching highly specific issues. This, combined with the typical need to manually perform repetitive tasks when using these software tools, makes it challenging to study large power systems with an adequate degree of accuracy. For this purpose, both Siemens PTI PSS E (version 2024) and DIgSILENT PowerFactory 2024 feature a Python Application Programming Interface (API) that enables the creation of custom scripts utilising the software as a computational engine, thereby helping to solve highly specific problems and to manage large datasets [24]. Therefore, the use of Python scripts capable of interacting with DIgSILENT PowerFactory efficiently enables the streamlining of processes related to power systems simulation and the optimisation of network management. These scripts provide the flexibility needed to automate repetitive tasks and customise simulations according to the specific needs of the problem that needs to be solved. Thus, the integration of Python 3.11 with DIgSILENT PowerFactory is a highly advantageous tool, allowing to conduct more precise analyses and hasten existing methodologies. In [25], it was demonstrated that the combined use of Python 3.11 and DIgSILENT PowerFactory 2024 can be utilized to determine the optimal location for a capacitor bank, a critical aspect of power system design which can be a tedious task if solved with common methodologies. Consequently, this paper is intended to highlight how the synergistic use of Python and DIgSILENT PowerFactory can facilitate the study of power network stability with a significant presence of renewable energy sources. Nevertheless, it should be noted that the results obtained in this paper can also be obtained with similar power system analysis software which provide a Python API; while the specific code will vary depending on the software used, the workflow that is described in the present paper can also be implemented in several other power system analysis software such as Siemens PTI PSS E 2024 or ETAP version 2024 (a particular case in which Siemens PTI PSS E (version 2024) and Python were used to perform frequency dynamic simulations can be found in [26]), hence the methodology that is used in this paper can be adapted based on the tools available to each researcher.

2. Materials and Methods

2.1. Implementation of Networks in DIgSILENT PowerFactory

The industrial network analysed in this paper was implemented in the DIgSILENT PowerFactory software because it is used by both Transmission System Operators (TSOs) and Distribution System Operators (DSOs), as well as researchers [27]. In fact, this software tool is one of the most widely used in this field, with its user base growing each year. DIgSILENT PowerFactory implements a wide range of tools to study power systems in both steady and dynamic state and, as mentioned, provides a Python API which grants the program an immeasurable versatility.
In this work, an industrial network was sized in accordance with the local DSO (I-DE) in which the industrial network is located (Albacete, Spain). The industrial network has a total installed power of 2.45 MW; however, in accordance with the local DSO, a simultaneity coefficient of 0.5 must be considered. Hence, the actual power that the network is expected to demand is around 1.16 MW. The industrial network comprises four secondary substations, which are supplied through a ringed medium-voltage network (20 kV). The low-voltage sides of the transformers supply power to the different loads within the industrial network. All the elements present in the network (transformers, lines...) were sized according to the requirements of the local DSO. Figure 3 shows a diagram of the medium-voltage network, together with the four secondary substations. The industrial network modelled in DIgSILENT PowerFactory is shown in Figure A1.
A wind farm that feeds its energy into the grid, supplying the industrial network, was also modelled. The wind farm is composed of five Gamesa G80 wind turbines, which are Type III generators (doubly fed induction generator) with a hub height of 78 metres. As the input data in our model is the wind speed at the hub height, the power curve of the wind turbines which relates the wind speed to generated power must be implemented. Each of the wind turbines present in the wind farm is connected to the grid through a transformer. These transformers have a nominal power of 2.5 MVA, with the high voltage side (the one that feeds into the grid) having a nominal voltage value of 20 kV and the low voltage side (to which the wind turbine is connected) a value of 0.69 kV. A diagram of the wind farm is provided in Figure 4, while the modelled wind farm in DIgSILENT PowerFactory is shown in Figure A2.

2.2. Wind Resource

Wind resource is a key parameter when evaluating the performance of a wind farm. In our model, the input variable is the wind speed at the hub height (in this case 78 m). Therefore, it is necessary to start with a series of wind data for our model to operate. In this work, wind speeds were obtained using a LiDAR (Light Detection and Ranging) device, more specifically a WindCube. This type of device operates by sending laser pulses and measuring the reflected light they receive, obtaining information on the variation in wavelength and time of arrival of these light reflections. This type of equipment is capable of obtaining extremely precise results, making it an ideal solution for characterising the wind resources in a specific area. It is also worth noting that such equipment can be programmed to autonomously carry out measurement campaigns, and so it is unnecessary for anyone to be present while these devices are operating [28]. The LiDAR was configured to take measurements at 40 m, 50 m, 62 m, 72 m, 85 m, 95 m, 110 m, 140 m, 160 m, and 200 m. This measurement campaign was conducted from 2 December to 17 February. Based on the availability of this equipment, a total of 11,094 data points should have been recorded (ten-minute measurements that began at 11:10 a.m.). However, only 11,032 data points were recorded due to various isolated equipment failures. Although measurements for different heights were performed, a model capable of predicting wind speeds for every possible height should be obtained, so that the wind speed at hub height (in this case 78 m) can be calculated. Wind speed at different heights is obtained by using Equation (1), which relates a specific velocity ( v 0 ) at a given height ( H 0 ) to another velocity (v) at a different height (H) by using a friction coefficient ( α ), which depends on the type of terrain [29].
v v 0 = H H 0 α
In order to use Equation (1) to determine the wind speed at the hub height, the value of the friction coefficient that best suits the location of the wind farm must be estimated. This coefficient can be calculated, as wind speed measurements for a wide range of heights were obtained. For each of our measurements, a mean friction coefficient is computed by using Equation (2) (which can be deduced from Equation (1)), and then, the average friction coefficient between measurements is computed. Nevertheless, it should be noted that in order to perform this calculation, the measurements corresponding to heights of 140 m, 160 m, and 200 m are discarded as 30% of the values registered were erroneous data. After the calculation, it was determined that a friction coefficient of 0.0892 described the wind profile of the location with great accuracy. Once the friction coefficient has been calculated, it is possible to calculate the exact wind speed at the hub height, which is the input data for the later simulations.
α = ln v v 0 ln H H 0

2.3. Python Scripting and DIgSILENT PowerFactory

DIgSILENT PowerFactory is an extremely versatile tool that can be used to study power systems in both transient and steady conditions. To execute DIgSILENT PowerFactory effectively, the system should meet the following requirements: an Intel/AMD x86 CPU (64 Bit) with a clock speed of 2 GHz, a minimum of 2 GB RAM for main memory, 5 GB of hard disk space, plus an additional 5 GB per user, and a SVGA graphics card capable of displaying a resolution of at least 1280 × 1024 pixels. Despite the program having multiple tools and capabilities, as networks and scenario analysis grow in complexity, it can be challenging to implement them in this software. Nevertheless, this complexity can be overcome by the use of the Python API provided by DIgSILENT PowerFactory. The main purpose of the API is to increase the automation of certain tasks which, if not implemented through the API, would result in highly tedious and prone to error tasks. This, combined with Python having a highly legible syntax and featuring a significant collection of modules aimed at data processing and visualisation, makes this API highly useful when working with large networks. DIgSILENT PowerFactory provides the user with a large set of functions, which, combined with other Python libraries, enable the use of this API for almost every application that the user might need. Hence, the only limit of this procedure is the ability of the user to implement their own scripts. In this paper, four additional Python packages are used as follows:
  • Numpy: This module is specifically designed to perform numerical computations. It enables the user to create arrays and matrices and provides multiple mathematical functions to operate with them.
  • Scipy: This package is a scientific computing library which implements a large set of commands intended for solving scientific tasks.
  • Pandas: This module was created to make it easier for the user to create and manipulate large sets of data in Python.
  • Matplotlib: This library is the most widely used module to visually represent data in Python. This module enables users to create complex and publication-quality visualisations in a straightforward procedure.
When working with Python and DIgSILENT PowerFactory, it is important to note that DIgSILENT PowerFactory is used in engine mode, and hence, DIgSILENT PowerFactory is only used for both defining the main elements of the network that we will work with and as the calculation tool used by Python to perform the task required. When this mode is executed, no graphical user interface is needed, thus making it possible to implement this tool in virtually any script. It is worth noting that Python is not installed when installing DIgSILENT PowerFactory, it should thus be downloaded after installing DIgSILENT PowerFactory (in this paper, Python 3.11 is used). A detailed explanation of the use of Python and DIgSILENT PowerFactory can be found in both [24] and the DIgSILENT PowerFactory documentation. The typical workflow that is followed when using Python and DIgSILENT PowerFactory can be summarised as follows:
  • Import PowerFactory module along with auxiliary packages in the Python environment;
  • Activate project and study case;
  • Define input and output variables;
  • Perform calculation in engine mode (e.g., simple powerflow);
  • Export output variables.
Figure 5 represents the integration methodology between Python and DIgSILENT PowerFactory. The API acts as an intermediary between Python and PowerFactory, enabling data and conditions defined in the scripts to be interpreted by PowerFactory. Additionally, the API is responsible for collecting the results obtained from simulations in PowerFactory and exporting them to the Python workspace, allowing for subsequent analysis and visualization.
An example script in which DIgSILENT PowerFactory API is used can be found in Figure A4. The blocks of code needed to perform a PowerFactory simulation are indicated, as well as the code required to obtain network elements information (in this example, the length of lines is stored in a dictionary) and the code required to print simulation results (in this example, bus voltages are printed).

3. Case Studies

In order to analyse the full potential of using Python and DIgSILENT PowerFactory combined, two different case studies are presented. In the first case study, stochastic methods are used to evaluate the behaviour of the industrial network fed by the wind farm, while in the second case study quasi-dynamic simulation is performed, highlighting how the use of Python can help researchers to deal with large amounts of data, implementing it in DIgSILENT PowerFactory for power systems stability analysis.

3.1. Stochastic Analysis

DIgSILENT PowerFactory incorporates a tool designed for stochastic analysis purposes, called the Generation Adequacy Analysis (GAA), which allows the user to determine the contribution of different generation sources (in our case, wind) to the total capacity of the electrical system being studied and to determine certain parameters of interest. Among these parameters of interest are the loss of load probability ( L O L P ) and the estimation of demand not supplied ( E D N S ). To carry out this type of analysis, it is vital that all generators present in our system have a stochastic model assigned that models the probability of these generators having to generate power at different operating points [30]. To conduct this analysis, DIgSILENT PowerFactory employs Monte Carlo simulations. In such simulations, a large number of random situations are generated, each corresponding to a defined state in the generation equipment and system loads. This process is repeated for a large number of iterations, yielding different results for each iteration; while executing these processes once required extremely powerful computers, there now exist methods to optimise the execution of such simulations, thereby rendering them much more suitable for resolving myriad problems [16].
This type of simulation has been widely used to study the behaviour of electrical systems in scenarios with wide variability in both generation and demand. These simulations are particularly suitable for studying the behaviour of power systems with a significant presence of renewable energies, as these energy sources can be easily characterised through stochastic models [17]. Hence, this tool is used by DIgSILENT PowerFactory to execute such analyses. As a simple example, we consider a system with 2 generators ( G 1 and G 2 ) that can operate at 3 operating points: 100%, 75%, and 50%, corresponding to power outputs of 100 MW, 75 MW, and 50 MW, respectively. Similarly, a load that can have demand values of 175 MW and 150 MW is considered. When conducting a Monte Carlo analysis using three iterations, the following results would be obtained:
As can be observed in Table 1, the demand not supplied ( D N S ) for each case was calculated using Formula (3); logically, the DNS parameter when the generation exceeds the load demand in our electrical system has a value of 0 (all loads can be supplied by the generators).
D N S = m a x 0 , D e m a n d G e n e r a t i o n
If the analysis continued by increasing the number of iterations (typically on the order of tens of thousands), both the loss of load probability ( L O L P ) and the estimation of demand not supplied ( E D N S ) could be calculated by applying Formulas (4) and (5), where N D N S is the number of iterations where the demand cannot be met by our system ( D N S > 0 ), and N is the total number of iterations.
L O L P = N D N S N
E D N S = D N S N
If LOLP is calculated, a value of 66.66% is obtained, while the EDNS factor has a value of 33.33 MW. Based on these results, we can see that the electrical system is unable to power the loads 66.66% of the time, with the average uncovered load being 33.33 MW.
In order to execute GAA, stochastic models have to be assigned to the generators present in the network, in which the generators are the wind turbines present in the wind farm previously discussed. As stated, the input variable for the model is the wind speed at the hub height (78 m), such that input must previously be calculated. Nevertheless, and thanks to Formula (1), the wind velocity can be easily calculated by using the friction coefficient that best suits our location; said coefficient was previously calculated, yielding a result of 0.0892. A Weibull distribution was used to model the distribution of wind speed at the hub height. Equation (6) represents the probability density function of a Weibull distribution, where c is the scale factor (m/s) and k is the shape factor.
f ( v ) = k c · v c k 1 e v c k
Figure 6 shows the Weibull distribution (represented in red) that fits the data (in blue). The Weibull distribution that fits the data has a shape factor (k) of 1.7315 and a scale factor (c) of 7.54 m/s. It is worth noting that the Weibull distribution was calculated using the Scipy package, and hence, both the data analysis stage and its implementation in DIgSILENT PowerFactory can be carried out in just one single Python script. The power curve corresponding to the Gamesa G80 wind turbine was also implemented in our model, using Python, which makes it easier to assign these data to all the wind turbines present in the network. Figure 7 shows the Weibull representation of wind speed (red) and the power curve of the Gamesa G80 wind turbine. Once the stochastic models are implemented for every wind turbine, the model is ready to be executed.

3.2. Quasi-Dynamic Analysis

The calculation of load flows (the basic operation performed by DIgSILENT PowerFactory) assumes that all elements of the network have fixed characteristics. That is, in this type of analysis, it is assumed that generators are generating a certain power, and loads are consuming a fixed power. However, when studying a power system, it must be acknowledged that not all loads demand the same power at each moment in time, and some generators exhibit significant variability in generation. Therefore, quasi-dynamic analyses are vital for studying the behaviour of a power system with the required level of detail to determine system stability. These analyses involve conducting a large number of load flow calculations considering the temporal characteristics of each element in our power system, hence the name quasi-dynamic, as we are actually performing a large number of load flows through a collection of states of our power system (i.e., it is a discrete analysis rather than continuous). Such analyses are extremely useful when our power grid includes at least one of the following elements or situations:
  • Time-dependent loads (be they daily variations, seasonal changes, etc.).
  • Renewable energy sources dependent on environmental factors (such as wind or solar radiation).
  • Regular variations in the topology or characteristics of the network (maintenance operations, faults, etc.).
A series of modifications to our industrial network are implemented to showcase the significant capabilities of this type of analysis. Firstly, we introduce some elements of distributed generation into our industrial network. These elements are represented as photovoltaic installations located on the roofs of some of the buildings within the industrial network. The photovoltaic installations are modelled taking into account that the modules used are of the type JKM405-72H-V. The installed capacity in each plot equipped with this type of system (seven plots in total) is assumed to be 40 kWp (with a unity power factor). It is crucial to note that as the dynamic behaviour of these systems is studied, it is necessary to configure the photovoltaic generation systems to behave according to the incident solar radiation at each moment in time. This can be achieved by selecting the “Solar Calculation” option within the properties menu of each of these elements. Additionally, it is necessary to define the tilt and orientation of the photovoltaic panels. In this case, the tilt has a value of 30° with a south orientation. Another important aspect when defining such systems in PowerFactory is their location. In this case, for each of our systems, we defined a latitude of 39° and a longitude of −1.85° (which are the coordinates of Albacete, the province where the industrial network is located). Based on the datasheet parameters of the PV modules used and the GPS coordinates of the photovoltaic systems, PowerFactory computes the power output of the modules taking into account the incident irradiance for each instant in time. It should be noted that as the quasi-dynamic simulation that has been performed has a step size of one hour, for each hour within our study range, PowerFactory will calculate the output power corresponding to the incident hourly irradiance on the photovoltaic modules. Additionally, we introduce an extra change to the industrial network model that was defined earlier by implementing electric vehicle (EV) charge stations. A total of 24 EV charge stations are implemented, 14 of which are expected to start to be used between 7:00 and 9:00 h, and 10 of them between 15:00 and 20:00 h.
As a quasi-dynamic analysis is performed to model the behaviour of the wind turbines, no stochastic model is used; time series data are used instead. Thanks to both the Pandas and Scipy packages, a database can be easily created that contains wind speed data (at hub height) and both the date and hour at which said measurements were registered. It is essential to emphasise that, in DIgSILENT PowerFactory, if a temporal characteristic must be defined for a complete year (or for several months, as is our case), hourly data rather than ten-minute intervals must be input (as our data is structured). Therefore, the first step is to transform our database from ten-minute data to hourly data. Initially, it may be inferred that restructuring our database is straightforward, as ten-minute data are available; simply taking the average of our data every six points would yield hourly data. However, as discussed, some measurements could not be registered due to technical issues. This means that if we were to follow the method of averaging our data every six points, there would come a point where our procedure would be incorrect. Hence, it was decided to use the resample command from the Pandas library, which allows us to group our data on an hourly basis. Subsequently, the data were interpolated to address days where measurements are missing, thereby obtaining a database containing hourly wind data for all hours of our measurement period. Once the wind speed time series was assigned to every wind turbine (again Python was used to do this automatically), the simulation is ready to start. The modified industrial network implemented in DIgSILENT PowerFactory is shown in Figure A3.

4. Results and Analysis

This work evaluates the behaviour of an industrial network fed by a nearby wind farm considering two study cases. The first uses a stochastic analysis, with the second executing a quasi-dynamic analysis.

4.1. Generation Adequacy Analysis

As Python is used to conduct this analysis, to initiate the generation adequacy analysis, the object ComGenrelinc must be called within the Python script, which is the initial process required to perform this type of analysis. Once this object is called, the reliability analysis is configured to achieve system losses of approximately 1%. Fixed demand and a full year of simulations are considered. Once this element is configured, it is executed and the object ComGenrel is subsequently called, which, when executed, will perform the necessary Monte Carlo simulations to conduct the reliability analysis (note that an attribute of this object is the number of iterations to perform; in this case, 100,000 iterations were used). Once the reliability analysis is executed with PowerFactory, the results obtained can be exported to files in ‘.csv’ format, which can subsequently be visualised.
Performing this kind of simulation involves taking an extremely important detail into account, which is that it should be defined whether or not the random generation of the power units present in our network is the same between each generator or if each generator can have different generation states in the same iteration. As wind speed was used as the input variable of the model (which is translated into generated power by the wind turbine power curve), it should be considered whether the wind speed at the hub height in all wind turbines is the same or not. If Monte Carlo simulations are carried out without defining any other parameter, DIgSILENT PowerFactory executes a GAA, considering that each wind turbine is working at a random operation point. If this analysis is carried out, the cumulative probability function that can be observed in Figure 8a is obtained. When representing the cumulative probability of generation, it can be observed that 80% of the time, a capacity greater than 1.6 MW is obtained, and 20% of the time, a capacity greater than 4.25 MW is obtained, etc. From this figure, the LOLP coefficient can also be obtained, as the loss of load is the point of intersection of the cumulative probability curve with the total demand curve (which, in this case, is a straight line since fixed demand was considered). It is also worth noting that, as stated, a simultaneity coefficient of 0.5 should be considered for the loads present in the industrial network. Nevertheless, when DIgSILENT PowerFactory executes a GAA, it considers all loads demanding their maximum capacity. In order to overcome this situation, the script implemented, prior to the execution of the GAA, reduces the capacity of each load by a factor of 0.5, and then, after the GAA is executed, resets the original capacity of each load. If this method were to be performed by hand, it would be a tedious task, but as Python is used, it can be carried out with ease by just simply adding a few lines of code to our script. The real demand and the maximum theoretical demand are both represented in Figure 8. If it is considered that every wind turbine is operating at a random power, the results shown in Figure 8a are obtained. The LOLP has a value of 13%, and the EDNS a value of 0.06 MW, which means that, 13% of the time, the wind farm is unable to produce energy to meet the demand of the industrial network, and the average value of capacity that cannot be covered has a value of 0.06 MW. Figure 8a shows that the probability of obtaining 10 MW of power is negligible. This can be readily explained by observing Figure 7, which depicts both the power curve of the wind turbines and the Weibull distribution of the wind speed. The probability of attaining wind speeds exceeding 15 m/s (which is the threshold for reaching the nominal power of the wind turbine) is relatively low. Considering five wind turbines are present in the wind farm, encountering situations where all of them reach nominal power simultaneously is highly improbable. This accounts for why, in Figure 8a, the probability of achieving a capacity of 10 MW hovers around 0%.
Upon making these observations about the obtained results, a salient finding emerges. DIgSILENT PowerFactory, when conducting Monte Carlo simulations, takes random values for each of the wind distributions at each of the wind turbines. This means that, for each iteration, it may consider the wind speed at the hub of Wind Turbine 1 to be 10 m/s, while at Wind Turbine 2, it could be 20 m/s. However, the operating points of the wind turbines (the wind speeds at hub height) located in the same wind farm could be expected to be the same for each moment in time. Therefore, it is necessary to make a series of modifications to the model to account for this situation. To instruct DIgSILENT PowerFactory to select the same value for each wind turbine in each iteration, we need to create an object called ’Meteorological Station’, which will help us achieve these objectives. If a meteorological station is assigned to every wind turbine present in the wind farm, the same operation point for each generator is taken into account on each iteration. With the meteorological station assigned to each of the wind turbines (again using Python), the simulations can be executed to obtain the new results. Upon rerunning the simulations, the results presented in Figure 8b are obtained, which are entirely different from those presented in Figure 8a. Since, we have considered in this case that all wind turbines are operating with the same wind speed in each iteration, the probability of having no production increases drastically (as evidenced in Figure 8b, where 20% of the time a capacity of 0 MW is obtained). However, similarly, the probability of obtaining capacities close to the nominal power of the wind farm (10 MW) increases significantly. In this case, the LOLP reaches a value of 45%, while the EDNS reaches a value of 0.43 MW. Hence, 45% of times the wind farm is unable to produce energy to meet the demand of the industrial network and the average value of capacity that cannot be covered has a value of 0.43 MW. Thus, this hypothesis is evidently much more unfavourable than the one previously presented.
As has been observed throughout this section, GAA is a powerful tool for determining the capability of an electrical system to meet the required demand. In this case study, the generators that meet the demand of the industrial network are the wind turbines in the wind farm under study. When these wind turbines cannot meet this demand, the external grid in the model supplies power to the industrial network. However, it is often not only of interest to conduct a statistical study of the electrical system but also to examine the system’s behaviour in the time domain. These types of studies are particularly useful when dealing with loads and/or generators whose demands/generations vary over time but for which stochastic models are unavailable. In such situations, another equally useful tool can be employed, namely quasi-dynamic analyses.

4.2. Quasi-Dynamic Analysis

As stated, in this case study, rather than a stochastic model, time series are used. Once the quasi-dynamic simulation is executed, the results can be analysed and represented. First and foremost, it is important to identify the system demand. As expected, the demand of the system consists of a constant component, corresponding to the fixed loads present in the industrial network (around 1.16 MW), and a variable component (corresponding to the demand of electric vehicles). The minimum system demand is 1.16 MW (corresponding to the constant load of the system) and the maximum demand is of around 1.29 MW (thanks to the contribution of electric cars). The distribution of demand is presented in Figure 9, where it can be seen that the values of the system demand are not uniformly distributed. It should be noted that the variable loads of the system (electric vehicles) are only connected during specific periods of time, and so most of the time, the system demand corresponds solely to the fixed demand portion of the system.
If the evolution of the variable load during a day is represented, the behaviour shown in Figure 10 is obtained. Clearly, the variable demand in the system increases owing to the early arrival hours of electric cars at the charging points. Given that the majority of users in our industrial network begin to arrive from 7:00 a.m. onwards, the peak of variable demand occurs during that hour (another peak of demand occurs from 20:00 p.m. onwards caused by users that are expected to arrive later).
In this regard, if we represent the operating points of the external grid to which both the industrial network and the wind farm are connected, the behaviour observed in Figure 11 is obtained. The external grid may exhibit two different behaviours: it can either provide energy to the system (feeding the loads of the industrial network when there is no wind generation), or it can absorb the excess energy that the wind farm may produce (negative power values indicate that energy is being injected into the grid, while positive power values indicate that the grid is supplying power to the industrial park). If Figure 11 is observed, it can be seen that the external grid will supply power to the industrial park (positive power values) 45% of the time. This result is almost identical to that obtained in Section 4.1, when it was considered that all wind turbines had the same operating point for each instant (Figure 8b). It should be noted that the power of the electric vehicle chargers pales in comparison to the fixed demand of the industrial network, hence the similarity in results.

5. Discussion and Conclusions

In this paper, real data obtained from a LiDAR were used to study the behaviour of a wind farm designed to supply power to an industrial network (previously designed according to current regulations, particularly in accordance with the regulations of the local distributor) and to feed surplus energy into the grid. Throughout this work, both the DIgSILENT PowerFactory software and the Python programming language were used. As presented in this work, the synergistic use of these two tools allow us to benefit from both the flexibility and ease of working with data provided by Python and the computational power of DIgSILENT PowerFactory, demonstrating that the combined use of both tools enables us to solve problems related to the integration of renewable energies into electrical networks. It was observed that the variability of renewable energy sources, such as wind, may initially pose a challenge when conducting simulations involving such generation. However, thanks to the use of the tools employed in this work, both temporal and stochastic models can be used to simulate the behaviour of such systems.
Our contribution demonstrates that GAA is a tool that, by utilising Monte Carlo simulations, proves to be ideal for studying electrical systems with a high penetration of renewable energy. They allow us to identify situations where the presence of an external grid is necessary to ensure electrical supply to all network consumers. Furthermore, thanks to the ease of handling time-domain data when implementing Python, the use of quasi-dynamic analyses in DIgSILENT PowerFactory is found to be a substantially powerful tool for studying electrical systems with a high penetration of renewable energies and time-dependent loads.

Author Contributions

Conceptualization and ideas: J.J.-R., A.H.-E. and E.G.-L.; Methodology: J.J.-R.; Validation, J.J.-R., A.H.-E. and E.G.-L.; Resources, A.H.-E.; Writing—original draft preparation: J.J.-R.; Visualization: J.J.-R.; Supervision: A.H.-E. and E.G.-L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was partially funded by the State Research Agency (Agencia Estatal de Investigación) through PROJECT PID2021-126082OB-C21, PRE2022-102783.

Institutional Review Board Statement

Not applicable because this study does not require ethical approval.

Informed Consent Statement

Not applicable because this study does not involve humans.

Data Availability Statement

All data and information are available upon request.

Acknowledgments

The authors are grateful to the State Research Agency (Agencia Estatal de Investigación) for partially funding this research. In addition, the authors would like to thank the editors and reviewers for their valuable comments and constructive suggestions.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
EUEuropean Union
APIApplication Programming Interface
TSOTransmission System Operator
DSODistribution System Operator
LiDARLight Detection and Ranging
GAAGeneration Adequacy Analysis
LOLPLoss of Load Probability
EDNSEstimation of Demand not Supplied
EVElectric Vehicle

Appendix A

Appendix A.1

Figure A1. Industrial network modelled in DIgSILENT PowerFactory.
Figure A1. Industrial network modelled in DIgSILENT PowerFactory.
Electronics 13 02134 g0a1
Figure A2. Wind farm modelled in DIgSILENT PowerFactory.
Figure A2. Wind farm modelled in DIgSILENT PowerFactory.
Electronics 13 02134 g0a2
Figure A3. Industrial network modelled in DIgSILENT PowerFactory (Quasi-Dynamic simulation).
Figure A3. Industrial network modelled in DIgSILENT PowerFactory (Quasi-Dynamic simulation).
Electronics 13 02134 g0a3

Appendix A.2

Figure A4. Python script executing a power flow simulation using PowerFactory API.
Figure A4. Python script executing a power flow simulation using PowerFactory API.
Electronics 13 02134 g0a4

Appendix B

Table A1. Lines data.
Table A1. Lines data.
NameRated Voltage (kV)Rated Current (kA)AC-Resistance ( Ω )AC-Reactance ( Ω )Nominal Frequency (Hz)
LV 3 × 240sm 0.6/1 kV10.3050.12660.06911550
MV 3 × 240rm 12/20 kV200.3450.12810.09738950
NA2XS(F)2Y 1 × 150RM 12/20 kV200.320.2110.12220850
Table A2. Transformers data.
Table A2. Transformers data.
NameRated Power (MVA)Nominal Frequency (Hz)Rated Voltage—HV Side (kV)Rated Voltage—LV Side (kV)ConfigurationShort-Circuit Voltage (%)Copper Losses (kW)
0.4 MVA 20/0.4 kV Dyn110.450200.4Dyn1164.8
Transformer Type 2.5 MVA 50 Hz2.550200.69Dyn5622
Table A3. Wind turbine data.
Table A3. Wind turbine data.
NameNominal Power (MW)Hub Height (m)Cut-In Speed (m/s)Cut-Out Speed (m/s)Rated Speed (m/s)Generator Type
Gamesa G802783.52512Type III (DFIG)
Table A4. PV modules data.
Table A4. PV modules data.
NameMaterialPeak Power (W)Rated Voltage (V)Rated Current (A)Open Circuit Voltage (V)Short Circuit Current (A)
JKM405-72H-VSingle crystalline silicon40540.4210.0249.410.69

References

  1. Raimi, D.; Campbell, E.; Newell, R.G.; Prest, B.; Villanueva, S.; Wingenroth, J. Global Energy Outlook 2022: Turning Points and Tension in the Energy Transition; Resources for the Future: Washington, DC, USA, 2022. [Google Scholar]
  2. Heuberger, C.F.; Bains, P.K.; Mac Dowell, N. The evolution of the power system: A spatio-temporal optimisation model to investigate the impact of electric vehicle deployment. Appl. Energy 2020, 257, 113715. [Google Scholar] [CrossRef]
  3. International Renewable Energy Agency (IRENA). Available online: https://www.irena.org/Energy-Transition/Technology/Wind-energy (accessed on 21 March 2024).
  4. Global Wind Energy Council Gobal Report. Available online: https://gwec.net/globalwindreport2023/ (accessed on 20 March 2024).
  5. Soares-Ramos, E.P.; de Oliveira-Assis, L.; Sarrias-Mena, R.; Fernández-Ramírez, L.M. Current status and future trends of offshore wind power in Europe. Energy 2020, 202, 117787. [Google Scholar] [CrossRef]
  6. Anuario Eólico (Asociación Empresarial Eólica). Available online: https://aeeolica.org/aee-anuario-2023/ (accessed on 20 March 2024).
  7. Gao, A.M.Z.; Huang, C.H.; Lin, J.C.; Su, W.N. Review of recent offshore wind power strategy in Taiwan: Onshore wind power comparison. Energy Strategy Rev. 2021, 38, 100747. [Google Scholar] [CrossRef]
  8. Gao, Y.; Ma, S.; Wang, T.; Gong, Y.; Peng, F.; Tsunekawa, A. Assessing the wind energy potential of China in considering its variability/intermittency. Energy Convers. Manag. 2020, 226, 113580. [Google Scholar] [CrossRef]
  9. Ren, B.; Jia, Y.; Li, Q.; Wang, D.; Tang, W.; Zhang, S. Robust Wind Power Ramp Control Strategy Considering Wind Power Uncertainty. Electronics 2024, 13, 211. [Google Scholar] [CrossRef]
  10. Garrido-Perez, J.M.; Ordóñez, C.; Barriopedro, D.; García-Herrera, R.; Paredes, D. Impact of weather regimes on wind power variability in western Europe. Appl. Energy 2020, 264, 114731. [Google Scholar] [CrossRef]
  11. Garip, S.; Özdemir, Ş.; Altın, N. Power System Reliability Assessment—A Review on Analysis and Evaluation Methods. J. Energy Syst. 2022, 6, 401–419. [Google Scholar] [CrossRef]
  12. Alimi, O.A.; Ouahada, K.; Abu-Mahfouz, A.M. A Review of Machine Learning Approaches to Power System Security and Stability. IEEE Access 2020, 8, 113512–113531. [Google Scholar] [CrossRef]
  13. Duchesne, L.; Karangelos, E.; Wehenkel, L. Recent Developments in Machine Learning for Energy Systems Reliability Management. Proc. IEEE 2020, 108, 1656–1676. [Google Scholar] [CrossRef]
  14. Pishgar-Komleh, S.H.; Keyhani, A.; Sefeedpari, P. Wind speed and power density analysis based on Weibull and Rayleigh distributions (a case study: Firouzkooh county of Iran). Renew. Sustain. Energy Rev. 2015, 42, 313–322. [Google Scholar] [CrossRef]
  15. Singh, V.; Moger, T.; Jena, D. Uncertainty handling techniques in power systems: A critical review. Electr. Power Syst. Res. 2022, 203, 107633. [Google Scholar] [CrossRef]
  16. Krupenev, D.; Boyarkin, D.; Iakubovskii, D. Improvement in the computational efficiency of a technique for assessing the reliability of electric power systems based on the Monte Carlo method. Reliab. Eng. Syst. Saf. 2020, 204, 107171. [Google Scholar] [CrossRef]
  17. Hasan, K.N.; Preece, R.; Milanović, J.V. Existing approaches and trends in uncertainty modelling and probabilistic stability analysis of power systems with renewable generation. Renew. Sustain. Energy Rev. 2019, 101, 168–180. [Google Scholar] [CrossRef]
  18. Barelli, L.; Ciupageanu, D.A.; Ottaviano, A.; Pelosi, D.; Lazaroiu, G. Stochastic power management strategy for hybrid energy storage systems to enhance large scale wind energy integration. J. Energy Storage 2020, 31, 101650. [Google Scholar] [CrossRef]
  19. Honrubia-Escribano, A.; Villena-Ruiz, R.; Artigao, E.; Gómez-Lázaro, E.; Morales, A. Advanced teaching method for learning power system operation based on load flow simulations. Comput. Appl. Eng. Educ. 2021, 29, 1743–1756. [Google Scholar] [CrossRef]
  20. Sun, L.; You, F. Machine learning and data-driven techniques for the control of smart power generation systems: An uncertainty handling perspective. Engineering 2021, 7, 1239–1247. [Google Scholar] [CrossRef]
  21. Habibi, M.R.; Golestan, S.; Guerrero, J.M.; Vasquez, J.C. Deep Learning for Forecasting-Based Applications in Cyber–Physical Microgrids: Recent Advances and Future Directions. Electronics 2023, 12, 1685. [Google Scholar] [CrossRef]
  22. Mossa, M.A.; El Ouanjli, N.; Gam, O.; Do, T.D. Enhancing the Performance of a Renewable Energy System Using a Novel Predictive Control Method. Electronics 2023, 12, 3408. [Google Scholar] [CrossRef]
  23. Lund, T.; Eek, J.; Uski, S.; Perdana, A. Dynamic fault simulation of wind turbines using commercial simulation tools. In Proceedings of the 5th International Workshop on Large-Scale Integration of Wind Power and Transmission Networks for Offshore Wind Farms, Glasgow, UK, 7–8 April 2005; pp. 238–246. [Google Scholar]
  24. López, C.D.; Rueda Torres, J.L. Python scripting for DIgSILENT PowerFactory: Leveraging the Python API for scenario manipulation and analysis of large datasets. In Advanced Smart Grid Functionalities Based on PowerFactory; Springer: Cham, Switzerland, 2018; pp. 19–48. [Google Scholar]
  25. Jimenez-Ruiz, J.; Honrubia-Escribano, A.; Gómez-Lázaro, E. Use of Python Programming Language for Solving Practical Problems Related to Electrical Engineering. In Proceedings of the 18th International Technology, Education and Development Conference, Valencia, Spain, 4–6 March 2024; pp. 562–569. [Google Scholar]
  26. Xie, Y.; Hou, Y.; Zhang, D.; Wen, T.; Jiang, X. Power System Frequency Dynamic Simulation Analysis and Tool Development of PSS/E. In Proceedings of the IEEE 2nd International Conference on Information Technology, Big Data and Artificial Intelligence (ICIBA), Chongqing, China, 17–19 December 2021; pp. 667–672. [Google Scholar]
  27. Cañas-Carretón, M.; Honrubia-Escribano, A. Coordinated teaching of power system simulation in a university multicampus structure. In Proceedings of the 17th International Technology, Education and Development Conference, Valencia, Spain, 6–8 March 2023; pp. 7389–7397. [Google Scholar]
  28. Mehendale, N.; Neoge, S. Review on Lidar Technology. SSRN 2020. [Google Scholar] [CrossRef]
  29. Albornoz, C.P.; Soberanis, M.E.; Rivera, V.R.; Rivero, M. Review of atmospheric stability estimations for wind power applications. Renew. Sustain. Energy Rev. 2022, 163, 112505. [Google Scholar] [CrossRef]
  30. Castro, P.F.; Rodriguez, Y.P.M.; Carvalho, F.B. Application of Generation Adequacy Analysis for Reliability Evaluation of a Floating Production Storage and Offloading Platform Power System. Energies 2022, 15, 5336. [Google Scholar] [CrossRef]
Figure 1. Evolution of installed wind power capacity worldwide [3].
Figure 1. Evolution of installed wind power capacity worldwide [3].
Electronics 13 02134 g001
Figure 2. Offshore wind capacity distribution [4].
Figure 2. Offshore wind capacity distribution [4].
Electronics 13 02134 g002
Figure 3. Medium-voltage network diagram.
Figure 3. Medium-voltage network diagram.
Electronics 13 02134 g003
Figure 4. Wind farm diagram.
Figure 4. Wind farm diagram.
Electronics 13 02134 g004
Figure 5. Interface scheme between Python and PowerFactory [24].
Figure 5. Interface scheme between Python and PowerFactory [24].
Electronics 13 02134 g005
Figure 6. Weibull distribution fitted to data.
Figure 6. Weibull distribution fitted to data.
Electronics 13 02134 g006
Figure 7. Representation of power curve of Gamesa G80 (in blue) and Weibull distribution (in red).
Figure 7. Representation of power curve of Gamesa G80 (in blue) and Weibull distribution (in red).
Electronics 13 02134 g007
Figure 8. GAA results.
Figure 8. GAA results.
Electronics 13 02134 g008
Figure 9. Histogram of the system demand.
Figure 9. Histogram of the system demand.
Electronics 13 02134 g009
Figure 10. Variable demand of the system.
Figure 10. Variable demand of the system.
Electronics 13 02134 g010
Figure 11. Contribution of external grid.
Figure 11. Contribution of external grid.
Electronics 13 02134 g011
Table 1. Example of Monte Carlo Analysis (data in MW).
Table 1. Example of Monte Carlo Analysis (data in MW).
Iteration G 1 G 2 G Load DNS DNS > 0
11001002001750
2505010017575
3755012515025
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Jiménez-Ruiz, J.; Honrubia-Escribano, A.; Gómez-Lázaro, E. Combined Use of Python and DIgSILENT PowerFactory to Analyse Power Systems with Large Amounts of Variable Renewable Generation. Electronics 2024, 13, 2134. https://doi.org/10.3390/electronics13112134

AMA Style

Jiménez-Ruiz J, Honrubia-Escribano A, Gómez-Lázaro E. Combined Use of Python and DIgSILENT PowerFactory to Analyse Power Systems with Large Amounts of Variable Renewable Generation. Electronics. 2024; 13(11):2134. https://doi.org/10.3390/electronics13112134

Chicago/Turabian Style

Jiménez-Ruiz, Javier, Andrés Honrubia-Escribano, and Emilio Gómez-Lázaro. 2024. "Combined Use of Python and DIgSILENT PowerFactory to Analyse Power Systems with Large Amounts of Variable Renewable Generation" Electronics 13, no. 11: 2134. https://doi.org/10.3390/electronics13112134

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop