Traction power substation balance and losses estimation in AC railways using a power transfer device through Monte Carlo analysis

The high dynamic power requirements present in modern railway transportation systems raise research challenges for an optimal operation of railway electrification. This paper presents a Monte Carlo analysis on the application of a power transfer device installed in the neutral zone and exchanging active power between two sections. The main analyzed parameters are the active power balance in the two neighbor traction power substations and the system power losses. A simulation framework is presented to comprise the desired analysis and a universe of randomly distributed scenarios are tested to evaluate the effectiveness of the power transfer device system. The results show that the density of trains and the relative branch length of a traction power substation should be considered in the evaluation phase of the best place to install a power transfer device, towards the reduction of the operational power losses, while maintaining the two substations balanced in terms of active power.


Introduction
Electrified railways have constantly raised interest since they are considered one of the most energy-efficient modes of transportation. It is known from the report of [1] that the railway sector is efficient when compared to other means of transportation: the railway sector has a 9% market share in the transportation of passengers and goods in the European Union and this is achieved with a final energy consumption of 2%, in comparison with other sectors. The considerable power requirements of the railway transportation system lead the railway operators to pursue actions to increase the energy efficiency, reduce the energy consumption bill and increase the infrastructure capacity, [2,3].
This work is framed within the IN2STEMPO 1 project objectives-Innovative Solutions in Future Stations, Energy Metering and Power Supply-specifically in the smart power supply activities. Inserted in the Shift2Rail European program [4], the smart power supply activities seek to contribute to the development of a railway power grid in a fully interconnected and communicating system, [5]. In the smart power supply target of IN2STEMPO, one goal is to study Flexible AC Transmission Systems (FACTS) to exploit the full potential of the 25 kV, 50 Hz rail power supply system. Specifically, one of the FACTS under study is the Railway Interline Power Flow Converter (RIPFC) [6]. The RIPFC comprehends a power transfer device (PTD) in the neutral zone (NZ), providing doubleside feeding to the catenary branch and respective trains, and reactive power on both sides to stabilize the catenary voltage.
The objective of this paper is to statistically evaluate the effects of the inclusion of a PTD in the neutral zone of an electrified railway line. Mainly, the active power balancing in the two traction power substations (TPS) and the system power losses are under consideration in this study.
The first contribution of this paper is a simulation framework to statistically evaluate the proposed PTD compensation strategy (where the framework is capable to be extended to additional statistical analysis). Then, the second contribution is the evaluation of two scenarios, with different PTD characteristics, when they are considered design constraints (namely, the catenary branch length and the sparsity/density of trains in the TPS).
This paper is divided into seven sections. Sect. 2 addresses a scientific literature review on the topologies for power transfer devices and on the control strategies. Section 3 presents the architecture for the simulation model necessary to implement the required analysis. Then, Sect. 4 covers reduced scenario simulations to illustrate the advantages of this strategy, in terms of active power balancing and system power losses. Section 5 covers the universe of parameters randomly analyzed with the Monte Carlo analysis methodology. Section 6 presents the results and the discussion on the. Finally, the conclusions are presented in Sect. 7.

