This chapter provides a solution for some transmission network operation and planning studies in GAMS. The transmission investment regarding building new lines and power flow controllers (phase shifter), sensitivity factors, and transmission switching have been discussed in this chapter. The GAMS code for solving each optimization problem is developed and discussed.

9.1 Transmission Network Planning

The question to be answered in transmission expansion planning (TEP) is when and which right of way should be selected to build a new line, perform reconductoring, build a new substation, or install power flow controllers. As a matter of fact, obtaining the public acceptance for building new transmission lines has become a challenging issue for the transmission asset owners. This also makes it difficult for transmission system operator to keep the technical and economic performance of transmission network high. The objective function is usually defined as the total operation and planning costs. Different models have been proposed for TEP purpose such as:

  • Probabilistic TEP considering load and wind power generation uncertainties [1]

  • MIP-based multi-stage TEP considering losses, generator costs, and the N − 1 security constraints [2]

  • Genetic algorithm-based TEP considering demand uncertainty [3]

  • Congestion reduction-based TEP [4]

  • Robust optimization-based TEP considering the uncertainties of renewable generation and load [5]

  • Branch and bound algorithm for TEP [6]

  • MIP-based TEP model considering different demand levels, N − 1 network security constraints as well as environmental constraints [7]

  • Multi-objective TEP considering total social costs, maximum regret (robustness criterion), and maximum adjustment cost (flexibility criterion) as three objective functions [8]

  • Monte-Carlo-based TEP considering random outages of generating units and transmission lines as well as inaccuracies in the long-term load forecasting [9]

  • An interior point method considering full AC power flow constraints [10]

  • Multi-objective TEP considering investment cost, reliability (both adequacy and security), and congestion costs [11]

  • Chance constrained TEP consideration of load and wind uncertainties [12].

9.1.1 TEP with New Lines Option

The transmission expansion planning is formulated in (9.1). It is assumed that the only planning option is building new lines.

$$\displaystyle\begin{array}{rcl} \mathrm{OF} = T \times \mathrm{OPC} + \mathrm{INVC}& &{}\end{array}$$
(9.1a)
$$\displaystyle\begin{array}{rcl} \mathrm{OPC} =\sum _{g\in \varOmega _{G}}b_{g}P_{g} + \mathrm{VOLL}\sum _{i}\mathrm{LS}_{i}& &{}\end{array}$$
(9.1b)
$$\displaystyle\begin{array}{rcl} \mathrm{INVC} = \left (-\eta _{ij}^{0} +\sum _{ k,ij}\alpha _{ij}^{k}\right )C_{ ij}& &{}\end{array}$$
(9.1c)
$$\displaystyle\begin{array}{rcl} P_{ij}^{k} - B_{ ij}(\delta _{i} -\delta _{j}) \leq (1 -\alpha _{ij}^{k})M& &{}\end{array}$$
(9.1d)
$$\displaystyle\begin{array}{rcl} P_{ij}^{k} - B_{ ij}(\delta _{i} -\delta _{j}) \geq -(1 -\alpha _{ij}^{k})M& &{}\end{array}$$
(9.1e)
$$\displaystyle\begin{array}{rcl} \sum _{g\in \varOmega _{G}^{i}}P_{g} + \mathrm{LS}_{i} - L_{i} =\sum _{j\in \varOmega _{\ell}^{i}}P_{ij}:\lambda _{i}\ \ \ i \in \varOmega _{B}& &{}\end{array}$$
(9.1f)
$$\displaystyle\begin{array}{rcl} - P_{ij}^{\max \nolimits }\alpha _{ ij}^{k} \leq P_{ ij}^{k} \leq P_{ ij}^{\max \nolimits }\alpha _{ ij}^{k}\ \ \ ij \in \varOmega _{\ell}& &{}\end{array}$$
(9.1g)
$$\displaystyle\begin{array}{rcl} P_{g}^{\min \nolimits } \leq P_{ g} \leq P_{g}^{\max \nolimits }& &{}\end{array}$$
(9.1h)
$$\displaystyle\begin{array}{rcl} \text{ if }\eta _{ij}^{0} = 1\text{ then }\alpha _{ ij}^{k=1} = 1& &{}\end{array}$$
(9.1i)
$$\displaystyle\begin{array}{rcl} B_{ij} = \frac{1} {x_{ij}}& &{}\end{array}$$
(9.1j)
$$\displaystyle\begin{array}{rcl} \alpha _{ij}^{k} \in \left \{0,1\right \}& &{}\end{array}$$
(9.1k)
$$\displaystyle\begin{array}{rcl} k \in \left \{1,2,3,4\right \}& &{}\end{array}$$
(9.1l)

The objective function in (9.1a) consists of operational costs (OPC) and investment costs (INVC). The operational costs are calculated in (9.1b) while the investment costs are calculated in (9.1c). (9.1d), and (9.1e) model, the power flow on branch connecting bus i to bus j. In (9.1d) and (9.1e) there is a parameter M. It is also called big M in the literature [13]. This parameter is selected as follows:

M = max ij B ij (δ i δ j )

The power balance between the generated power, load shedding, demand, and line flows is ensured by (9.1f). The line flow limits are modeled in (9.1g) and the impacts of line investment decision α ij k are formulated. The generation operating limits are given in (9.1h). The initial status of each line is described in (9.1i).

The six-bus Garver transmission network [14] is shown in Fig. 9.1.

Fig. 9.1
figure 1

Six-bus Garver transmission network (base case)

Transmission expansion planning data are given in Table 9.1. The existing and potential right of ways in addition to the reactances and flow limits are provided there. The investment costs (C ij ) are given in million $. The VOLL is assumed to be 1000 $/MW h. There are three generating units with different operating costs as shown in Fig. 9.1. Although the generator number 3 is the cheapest unit, however, it is not connected to the grid. The candidate right of ways are the existing ones (indicated by solid lines and the dashed ones as indicated in Fig. 9.1). The GAMS code for solving the DC power flow-based TEP is provided in GCode 9.1.

Table 9.1 Transmission expansion planning data for Garver six-bus transmission network

GCode 9.1 DC-OPF-based TEP

