Introduction

In 1900, Poincare established the principles of algebraic topology introducing the description of graphs by using the incidence matrix. Then, in 1916, Veblen showed how the Kirchhoff’s laws could be formulated by applying Poincare theory [8].

This was just the beginning of multiple improvements and innovations in graph theory and its application to power systems modeling and analysis. The bulk of these improvements took place in the decades of 1950’s and 1960’s, when the classical topological formulas were modified to fit passive networks containing mutual couplings and active networks. For example, methods for solving a system of indefinite linear algebraic equations by applying a directed weighted graph, known as a signal-flow graph, were proposed in [7, 12, 13, 16, 18, 23]. Successive efforts were done to develop the graph description by means of matrix techniques [4, 31].

Nowadays, the graph theory is still in vogue, but new advances do not only lie on the graph theory itself, but also on its applications to a wide range of different problems. Regarding power systems analysis and modeling, three main graph theory applications have been identified:

  • Modeling and analysis of non linear networks [10]. Graph theory is applied to formulate and describe non-linear networks for dynamic analysis, revealing that graph theory is a very useful tool for complex network description. The method, known as “two-graph modified nodal analysis” was used by the Korres et al. in [25] for the sensitivity analysis of periodically switched linear networks instead of the state space modeling. In this way, the definition of state-variables and the equation formulation are avoided. In [33], the use of switching signal flow graph method was applied to large signal analysis of non linear circuits in super-lift converters.

  • Observability analysis in power systems. In [11], the graph theoretic observability analysis is extended to make it capable of processing switching branches in electric power systems. The authors in [20] identify the maximum number of observable islands in a measured power system. The optimal placement of phasor measurement units to be combined with power flow techniques in observability analysis of power systems is determined in [32].

  • Power flow techniques [22]. Graph theory is applied to decompose a large-dimension optimum power flow problem, with a large number of thermal limit constraints into a set of medium-dimension problems. In [19], the graph theory is used to analyze the effect of phase-shifting transformers over the power flow, determining the optimum number of this kind of devices and their location to reach a certain control in the whole power system. A new method to extract all possible radial configurations in a weakly meshed power system using graph based search methods is proposed in [1]. In [14] a three-phase distribution power flow solution for unbalanced radial distribution systems has been developed based on graph theory. A solution for coordinating large-scale multi-agent systems is presented in [21], and in [15] graph theory is used to deploy multiple layers of multi-agent systems to protect sub-systems around identified loads in a power system.

The RPSS represents a very important part of the traction system infrastructure, so in order to make properly dimensioning, take correct decisions about future investments, or just make an accurate estimation of the operation costs, we need a good estimation of energy consumption and peak power at each line and substation connecting the AC to the DC system. For this reason, large efforts have been done to obtain an accurate, robust, easy to implement and computationally light power flow method [3, 5, 2628, 30].

In [2], an unified AD/DC power flow method to simultaneously solve the whole equation system was proposed. This method includes several features such as: matrix based formulation in \(dq\) coordinates, compact form, a technique based in graph theory to simulate the train motion and a new procedure to obtain power flows, losses and injected/absorbed powers in all nodes. The main advantage is that the system topology and dimension remain constant, even if a new train comes into stage or exits the system.

The present work is focused on the power flow problem. The network description procedure is expanded and the use of the graph theory based method applied to AC/DC RPSS description is explained at length.

The structure of this paper is as follows. “Theoretical Background” section presents a short theoretical background; the obtaining of the matrices describing a graph that are used in successive sections is explained. “Railway Power System Associated Graph” section defines the RPSS associated graph, nodes and lines enumeration criteria, and matrices construction considering the AC and DC subsystems and the trains as static loads (without movement). In “Train Movement and Influence in System Dimension and Topology” section the authors explain how to overcome the problem of the topology variation due to the train movement. In this section the trains are considered like dynamic loads that can vary their position, but they can also vary in number since one train can be activated or deactivated in the system. With the use of the graph theory this problem can be solved keeping constant the network dimension and topology. In “Results” section, a case of study is described and analyzed. Finally, in “Applications” section a set of conclusions are stated.

Theoretical Background