Literature review
Electrified railways, DC or AC, must deal with several power quality issues, either in the railway subsystem itself and in the transmission/distribution system operator (TSO/DSO) supply [7][8][9][10]. In the past, some passive solutions helped to alleviate these issues but their performance was dependent on different operation parameters and has poor dynamics. Then, the use of power electronics based converters for power quality increasing in railway systems has entered into the domain and is continuously increasing [11][12][13]. Their purpose is quite large and addresses different power quality issues in railway systems: transformer losses, catenary voltage stability, substation active power balancing, peak shaving, three-phase current balancing, reactive power compensation [13][14][15]. It should be mentioned that the static frequency converter (SFC) system is a kind of ''one fits all'' regarding all the referred power quality issues but this system is a stand-alone solution, interesting for new lines, [12,[16][17][18]. Since the large majority of railway systems is based on some type of transformer topology, the SFC system will not be further considered in this paper.
Modern railway line voltage stabilization is made using a static VAR compensator (SVC), located near the neutral zone [19,20] , or using mobile reactive power compensation strategies [3,21,22]. The railway power conditioner system (RPC) is employed in conjunction with V/V transformers and offers very good performance regarding 3-phase power balancing and power factor correction [10,23,24]. Similarly, the co-phase system [25][26][27][28] , has similar characteristics in terms of an optimized 3-phase interface. Maintaining the objective of guaranteeing a high level of power quality at the 3-phase supply, additional solutions are employed, e.g. the STATCOM [29][30][31].
In recent years, a strong effort is being made to introduce renewables and storage in railway systems. This tendency intends the satisfaction of several main objectives: i) alleviate the substations load and then avoid peak loads (peak shaving) and, at the same time, reduce the system losses [32][33][34]; ii) turn the railway system an even more environmental friendly [35]; and iii) provide the means for regenerative energy storage [36,37].
There are many factors such as weather conditions, driving style, schedule, and stop time in the stations which alter the actual characteristics of train circulation concerning pre-defined ideal conditions. All of these factors have some randomness degree [38].
The position in the sector, speed and acceleration of the train define both the consumed power and the voltage drop in the line and respective losses and the power factor in the substation. Therefore, it is not possible to carry out a fully deterministic analysis of the various operating parameters of the railway subsystem [39,40].
Thus, several aspects of the power flow analysis regarding both the railway substations and the catenary are better characterized from a probabilistic analysis [41][42][43]. Analyses of feeder current profile, [44,45], harmonic propagation in DC [46] or AC railways [47], and the voltage profile in the catenary [39,48], have been performed using probabilistic methods. The analysis of data from both real exploration and dedicated simulators allows defining the probability density functions associated with factors that contain a probabilistic character such as the number of trains in a section, the position, the consumed power, or the power in the substation [41,49].
The PTD is an additional element in the railway system and the analyses of its effects, both on the balance of active power in substations and on the redistribution of power losses in the system, are the main objectives of this article. As, the railway system becomes more complex, data clustering and probabilistic analysis are used, in particular, the Monte Carlo method. The following section addresses the subsystem models, with particular focus on the developed simulation framework.

Subsystem models
Let us consider a generic 1Â25 kV, 50 Hz double-track railway line as illustrated in Fig. 1 including a PTD in the ND. In this configuration, and commonly, each traction substation is electrically isolated from an adjacent one where this electric separation is made in the ND.
This paper considers the inclusion of a power converter (a PTD) in the ND, having a back-to-back configuration, as illustrated in Fig. 2, being capable of independently control the reactive power injected in each side of the two sections (Q 1 and Q 2 ) and transfer active power between the two sides (P ptd ). To limit the size of the problem, the work in this paper is only focused on the management of active power where the power factor of the PTD is unitary.
The specific converter structure can be based on different approaches but the most common is a multilevel one, built with cascaded H-bridges, neutral-point clamped, or modular multilevel converters. The transformers are designed according to the power level to be transferred between sections, the reactive power injected in the ND, and the voltage and current levels in the converters. Also, a parameter of high relevance in the system design either in the transformer and in the converters is the efficiency level. This parameter ensures that the power losses value is kept at a minimum and thus does not compromise the overall losses when using the PTD, particularly in the active power transfer mode.