Sets bus  /1*6/,  slack ( bus ) /1/, Gen /g1 * g3 /, k /k1 * k4 /; Scalars   Sbase /100/ , M  /1000/; a l i a s (bus, node ); Table GenData(Gen, * )   Generating units  c h a r a c t e r i s t i c s    b     pmin pmax g1 20    0    400 g2 30    0    400 g3 10    0    600; set GBconect(bus,Gen) connectivity  index of  each generating  unit to each bus /1    .     g1  3    .     g2  6    .     g3  / ; Table BusData(bus, * )  Demands of  each bus in MW          Pd 1        80 2        240 3        40 4        160 5        240; table  branch (bus,  node, * )     Network technical  c h a r a c t e r i s t i c s                X     LIMIT Cost stat 1    .     2    0.4   100   40   1 1    .     4    0.6   80    60   1 1    .     5    0.2   100   20   1 2    .     3    0.2   100   20   1 2    .     4    0.4   100   40   1 2    .     6    0.3   100   30   0 3    .     5    0.2   100   20   1 4    .     6    0.3   100   30   0; Set conex (bus, node )        Bus connectivity  matrix; conex (bus, node )$( branch (bus, node, ’x ’ ) )=yes;  conex (bus, node ) $conex (node, bus )=yes; branch (bus, node, ’x ’ ) $branch (node, bus, ’x ’ )= branch (node, bus, ’x ’ ); branch (bus, node, ’ cost ’ ) $branch (node, bus, ’ cost ’ )= branch (node, bus, ’ cost ’ ); branch (bus, node, ’ stat ’ ) $branch (node, bus, ’ stat ’ )= branch (node, bus, ’ stat ’ ); branch (bus, node, ’ Limit ’ )$( branch (bus, node, ’ Limit ’ )=0) = branch (node, bus, ’ Limit ’ ); branch (bus, node, ’ bij ’ ) $conex (bus, node ) =1/branch (bus, node, ’x ’ ); M = smax (( bus, node ) $conex (bus, node ), branch (bus, node, ’ bij ’ ) * pi* 4 / 3 ); Variables   OF, Pij (bus, node, k),Pg(Gen), delta ( bus ),LS( bus ); binary variable  alpha (bus, node, k);  alpha. l (bus, node, k) =1; alpha. fx (bus, node, k)$( conex (bus, node ) and ord (k)=1 and  branch (node, bus, ’ stat ’ ) ) =1; Equations const1A, const1B, const1C, const1D, const1E, const2, const3; const1A (bus, node, k) $conex (node, bus ) ..  Pij (bus, node, k) − branch (bus, node, ’ bij ’ ) * ( delta ( bus ) −delta ( node ) )=l=  M *(1 − alpha (bus, node, k) ); const1B (bus, node, k) $conex (node, bus ) ..  Pij (bus, node, k) − branch (bus, node, ’ bij ’ ) * ( delta ( bus ) −delta ( node ) )= g =− M *(1 − alpha (bus, node, k) ); const1C (bus, node, k) $conex (node, bus ) ..  Pij (bus, node, k)=l=  alpha (bus, node, k) * branch (bus, node, ’ Limit ’ )/Sbase; const1D (bus, node, k) $conex (node, bus ) ..  Pij (bus, node, k)= g = −alpha (bus, node, k) * branch (bus, node, ’ Limit ’ )/Sbase; const1E (bus, node, k) $conex (node, bus ) ..  alpha (bus, node, k)= e =alpha (node, bus, k); const2 ( bus ) ..  LS( bus )+ sum(Gen$GBconect(bus,Gen),Pg(Gen) ) − BusData(bus, ’pd ’ )/Sbase = e =+ sum((k, node ) $conex (node, bus ), Pij (bus, node, k) ); const3      ..  OF = g = 2 * 8 7 6 0 * ( sum(Gen, Pg(Gen) * GenData(Gen, ’b ’ ) * Sbase ) +1000* sbase * sum(bus, LS( bus ) ) ) +1e6 * sum(( bus, node, k) $conex (node, bus ), 0. 5 * branch (bus, node, ’ cost ’ ) * alpha (bus, node, k) $( ord (k)>1 or branch (node, bus, ’ stat ’ )=0)); Model loadflow     /all/;  option optcr =0; LS. up( bus )= BusData(bus, ’pd ’ )/Sbase;   LS. lo ( bus ) =0; Pg. lo (Gen)= GenData(Gen, ’Pmin ’ )/Sbase; Pg. up(Gen)= GenData(Gen, ’Pmax ’ )/Sbase; delta. up( bus )= pi/3;  delta. lo ( bus )=− pi/3;  delta. fx ( slack ) =0; Pij. up(bus, node, k)$ (( conex (bus, node ) ) ) =1* branch (bus, node, ’ Limit ’ )/Sbase; Pij. lo (bus, node, k)$ (( conex (bus, node ) ) )=−1*branch (bus, node, ’ Limit ’ )/Sbase; Solve loadflow min OF  us MIP;

9.1.1.1 Two Years Planning Period

The optimal TEP solution for 2 years planning period (T = 2 ∗ 8760 h) is shown in Fig. 9.2. The total operating cost is M$227.142, and the investment costs are M$110. The total costs would be M$337.140.

Fig. 9.2
figure 2

Optimal TEP solution for 2 years planning period (T = 2 ∗ 8760 h)

The optimal solutions dictate that the branch connecting bus 1 to bus 5 should be reinforced with one additional line. Bus 6 to bus 2 should be connected using three lines.

9.1.1.2 Ten Years Planning Period

The optimal TEP solution for 2 years planning period (T = 10 ∗ 8760 h) is shown in Fig. 9.3. The total operating cost is M$871.410 and the investment costs are M$162.853. The total costs would be M$1034.263. The optimal solutions dictates that the branch2–3 and branch1–5 should be reinforced with one additional line. Bus 6 to bus 2 should be connected using four lines. Bus 6 to bus 4 should be connected using two lines. It should be noted that the current model is simplistic. It needs to consider more realistic constraints. Some of them are listed as follows:

  • The model is a single period. The load duration curve (LDC) or a discrete LDC with some demand levels and their associated duration should be considered.

    Fig. 9.3
    figure 3

    Optimal TEP solution for 10 years planning period (T = 10 ∗ 8760 h)

  • The contingencies should be taken into account. This will ensure the system operator to keep the light on even some network/generation assets fail. The failure of transmission lines or generating units might cause overloading of the remaining lines and operation of over-current relays and cause cascaded failures. It might even lead to black out.

  • The AC power flow constraints should be checked to make sure no voltage constraint or line limit is violated.

  • The voltage stability issue should also be checked.

  • The model is trying to minimize the total operating cost plus the investment costs. In deregulated environment, the transmission asset owner and the transmission system operator are two independent entities. This makes the problem more complicated since these two entities would have different objective functions. The asset owner is trying to maximize its benefit and make money by making investments. On the other hand, the system operator is trying to maximize the social welfare. The multi-objective techniques [8] or complementarity models [15] provide the suitable answer to this challenge.

  • The demand grows should be considered.

  • The formulated transmission planning model is a static model. This means that the decision is made in order to make the system capable of answering for the needs of next N years. The dynamic of investment or timing of investment and time value of money is neglected.

  • The uncertainties of the electricity market, renewable energies, demand, and regulatory frameworks should be considered to make the model robust against future scenarios.

  • The VOLL is assumed to be the same for all demands at different buses. However, the importance level of all demands is not the same. This can reduce the investment requirements for TEP.

9.1.2 TEP with New Lines and Power Flow Controller Option

This section investigates the impact of power flow controller as a planning option. The phase shifter is used as the power flow controller device. The role of the phase shifter is depicted in Fig. 9.4. The relation between the power flow, voltage angles difference across the branch ij , and the line susceptance is given in (9.2).

$$\displaystyle\begin{array}{rcl} P_{ij} = \frac{\delta _{i} -\delta _{j} +\varPsi _{ij}} {x_{ij}} = B_{ij}(\delta _{i} -\delta _{j} +\varPsi _{ij})& &{}\end{array}$$
(9.2a)
$$\displaystyle\begin{array}{rcl} -\varPsi _{ij}^{\max \nolimits } \leq \varPsi _{ ij} \leq +\varPsi _{ij}^{\max \nolimits }& &{}\end{array}$$
(9.2b)
$$\displaystyle\begin{array}{rcl} \varPsi _{ij} = -\varPsi _{ji}& &{}\end{array}$$
(9.2c)
Fig. 9.4
figure 4

The phase shifter function in power flow control

Although the voltage phase shift is a discrete variable in reality but it is modeled as a continuous variable for simplicity in (9.2).

