# Mathematical Programming for Power Systems Operation

## From Theory to Applications in Python

Wiley - IEEE

1. Edition October 2021

304 Pages, Hardcover*Wiley & Sons Ltd*

**978-1-119-74726-0**

Explore the theoretical foundations and real-world power system applications of convex programming

In Mathematical Programming for Power System Operation with Applications in Python, Professor Alejandro Garces delivers a comprehensive overview of power system operations models with a focus on convex optimization models and their implementation in Python. Divided into two parts, the book begins with a theoretical analysis of convex optimization models before moving on to related applications in power systems operations.

The author eschews concepts of topology and functional analysis found in more mathematically oriented books in favor of a more natural approach. Using this perspective, he presents recent applications of convex optimization in power system operations problems.

Mathematical Programming for Power System Operation with Applications in Python uses Python and CVXPY as tools to solve power system optimization problems and includes models that can be solved with the presented framework. The book also includes:

* A thorough introduction to power system operation, including economic and environmental dispatch, optimal power flow, and hosting capacity

* Comprehensive explorations of the mathematical background of power system operation, including quadratic forms and norms and the basic theory of optimization

* Practical discussions of convex functions and convex sets, including affine and linear spaces, politopes, balls, and ellipsoids

* In-depth examinations of convex optimization, including global optimums, and first and second order conditions

Perfect for undergraduate students with some knowledge in power systems analysis, generation, or distribution, Mathematical Programming for Power System Operation with Applications in Python is also an ideal resource for graduate students and engineers practicing in the area of power system optimization.

Introduction xi

1 Power systems operation 1

1.1 Mathematical programming for power systems operation 1

1.2 Continuous models 3

1.2.1 Economic and environmental dispatch 3

1.2.2 Hydrothermal dispatch 3

1.2.3 Effect of the grid constraints 5

1.2.4 Optimal power flow 5

1.2.5 Hosting capacity 7

1.2.6 Demand-side management 7

1.2.7 Energy storage management 9

1.2.8 State estimation and grid identification 9

1.3 Binary problems in power systems operation 11

1.3.1 Unit commitment 12

1.3.2 Optimal placement of distributed generation and capacitors 12

1.3.3 Primary feeder reconfiguration and topology identification 13

1.3.4 Phase balancing 13

1.4 Real-time implementation 14

1.5 Using Python 15

Part I Mathematical programming 17

2 A brief introduction to mathematical optimization 19

2.1 About sets and functions 19

2.2 Norms 22

2.3 Global and local optimum 24

2.4 Maximum and minimum values of continuous functions 25

2.5 The gradient method 26

2.6 Lagrange multipliers 32

2.7 The Newton's method 33

2.8 Further readings 35

2.9 Exercises 35

3 Convex optimization 39

3.1 Convex sets 39

3.2 Convex functions 45

3.3 Convex optimization problems 47

3.4 Global optimum and uniqueness of the solution 50

3.5 Duality 52

3.6 Further readings 56

3.7 Exercises 58

4 Convex Programming in Python 61

4.1 Python for convex optimization 61

4.2 Linear programming 62

4.3 Quadratic forms 67

4.4 Semidefinite matrices 69

4.5 Solving quadratic programming problems 71

4.6 Complex variables 74

4.7 What is inside the box? 75

4.8 Mixed-integer programming problems 76

4.9 Transforming MINLP into MILP 79

4.10 Further readings 80

4.11 Exercises 81

5 Conic optimization 85

5.1 Convex cones 85

5.2 Second-order cone optimization 85

5.2.1 Duality in SOC problems 90

5.3 Semidefinite programming 92

5.3.1 Trace, determinant, and the Shur complement 92

5.3.2 Cone of semidefinite matrices 95

5.3.3 Duality in SDP 97

5.4 Semidefinite approximations 98

5.5 Polynomial optimization 102

5.6 Further readings 105

5.7 Exercises 106

6 Robust optimization 109

6.1 Stochastic vs robust optimization 109

6.1.1 Stochastic approach 110

6.1.2 Robust approach 110

6.2 Polyhedral uncertainty 111

6.3 Linear problems with norm uncertainty 113

6.4 Defining the uncertainty set 115

6.5 Further readings 121

6.6 Exercises 121

Part II Power systems operation 125

7 Economic dispatch of thermal units 127

7.1 Economic dispatch 127

7.2 Environmental dispatch 133

7.3 Effect of the grid 136

7.4 Loss equation 140

7.5 Further readings 143

7.6 Exercises 143

8 Unit commitment 145

8.1 Problem definition 145

8.2 Basic unit commitment model 146

8.3 Additional constraints 150

8.4 Effect of the grid 151

8.5 Further readings 153

8.6 Exercises 153

9 Hydrothermal scheduling 155

9.1 Short-term hydrothermal coordination 155

9.2 Basic hydrothermal coordination 156

9.3 Non-linear models 159

9.4 Hydraulic chains 162

9.5 Pumped hydroelectric storage 165

9.6 Further readings 168

9.7 Exercises 169

10 Optimal power flow 171

10.1 OPF in power distribution grids 171

10.1.1 A brief review of power flow analysis 173

10.2 Complex linearization 177

10.2.1 Sequential linearization 181

10.2.2 Exponential models of the load 182

10.3 Second-order cone approximation 184

10.4 Semidefinite approximation 188

10.5 Further readings 190

10.6 Exercises 190

11 Active distribution networks 195

11.1 Modern distribution networks 195

11.2 Primary feeder reconfiguration 196

11.3 Optimal placement of capacitors 200

11.4 Optimal placement of distributed generation 203

11.5 Hosting capacity of solar energy 205

11.6 Harmonics and reactive power compensation 208

11.7 Further readings 212

11.8 Exercises 212

12 State estimation and grid identification 215

12.1 Measurement units 215

12.2 State estimation 216

12.3 Topology identification 221

12.4 Ybus estimation 224

12.5 Load model estimation 228

12.6 Further readings 231

12.7 Exercises 232

13 Demand-side management 235

13.1 Shifting loads 235

13.2 Phase balancing 240

13.3 Energy storage management 246

13.4 Further readings 249

13.5 Exercises 249

A The nodal admittance matrix 253

B Complex linearization 257

C Some Python examples 263

C.1 Basic Python 263

C.2 NumPy 266

C.3 MatplotLib 268

C.4 Pandas 268

Bibliography 271

Index 281