Architecture of the simulation framework
The simulation model of a railway power system is a particular power flow analysis, where the electric model is dynamic. Specifically, the electric model depends on the number of trains and the position of each one (absolute/ relative position). Then, the power flow analysis of a railway power system is a snapshot simulation, where each simulated scenario has a specific matrix for the branches and the buses of the power system. This work requires the development of a simulation framework, available as open-source in the repository 2 . The simulation framework purpose is to dynamically generate the branches and bus matrices of the power system based on the definition of the physical conditions. Then, this framework has two functional highlights: for each scenario, the physical characteristics can be established (either fixed or randomly defined), with the automatic power system modeling, and the scenario can be automatically evaluated (using a power flow solver).
The implementation approach depends on the usage of an object-oriented language, where each simulation scenario follows a class of objects capable to implement the functional highlights.
The desired functionality was modeled in a MATLAB simulation framework where the power flow analysis is made using the MatPower tool. The simulation framework has the following functional requirements: 1. Must be capable of simulating all trains of two or four branches of each traction substation (respectively for single and double track lines). 2. Must be implemented in an object-oriented approach, enabling the analysis of an array of simulation scenarios targeting multi-core parallelization. Each simulation scenario is one object, having intrinsic properties and methods. 3. Each simulation scenario (or object) must consider: • All traction substations -TPS½1; 2; . . .; T -in adjacent pairs; • All branches of each TPS -br [1,2] or br [1,2,3,4];  4. The essential methods of the class must be: • Dynamic setup of all TPS branches; • Dynamic addition of N trains to a branch (placed in specific positions, with specific apparent power consumption); • Dynamic setup of power transfer devices; • Power flow analysis and automatic output generation; • Automatic graphical generation of the electric diagram.
Let us consider a simple scenario having two traction substations, each one feeding a single-track 1Â25 kV railway line, where both TPS are interconnected through a power transfer device, and the respective two branches (20 km and 15 km, respectively) have three trains each in different positions and with different apparent power. This scenario can be simulated in the proposed simulation framework. Then, the automatic graphical generation output is illustrated in Fig. 3.
The output visible in Fig. 3 can be automatically generated by the simulation framework.
Since there are no trains in the left branch of the TPS1, the branch impedance (br [2]: 2-3) corresponds to the impedance of a 20 km catenary line. The traction power transformer of TPS1 is represented by branch br [1]: 1-2. The automatic electric model generator ensures that the sum of the impedances of the right branch is equal to the total impedance of a 20 km catenary line (br [7] ? br [8] ? br [9] ? br [3] = br [2]).
Regarding the PTD, the adopted model comprises two series branches with a middle bus representing the constant losses. The first branch (br [13]: 4-100) represents the series impedance of the PTD step-down transformer; the subsequent branch (br [14]: 100-101) is associated to the inverter conduction losses. The constant power losses in bus 100 represent the transformer constant power losses (no-load losses) together with the inverter constant power losses.
The simulation framework follows the UML diagram of    power flow solver). Also, each electric_model object has several methods, which are the functions of the class, with examples like: i) electric_model::generate_random_trains() to start a new scenario with random train positions and respective power consumptions; ii) electric_model::run_powerflow() to perform the power flow analysis of the scenario; or iii) electric_model:: attach_power_transfer_device() to include a PTD to the scenario for optimization of the TPS power consumption. Additional methods were also developed to load and save the simulation state, or to plot the resulting electric diagram of the scenario.
A new scenario is evaluated with the sequential launch of the methods of electric_model, as illustrated in Fig. 5. The initial step is to configure the electric parameters and the two TPS under study. Then, the trains are generated (number of trains, active power, and power factor of each one) for both TPS and the power flow is calculated. Finally, the PTD is attached to the simulation framework with a specific optimization strategy, the power flow is launched again and the final results are extracted. This procedure is then evaluated as a scenario of two TPS without and with the PTD in the ND.
In the example of the application of the flowchart of Fig. 5, the main objective is to balance the active power in each TPS, with the compensation power in the power transfer device being defined by the method electric_model::tps_power_optimization(), where half of the power is transferred in the NZ. In this flowchart, the first part (in green) is to prepare the object for the power flow analysis: first is defined the electric parameters (TPS traction transformer impedance, catenary impedance, among others),  and then is created a new physical simulation scenario (where the number of trains can be random or fixed, as well as the respective apparent power and position in the branches, among other properties). The second part (in coral and blue) targets the specific simulation presented in this paper: the evaluation of the installation of the PTD in the NZ, in terms of power losses, where is obtained the knowledge of the system state before and after the installation.

CLASS: plot_electric
To evaluate a universe of simulation scenarios, a second handler class was developed, which follows the UML of Fig. 6.
The purpose of this handler class is to hold the array of electric_model_objects and to extract the results on the performed analysis. The main method of this class is the eval_compensation(type,max_iter), where all the new simulation scenarios are created, the random and fixed parameters of each scenario are generated and the power flow analysis is performed, following the flowchart of This section was detailed with the implementation steps of the simulation framework capable to evaluate the inclusion of the PTD for a universe of simulation scenarios. The Appendix section is also presented two details of the graphical user interface, in Figs. 26 and 27, where the scenario random generation and the electric parameters menus are presented, respectively.