$$\displaystyle\begin{array}{rcl} \mathrm{OF} = T \times \mathrm{OPC} + \mathrm{INVC}& &{}\end{array}$$
(9.3a)
$$\displaystyle\begin{array}{rcl} \mathrm{OPC} =\sum _{g\in \varOmega _{G}}b_{g}P_{g} + \mathrm{VOLL}\sum _{i}\mathrm{LS}_{i}& &{}\end{array}$$
(9.3b)
$$\displaystyle\begin{array}{rcl} \mathrm{INVC} = \left (-\eta _{ij}^{0} +\sum _{ k,ij}\alpha _{ij}^{k}\right )C_{ ij} +\sum _{k,ij}I_{ij}^{k}\gamma _{ ij}& &{}\end{array}$$
(9.3c)
$$\displaystyle\begin{array}{rcl} P_{ij}^{k} - B_{ ij}(\delta _{i} -\delta _{j} +\varPsi _{ ij}^{k}) \leq (1 -\alpha _{ ij}^{k})M& &{}\end{array}$$
(9.3d)
$$\displaystyle\begin{array}{rcl} P_{ij}^{k} - B_{ ij}(\delta _{i} -\delta _{j} +\varPsi _{ ij}^{k}) \geq -(1 -\alpha _{ ij}^{k})M& &{}\end{array}$$
(9.3e)
$$\displaystyle\begin{array}{rcl} -\varPsi _{ij}^{\max \nolimits }I_{ ij}^{k} \leq \varPsi _{ ij}^{k} \leq +\varPsi _{ ij}^{\max \nolimits }I_{ ij}^{k}& &{}\end{array}$$
(9.3f)
$$\displaystyle\begin{array}{rcl} \varPsi _{ij} = -\varPsi _{ji}& &{}\end{array}$$
(9.3g)
$$\displaystyle\begin{array}{rcl} I_{ij}^{k} \leq \alpha _{ ij}^{k}& &{}\end{array}$$
(9.3h)
$$\displaystyle\begin{array}{rcl} \sum _{g\in \varOmega _{G}^{i}}P_{g} + \text{LS}_{i} - L_{i} =\sum _{j\in \varOmega _{\ell}^{i}}P_{ij}:\lambda _{i}\ \ \ i \in \varOmega _{B}& &{}\end{array}$$
(9.3i)
$$\displaystyle\begin{array}{rcl} -P_{ij}^{\max \nolimits }\alpha _{ ij}^{k} \leq P_{ ij}^{k} \leq P_{ ij}^{\max \nolimits }\alpha _{ ij}^{k}\ \ \ ij \in \varOmega _{\ell}& &{}\end{array}$$
(9.3j)
$$\displaystyle\begin{array}{rcl} P_{g}^{\min \nolimits } \leq P_{ g} \leq P_{g}^{\max \nolimits }& &{}\end{array}$$
(9.3k)
$$\displaystyle\begin{array}{rcl} \text{ if }\eta _{ij}^{0} = 1\text{ then }\alpha _{ ij}^{k=1} = 1& &{}\end{array}$$
(9.3l)
$$\displaystyle\begin{array}{rcl} B_{ij} = \frac{1} {x_{ij}}& &{}\end{array}$$
(9.3m)
$$\displaystyle\begin{array}{rcl} \alpha _{ij}^{k},I_{ ij}^{k} \in \left \{0,1\right \}& &{}\end{array}$$
(9.3n)
$$\displaystyle\begin{array}{rcl} k \in \left \{1,2,3,4\right \}& &{}\end{array}$$
(9.3o)

The phase shifter impact is shown in (9.3d) and (9.3e). The investment decision regarding the phase shifter is reflected in (9.3f). The phase shifter can be installed on lines that initially exist or built lines as shown in (9.3h). The investment cost for each phase shifter is assumed to be γ ij  = M$0.6. The optimal decisions regarding the location of phase shifter and new transmission lines 2 years plan (T = 2 ∗ 8760) are given in Fig. 9.5. The total operating cost is M$224.256 and the investment costs are M$110.6. The total costs would be M$334.856.

Fig. 9.5
figure 5

The optimal decisions regarding the location of phase shifter and new transmission lines 2 years plan (T = 2 ∗ 8760)

GCode 9.2 DC-OPF-based TEP considering phase shifter option

Sets bus  / 1 * 6 /  , slack ( bus ) /1/,Gen /g1 * g3 /,k /k1 * k4 /; a l i a s (bus, node ); Scalars   Sbase /100/ , M  /1000/, T;  T=8760*2;  Set conex (bus, node ); Table GenData(Gen, * )   Generating units  c h a r a c t e r i s t i c s    b     pmin pmax g1 20    0    400 g2 30    0    400 g3 10    0    600; Set GBconect(bus,Gen) connectivity  index of  each generating  unit to each bus /1    .     g1  3    .     g2  6    .     g3  / ; Table BusData(bus, * )  Demands of  each bus in MW          Pd 1        80 2        240 3        40 4        160 5        240; table  branch (bus,  node, * )     Network technical  c h a r a c t e r i s t i c s                X     LIMIT Cost stat ; conex (bus, node )$( branch (bus, node, ’x ’ ) )=yes;  conex (bus, node ) $conex (node, bus )=yes; branch (bus, node, ’x ’ ) $branch (node, bus, ’x ’ )= branch (node, bus, ’x ’ ); branch (bus, node, ’ cost ’ ) $branch (node, bus, ’ cost ’ )= branch (node, bus, ’ cost ’ ); branch (bus, node, ’ stat ’ ) $branch (node, bus, ’ stat ’ )= branch (node, bus, ’ stat ’ ); branch (bus, node, ’ Limit ’ )$( branch (bus, node, ’ Limit ’ )=0) = branch (node, bus, ’ Limit ’ ); branch (bus, node, ’ bij ’ ) $conex (bus, node ) =1/branch (bus, node, ’x ’ ); M = smax (( bus, node ) $conex (bus, node ), branch (bus, node, ’ bij ’ ) * 3. 1 4 * 2 ); Variables   OF, Pij (bus, node, k),Pg(Gen), delta ( bus ),LS( bus ), PSHij (bus, node, k); binary variable  alpha (bus, node, k), I (bus, node, k);  alpha. l (bus, node, k) =1; alpha. fx (bus, node, k)$( conex (bus, node ) and ord (k)=1 and  branch (node, bus, ’ stat ’ ) ) =1; Equations const1A, const1B, const1C, const1D, const1E, const2, const3, const4, const5, const6, const7; const1A (bus, node, k) $conex (node, bus ) ..  Pij (bus, node, k) −branch (bus, node, ’ bij ’ ) * (                 delta ( bus ) −delta ( node )+ PSHij (bus, node, k) )=l= M *(1 − alpha (bus, node, k) ); const1B (bus, node, k) $conex (node, bus ) ..  Pij (bus, node, k) −branch (bus, node, ’ bij ’ ) * (                delta ( bus ) −delta ( node )+ PSHij (bus, node, k) )= g =− M *(1 − alpha (bus, node, k) ); const1C (bus, node, k) $conex (node, bus ) ..  Pij (bus, node, k)=l= alpha (bus, node, k) * branch (bus, node, ’ Limit ’ )/Sbase; const1D (bus, node, k) $conex (node, bus ) ..  Pij (bus, node, k)= g = −alpha (bus, node, k) * branch (bus, node, ’ Limit ’ )/Sbase; const1E (bus, node, k) $conex (node, bus ) ..  alpha (bus, node, k)= e =alpha (node, bus, k); const2 ( bus ) ..  LS( bus )+ sum(Gen$GBconect(bus,Gen),Pg(Gen) ) − BusData(bus, ’pd ’ )/Sbase= e =+ sum((k, node ) $conex (node, bus ), Pij (bus, node, k) ); const3 ..OF = g = T * ( sum(Gen, Pg(Gen) * GenData(Gen, ’b ’ ) * Sbase ) +100000*sum(bus, LS( bus ) ) ) +1e6 * sum(( bus, node, k) $conex (node, bus ), 0. 5 * branch (bus, node, ’ cost ’ ) * alpha (bus, node, k)$( ord (k)>1 or branch (node, bus, ’ stat ’ )=0))+6e5 * 0. 5 * sum(( bus, node, k) $conex (node, bus ), I (bus, node, k) ); const4 (bus, node, k) $conex (node, bus ) .. PSHij (bus, node, k)+ PSHij (node, bus, k)= e=0; const5 (bus, node, k) $conex (node, bus ) .. PSHij (bus, node, k)=l=I (bus, node, k) * pi/8; const6 (bus, node, k) $conex (node, bus ) .. PSHij (bus, node, k)= g =−I (bus, node, k) * pi/8; const7 (bus, node, k) $conex (node, bus ) .. I (bus, node, k)=l=alpha (bus, node, k); Model loadflow     /all/;  LS. up( bus )= BusData(bus, ’pd ’ )/Sbase;  LS. lo ( bus ) =0; Pg. lo (Gen)= GenData(Gen, ’Pmin ’ )/Sbase;  Pg. up(Gen)= GenData(Gen, ’Pmax ’ )/Sbase; delta. up( bus )= pi/3;  delta. lo ( bus )=− pi/3;  delta. fx ( slack ) =0; Pij. up(bus, node, k)$ (( conex (bus, node ) ) ) =1* branch (bus, node, ’ Limit ’ )/Sbase; Pij. lo (bus, node, k)$ (( conex (bus, node ) ) )=−1*branch (bus, node, ’ Limit ’ )/Sbase; PSHij. up(bus, node, k)=  pi/8;  PSHij. lo (bus, node, k)=− pi/8;  option optcr =0; Solve loadflow min OF  us MIP;