A graph \(G\) consists of two finite sets \((V,E)\), where \(V\) is the set of elements called vertices or nodes and \(E\) is the set of elements called edges. Nodes will be represented as \(1,2,\ldots ,n\) and edges as \(e_1,e_2,\ldots e_k\). Each edge \(e_l\) is identified with a pair of nodes \((i,j)\). G is a directed, oriented graph or digraph if its edges are identified with ordered pairs of nodes. Otherwise G is an undirected or a non oriented graph. In addition, a graph is a simple graph if it has no self-loops or multi-edges [17, 29]. The digraph \(G=(V,E)\) is depicted in Fig. 1a. Here in after, simple digraphs will be used.

Fig. 1
figure 1

a Digraph \(G=(V,E)\); b subgraph of \(G\)

Where:

$$\begin{aligned} V= & {} \{1,2,3,4\}\\ E= & {} \{e_1,e_2,e_3,e_4\} \end{aligned}$$

such that:

$$\begin{aligned} e_1= & {} (1,2)\\ e_2= & {} (1,3)\\ e_3= & {} (3,2)\\ e_4= & {} (4,3) \end{aligned}$$

A subgraph \(H=(V_h,E_h)\) of a graph \(G=(V_g,E_g)\), is a graph where \(V_h\) and \(E_h\) are subsets of \(V_g\) and \(E_g\) respectively [9]. In Fig. 1b a subgraph of the digraph depicted in Fig. 1a is represented.

A bipartite graph \(G = (V, E)\) is a graph whose vertices (set \(V\)) can be divided into two subsets \(V_1\) and \(V_2\), such that every edge of \(E\) has a vertex in \(V_1\) and other in \(V_2\). If it exists an edge \((i,j)\) for every vertex \(i\) of \(V_1\) and every vertex \(j\) of \(V_2\), the graph is called complete bipartite graph, see Fig. 2. This kind of graphs can be also simple digraphs and will be very useful for describing the connections between trains and DC nodes, as it will be explained in further sections.

Fig. 2
figure 2

Complete bipartite graph

In this paper the authors will use the union of subgraphs to form the complete graph of the system. Therefore, being \( G_1 = (V_1, E_1)\) and \( G_2 = (V_2, E_2)\) subgraphs of \( G = (V, E)\), the union \( G_1 \cup G_2 \) called sum graph, has \( V_1 \cup V_2 \) nodes and \(E_1 \cup E_2\) edges. If \(G_1 \cup G_2= G\), then \(G_1\) and \(G_2\) are complementary subgraphs of \(G\) [9], see Fig. 3.

Fig. 3
figure 3

Complementary subgraphs of graph depicted in Fig. 1a. a Complementary subgraph 1. b Complementary subgraph 2

Every graph can be defined by its adjacency (\({\varvec{\Lambda }}\)) and its incidence matrix \(({\varvec{\Gamma }})\). For a graph \(G\) with \(n\) nodes (graph order) the \({\varvec{\Lambda }}\) matrix with dimension \((n,n)\) that relates the connections between nodes is formed as follows [17, 29]:

$$\begin{aligned} {\varvec{\Lambda }}_{i,j}= {\left\{ \begin{array}{ll} \text {number of edges between } i \;\text {and}\; j &{}i \ne j\\ \text {number of self-loops in } i &{}i =j \end{array}\right. } \end{aligned}$$
(1)

In this paper, as it was mentioned, all graphs will be simple digraphs so (1) can be reformulated as:

$$\begin{aligned} {\varvec{\Lambda }}_{i,j}= {\left\{ \begin{array}{ll} 1 &{} \exists \;\text {adjacency between} \; i \;\text {and}\;j \wedge i > j\\ 0 &{} \text {other cases} \end{array}\right. } \end{aligned}$$
(2)

Normally, adjacency matrices are defined as symmetric. However, according to (2), the matrices are defined as upper triangular, thus the redundant information storage is avoided allowing greater efficiency in the use of sparse matrices.

In the same way, the graph \(G\) with \(n\) nodes and \(k\) edges is fully defined by the \((k,n)\) dimension incidence matrix (\({\varvec{\Gamma }}\)) [9, 24], defined as:

$$\begin{aligned} {\varvec{\Gamma }}_{i,j}= {\left\{ \begin{array}{ll} 1 &{} i \; \text {edge} \;\text {incident and directed from} \; j \\ -1 &{} i \; \text {edge} \;\text {incident and directed to} \; j \\ 0 &{} i \; \text {edge} \;\text {not incident on} \; j \end{array}\right. } \end{aligned}$$
(3)

Railway Power System Associated Graph

The RPSS will be represented by a graph, replacing each element by an edge or node, independently of the element nature. A typical network as shown in Fig. 4, will be described as a digraph, characterized by the aforementioned matrices. The whole RPSS system can be divided into three different subsystems:

  • DC subsystem.

  • AC subsystem.

  • AC/DC substations. Link subsystem.

Fig. 4
figure 4

AC/DC Rail power system

Each subsystem can be represented by a subgraph of the complete system graph. Each subsystem has the following nodes:

  • DC subsystem: Trains, DC terminals in rectifier substations and cross points in catenaries. The number of nodes in this subsystem will be \({n_{N}^{DC}}={n_{t}}+{n_{S}^{DC}}\). Where \({n_{t}}\) is the number of trains and \({n_{S}^{DC}}\) the number of nodes for the basic DC topology.

  • AC subsystem: AC nodes and secondary of power transformers (AC/DC substation or link nodes). The number of nodes for this subsystem will be \({n_{N}^{AC}}={n_{N}^{L}}+{n_{S}^{AC}}\). Where \({n_{N}^{L}}\) is the number of link nodes and \({n_{S}^{AC}}\) is the number of AC network nodes.

  • Link subsystem: It does not have own nodes. It only has vertices representing the power converters.

Therefore, the graph describing the whole AC/DC system will be a \({n_{N}}\) order graph, where:

$$\begin{aligned} {n_{N}}={n_{N}^{DC}}+{n_{N}^{AC}}\end{aligned}$$
(4)

The (\({n_{N}},{n_{N}}\)) adjacency matrix representing this system, can be calculated as:

$$\begin{aligned} {\varvec{\Lambda }^{TOT}}=\varvec{\Lambda }^{DC}+{\varvec{\Lambda }^{L}}+\varvec{\Lambda }^{AC}\end{aligned}$$
(5)

where \(\varvec{\Lambda }^{DC}\), \({\varvec{\Lambda }^{L}}\), \(\varvec{\Lambda }^{AC}\) are the DC, the link and the AC subgraphs adjacency matrices, respectively. These matrices have to be total dimension (\({n_{N}},{n_{N}}\)), in order to compute \({\varvec{\Lambda }^{TOT}}\) according to (5). \(\varvec{\Lambda }^{DC}\), \({\varvec{\Lambda }^{L}}\), \(\varvec{\Lambda }^{AC}\) represent each subgraph adjacencies, but considering that all nodes will appear in each subgraph. For example, the graph described by \(\varvec{\Lambda }^{DC}\) will have all nodes represented in it. However, neither the AC or the link node will present adjacencies.

From now on, \({\varvec{\Lambda }^{DC^*}}\), \({\varvec{\Lambda }^{L^*}}\) and \({\varvec{\Lambda }^{AC^*}}\) will denote subgraphs with their particular dimension. Therefore, \({\varvec{\Lambda }^{DC^*}}\) and \({\varvec{\Lambda }^{AC^*}}\) will represent the subgraphs with their subsystem nodes. However, the link subsystem does not have own nodes, so its dimension will vary with the number of no-train type DC nodes and with all link nodes in the AC subsystem.

Node Enumeration Criteria and Subgraphs Matrices

The criteria used to list nodes begins with the trains and get on with the rest of nodes in DC, then the link nodes, and finally the AC nodes. Thus the vector with all nodes in the system will be as follows:

$$\begin{aligned}&\varvec{vn}= [ \;\; \varvec{vn}^{DC}\;\;\varvec{vn}^{AC}\; \;] \end{aligned}$$
(6)
$$\begin{aligned}&\varvec{vn}^{DC}= [ \;\; \varvec{t}\;\;\varvec{s}^{DC}\; \;] \end{aligned}$$
(7)
$$\begin{aligned}&\varvec{vn}^{AC}= [ \;\; \varvec{l}\; \;\varvec{s}^{AC}\; \;] \end{aligned}$$
(8)

where \(\varvec{vn}^{DC}\) and \(\varvec{vn}^{AC}\) are the node vectors of DC and AC subsytem respectively; \(\varvec{t}\), \(\varvec{s}^{DC}\), \(\varvec{l}\) and \(\varvec{s}^{AC}\) are the vectors containing the train type nodes, DC topology nodes, link nodes and AC power system nodes. The system of Fig. 4 can be depicted following this criteria in Fig. 5.

Fig. 5
figure 5

Edge and node enumeration criteria

According to this enumeration criteria and the adjacency matrix definition in (2) , the \({\varvec{\Lambda }}\) describing the RPSS will be a block matrix (see Fig. 6) where lined zones correspond to non zero values.

The (\({n_{N}^{DC}},{n_{N}^{DC}}\)) dimension matrix \({\varvec{\Lambda }^{DC^*}}\) will be defined as:

$$\begin{aligned} {\varvec{\Lambda }^{DC^*}}= \left( \begin{array}{c|c} \varvec{\Lambda }^{tt}_{({n_{t}},{n_{t}})}&{} \varvec{\Lambda }^{ts}_{({n_{t}},{n_{S}^{DC}})}\\ \hline 0&{}\varvec{\Lambda }^{ss}_{({n_{S}^{DC}},{n_{S}^{DC}})}\\ \end{array} \right) \end{aligned}$$
(9)

where:

  • \(\varvec{\Lambda }^{tt}\) is the adjacency matrix representing connections between trains.

  • \(\varvec{\Lambda }^{ts}\) is the adjacency matrix representing connections between trains and DC topology nodes.

  • \(\varvec{\Lambda }^{ss}\) is the adjacency matrix representing real connections between DC nodes.

Fig. 6
figure 6

Whole system block adjacency matrix

These matrices will define three DC subsystem subgraphs. If only the train positions in Fig. 4 were considered, \(\varvec{\Lambda }^{tt}\) would be a null matrix because there is no adjacency between trains. All cases must be considered as it will be explained in “Train movement and influence in system dimension and topology” section because it may be the case in which two trains were in the same line, resulting in an adjacency between them. To formulate \({\varvec{\Lambda }^{TOT}}\) following (5), \(\varvec{\Lambda }^{DC}\) will be completed to total dimension:

$$\begin{aligned} \varvec{\Lambda }^{DC}=\left( \begin{array}{c|c} {\varvec{\Lambda }^{DC^*}}&{}0_{({n_{N}^{DC}},{n_{N}^{AC}})}\\ \hline 0_{({n_{N}^{AC}},{n_{N}^{DC}})}&{}0_{({n_{N}^{AC}}, {n_{N}^{AC}})}\\ \end{array}\right) \end{aligned}$$
(10)

The formulation of \({\varvec{\Lambda }^{L}}\) for any system is shown in (11). As it can be observed this matrix has only non-zero terms in the positions corresponding to DC topology nodes (\({n_{S}^{DC}}\)) and link nodes (\({n_{N}^{L}}\)). Then \({\varvec{\Lambda }^{L^*}}\) will be a \(({n_{S}^{DC}},{n_{N}^{L}})\) dimension matrix.

$$\begin{aligned} {\varvec{\Lambda }^{L}}=\left( \begin{array}{c|ccc} {0_{({n_{N}^{DC}}, {n_{N}^{DC}})}}&\begin{array}{cc}0_{({n_{t}},{n_{N}^{L}})}&{}0_ {({n_{t}},{n_{S}^{AC}})}\end{array}&{}&{}\\ &{}\begin{array}{cc}{\varvec{\Lambda }^{L^*}}&{}0_{({n_{S}^{DC}},{n_{S}^{AC}})}\end{array}\\ \hline {0_{({n_{N}^{AC}}, {n_{N}^{DC}})}}&{}{0_ {({n_{N}^{AC}},{n_{N}^{AC}})}}\\ \end{array}\right) \end{aligned}$$
(11)

\({\varvec{\Lambda }^{AC^*}}\), with dimension \(({n_{N}^{AC}},{n_{N}^{AC}})\) describing AC subsystem graph, could be formulated as follows:

$$\begin{aligned} {\varvec{\Lambda }^{AC^*}}= \left( \begin{array}{c|c} 0_{({n_{N}^{L}},{n_{N}^{L}})}&{}\varvec{\Lambda }^{trafo}\\ \hline 0_{({n_{S}^{AC}},{n_{N}^{L}})}&{}\varvec{\Lambda }^{sAC}\\ \end{array} \right) \end{aligned}$$
(12)

where \(\varvec{\Lambda }^{trafo}\), with dimensions \(({n_{N}^{L}},{n_{S}^{AC}})\), is the adjacency matrix describing transformers, and \(\varvec{\Lambda }^{sAC}\) is the adjacency matrix describing lines between AC nodes, and its dimensions \(({n_{S}^{AC}},{n_{S}^{AC}})\).

The total dimension matrix \(\varvec{\Lambda }^{AC}\) describing the AC subgraph will be:

$$\begin{aligned} \varvec{\Lambda }^{AC}=\left( \begin{array}{c|c} 0_{({n_{N}^{DC}},{n_{N}^{DC}})}&{}0_{({n_{N}^{DC}}, {n_{N}^{AC}})}\\ \hline 0_{({n_{N}^{AC}},{n_{N}^{DC}})}&{}{\varvec{\Lambda }^{AC^*}}\\ \end{array}\right) \end{aligned}$$
(13)

Now Eq. (5) can be completed as:

(14)

Edge Enumeration Criteria and Incidence Matrix Formulation

With the same criteria used for nodes, the edges will be enumerated. First the DC subsystem edges, then the link edges and finally the AC subsystem edges. Thus starting with the DC subgraph, the edge enumeration criteria starts numbering all outgoing node \(1\) edges following an ascending order based on the end node. Then all the outgoing node \(2\) edges and so on. Thereafter, with same criteria, link edges and AC edges will be numerated.

This criteria can be observed in Fig. 5, applied to the example of Fig. 4. As it was discussed in previous sections, the authors used digraphs for describing the system, however the edge direction are not displayed in Fig. 5. These directions allow to set a reference direction for the different physical variables involved on each edge (i.e. currents or powers).

With the node and edge enumeration criteria exposed, the vector containing all system edges is as follows:

$$\begin{aligned} \varvec{ve}= \big [\varvec{e}^{DC}\;\;\varvec{e}^{L}\;\;\varvec{e}^{AC}\big ] \end{aligned}$$
(15)

where \(\varvec{e}^{DC}\), \(\varvec{e}^{L}\) and \(\varvec{e}^{AC}\) are the vectors containing DC, link and AC edges respectively. At the same time \(\varvec{e}^{AC}\) can be divided in transformer edges (\(\varvec{e}^{trafo}\)) and AC lines edges (\(\varvec{e}^{lineAC}\)):

$$\begin{aligned} \varvec{e}^{AC}= \big [\varvec{e}^{trafo}\;\;\varvec{e}^{lineAC}\big ] \end{aligned}$$
(16)

The total number of edges (\(n_{e}\)) in the graph describing the AC/DC RPSS will be:

$$\begin{aligned} n_{e}=n_{e}^{DC}+n_{e}^{L}+n_{e}^{AC}\end{aligned}$$
(17)

where \(n_{e}^{DC}\),\(n_{e}^{AC}\) and \(n_{e}^{L}\) are the number of edges in DC, AC and link subsystem respectively.

For the DC subsystem, the number of edges can be computed as the sum of the edges of the three subgraphs that form it:

$$\begin{aligned} n_{e}^{DC}=n_{e}^{tt}+n_{e}^{ts}+n_{e}^{ss}\end{aligned}$$
(18)

where \(n_{e}^{tt}\) are edges between trains, \(n_{e}^{ts}\) edges between trains and DC topology nodes and \(n_{e}^{ss}\) are edges corresponding to DC lines without trains.

The link subsystem edges (\(n_{e}^{L}\)) represent the AC/DC substation rectifiers.

Finally, in the AC subsystem, the edges represent AC lines \((n_{e}^{lineAC})\) and transformers \((n_{e}^{trafo})\).

$$\begin{aligned} n_{e}^{AC}=n_{e}^{trafo}+n_{e}^{lineAC} \end{aligned}$$
(19)

From each subgraph, the incidence matrix is obtained from its adjacency matrix. Then the \(\varvec{\Gamma }^{TOT}\) with dimension \((n_{e},{n_{N}})\), is computed:

(20)

Being \(\varvec{\Gamma }^{DC^*}\) of dimension \((n_{e}^{DC},{n_{N}^{DC}})\), \(\varvec{\Gamma }^{L^*}\) of dimension \((n_{e}^{L},{n_{S}^{DC}}+{n_{N}^{L}})\) and \(\varvec{\Gamma }^{AC^*}\) of dimension \((n_{e}^{AC},{n_{N}^{AC}})\).

\(\varvec{\Gamma }^{TOT}\) could be obtained from \({\varvec{\Lambda }^{TOT}}\) directly, however by doing this, a link edge could be numerated before a DC edge. Based on Fig. 5, if the incidence matrix is directly computed from \({\varvec{\Lambda }^{TOT}}\), all edges outgoing \(1\) will be first numerated, then all outgoing \(2\) and so on. But node 3 shows an adjacency with a link node, so an edge from the link subsystem would be numerated before the rest of the DC edges outgoing nodes \(4\) and \(5\). Consequently in Fig. 5, \(e_5\) corresponding to adjacency \((4,5)\) would be \((3,7)\), changing the \(\varvec{\Gamma }^{TOT}\) structure substantially.

In Fig. 7 the graph representing the whole system with the trains positioned as in the example of Fig. 5 is depicted. In Fig. 8 the subgraphs representing the three subsystems are shown.

Fig. 7
figure 7

AC/DC system graph

Fig. 8
figure 8

System subgraphs. a DC subsystem subgraph. b AC subsystem subgraph. c Links subsystem subgraph

Train Movement and Influence in System Dimension and Topology

Until now, it was explained how RPSS can be represented with a graph, and how this graph is completely defined through a set of matrices. However, the RPSS is not a static network. The dynamic variation is derived from the movement of loads (trains) in the DC subsystem.

In order to analyze the DC subsystem properly, two main problems must be solved. The first one has to do with the number of trains in the system at a given instant. This number is not constant and provokes a change in the problem dimension among different instants. The second issue lies on trains movement, which produces changes in the relative position of nodes during the simulation. Traditionally, to overcome these difficulties a new problem is set out for each instant.

These problems do not lead to major issues when the system is small and the time interval is not too long. However, the disadvantages of the traditional way of solving the problem arise when a real system must be studied during a significant period of time. The main drawbacks of the traditional solving method can be summarized as:

  • A procedure to determine which trains are in the system at each step of simulation and its position should be developed. A new topology must be defined at each instant, varying the number of nodes, their relative positions and the lines connecting them.

  • An enumeration criteria should be designed to identify each network element (node or line) at each instant. Since the same criteria is applied to different instants, different indexes can be assigned to the same element at two different instants.

  • Due to this last point, there may be changes in the node and edge vectors, both in dimension and components, making very difficult to compare different instants. Even if the vectors corresponding to different instants had the same dimension, a given position of the vector may belong to different elements. Hence, a tracking subroutine should be necessary to find an element in the vector at different instants.

On account of this, the authors propose a partial modification of this procedure to overcome the aforementioned difficulties.

Solution to System Dimension Variability

The solution to keep constant the dimension of the system is to consider all the trains appearing in the temporal interval of study to be represented in the graph, regardless of whether they are physically or not in the system. Throughout this section, the authors will work with a three trains case, as shown in Fig. 9.

The enumeration criteria is the same explained in “Node enumeration criteria and subgraphs matrices” section. For system depicted in Fig. 9, \({n_{t}}\) is 3, then DC topology nodes will begin with index 4.

Solution to System Topology Variability

With the node enumeration criteria above described a particular node will always represent the same train or the same node regardless the instant. However, the train movement continues causing changes in the system topology.

Assuming for instance one instant in the system depicted in Fig. 9, in which only train 1 is located between nodes 4 and 5, with the edge enumeration criteria explained in “Edge enumeration criteria and incidence matrix formulation” section, the edges will be \(e_1=(1,4)\), \(e_2=(1,5)\), \(e_3=(5,6)\), \(e_4=(5,7)\) and \(e_5=(6,7)\) (graph shown in Fig. 10a). Supposing that the train moves toward node \(7\), there will be an instant when the train will be situated between nodes \(5\) and \(7\), therefore \(e_1=(1,5)\) and \(e_2=(1,7)\). Also, for this second instant if a new train (train 2) appears between nodes \(7\) and \(6\), two new edges \(e_3=(2,6)\) and \(e_4=(2,7)\) will emerge. The edge between node \(5\) and \(6\) would become \(e_6 =(5,6)\) and \(e_5\) will connect nodes 4 and 5 (\(e_5=(4,5)\)), (see Fig. 10b). Therefore, the influence of train movement in the dimension of the edges vector and the change in the adjacency represented by the same edge \(e_i\) in two different instants is proved.

Fig. 9
figure 9

Constant dimension AC/DC rail power system

Fig. 10
figure 10

Edge variation example

The dynamic variation of the system only affects the DC subsystem. In order to construct an invariant dimension system, we consider that all trains are connected among them and with all DC topology nodes, thus covering all the possibilities. Thereafter, only edges representing trains that are physically in the system will be activated. So from now on, \({\varvec{\Lambda }^{DC^*}}\) and \(\varvec{\Gamma }^{DC^*}\) construction will take into account all possible connections.

Fig. 11
figure 11

Set of subgraphs that represents the DC network topology. a Sub-graph describing all possible connections between trains (complete type graph). b Sub-graph describing connections between trains and DC topology nodes (complete bipartite graph). c Sub-graph describing the real DC network topology

The graph representing the whole DC system will be constructed considering all possible connections. It is comprised of three subgraphs, as it is represented in Fig. 11:

  • Subgraph describing all possible connections between trains, Fig. 11a. It must be noticed that the case where all trains are running between two DC nodes can exist. To cover all possibilities, this graph is a complete type graph; that is, a simple one in which every pair of distinct nodes are connected by a unique edge [29].

  • Subgraph describing connections between trains and DC topology nodes, Fig. 11b. Every train can be connected to every DC topology node at different simulation steps. In this case the subgraph symbolizing these connections is a complete bipartite graph between trains and DC nodes.

  • Subgraph describing the real DC network topology, Fig. 11c. It represents the real topology of the DC system without trains.

The adjacency matrix corresponding to the DC subsystem can be calculated as the sum of the abovementioned subgraphs adjacency matrices.

$$\begin{aligned} {\varvec{\Lambda }^{DC^*}}= & {} \varvec{\Lambda }^{tt}+\varvec{\Lambda }^{ts}+\varvec{\Lambda }^{ss}\nonumber \\= & {} \left( \begin{array}{c|c} \varvec{\Lambda }^{tt}_{(n_t,n_t)}&{}0\\ \hline 0&{}0\\ \end{array} \right) +\left( \begin{array}{c|c} 0&{}\varvec{\Lambda }^{ts}_{(n_t,n_{S_{}}^{DC})}\\ \hline 0&{}0^{}\\ \end{array} \right) \nonumber \\&+\, \left( \begin{array}{c|c} 0&{}0\\ \hline 0&{}\varvec{\Lambda }^{ss}_{(n_S^{DC},n_S^{DC})}\\ \end{array} \right) \nonumber \\= & {} \left( \begin{array}{c|c} \varvec{\Lambda }^{tt}_{(n_t,n_t)}&{}\varvec{\Lambda }^{ts} _{(n_t,n_{S_{}}^{DC})}\\ \hline 0&{}\varvec{\Lambda }^{ss^{}}_{(n_S^{DC},n_S^{DC})}\\ \end{array} \right) \end{aligned}$$
(21)

The number of edges of DC subsystem can be calculated as:

$$\begin{aligned}&n_{e}^{DC}=n_{e}^{tt}+n_{e}^{ts}+n_{e}^{ss}\end{aligned}$$
(22)
$$\begin{aligned}&n_{e}^{tt}=\frac{{n_{t}}({n_{t}}-1)}{2} \end{aligned}$$
(23)
$$\begin{aligned}&n_{e}^{ts}={n_{t}}\times {n_{S}^{DC}}\end{aligned}$$
(24)
Table 1 DC subsytem edges

The number of edges in the third subgraph (\(n_{e}^{ss}\)) only depends on the number of real lines connecting DC topology nodes. The Eq. (23) represents the number of edges of a complete graph of \({n_{t}}\) nodes. Equation (24) represents the number of edges in a complete bipartite graph of \({n_{t}}\) nodes in \(V_1\) and \({n_{S}^{DC}}\) nodes in \(V_2\), [29].

Once the DC subsystem is computed considering all possible connections, the invariant part of RPSS (links and AC subsystems) is added.

In Fig. 12 the graph representing the whole DC subsystem and the three subgraphs are represented. In Tables 1 and 2 the edges are listed for each subsystem.

Table 2 Links and AC subsytem edges
Fig. 12
figure 12

DC Subsystem graphs . a DC subsystem graph. b Subgraph \(tt\). c Subgraph \(ts\). d Subgraph \(ss\)

Table 3 Train position
Fig. 13
figure 13

DC subsytem scheme for instants defined in Table 3. a Instant \(t\). b Instant \(t+\Delta t\)

Fig. 14
figure 14

DC subsystem graphs for instants defined in table 3. a Instant \(t\). b Instant \(t+\Delta t\)

Results

For the example depicted in Fig. 9 two different instants will be studied. The trains are located as described in Table 3, where the column \(Distance\) represents the train position as a percentage of the total line length. The DC subsystem schemes for the considered positions are depicted in Fig. 13. Comparing both schemes, it can be observed that edge \((6,7)\) is invariant. Edges \((1,5)\), \((3,5)\) and \((2,7)\) also appear in both instants.

Figure 14 shows the graphs corresponding to the two instants. The edges existing for each case are depicted. It can be observed that the edge representing the adjacency \((6,7)\), is \(e_ {19}\) in both cases. Furthermore, the adjacencies appearing in both cases (\((1,5)\), \((3,5)\) and \((2,7)\)) are represented by the same edges (\(e_4 \), \(e_{13} \) and \(e_{11}\)).

Table 4 shows the “active” and “non active” edges at each instant and Fig. 15 shows the \({\varvec{\Lambda }^{TOT}}\) and \(\varvec{\Gamma }^{TOT}\) for the example.

Table 4 Active DC subsystem edges in instants depicted in Fig. 13
Fig. 15
figure 15

Matrices for scheme Fig. 9. Where \(+\) symbol implies 1 and open circle symbol \(-1\) . a \({\varvec{\Lambda }^{TOT}}\). b \(\varvec{\Gamma }^{TOT}\)

Applications

One of the possible applications of these theory is the fast formulation of all Kirchhoff’s current and voltage laws in al lines and nodes of a railway system. For instance, by means of the \(\varvec{\Gamma }\) matrix, all current and voltage Kirchhoff laws can be expressed in a compact form as follows [2, 6]:

$$\begin{aligned} g(\mathbf z )=\mathbf M \mathbf z ^{T} =0 \end{aligned}$$
(25)

where \(\mathbf z \) is the vector representing voltage and current magnitudes. And M can be expanded as follows. \(\varvec{\Gamma }^{DC}\) and \(\varvec{\Gamma }^{AC}\) represent the DC and AC subsystems topology respectively. \(\mathbf R _B^{DC}\) is the branch resistance matrix of the DC subsystem. \(\mathbf R _B^{AC}\) and \(\mathbf X _B^{AC}\) are the resistance and reactance matrices respectively, representing the impedance between AC nodes. \(\mathbf I \) identity matrix. And \(\mathbf S \) is a block diagonal matrix. The first block is an identity matrix, the second block is a diagonal matrix denoted as \(\mathbf S ^{L}_{(n_{s} , n_{s})}\). Element \(s_{ii}\) belonging to \(\mathbf S ^{L}\) is 1 if the DC substation \(i\) is connected to the AC network and \(s_{ii}\) is 0 when the DC substation \(i\) is not connected to the AC grid.

(26)

Conclusions

As it was demonstrated, with the proposed method, a complex RPSS can be easily characterised and described even when it has multiple loads that change their relative position with the time. By means of the described technique the Kirchhoff Current laws and the Kirchhoff voltage laws can be formulated in a extremely easy compact form. The proposed method has been developed for a railway traction system, but it could be also applied to any power system, being specially useful for those systems in which loads and generators vary their relative positions. Another application might be a system with combination of AC and DC systems as for example High Voltage Direct Current (HVDC) systems.