Reduced scenario simulation
Before entering a large-scale simulation analysis, it is useful to analyze and validate some simple scenarios, in which the quantitative and qualitative analysis should validate a priori known conclusions.
This section evaluates two sets of simulation scenarios, starting with scenarios comprising two TPS and one train, and then scenarios having two TPS and two trains (each one supplied by a different TPS), using the simulation framework presented in the previous section. Fig. 7 illustrates a simple simulation of one train and two TPS connected by a PTD.
Let us consider the following reduced scenario analysis, consisting of N scenario simulations, as in (1), where the power consumption and position of this train are randomly distributed following specific probability distribution functions (PDF). P train ½1; 2; :::; N 2 ½08 in MW D train ½1; 2; ::: For all N scenarios, the train power factor is fixed  Considering that the PTD operates to perfectly balance the traction power between the two TPS, then the formulation of the system power losses can be illustrated in Fig. 8.
Assuming jV s1 j ¼ jV s2 j, Z tps1 ¼ Z tps2 and near-equal power factors, with a perfect power balance obtained with the PTD, the train current is divided in half, and with the same catenary length of the two branches, this results in the invariant power losses of Fig. 9 when it concerns to the a value.
This constant power losses, P z l þz r , are the sum of the catenary, TPS and PTD losses, where half of the train current is associated to the Z tps þ aZ cat impedances, and the other half of current passes through the Z tps þ Z cat þ 2Z ptd þ ð1 À aÞZ cat impedances.
Then, if the train is only supplied by the TPS1 with a current I s1 , the power losses can be estimated: On the other side, if the PTD forces the division of the currents in the two TPS, where I s1 ¼ I s2 ¼ I =2, and considering unitary power factors in TPS1 and TPS2, then: Electric model The intersection point, where P left loss ¼ P left loss;ptd þ P right loss;ptd , can be obtained as following: Then, for the considered assumptions, this results in a 0 % 0:6. This value means that the adoption of a PTD with the objective of power balancing leads to a minimization of the system power losses if the train is located between a 0 and the NZ. The closer the train is to the NZ, the higher the advantages in terms of the system losses, as expected. Fig. 10 presents the evaluation of the difference of the system power losses for the N scenarios of (1). Each point of the graph corresponds to a simulated scenario (without and with the PTD), and the lines represent the equipotential values where the power losses difference (''after-before'' the PTD) is the same. Thus, negative values mean that the PTD action reduced the power losses in the system.
In the simulation results of Fig. 10, it is visible that the actual a 0 value is close to the theoretic value of a 0 % 0:6, from expression in (5). This result is obtained with the balancing in the two TPS visible in Fig. 11.
The previous reduced scenario analysis is useful to evaluate the advantages expected from the inclusion of the PTD. First, it should be highlighted that the major compensation strategy is in the balancing of the two TPS. The example presented can reduce an unbalance from 8 MW to a maximum of 0.45 MW (with the majority of the unbalance values closer to 0 MW, thus a perfectly balanced system in terms of power consumption).  (1).
The results after the inclusion of the PTD show final power unbalance between the two TPS (±0.45 MW, corresponding to 5.5 % of the maximum transferred power), which are caused by the compensation strategy of the PTD. Essentially, the simulation framework performs an initial power flow analysis for both TPS without the influence of the PTD. Based on the difference of power in the two TPS, this difference is used as a setpoint for the power transfer device and the simulation framework is subject to a final power flow analysis. Only with an iterative process is possible to reduce the final unbalance, which, in terms of implementation, means the need for a feedback loop if a perfect balance is required.
A preliminary analysis of the system power losses before and after the inclusion of the PTD might not justify the adoption of the power converter. Only in a hypothetical scenario where the majority of trains are located near the NZ (where a [ a 0 ) is justified the adoption of PTD. For obvious reasons, the train position follows a uniform PDF  across the entire railway line. Then, as illustrated by Fig. 10, the majority of the scenarios increase in the system power losses, when comparing the power losses before and after the inclusion of the PTD. When considering the PTD constant power losses, the results of Fig. 10 are affected by an offset. For example, if these power losses are higher than 0.15 MW, all of the simulation scenarios increase the system power losses.
This section leads to addressing the two metrics of analysis when is considered the inclusion of the PTD: the system power losses and the minimization of unbalance in the TPS power. For the following sections, any discussion on results must consider an analysis on both metrics. As an example, even if every scenario of analysis increases the system power losses, the advantages of adopting a PTD lie in balancing both TPS.

Monte Carlo analysis
This section presents the details of the simulation scenarios, specifically on the input parameters. Considering the diagram of Fig. 1, a simplified analysis of the adoption of a PTD (to improve the railway infrastructure) can consider two catenary branches of two subsequent TPS.
The universe of simulation scenarios must cover several parameters variation, such as: The surface of this universe of simulation scenarios is, at least, S 2 NR 5 .
To reduce the universe of simulation scenarios, some assumptions must be made based on the Monte Carlo statistical analysis. Being the Monte Carlo term associated with the process of modeling and simulating a system that is affected by randomness [50], this analysis requires that each of the parameters follows an appropriate probability distribution functions (PDF).
With the generation of several random scenarios (where the parameters follow PDF functions), and the collection of relevant statistics, thus it can be assessed the performance of a decision policy or the value of an asset [50], or in this work, the decision of the installation of a PTD. The usage of a specific railway line and a dataset of measurements enable the fitting of the PDF for each of the parameters, as shown in the following statistical analysis.

Statistical analysis
In the following, it is considered the relevant characteristics of a 250 km railway line with seven substations. The first aspect analyzed in this work is on the catenary branch   Fig. 13. The branch distance of Fig. 13 does not follow a specific PDF: it could be highlighted that the catenary branch distance is uniformly distributed between 6 km and 30 km.
Despite the uniform distribution of the length of the catenary branch, it would be interesting the analysis of clustered lengths. It could be argued that long lines can have much more branches and, then, a normal PDF function would be appropriate. Then, in this work, two clusters of line lengths can be defined, where l is the average and r is the standard deviation, following: • Short catenary branch lengths, following a normal PDF with N ðl ¼ 15; r ¼ 2:5Þ; • Long catenary branch lengths, following a normal PDF with N ðl ¼ 21; r ¼ 2:5Þ.
Statistical analysis for the respective clusters is presented in the histogram graphs of Fig. 14. Furthermore, this work considers two types of TPS, each of them having a randomly defined number of trains, and a randomly defined power consumption profile.
The first assumption is to define clusters of types of TPS. The rationale behind this assumption is the following: the number of trains throughout the day will define the power consumption requirements of this TPS. For example, a TPS covering a dense metropolitan area will be more likely to have more trains and higher power consumption than a TPS covering a sparse rural area. The two clusters are presented in the blue bars of Fig. 16. Based on the available data, the number of trains for both types of TPS follows a Poisson PDF, defined as: • Dense area, with Poisðk ¼ 1:4Þ; • Sparse area, with Poisðk ¼ 0:3Þ; where the Poisson PDF is given by (6) and k is equal to the expected value of k.
Then, this can be better illustrated in the fitting bar graph of Fig. 16.
Regarding the TPS power consumption, a similar analysis can also be made in Fig. 17.
Considering the two clusters of TPS (dense and sparse areas), the power consumption is also directly related to this cluster, as visible in Fig. 17.
Based on the available data, the clustered TPS power consumption can be approximated to a log-normal PDF, as follows: • Dense area, with Lognormalðl ¼ lnð5e6Þ; r ¼ 0:75Þ; • Sparse area, with Lognormalðl ¼ lnð1e6Þ; r ¼ 1:00Þ; where the log-normal PDF is given by The histogram of the clustered TPS power consumption and respective fitting is visible in Fig. 18. As stated, the data of power consumption presented in Fig. 18 were fitted to the proposed log-normal PDF. However, this approximation should be taken with caution, since the performed statistical hypothesis tests from [51] do not prove that the data fits the distribution with a high degree of confidence.
Regarding the train power consumption, from the available data is visible that this parameter does not follow any PDF. Even if the authors in [41] shows a possible fitting of multiple normal PDF, the histogram results of Fig. 19 lack the fitting for specific distribution functions. Then, this work assumes a uniform PDF for the train power to comprise the diversity of types of trains present in the dataset of more than 300 train journeys.
Regarding the train power factor, from the analysis of all available data, is visible a possible dependence of the train power factor as a function of the train power, as illustrated in Fig. 20.
For lower train power consumption values, the train power factor varies from 0.4 to 1. However, and as expected, for higher train power consumption values, the train power factor is closer to unitary.
Then, a bivariate PDF is fitted, where the power factor follows a normal distribution function and the l and r values depend on the train power consumption. Specifically, as illustrated in Fig. 21, it was approximated these values to sigmoid functions.   The resultant bivariate surface after applying the l and r curve values is presented in Fig. 22.

Scenario generation algorithm
The previous analysis is essential to define an automatic scenario generation that covers the universe of possible scenarios of a railway electrification line. Fig. 23 proposes an algorithm to generate a new scenario.
The first step is to generate a random length cluster, following a Bernoulli PDF for each TPS branch, resulting in four equally distributed scenarios: • TPS1 2 fshort; longg; • TPS2 2 fshort; longg.
Then, the length of the branch follows a normal PDF, as stated in the l and r values that led to Fig. 14. Furthermore, the third step is to generate a random type of TPS, or TPS cluster, following a Bernoulli PDF as well, resulting in four equally distributed scenarios: From the definition of the TPS cluster, the number of trains is generated in step four, based on the Poisson PDF that led to the results presented in Fig. 16.
The fifth step is the generation of the TPS total power consumption, which depends on the TPS cluster. Both sparse and dense TPS power consumptions follow a lognormal PDF, where the l and r parameters are the ones that led to Fig. 18.
Then, this TPS power consumption is associated with the number of trains on the branch, where the power of each train is generated using a uniform PDF between a minimum and a maximum, and a final gain is applied to all  Fig. 19 Histogram graph of all train apparent power consumption. In this histogram, the frequency is in a logarithmic scale Traction power substation balance and losses estimation in AC railways using a power transfer 85 train power consumptions to ensure that the sum of all individual powers is equal to the TPS power consumption selected in step five. Using a normal PDF for each train, step seven generates a random power factor using the estimated train power consumption and following the l and r parameters that led to the results in Figs. 21 and 22. Finally, for each TPS branch, based on the number of trains and the TPS branch length, the position of each train is estimated using a uniform PDF (a minimum distance between trains is ensured in this phase).

Monte Carlo metrics
In previous subsections, all the possible parameters that affect the analysis of the inclusion of a PTD in a railway line were extensively analyzed. As stated in the previous reduced scenario section, the scenarios where the advantages (in terms of system losses) justify the adoption of a PTD are when the train is near the NZ. However, the train position follows uniform PDF. The type of conclusions to be made should be: ''With the adoption of a PTD, during more than 60% of the operation time-frame, the inclusion of the PTD leads to an increase of system power losses'', and not ''Only if all trains are closer to NZ during the operation timewindow, is justified the adoption of the PTD''.
The Monte Carlo analysis must consider the analysis of the two parameters-the TPS length cluster and the TPS density cluster-that are fixed for a specific railway line. This analysis allows the identification of the relevant characteristics of a railway line where the study of the system power losses is essential to support this identification. The Monte Carlo analysis performed in this work will be focused on listing the combination of characteristics of a railway line (short or long TPS branches and dense or sparse TPS clusters) that contribute to a higher number of advantageous scenarios.
Regarding the number of scenarios necessary to be evaluated, let us consider a repetitive simulation of 1000 randomly generated scenarios, throughout 1000 iterations (thus a total of one million scenarios), as illustrated in Fig. 24. This figure presents the result metric for the mean value of the power loss difference (losses after minus losses before the installation of PTD).
The mean value converges to a power loss difference of 11.62 kW after the inclusion of a PTD. It is visible in the results of Fig. 24 that if only 1000 scenarios are considered for analysis, the average can vary from 7.33 kW to 16.97 kW, which might be unacceptable, (±41.5 % maximum error, when compared to the 1 million average). If there are considered 10 000 scenarios, from Fig. 24, the same value can vary from 10.3 to 12.51 kW (±9.4 % maximum error, when compared to the 1 million average). When 100 000 scenarios are considered, the maximum error is reduced to ±1.72 %, from a value variation from 11.4 to 11.8 kW.
Thus, only with a considerable amount of simulations is possible to increase the confidence level on the conclusions. The minimum number of simulations required and the computational needs to achieve the conclusions should be appropriately balanced. It could be argued that with this analysis, the degree of confidence of the results generated through 100 000 scenarios is better than 2 %.
Regarding the sigma value, similar convergence conclusions can be made. Both the average and variance values are also useful to evaluate the percentage of scenarios where the inclusion of the PTD is advantageous, as illustrated in Fig. 25.
Since the PTD for the 1 million simulated scenarios is modeled without constant power losses (the PTD only has conduction power losses), there is a considerable The percentage value of the advantageous scenarios can be obtained from the definition of the cumulative distribution function for the normal PDF, following: where erfðzÞ is the Gauss error function, given by As example, for the given histogram of Fig. 25, the percentage value of the advantageous scenarios, Uðx 0Þ, is 39:7%. The final results presented in the following section are obtained with the simulation of 100 000 scenarios (and a different PTD).

Results and discussion
This section addresses the evaluation of the PTD inclusion, for 100 000 different scenarios. In particular, the comparison is on the different clusters of TPS and branch lengths.
Two different analyses are made with different power transfer devices: i) a PTD with typical permanent power losses, with a value of 50 kW corresponding to 20 % of the total power losses; and ii) a PTD with reduced permanent power losses, 25 kW corresponding to 10 % of the total PTD power losses. The power losses at nominal power are the same, 2 % corresponding to 250 kW of power losses (when the PTD is in nominal operation, transferring 12.5 MW from one section to the other).
The results for 100 000 scenarios in the following subsections are presented in Tables 1-4, where each row comprises 10 000 simulated scenarios. Each cell of Tables 1-4 refer to approximately 10000\16 scenarios.  Traction power substation balance and losses estimation in AC railways using a power transfer 87