The optimal decisions regarding the location of phase shifter and new transmission lines 10 years plan (T = 10 ∗ 8760) are given in Fig. 9.6. The total operating cost is M$805.920 and the investment costs are M$200.600. The total costs would be M$1006.520.

Fig. 9.6
figure 6

The optimal decisions regarding the location of phase shifter and new transmission lines 10 years plan (T = 10 ∗ 8760)

Nomenclature

Indices and Sets

g :

Index of thermal generating units

i, j :

Index of network buses

Ω G :

Set of all thermal generating units

Ω G i :

Set of all thermal generating units connected to bus i

Ω i :

Set of all buses connected to bus i

Ω B :

Set of network buses

Parameters

M :

Big number

T :

Duration of planning period (h)

L i :

Electric power demand in bus i at time t

b g :

Fuel cost coefficient of thermal unit g

η ij 0 :

Initial status of branch connecting bus i to j

C ij :

Investment cost for branch connecting bus i to j

γ ij :

Investment cost of phase shifter in line ij

P g max∕min :

Maximum/minimum limits of power generation of thermal unit g

P ij max :

Maximum power flow limits of branch connecting bus i to j

Ψ ij max :

Maximum phase shift in line connecting bus i to bus j

x ij :

Reactance of branch connecting bus i to j

B ij :

Susceptance of branch connecting bus i to j

VOLL:

Value of loss of load ($/MW h)

Variables

P ij k :

Active power flow of branch k connecting bus i to j (MW)

P g :

Active power generated by thermal unit g (MW)

α ij k :

Binary variable to model the investment decision regarding the line k at the right of way ij

I ij k :

Binary variable to model the investment decision regarding the phase shifter in line k at the right of way ij

λ i :

Locational marginal price in bus i ($/MW h)

LS i :

Load shedding in bus i (MW)

Ψ ij :

Phase shift in line connecting bus i to bus j

OPC:

Total operating costs ($)

OF:

Total costs ($)

INVC:

Total investment costs ($)

δ i :

Voltage angle of bus i (rad)

9.2 Sensitivity Factors in Transmission Networks

In this section two important factors are analyzed and calculated namely:

  • Generation Shift Factor (GSF)

  • Line Outage Distribution Factor (LODF)

9.2.1 Generation Shift Factors

The transmission network planner/operator is always interested to know what happens to the line flows if any outage happens in generation units. In other words, what is the influence of generation/demand change in bus i on the line (connecting bus n to bus m)? It is important since there is always a chance for contingencies to happen in generating units. This section will provide an answer to this question.

The DC power flow equations of the network shown in Fig. 9.7 is provided in (9.4).

$$\displaystyle\begin{array}{rcl} P_{1}^{g} - L_{ 1} = \frac{\delta _{1} -\delta _{2}} {x_{12}} + \frac{\delta _{1} -\delta _{3}} {x_{13}} & &{}\end{array}$$
(9.4a)
$$\displaystyle\begin{array}{rcl} P_{2}^{g} - L_{ 2} = \frac{\delta _{2} -\delta _{1}} {x_{21}} + \frac{\delta _{2} -\delta _{3}} {x_{23}} & &{}\end{array}$$
(9.4b)
$$\displaystyle\begin{array}{rcl} P_{3}^{g} - L_{ 3} = \frac{\delta _{3} -\delta _{2}} {x_{32}} + \frac{\delta _{3} -\delta _{1}} {x_{31}} & &{}\end{array}$$
(9.4c)
Fig. 9.7
figure 7

Three-bus network example for sensitivity factors calculation

By substituting the numerical values of x ij in (9.4) we will have:

$$\displaystyle\begin{array}{rcl} P_{1}^{g} - L_{ 1} = \frac{\delta _{1} -\delta _{2}} {0.1} + \frac{\delta _{1} -\delta _{3}} {0.2} & &{}\end{array}$$
(9.5a)
$$\displaystyle\begin{array}{rcl} P_{2}^{g} - L_{ 2} = \frac{\delta _{2} -\delta _{1}} {0.1} + \frac{\delta _{2} -\delta _{3}} {0.25} & &{}\end{array}$$
(9.5b)
$$\displaystyle\begin{array}{rcl} P_{3}^{g} - L_{ 3} = \frac{\delta _{3} -\delta _{2}} {0.25} + \frac{\delta _{3} -\delta _{1}} {0.2} & &{}\end{array}$$
(9.5c)

(9.4) can be written as: \(\left (\begin{array}{c} P_{1} \\ P_{2} \\ P_{3} \end{array} \right ) = \left (\begin{array}{ccc} 15 & - 10& - 5\\ - 10 & 14 & - 4 \\ - 5 & - 4 & 9 \end{array} \right ) = \left (\begin{array}{c} \delta _{1}\\ \delta _{ 2}\\ \delta _{3} \end{array} \right )\) where P i = P i gL i . Suppose \(B = \left (\begin{array}{ccc} 15 & - 10& - 5\\ - 10 & 14 & - 4 \\ - 5 & - 4 & 9 \end{array} \right )\) then we can have the relation between the bus angles and the net injections as a linear matrix form.

$$\displaystyle\begin{array}{rcl} P = B\delta & &{}\end{array}$$
(9.6)

In normal DC power flow, the P vector is known and the decision maker’s goal is to find the δ vector. The problem is that matrix B is singular and does not have a matrix inverse.

The good news is that the bus angle at slack bus is known to be zero. If the slack bus is bus 1 then we can have the following matrix form:

$$\displaystyle\begin{array}{rcl} \left (\begin{array}{c} P_{2} \\ P_{3} \end{array} \right ) = \left (\begin{array}{cc} 14 & - 4\\ - 4 & 9 \end{array} \right )\left (\begin{array}{c} \delta _{2}\\ \delta _{ 3} \end{array} \right )& &{}\end{array}$$
(9.7)

Now the matrix can be inversed as follows

$$\displaystyle\begin{array}{rcl} \left (\begin{array}{c} \delta _{2}\\ \delta _{ 3} \end{array} \right ) = \left (\begin{array}{cc} 14 & - 4\\ - 4 & 9 \end{array} \right )^{-1}\left (\begin{array}{c} P_{2} \\ P_{3} \end{array} \right ) = \left (\begin{array}{cc} 0.0818\mbox{ }&\mbox{ }0.0364\\ 0.0364\mbox{ } &\mbox{ } 0.1273 \end{array} \right )\left (\begin{array}{c} P_{2} \\ P_{3} \end{array} \right )& &{}\end{array}$$
(9.8)

We can write down (9.8) as a general form

$$\displaystyle\begin{array}{rcl} \delta _{\mathrm{red}} = X_{\mathrm{red}}P_{\mathrm{red}}& &{}\end{array}$$
(9.9)
$$\displaystyle\begin{array}{rcl} X_{\mathrm{red}} = B_{\mathrm{red}}^{-1}& &{}\end{array}$$
(9.10)

where B red is the B matrix after eliminating the row and column of slack bus. If the network has n buses then B red would be a square (n − 1) × (n − 1) matrix. For the rest of this chapter, whenever X appears in any equation it is representing X red.

Now we are about to investigate the impact of change in power injection in bus n on the line flow between bus i and bus j. The flow on line connecting bus i to bus j is calculated as follows:

$$\displaystyle\begin{array}{rcl} f_{ij} = \frac{\delta _{i} -\delta _{j}} {x_{ij}} & &{}\end{array}$$
(9.11)

Now we assume that any change in injected power at bus m will be compensated by the slack bus. In order to calculate the flow change in line ij we need to use the following equation:

$$\displaystyle\begin{array}{rcl} \varDelta f_{ij} = \frac{\varDelta \delta _{i} -\varDelta \delta _{j}} {x_{ij}} & &{}\end{array}$$
(9.12)

The value of x ij remains constant but the voltage angles would change if ΔP is happening at bus m (and −ΔP at slack bus). Referring to (9.9) we would have

$$\displaystyle{ \varDelta \delta = X\varDelta P }$$
(9.13)
$$\displaystyle{ \left (\begin{array}{c} \varDelta \delta _{2}\\ \varDelta \delta _{ 3}\\ \vdots\\ \varDelta \delta _{m}\\ \vdots \\ \varDelta \delta _{i}\\ \vdots\\ \varDelta \delta _{ j}\\ \vdots\\ \varDelta \delta _{ n-1}\\ \varDelta \delta _{n } \end{array} \right )_{n-1\times 1} = \left (\begin{array}{ccccc} X_{22} & \cdots & X_{2,n-1} & X_{2n} \\ X_{32} & \cdots & X_{3,n-1} & X_{3n}\\ \vdots & \ddots & \ddots & \vdots \\ X_{m2} & \cdots & X_{m,n-1} & X_{mn}\\ \vdots & \ddots & \ddots & \vdots \\ X_{i2} & \cdots & X_{i,n-1} & X_{in}\\ \vdots & \ddots & \ddots & \vdots \\ X_{j2} & \cdots & X_{j,n-1} & X_{jn}\\ \vdots & \ddots & \ddots & \vdots \\ X_{n-1,2} & \cdots &X_{n-1,n-1} & X_{n-1,n} \\ X_{n,2} & \cdots & X_{n,n-1} & X_{n,n} \end{array} \right )_{n-1\times n-1}\left (\begin{array}{c} 0\\ 0\\ \vdots \\ \varDelta P_{m}\\ \vdots \\ 0\\ \vdots\\ 0\\ \vdots \\ 0\\ 0\end{array} \right )_{n-1\times 1} }$$
(9.14)

The changes of voltage angles in bus i and j are calculated as follows:

$$\displaystyle\begin{array}{rcl} \varDelta \delta _{i} = X_{im}\varDelta P_{m}& &{}\end{array}$$
(9.15)
$$\displaystyle\begin{array}{rcl} \varDelta \delta _{j} = X_{jm}\varDelta P_{m}& &{}\end{array}$$
(9.16)
$$\displaystyle\begin{array}{rcl} \varDelta f_{ij} = \frac{X_{im}\varDelta P_{m} - X_{jm}\varDelta P_{m}} {x_{ij}} & &{}\end{array}$$
(9.17)

The (9.17) states that the sensitivity of the flow in line ij of power change in bus m is obtained as follows:

$$\displaystyle\begin{array}{rcl} a_{m}^{ij} = \frac{\varDelta f_{ij}} {\varDelta P_{m}} = \frac{X_{im} - X_{jm}} {x_{ij}} & &{}\end{array}$$
(9.18)

Using the (9.18) is useful in calculating the line flows in post-contingency period.

$$\displaystyle\begin{array}{rcl} f_{ij}^{\mathrm{post}} = f_{ ij}^{\mathrm{pre}} + a_{ m}^{ij}\varDelta P_{ m}& &{}\end{array}$$
(9.19)

If the post-contingency line flow at line ij after the failure of a generating unit at bus m (producing P m g MW) is to be calculated then the following equation can be used:

$$\displaystyle\begin{array}{rcl} f_{ij}^{\mathrm{post}} = f_{ ij}^{\mathrm{pre}} + a_{ m}^{ij}(-P_{ m}^{g})& &{}\end{array}$$
(9.20)

If the post-contingency line flow at line ij after the disconnection of load at bus m is to be calculated then the following equation can be used:

$$\displaystyle\begin{array}{rcl} f_{ij}^{\mathrm{post}} = f_{ ij}^{\mathrm{pre}} + a_{ m}^{ij}(L_{ m})& &{}\end{array}$$
(9.21)

Now let’s calculate the Generation Shift Factors (a m ij) for the network shown in Fig. 9.7.

The GCode 9.3 described the GAMS code for calculating the generation shift factors.

GCode 9.3 Generation Shift Factor Calculation

Sets bus  / 1 * 3 /  , slack ( bus ) /1/,Gen /g1 * g3 /, nonslack ( bus ) / 2 * 3 /  ; scalars   Sbase /100/ ;  a l i a s (bus, node, shin, knot );  a l i a s ( nonslack, nonslackj ); Table branch (bus, node, * )     Network technical  c h a r a c t e r i s t i c s                X     LIMIT stat 1    .     2    0.1   100   1 1    .     3    0.2   80    1 2    .     3    0.25 100   1; set conex (bus, node )        Bus connectivity  matrixl; conex (bus, node )$( branch (bus, node, ’x ’ ) )=yes; conex (bus, node ) $conex (node, bus )=yes; branch (bus, node, ’x ’ ) $branch (node, bus, ’x ’ )= branch (node, bus, ’x ’ ); branch (bus, node, ’ stat ’ ) $branch (node, bus, ’ stat ’ )= branch (node, bus, ’ stat ’ ); branch (bus, node, ’ Limit ’ )$( branch (bus, node, ’ Limit ’ )=0) = branch (node, bus, ’ Limit ’ ); branch (bus, node, ’ bij ’ ) $conex (bus, node ) =1/branch (bus, node, ’x ’ ); Parameter Bmatrix (bus, node ), Binv (bus, node ),Flow(bus, node );  Alias (bus, knot ); Bmatrix (bus, node )$( conex (node, bus ) )=− branch (bus, node, ’ bij ’ ); Bmatrix (bus, bus )= sum( knot$conex ( knot, bus ),−Bmatrix (bus, knot ) ); parameter Breduced ( nonslack, nonslackj ),GSHF(bus, node, knot ); Breduced ( nonslack, nonslackj )= Bmatrix ( nonslack, nonslackj ); parameter inva ( nonslack, nonslackj ) ’ inverse  of  a ’; execute_unload ’a. gdx ’, nonslack, Breduced; execute ’=invert. exe a. gdx nonslack Breduced b. gdx inva ’; execute_load ’b. gdx ’, inva; Binv ( nonslack, nonslackj )=inva ( nonslack, nonslackj ); GSHF(bus, node, knot ) $conex (bus, node )= branch (bus, node, ’ bij ’ ) * ( Binv (bus, knot ) −Binv (node, knot ) ); Display Bmatrix, Binv,GSHF;

The GCode 9.3 has no solve statement or variable. This is because no optimization is going to be done. First of all, the B matrix is calculated in GCode 9.3 as follows:

Parameter Bmatrix(bus,node);

Alias(bus,knot);

Bmatrix(bus,node)$conex(node,bus)=-branch(bus,node,’bij’);

Bmatrix(bus,bus)=sum(knot$conex(knot,bus),-Bmatrix(bus,knot));

This would calculate the Bmatrix as follows:

—- 68 PARAMETER Bmatrix

Table 2

Now we need to eliminate the row and column containing the slack bus. In order to do this, another parameter called Breduced is defined but over the non-slack bus set. This set is defined over all buses except the slack buses.

Parameter Breduced(nonslack,nonslackj);

Breduced(nonslack,nonslackj)=Bmatrix(nonslack,nonslackj);

Parameter inva(nonslack,nonslackj) ’inverse of a’;

execute_unload ’a.gdx’, nonslack, Breduced;

execute ’=invert.exe a.gdx nonslack Breduced b.gdx inva’;

execute_load ’b.gdx’, inva;

