Optimal control of compressor stations in a coupled gas-to-power network
Eike Fokken, Simone G\"ottlich, Oliver Kolb

TL;DR
This paper presents a simulation and optimization tool for coupled gas pipeline and power grid networks, modeling gas flow with Euler equations and power with AC equations, highlighting operator responses to demand changes.
Contribution
It introduces a combined gas and power network model with compressor control, integrating gas dynamics and power flow for improved operational analysis.
Findings
Fast power demand changes impact gas pipeline pressures.
Compressor stations are crucial for maintaining pressure bounds.
Operator actions are necessary during rapid demand fluctuations.
Abstract
We introduce a tool for simulation and optimization of gas pipeline networks coupled to power grids by gas-to-power plants. The model under consideration consists of the isentropic Euler equations to describe the gas flow coupled to the AC powerflow equations. A compressor station is installed to control the gas pressure such that certain bounds are satisfied. A numerical case study is presented that showcases effects of fast changes in power demand on gas pipelines and necessary operator actions.
| Pipe | From | To | Length [km] |
|---|---|---|---|
| P10 | S4 | S20 | 20.322 |
| P20 | S5 | S0 | 20.635 |
| P21 | S17 | S4 | 10.586 |
| P22 | S17 | S8 | 10.452 |
| P24 | S8 | S20 | 19.303 |
| P25 | S20 | S25 | 66.037 |
| Node | ||
|---|---|---|
| N1 | 0.0000 | -17.3611 |
| N2 | 0.0000 | -16.0000 |
| N3 | 0.0000 | -17.0648 |
| N4 | 3.3074 | -39.3089 |
| N5 | 3.2242 | -15.8409 |
| N6 | 2.4371 | -32.1539 |
| N7 | 2.7722 | -23.3032 |
| N8 | 2.8047 | -35.4456 |
| N9 | 2.5528 | -17.3382 |
| Node | ||
|---|---|---|
| N1 | 0.0000 | -17.3611 |
| N2 | 0.0000 | -16.0000 |
| N3 | 0.0000 | -17.0648 |
| N4 | 3.3074 | -39.3089 |
| N5 | 3.2242 | -15.8409 |
| N6 | 2.4371 | -32.1539 |
| N7 | 2.7722 | -23.3032 |
| N8 | 2.8047 | -35.4456 |
| N9 | 2.5528 | -17.3382 |
| Edge | From | To | ||
|---|---|---|---|---|
| TL14 | N1 | N4 | 0.0000 | 17.3611 |
| TL45 | N4 | N5 | -1.9422 | 10.5107 |
| TL56 | N5 | N6 | -1.2820 | 5.5882 |
| TL36 | N3 | N6 | 0.0000 | 17.0648 |
| TL67 | N6 | N7 | -1.1551 | 9.7843 |
| TL78 | N7 | N8 | -1.6171 | 13.6980 |
| TL82 | N8 | N2 | 0.0000 | 16.0000 |
| TL89 | N8 | N9 | -1.1876 | 5.9751 |
| TL94 | N9 | N4 | -1.3652 | 11.6041 |
| Node | ||||
|---|---|---|---|---|
| N1 | - | - | 1 | 0 |
| N2 | 163 | - | 1 | - |
| N3 | 85 | - | 1 | - |
| N4 | 0 | 0 | - | - |
| N5 | -90 | -30 | - | - |
| N6 | 0 | 0 | - | - |
| N7 | -100 | -35 | - | - |
| N8 | 0 | 0 | - | - |
| N9 | -125 | -50 | - | - |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
∎
11institutetext: Eike Fokken 22institutetext: University of Mannheim
22email: [email protected] 33institutetext: Simone Göttlich 44institutetext: University of Mannheim
44email: [email protected] 55institutetext: Oliver Kolb 66institutetext: University of Mannheim
66email: [email protected]
Optimal control of compressor stations in a coupled gas-to-power network††thanks: The authors gratefully thank the BMBF project ENets (05M18VMA) for the financial support.
Eike Fokken
Simone Göttlich
Oliver Kolb
Abstract
We introduce a tool for simulation and optimization of gas pipeline networks coupled to power grids by gas-to-power plants. The model under consideration consists of the isentropic Euler equations to describe the gas flow coupled to the AC powerflow equations. A compressor station is installed to control the gas pressure such that certain bounds are satisfied. A numerical case study is presented that showcases effects of fast changes in power demand on gas pipelines and necessary operator actions.
Keywords:
Coupling of gas and power networks compressor stations optimal control
MSC:
76N15 65M08 49J20
1 Introduction
Renewable power sources have an ever increasing share of all power sources. Though renewable energy has been developed in recent years with great success, its intermittent and unpredictable nature raises the difficulty to balance the energy production and consumption Gahleitner2013 ; ZengFangLiChen2016 . A frequent proposal is to use gas turbine plants to compensate for sudden drops in power of renewable sources because these plants are relatively flexible in comparison to coal or nuclear plants. A welcome advantage of this approach is the possibility to run gas plants with fuel produced from renewable electricity via power-to-gas plants, thereby reducing or even negating carbon emissions of the gas plants. For a review of power-to-gas capability see Gahleitner2013 .
It is desirable to have a joint optimal control framework for power and gas sector of the energy system to model this compensation. So far only steady-state flow in the gas network has been considered CHERTKOV2015541 ; ZengFangLiChen2016 ; Zlotnik2016 , which may be too coarse for several applications. Therefore, we focus on an optimal control strategy for the instationary gas network model banda_herty_klar coupled to a power grid Bienstock via compressor stations, see for example Herty2007 ; Mak2018 ; CompressorModels2017 . The mathematical foundation for the gas-to-power coupling has been recently introduced in fokken_goettlich_kolb , where conditions for the well-posedness have been derived and proved. This work is the first attempt to model this interaction and yields an understanding of the underlying equations. The next step will be real-world scenarios.
2 Optimal control problem
The gas dynamics within each pipeline of the considered gas networks are modeled by the isentropic Euler equations, supplemented with suitable coupling and boundary conditions. For the power grid, we apply the well-known powerflow equations. The coupling between gas and power networks at gas-driven power plants is modeled by (algebraic) demand-dependent gas consumption terms. To react on the demand-dependent influences on the gas network, controllable devices as compressor stations are considered within the gas network. The aim is to fulfill given state restrictions like pressure bounds whereas at the same time the entire fuel gas or power consumption of the compressor stations is to be minimized.
The network under consideration is similar to the one presenetd in fokken_goettlich_kolb and is depicted in Figure 1. In addition, there is now a compressor with a time-dependent control , which is used to satisfy pressure bounds. The optimal control problem is to minimize compressor costs while satisfying power demand and gas dynamics:
[TABLE]
Mathematically, this is an instationary nonlinear optimization problem constrained by partial differential equations, see Hinze2009 for an overview. To solve the problem, we make use of a first-discretize-then-optimize approach and apply the interior point solver IPOPT Ipopt . The necessary gradient information for IPOPT, i.e., gradients with respect to all controllable devices, is efficiently computed via adjoint equations. Here, the underlying systems can be solved time-step-wise (backwards in time), where additionally the sparsity structure is exploited.
We remark that the cost function is given in Subsection 2.3, while the bounds on the pressure are introduced as box constraints within the numerical optimization procedure in Section 3. Within the Subsections 2.1–2.5, we now describe the constraints of the optimal control problem in detail and focus on the technical details.
2.1 The isentropic Euler equations
The gas network is modeled by the isentropic Euler equations (see Colombo2008 ; banda_herty_klar ), which govern gas flow in each pipeline between nodes,
[TABLE]
where is the density, is the flow, is the pressure function. In our example we use and , that is, the isothermal Euler equations with speed of sound . The Euler equations must be met for and , where is the length of the pipe. Furthermore, is a source term,
[TABLE]
where is the solution to the Prandtl-Colebrook formula,
[TABLE]
The Reynolds number is given by
[TABLE]
with dynamic viscosity
[TABLE]
The roughness and diameter of the pipes are all the same in our example and given by
[TABLE]
2.2 Coupling at gas nodes
At the nodes we use the usual Kirchhoff-type coupling conditions: The pressure is the same near the node in all pipes connected to it and the flows must add up to zero (where the sign for inflow is positive, the sign for outflow negative),
[TABLE]
The example gas network we are using is a small part of the GasLib-40 network Humpola_et_al:2015 . In Table 1 the only remaining parameter, the length of each pipe, is gathered. Note that no length is given for the arc connecting S[math] and S, because only a compressor is situated between these nodes.
2.3 Compressor stations
To compensate for pressure losses in the gas network, we consider compressor stations, which are also modelled as arcs. Those arcs have (time-dependent) in- and outgoing pressure (, ) and flux values (, ). In general, the two separate flux values allow the modelling of fuel gas consumption of the compressor station, whereas we will consider an external power supply for the compressor and therefore have . The power consumption is modelled as a quadratic function of the power required for the compression process. Denoting this as function , our objective function in the optimal control problem is of the form
[TABLE]
Note that the power consumption does not influence the network dynamics and is therefore only of interest for the optimization procedure. For our investigations below it is sufficient to know that the consumption and therewith the costs increase if the ratio increases. For the details of the power consumption model, we refer to (CompressorModels2017, , Section 3.2.3). The influence of the compressor station on the network dynamics is modelled by the control of the pressure difference:
[TABLE]
2.4 Power model
For the power grid we use the AC powerflow equations (see grainger2016power for an introduction),
[TABLE]
where , are real and reactive power at node , is the voltage amplitude, is the phase (and ) and , are parameters of the transmission lines between nodes and or of the node for and . Each node is either the slack bus (in our case N; and given), a generator bus (N and N; and given) or a load bus (N through N; and given). All in all for nodes we get equations for variables.
The considered power grid is taken from the example “case9” of the MATPOWER Matlab programming suite MATPOWER . A per-unit system is used, whose base power and voltage are 100MW and 345kV respectively. The corresponding node and transmission line parameters are gathered in Table 2, these are the entries of the nodal admittance matrix (see grainger2016power ).
2.5 Coupling
The last ingredient is a model for converting gas to power at a gas power plant. In our example, it will be situated between the nodes S and N and convert a gas flow into a real power output according to
[TABLE]
The flow must be diverted from the pipeline network, hence the coupling condition at node S must be changed to
[TABLE]
The details of simulation of such a combined network and the treatment of all arising mathematical issues can be found in fokken_goettlich_kolb . We now showcase a concrete example.
3 Numerical results
3.1 Problem setup
As already noted, we consider a small part of the GasLib-40 network from [2] consisting of 7 pipelines with a total length of 152km. This network is extended by a compressor station and additionally connected to a power grid with 9 nodes by a gas-to-power generator. For this coupled gas-power network, we simulate a sudden increase in power demand within the power grid and study its effect on the gas network. The considered compressor station is supposed to compensate part of the pressure losses in the gas network such that a given pressure bound is satisfied all the time, while power consumption of the compressor is minimized.
To complete the problem description, the following initial and boundary conditions are given:
- •
and at load nodes,
- •
and at generator nodes,
- •
and at the slack bus,
- •
at S,
- •
at S,
- •
, for all pipelines.
More precisely, the initial conditions for the power network are given in Table 3. These remain constant over time except for the power demand at node N, which changes linearly between hour and hours from p.u. to p.u. for the real power and from p.u. to p.u. for the reactive power, see also Figure 2.
For the gas network the incoming pressure at S is fixed at 60bar, the outflow at S is fixed at , where and . The fuel consumption parameters we use in equation (5) are given by , , . Since the data for the considered gas and power networks are taken from different sources, the parameters of the gas-to-power generator are chosen in such a way that a significant influence is caused.
Further, the pressure at S is supposed to satisfy a lower pressure bound of bar, i.e.,
[TABLE]
for all times , where we consider a time horizon of hours.
As we will see below, the compressor station between nodes S0 and S17 will have to run at a certain time, i.e., , to keep this pressure bound. In general, a solution to the described optimal control problem consists of the control and the entire network state for all times , i.e.,
- •
, , , for all nodes in the power grid,
- •
, for all pipelines in the gas network,
fulfilling the given model equations and the pressure constraint.
3.2 Discretization and Optimization Schemes
To solve the described optimal control problem, we follow a first-discretize-then-optimize approach. The model equations of the power grid only require a discretization in time, which means that the given boundary conditions and the powerflow equations (4) hold for discrete times with minutes and in our scenario. The discretization of the isentropic Euler equations within the pipelines of the gas network additionally requires a spatial grid (here with grid sizes km) and an appropriate discretization scheme. Here we apply an implicit box scheme KolbLangBales2010 , which allows the application of large time steps as minutes for the considered spatial grid. Considering the isentropic Euler equations as a system of balance laws of the form
[TABLE]
the applied scheme reads
[TABLE]
The numerical approximation of the balance law is thought in the following sense:
[TABLE]
Together with the algebraic equations modelling the compressor station and the coupling and boundary conditions, the discretization process results in a system of nonlinear equations for all state variables of the coupled gas-power network. For simulation purposes, the entire discretized system is solved with Newton’s method. Note that the system can be solved time-step per time-step and that we exploit the sparsity structure of the underlying Jacobian matrices.
So far we can only compute the state of the considered gas-power network (for a given compressor control ) and evaluate quantities of interest like the power consumption of the compressor station or the pressure constraint within the time horizon of the simulation. For the given time discretization, the compressor costs (3) are approximated by the trapezoidal rule and formally contained in below. Next, we want to solve the (discretized) optimal control problem, i.e., to find control values such that the pressure constraint is satisfied, while the power consumption of the compressor is minimized. For this purpose, we apply the interior point optimization code IPOPT Ipopt to the (reduced) discretized optimal control problem. In addition to our simulation procedure to evaluate quantities of interest for a given control, IPOPT further requires gradient information of those quantities with respect to the control. Based on the considered discretization, such information can be efficiently computed by an adjoint approach, which we briefly describe in the following. Therefore, we consider the discretized optimal control problem in the following abstract form:
[TABLE]
The vector contains all control variables (here the compressor control for all times ) and contains all state variables of the coupled gas-power network of all time steps . The mapping is implicitly given by our simulation procedure. Thus, IPOPT does not have to care about the model equations formally summarized in , but only about the further constraints and minimizing the objective function . Accordingly, we need to provide total derivatives of and with respect to .
In the following, we consider the computation of these derivatives only for the objective function, since the procedure is identical for the constraints, and we follow the description given in KolbGoettlich2015 . First of all, the chain rule yields
[TABLE]
While the partial derivatives of with respect to and can be directly computed, the derivatives of the states with respect to the control are only implicitly given. Differentiating the model equations yields
[TABLE]
and therewith (formally)
[TABLE]
Even though the partial derivatives on the right-hand-side of (8) can be directly computed, one would have to solve systems of linear equations here. Instead of that, we insert (8) into (7) and get
[TABLE]
With the so-called adjoint state as the solution of the adjoint equation
[TABLE]
we finally have
[TABLE]
It is the fact that (9) is a single linear system and has a special structure, which can be easily exploited (see for instance DissKolb ; KolbLang2012 ), which makes the computation of derivatives via the presented adjoint approach very efficient. Nevertheless note that for given control variables one still has to solve the model equations to get , before one may compute the gradient information via (9) and (10).
3.3 Results
We first discuss the simulation with inactive compressor. In the course of the simulation, due to the increase in power demand at node N, the power demand at the slack bus rises as well and leads to increased fuel demand at node S. This increases the inflow into the gas network, as can be seen in Figure 3. Also the pressure in the final node S decreases and violates the pressure bound after approximately 4 hours, see Figure 4.
After the optimization procedure, the compressor station compensates part of the pressure losses in the gas network such that the pressure bound is satisfied all the time. Since the power consumption of the compressor station is minimized within the optimization, the pressure constraint is active after roughly 4 hours (see again Figure 4), i.e., the compressor station applies as little as possible energy.
4 Conclusion
The proposed optimization model allows to predict pressure transgressions within a coupled gas-to-power framework. Simulation and optimization tasks are efficiently solved by exploiting the underlying nonlinear problem structure while keeping the full transient regime. This makes it possible to track bounds much more accurately than with a steady state model, thereby achieving lower costs.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1(1) M. Banda, M. Herty, and A. Klar , Gas flow in pipeline networks , Networks & Heterogeneous Media, 1 (2006), pp. 41–56.
- 2(2) D. Bienstock , Electrical Transmission System Cascades and Vulnerability , Society for Industrial and Applied Mathematics, Philadelphia, PA, 2015.
- 3(3) M. Chertkov, S. Backhaus, and V. Lebedev , Cascading of fluctuations in interdependent energy infrastructures: Gas-grid coupling , Applied Energy, 160 (2015), pp. 541 – 551.
- 4(4) R. Colombo and M. Garavello , On the cauchy problem for the p-system at a junction , SIAM Journal on Mathematical Analysis, 39 (2008), pp. 1456–1471.
- 5(5) E. Fokken, S. Göttlich, and O. Kolb , Modeling and simulation of gas networks coupled to power grids , ar Xiv:1812.11438 [math.NA], (2018).
- 6(6) G. Gahleitner , Hydrogen from renewable electricity: An international review of power-to-gas pilot plants for stationary applications , International Journal of Hydrogen Energy, 38 (2013), pp. 2039 – 2061.
- 7(7) J. Grainger, W. Stevenson, and G. Chang , Power System Analysis , Mc Graw-Hill series in electrical and computer engineering: Power and energy, Mc Graw-Hill Education, 2016.
- 8(8) M. Herty , Modeling, simulation and optimization of gas networks with compressors , N Networks and Heterogeneous Media, 2 (2007), pp. 81–97.