Power transfer device with typical power losses
The results were obtained with a PTD with a nominal power of 12.5 MVA , where the total nominal losses are 2 % and 20 % of the total nominal losses are constant ones. Table 1 presents the average of the system power losses difference. The global average value is 55.8 kW. This means that in the average of the simulated scenarios, the inclusion of a PTD result in a power balance between two TPS with the disadvantage of increasing the losses in an average amount of 55.8 kW. Then, from the results of Table 1, further conclusions can be obtained: • If one TPS has a short branch and is a high density one, and the other TPS has a long branch and sparse density, then the average system power losses difference is near 10 kW higher than the global average (columns 6 and 11); • If one TPS has a long branch and high density, and the other TPS has a short branch and sparse density, then the average system power losses difference is around 6.3 kW lower than the global average (columns 7 and 10).
In addition to the average value, Table 2 presents the variance of the system power losses difference. Based on the application of the expression in (8) Table 1 and Table 2, respectively, Table 3 presents the percentage of favorable scenarios where is advantageous the installation of a PTD in terms of system power losses. From the results of Table 3, it is identified the best scenario (column 7) where the probability of having favorable scenarios is the highest (15.1 %). This scenario is when TPS1 is dense and long and TPS2 is sparse and short. Then, more limited conclusions regarding the sparsity/density can be made, as follows: -Due to the low r values in the scenarios having both sparse TPS, Table 3 shows a near-zero probability of having favorable scenarios (columns 13 to 16); -The probability of having favorable scenarios if one of the TPS is dense is 9.1 % higher than having both TPS sparse (columns 5 to 12); -If both TPS are dense, the probability of having favorable scenarios is 11.6 % higher than having both TPS sparse (columns 1 to 4).
Regarding the clustering associated with the TPS lengths, other conclusions are listed: • The probability of having favorable scenarios if both TPS branches are short is 4 % (columns 1, 5, 9 and 13); • The probability of having favorable scenarios if both TPS branches are long is 9.2 % (columns 4, 8, 12 and 16);  Long Traction power substation balance and losses estimation in AC railways using a power transfer 89 • If both TPS are dense and if one TPS branch is different from the other, the probability of having favorable scenarios is 13.1 % (columns 2 and 3); • If one TPS is dense and short, and the other TPS is sparse and long (columns 6 and 11), the probability of having favorable scenarios is 6.2 %; • If one TPS is dense and long, and the other TPS is sparse and short (columns 7 and 10), the probability of having favorable scenarios is 14.2 %.