This would calculate the inverse matrix of the reduced B matrix.

—- 68 PARAMETER Binv

Table 3

Now all needed data for calculating the a m ij is available. The generation shift factors are calculated as follows:

Binv(nonslack,nonslackj)=inva(nonslack,nonslackj);

GSHF(bus,node,knot)$conex(bus,node)=branch(bus,node,’bij’)*(Binv (bus,knot)-Binv(node,knot));

Using the GCode 9.3, the generation shift factors are calculated as Table 9.2.

Table 9.2 Generator shift factors (a m ij) for three-bus network

The generation shift factors (GSHF) have the following interesting features as follows:

  • The procedure for calculating the GSHF does not involve any optimization

  • The values of GSHF can be calculated in advance and be used in real-time applications.

  • The values of GSHF do not depend on the loading condition of the network. These coefficients only depend on the network topology. If the network topology is changed (due to transmission outage or switching), GSHF should be recalculated.

  • The technique we used for calculating the GSHF is assuming that the changes at any bus are quickly compensated by the slack bus. In case the changes are compensated by multiple generating units then the calculation procedure would be slightly different [16].

  • The GSHF are also useful for understanding how to reduce the line loading. For example, suppose we need to reduce the flow at line 3 − 1. As we can see that bus 3 has the largest GSHF equal to 0.636. It means that if we can reduce the generation at bus 3, then a negative value will be added to the initial flow of line 3 − 1. If the initial flow from bus 3 to bus 1 is positive, then it would reduce.

Now let’s check the values obtained in Table 9.2. For this purpose, the base power flow is solved and is shown in Fig. 9.8. The values of line flow, as well as the voltage angles, are specified in this figure. Suppose it is desired to increase the flow on the line connecting the bus 3 to bus 2. The power flow on this line is f 32 0 = 2. 7 MW. Using the Table 9.2 states that a 2 32 = −0. 182 and a 3 32 = 0. 364. Let’s investigate the impact of changes in power injections in different buses on transmission lines.

Fig. 9.8
figure 8

The DC power flow solution for three-bus network

9.2.1.1 Demand Increase in L 2 by 10 MW

The demand in bus 2 is increased by 10 MW and the new line flows are depicted in Fig. 9.9. As it can be seen in this figure, the new line flow of line 3 − 2 is 4.5 MW. This is obtained using a GAMS code. Let’s calculate the new line flow using the Table 9.2. The new line flow is calculated as follows:

$$\displaystyle\begin{array}{rcl} f_{32}^{\mathrm{post}} = f_{ 32}^{\mathrm{pre}} + a_{ 2}^{32}(\varDelta P_{ 2}) = 0.027 - 0.182 {\ast} (-0.1) = 0.0452\text{ pu }& &{}\end{array}$$
(9.22)
$$\displaystyle\begin{array}{rcl} f_{12}^{\mathrm{post}} = f_{ 12}^{\mathrm{pre}} + a_{ 2}^{12}(\varDelta P_{ 2}) = -0.177 - 0.818 {\ast} (-0.1) = -0.0952\text{ pu }& &{}\end{array}$$
(9.23)
$$\displaystyle\begin{array}{rcl} f_{31}^{\mathrm{post}} = f_{ 31}^{\mathrm{pre}} + a_{ 2}^{31}(\varDelta P_{ 2}) = 0.123 + 0.182 {\ast} (-0.1) = 0.1048\text{ pu }& &{}\end{array}$$
(9.24)

It should be noted that the flow values as well as the change in power injection at bus 2 are expressed in pu. ΔP 2 is representing the change in bus injection at bus 2 which is − 10 MW or 0.1 pu. It can be observed that the results confirm what is obtained by solving the DC power flow as shown in Fig. 9.9.

Fig. 9.9
figure 9

The DC power flow solution for three-bus network after increasing the demand at bus 2 for 10 MW.

9.2.1.2 Generation Increase in P 3 g by 10 MW

The generation in bus 3 is increased by 10 MW and the new line flows are depicted in Fig. 9.10 which are obtained using a GAMS code. Let’s calculate the new line flow using the GSHF in Table 9.2. The new line flow is calculated as follows:

$$\displaystyle\begin{array}{rcl} f_{32}^{\mathrm{post}} = f_{ 32}^{\mathrm{pre}} + a_{ 3}^{32}(\varDelta P_{ 3}) = 0.027 + 0.364 {\ast} (0.1) = -0.0634\text{ pu }& &{}\end{array}$$
(9.25)
$$\displaystyle\begin{array}{rcl} f_{12}^{\mathrm{post}} = f_{ 12}^{\mathrm{pre}} + a_{ 3}^{12}(\varDelta P_{ 3}) = -0.177 + 0.364 {\ast} (0.1) = -0.2134\text{ pu }& &{}\end{array}$$
(9.26)
$$\displaystyle\begin{array}{rcl} f_{31}^{\mathrm{post}} = f_{ 31}^{\mathrm{pre}} + a_{ 3}^{31}(\varDelta P_{ 3}) = 0.123 + 0.636 {\ast} (0.1) = 0.1866\text{ pu }& &{}\end{array}$$
(9.27)
Fig. 9.10
figure 10

The DC power flow solution for three-bus network after increasing the generation at bus 3 for 10 MW.

9.2.2 Line Outage Distribution Factors

The impact of line outages on power flow of other lines is investigated in this section. Consider the line connecting the bus n and m as shown in Fig. 9.11. In Fig. 9.11a, the intact network is shown. We need to find out the impact of the line outage of the branch connecting bus n to bus m on the rest of the network. Suppose the flow of this line is initially equal to f nm 0. The power from the rest of the network injected to bus n is equal to power absorption from bus m to the rest of network when no contingency has happened. We need to find a way to make these flows equal to zero. It is done using a very smart trick [17]. If we add two injections to the network: + ΔP n at bus n and another one equal to −ΔP n at bus m the flow on the line nm would change as shown in Fig. 9.11b. The question is what is the new flow on this line? The change of flow on line nm can be easily calculated using the following equation:

$$\displaystyle\begin{array}{rcl} \varDelta f_{nm} = \frac{\varDelta \delta _{n} -\varDelta \delta _{m}} {x_{nm}} = \frac{X_{nn}\varDelta P_{n} + X_{nm}(-\varDelta P_{n}) - (X_{mn}\varDelta P_{n} + X_{mm}(-\varDelta P_{n}))} {x_{nm}} & &{}\end{array}$$
(9.28)

This means that

$$\displaystyle\begin{array}{rcl} \varDelta f_{nm} = \frac{X_{nn} + X_{mm} - 2 {\ast} X_{nm}} {x_{nm}} \varDelta P_{n}& &{}\end{array}$$
(9.29)

Now the post-contingency line flow is calculated as follows:

$$\displaystyle\begin{array}{rcl} f_{nm}^{\mathrm{post}} = f_{ nm}^{0} +\varDelta f_{ nm}& &{}\end{array}$$
(9.30)

If the virtual injection to the grid ΔP n is carefully chosen then f nm post = ΔP n . This makes the flow from the rest of the network to bus n and m equal to zero (line outage).

$$\displaystyle\begin{array}{rcl} \varDelta P_{n} = f_{nm}^{\mathrm{post}} = f_{ nm}^{0} +\varDelta f_{ nm}& &{}\end{array}$$
(9.31)
Fig. 9.11
figure 11

Line outage modeling using virtual injections. (a) Intact network. (b) Post-contingency network

Combining the (9.29) with (9.31) gives us:

$$\displaystyle\begin{array}{rcl} & & \varDelta P_{n} = f_{nm}^{0} + \frac{X_{nn} + X_{mm} - 2X_{nm}} {x_{nm}} \varDelta (P_{n}) \\ & & \varDelta P_{n}\left (1 -\frac{X_{nn} + X_{mm} - 2X_{nm}} {x_{nm}} \right ) = f_{nm}^{0} \\ & & \varDelta P_{n} = \frac{f_{nm}^{0}} {\left (1 -\frac{X_{nn}+X_{mm}-2X_{nm}} {x_{nm}} \right )} {}\end{array}$$
(9.32)

