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.
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 (
) and the estimation of demand not supplied (
). 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 (
and
) 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 (
) 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).
If the analysis continued by increasing the number of iterations (typically on the order of tens of thousands), both the loss of load probability (
) and the estimation of demand not supplied (
) could be calculated by applying Formulas (
4) and (
5), where
is the number of iterations where the demand cannot be met by our system (
), and
N is the total number of iterations.
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.
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.
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.