High-efficiency power transfer device
A second analysis was made with a more efficient PTD. The total nominal losses are still 2 % of the nominal power of 12.5 MW. The constant power losses are 10 % of the nominal power losses. Table 4 presents the percentage of favorable scenarios where is advantageous the installation of a PTD.
Similar to the analysis made for the PTD with typical power losses, the percentage results in Table 4 show the best scenario being the same (column 7), where the     When compared to a PTD with typical constant power losses, Table 4 shows a considerable increase in all the probabilities for having favorable scenarios, as expected. This increase is on average 10.5 percentage points (scenarios 1 to 12, with 1.2 percentage points in standard deviation).
Since the constant power losses of this PTD analysis are 25 kW (half of the typical PTD), if both TPS are sparse (columns 13 to 16), there is a slight increase in the probability of having favorable scenarios (in the neighborhood of 1 %).

Discussion
The analysis previously made is useful if the study of the implementation of a PTD in the NZ is strictly subject to the system power losses. If is needed an analysis on the best location to install one PTD from a universe of possible alternatives, then the first analysis is to evaluate the branch lengths and the TPS density. In particular, when compared to all possible scenarios, it is concluded that the best scenarios are the ones where one TPS is dense and long, and the other TPS is sparse and short (columns 7 and 10) to achieve the highest probability of having favorable scenarios (14.2 % for PTD with typical constant losses, or 23.4 % for highly efficient PTD).
In an opposite situation, if both TPS are sparse, from the results achieved, it is expected that the probability of having favorable scenarios is residual (near-zero for the typical PTD, and near 1 % for PTD with reduced losses), leading to the conclusion that, if there is a choice, it is not justified the installation of a PTD in this cluster of TPS. As visible in Fig. 16, for this scenario, the probability of not having any train in both TPS can be estimated using the Poisson PDF for the sparse area. This value is around 54 %, wherein in all operation scenarios, the PTD only accounts for the unfavorable constant losses. Also, in this scenario, the probability of having one train either in one of the TPS branches is around 33 %, and considering Fig. 10 of the atomic scenario, from all of these scenarios, only 40 % of these are advantageous.
It should be highlighted that the inclusion of the PTD installation in the railway electrification system leads always to a more balanced railway power supply. Despite the major focus of the results presented in this paper are on the system power losses, it is clear that once this system is installed, the power demand of the trains in a catenary branch is distributed among the adjacent TPS.
The compensation strategy illustrated in this work depends on the measurement of the power consumption in both TPS. Then, in a practical implementation of this strategy, it might be required a real-time communication system to transfer the measurements remotely between both TPS and the PTD control system.
Finally, this work does not address the control of the PTD reactive power. As stated in [3], a reactive power compensation device can improve the power quality in the railway electrification, specifically with the stabilization of the catenary voltage (allowing to an increase in the infrastructure capacity). In the limit scenario presented in [3], the catenary power losses can be reduced by more than 50 % if the reactive power in the railway electrification is handled. The practical implementation of the strategy proposed in this work must also consider the management of the reactive power, for improved operation of the PTD system.