Now the change in power flow in line ij is calculated as follows:

$$\displaystyle\begin{array}{rcl} \varDelta f_{ij} = \frac{\varDelta \delta _{i} -\varDelta \delta _{j}} {x_{ij}} = \frac{X_{in}\varDelta P_{n} + X_{im}(-\varDelta P_{n}) - (X_{jn}\varDelta P_{n} + X_{jm}(-\varDelta P_{n}))} {x_{ij}} & &{}\end{array}$$
(9.33)
$$\displaystyle\begin{array}{rcl} \varDelta f_{ij} = \frac{X_{in} - X_{im} - X_{jn} + X_{jm}} {x_{ij}} \varDelta P_{n}& &{}\end{array}$$
(9.34)
$$\displaystyle\begin{array}{rcl} \mathrm{LODF}_{ij,nm} = \frac{\varDelta f_{ij}} {f_{nm}^{0}} = \frac{X_{in} - X_{im} - X_{jn} + X_{jm}} {x_{ij}(1 -\frac{X_{nn}+X_{mm}-2X_{nm}} {x_{nm}} )} & &{}\end{array}$$
(9.35)

The GCode 9.4 is developed to calculate the Line outage distribution factors for the network shown in Fig. 9.7.

GCode 9.4 Line outage distribution factor calculation

Sets bus  / 1 * 3 /  , slack ( bus ) /1/, Gen /g1 * g3 /, nonslack ( bus ) / 2 * 3 /  ; Scalars   Sbase /100/ ; Alias (bus, node, shin, knot ); Alias ( nonslack, nonslackj ); Table branch (bus, node, * )     Network technical  c h a r a c t e r i s t i c s                X     LIMIT stat 1    .     2    0.1   100   1 1    .     3    0.2   80    1 2    .     3    0.25 100   1; Set conex (bus, node )        Bus connectivity  matrixl; conex (bus, node )$( branch (bus, node, ’x ’ ) )=yes; conex (bus, node ) $conex (node, bus )=yes; branch (bus, node, ’x ’ ) $branch (node, bus, ’x ’ )= branch (node, bus, ’x ’ ); branch (bus, node, ’ stat ’ ) $branch (node, bus, ’ stat ’ )= branch (node, bus, ’ stat ’ ); branch (bus, node, ’ Limit ’ )$( branch (bus, node, ’ Limit ’ )=0) = branch (node, bus, ’ Limit ’ ); branch (bus, node, ’ bij ’ ) $conex (bus, node ) =1/branch (bus, node, ’x ’ ); Parameter Bmatrix (bus, node ), Binv (bus, node ); Alias (bus, knot ); Bmatrix (bus, node )$( conex (node, bus ) )=− branch (bus, node, ’ bij ’ ); Bmatrix (bus, bus )= sum( knot$conex ( knot, bus ),−Bmatrix (bus, knot ) ); parameter Breduced ( nonslack, nonslackj ),GSHF(bus, node, knot ),X0(bus, node ); Breduced ( nonslack, nonslackj )= Bmatrix ( nonslack, nonslackj ); Parameter inva ( nonslack, nonslackj ) ’ inverse  of  a ’, Dfactor (bus, node, knot, shin ), contingency (bus, node, knot, shin ); execute_unload ’a. gdx ’, nonslack, Breduced; execute ’=invert. exe a. gdx nonslack Breduced b. gdx inva ’; execute_load ’b. gdx ’, inva; Binv ( nonslack, nonslackj )=inva ( nonslack, nonslackj ); GSHF(bus, node, knot ) $conex (bus, node )= branch (bus, node, ’ bij ’ ) * ( Binv (bus, knot ) −Binv (node, knot ) ); dfactor (bus, node, knot, shin )$( conex (bus, node ) and  conex ( knot, shin ) and ( ord ( bus ) >ord ( node ) ) and ( ord ( knot ) >ord ( shin ) ) and ( ord ( bus ) <>ord ( knot ) or  ord ( node ) <>ord ( shin ) ) )= branch (bus, node, ’ bij ’ ) * ( Binv (bus, knot ) −Binv (bus, shin ) −Binv (node, knot ) + Binv (node, shin ) )/(1−branch ( knot, shin, ’ bij ’ ) * ( Binv ( knot, knot ) + Binv ( shin, shin ) −2* Binv ( knot, shin ) ) ); Display Bmatrix, Binv,GSHF, dfactor;

Line outage distribution factors (LODF ij, nm ) are described in Table 9.3.

Table 9.3 Line outage distribution factors (LODF ij, nm ) for three-bus network

The branch data for IEEE RTS 24-bus network is provided in Table 9.4. The LODF and GSF coefficients are calculated for IEEE RTS 24-bus (Fig. 9.12) and are given in Tables 9.5 and 9.6, respectively.

Fig. 9.12
figure 12

IEEE RTS 24-bus network

Table 9.4 Branch data for IEEE RTS 24-bus network
Table 9.5 LODF12, calculated for IEEE RTS 24-bus network
Table 9.6 GSHF , m calculated for IEEE RTS 24-bus network

9.3 Transmission Network Switching

The idea of optimal transmission switching (OTS) has been broadly investigated in the literature [18]. Opening a set of transmission lines would change the network topology and the line flow patterns. This can be used to relieve the line congestion in the system and reduce the operating costs. Some research works which used the transmission switching as a flexibility tool are listed as follows:

  • DC-OPF considering N − 1 contingencies [19]

  • Co-optimization of unit commitment and transmission switching with N − 1 reliability constraints [20]

  • Robust transmission switching considering Nk contingencies [21]

  • Optimal transmission switching considering short-circuit current limitation constraints [22]

  • Probabilistic security analysis of OTS [23]

  • Chance-constrained OTS with guaranteed wind power utilization [24]

  • Heuristics OTS based on DC-OPF and AC-OPF [25]

In this section, the OTS is solved using GAMS and then we will discuss how this model can be improved and extended. The transmission switching problem is formulated as a MIP model in (9.36).

$$\displaystyle\begin{array}{rcl} \mathrm{OF} =\sum _{g\in \varOmega _{G}}b_{g}P_{g}& &{}\end{array}$$
(9.36a)
$$\displaystyle\begin{array}{rcl} P_{ij} - B_{ij}(\delta _{i} -\delta _{j}) \leq (1 -\zeta _{ij})M& &{}\end{array}$$
(9.36b)
$$\displaystyle\begin{array}{rcl} P_{ij} - B_{ij}(\delta _{i} -\delta _{j}) \geq -(1 -\zeta _{ij})M& &{}\end{array}$$
(9.36c)
$$\displaystyle\begin{array}{rcl} \sum _{g\in \varOmega _{G}^{i}}P_{g} + \mathrm{LS}_{i} - L_{i} =\sum _{j\in \varOmega _{\ell}^{i}}P_{ij}:\lambda _{i}\ \ \ i \in \varOmega _{B}& &{}\end{array}$$
(9.36d)
$$\displaystyle\begin{array}{rcl} -P_{ij}^{\max \nolimits }\zeta _{ ij} \leq P_{ij} \leq P_{ij}^{\max \nolimits }\zeta _{ ij}\ \ \ ij \in \varOmega _{\ell}& &{}\end{array}$$
(9.36e)
$$\displaystyle\begin{array}{rcl} P_{g}^{\min \nolimits } \leq P_{ g} \leq P_{g}^{\max \nolimits }& &{}\end{array}$$
(9.36f)
$$\displaystyle\begin{array}{rcl} \sum _{ij}(1 -\zeta _{ij}) \leq N_{\mathrm{sw}}\ \ \ ij \in \varOmega _{\ell}& &{}\end{array}$$
(9.36g)
$$\displaystyle\begin{array}{rcl} B_{ij} = \frac{1} {x_{ij}}& &{}\end{array}$$
(9.36h)
$$\displaystyle\begin{array}{rcl} \zeta _{ij} \in \left \{0,1\right \}& &{}\end{array}$$
(9.36i)

where ζ ij is the on/off state of the branch connecting bus i to bus j, and N sw is the number of allowed switching actions in the network.

The operating and congestion cost vs number of switched lines in IEEE 118-bus network (Fig. 9.13) are depicted in Fig. 9.14. The GAMS code for solving the (9.36) is provided in GCode 9.5.

Fig. 9.13
figure 13

IEEE 118-bus network

Fig. 9.14
figure 14

The operating and congestion cost vs number of switched lines in IEEE 118-bus network

GCode 9.5 The OTS GAMS code for IEEE 118-bus network

Sets bus /1*118/,  slack ( bus ) /13/, conex (bus, node ), GenNo /Gen1 * Gen54/, counter /c0 * c10 /; Scalars     Sbase /100/; Alias (bus, totalbus, node ); Table GenDatanew(bus,GenNo, * )                 b       pmin pmax ; Table BusData(bus, * )  buss c h a r a c t e r i s t i c s           Pd ; Table branch (bus, totalbus, * )                x       Ilim ; branch (bus, totalbus, ’ bij ’ ) $branch ( totalbus, bus, ’x ’ ) =1/branch (bus, totalbus, ’x ’ ); conex (bus, node ) $branch (bus, node, ’x ’ )=yes; parameter branch (bus, totalbus, * ),M,NSW, report ( counter, * ); M = smax (( bus, node ) $conex (bus, node ), branch (bus, node, ’ bij ’ ) * 2 * pi/3); Positive  variable  Pg(GenNo); Variables  Pij (bus, node ), delta ( bus ),ROF; BINARY  VARIABLE  SW (bus, node ); Equations const0, const1, const2, const3, const0A, const0B, const0C, const0D, const0E, const0F; const0 (bus, node ) $conex (bus, node ) ..  Pij (bus, node )= e = branch (bus, node, ’ bij ’ ) * ( delta ( bus ) −delta ( node ) ); const1 ( bus )..  sum(GenNo$GenDatanew(bus,GenNo, ’Pmax ’ ),Pg(GenNo) ) − BusData(bus, ’Pd ’ )/ sbase= e =+ sum( node$conex (node, bus ), Pij (bus, node ) ); const2     ..  ROF = g =  sum((GenNo, bus )$GenDatanew(bus,GenNo, ’Pmax ’ ), GenDatanew(bus,GenNo, ’b ’ ) * Pg(GenNo) * Sbase ); const0A (bus, node ) $conex (bus, node ).. Pij (bus, node ) −branch (bus, node, ’ bij ’ ) * ( delta ( bus ) −delta ( node ) )=l=  M *(1 − SW (bus, node ) ); const0B (bus, node ) $conex (bus, node ).. Pij (bus, node ) −branch (bus, node, ’ bij ’ ) * ( delta ( bus ) −delta ( node ) )= g =− M *(1 − SW (bus, node ) ); const0C (bus, node ) $conex (bus, node ).. Pij (bus, node )=l=  SW (bus, node ) * branch (bus, node, ’ Ilim ’ ); const0D (bus, node ) $conex (bus, node ).. Pij (bus, node )= g =− SW (bus, node ) * branch (bus, node, ’ Ilim ’ ); const0E (bus, node ) $conex (bus, node )..SW (node, bus )= e = SW (bus, node ); const0F (bus, node ) $conex (bus, node ).. Pij (node, bus )= e =−Pij (bus, node ); const3 ..    0. 5 * sum(( bus, node ) $conex (bus, node ),1− SW (bus, node ) )=l= NSW; model BASE  /const0, const1, const2 /; model Switching/const1, const2, const0A, const0B, const0C,                                           const0D, const0E, const0F, const3 /; Option  Optca=0; Option  Optcr=0; BusData(bus, ’Pd ’ ) =1.1* BusData(bus, ’Pd ’ ); Pg. lo (GenNo)= sum(bus, GenDatanew(bus,GenNo, ’Pmin ’ ) )/Sbase; Pg. up(GenNo)= sum(bus, GenDatanew(bus,GenNo, ’Pmax ’ ) )/Sbase; delta. up( bus )= pi/3;  delta. lo ( bus )=− pi/3;  delta. l ( bus ) =0; delta. fx ( slack ) =0; Pij. up(bus, node ) $conex (bus, node )=  1 * branch (bus, node, ’ Ilim ’ ); Pij. lo (bus, node ) $conex (bus, node )=−1*branch (bus, node, ’ Ilim ’ ); Solve BASE  minimizing ROF  using lp; SW. l (bus, node ) =1; report ( ’ c0 ’, ’OF’ )= ROF. l; report ( ’ c0 ’, ’ NSW’ ) =0.5*sum(( bus, node ) $conex (bus, node ),1− SW. l (bus, node ) ); report ( ’ c0 ’, ’ Congestion ’ ) =0.5*sum(( bus, node ) $conex (bus, node ), (−const1.m ( bus )+const1.m ( node ) ) * Pij. l (bus, node ) ); loop ( counter $( ord ( counter )>1), NSW = ord ( counter ) −1; Solve switching minimizing ROF  using mip; report ( counter, ’OF’ )= ROF. l; report ( counter, ’ NSW’ ) =0.5*sum(( bus, node ) $conex (bus, node ),1− SW. l (bus, node ) ); report ( counter, ’ Congestion ’ ) =0.5*sum(( bus, node ) $conex (bus, node ),                           (−const1.m ( bus )+const1.m ( node ) ) * Pij. l (bus, node ) ); );

Increasing the demand in a given area or bus (or equivalently losing the generation) might cause congestion and increasing the total operating costs. The OTS can be used to enhance the grid utilization and reduce the line congestions. A simple analysis is conducted as follows:

  • The demand at bus i is increased for 20 MW.

  • The DC OPF is solved without considering the transmission switching option (LP model).

  • The DC OPF along with transmission switching option is solved (MIP model).

The comparison of the total operating costs between the with/without transmission switching cases are shown in Fig. 9.15. The impact of connecting a new demand to different buses would cause different changes in total operating costs. In all cases, using the transmission switching flexibility can reduce the operating costs as shown in Fig. 9.15.

Fig. 9.15
figure 15

The operating cost vs the connection point of new demand (20 MW) in with/without transmission switching cases

Using the transmission switching might change the LMP values at different buses. The LMP values (λ i ) in $/MW h at different buses in with/without transmission switching cases. As it is shown in Fig. 9.16, when no switching is allowed (N sw = 0) then the LMP values of switching and not switching cases are the same. By increasing the number of switchable lines, the LMP values get closer to each other. The generation and branch data of IEEE 118 bus are given in Tables 9.7 and 9.8, respectively.

Table 9.7 Generation data for 118-bus network
Fig. 9.16
figure 16

The LMP values (λ i ) in ($/MW h) at different buses in with/without transmission switching cases

Table 9.8 Branch data for 118-bus network

The developed GAMS code for OTS can be improved to consider the following issues:

  • The model should be multi-period. The OTS should consider the variation pattern of demand and then determine the optimal switching actions.

  • The uncertainty of demand and renewable power generation should be taken into account.

  • The current formulation does not ensure the network connectivity. It only tries to satisfy the nodal demand-supply constraint. The resultant system (after switching) might contain some islands.

  • The computation burden of the model should be improved to make it applicable for large scale transmission networks.

  • The AC power flow constraints should be used for getting closer to reality.

  • The unit commitment constraints can be added to the formulation to consider the on/off states of the units as the decision variables.

  • Changing the transmission network topology might change the short circuit level on each bus. This should be taken into account for protection issues.

  • The current model only considers the intact condition of the network. The contingencies should also be considered.

  • The OTS flexibility can be combined with demand response and power flow controller devices.

  • The bus splitting can be regarded as a switching action.