Conclusion
This paper addresses the effects of the inclusion of a Power Transfer Device between two sections of a railway line based on a Monte Carlo statistical analysis. The main analyzed parameters are the active power balancing in the two substations and the system power losses difference with/without the installation of the PTD.
The proposed methodology considers a generic electrification where several scenarios can be simulated and where each scenario has several different parameters.
From a reduced analysis scenario, the adopted strategy is capable to balance the power in both TPS with a small maximum error (5.5 % in the presented analysis). However, this TPS power balance is achieved with non-negligible system power losses. Specifically, if it is considered an ideal TPS and an ideal PTD (R tps ¼ 0 and R ptd ¼ 0, resulting in a 0 ¼ 0:5), if the train is in the half of the branch closer to the TPS, then the adoption of a PTD results in higher losses than if no PTD is installed.
To contemplate a generic scenario coverage, then an extensive statistical analysis was made in this paper, using data and measurements obtained from a 250 km railway line with 7 TPS. It was concluded that some of the parameters follow specific probability distribution functions. Specifically, the number of trains follows a Poisson PDF, the TPS power consumption follows a Log-Normal PDF and the train power factor is statistically dependent on the train active power.
The final results of the Monte Carlo analysis show that, depending on the density of trains and on the branch lengths, the scenarios where these factors are different for the two TPS can result in considerable higher losses if not carefully considered. However, the PTD system can always balance the two substations, thus implementing double-side feeding and can also reduce the system total losses in some specific scenarios.