Contents

1 Introduction
 1.1 Background
 1.2 License and Terms of Use
 1.3 Citing Matpower
 1.4 Matpower Development
 1.5 Sponsoring the Matpower Project
2 Getting Started
 2.1 System Requirements
 2.2 Getting Matpower
  2.2.1 Versioned Releases
  2.2.2 Current Development Version
  2.2.3 Matpower Docker Image
 2.3 Installation
 2.4 Running a Simulation
  2.4.1 Preparing Case Input Data
  2.4.2 Solving the Case
  2.4.3 Accessing the Results
  2.4.4 Setting Options
 2.5 Documentation
3 Modeling
 3.1 Data Formats
 3.2 Branches
 3.3 Generators
 3.4 Loads
 3.5 Shunt Elements
 3.6 Network Equations
 3.7 DC Modeling
4 Power Flow
 4.1 AC Power Flow
  4.1.1 Cartesian vs. Polar Coordinates for Voltage
  4.1.2 Current vs. Power for Nodal Balance Equations
 4.2 DC Power Flow
 4.3 Distribution Power Flow
  4.3.1 Radial Power Flow
  4.3.2 Current Summation Method
  4.3.3 Power Summation Method
  4.3.4 Admittance Summation Method
  4.3.5 Handling PV Buses
 4.4 runpf
 4.5 Linear Shift Factors
5 Continuation Power Flow
 5.1 Parameterization
 5.2 Predictor
 5.3 Corrector
 5.4 Step Length Control
 5.5 Event Detection and Location
 5.6 runcpf
  5.6.1 CPF Callback Functions
  5.6.2 CPF Example
6 Optimal Power Flow
 6.1 Standard AC OPF
  6.1.1 Cartesian vs. Polar Coordinates for Voltage
  6.1.2 Current vs. Power for Nodal Balance Constraints
 6.2 Standard DC OPF
 6.3 Extended OPF Formulation
  6.3.1 User-defined Variables
  6.3.2 User-defined Constraints
  6.3.3 User-defined Costs
 6.4 Standard Extensions
  6.4.1 Piecewise Linear Costs
  6.4.2 Dispatchable Loads
  6.4.3 Generator Capability Curves
  6.4.4 Branch Angle Difference Limits
 6.5 Solvers
 6.6 runopf
7 Extending the OPF
 7.1 Direct Specification
  7.1.1 User-defined Variables
  7.1.2 User-defined Constraints
  7.1.3 User-defined Costs
  7.1.4 Additional Comments
 7.2 Callback Functions
  7.2.1 User-defined Variables
  7.2.2 User-defined Costs
  7.2.3 User-defined Constraints
 7.3 Callback Stages and Example
  7.3.1 ext2int Callback
  7.3.2 formulation Callback
  7.3.3 int2ext Callback
  7.3.4 printpf Callback
  7.3.5 savecase Callback
 7.4 Registering the Callbacks
 7.5 Summary
 7.6 Example Extensions
  7.6.1 Fixed Zonal Reserves
  7.6.2 Interface Flow Limits
  7.6.3 DC Transmission Lines
  7.6.4 OPF Soft Limits
8 Unit De-commitment Algorithm
9 Miscellaneous Matpower Functions
 9.1 Input/Output Functions
  9.1.1 loadcase
  9.1.2 savecase
  9.1.3 cdf2mpc
  9.1.4 psse2mpc
  9.1.5 save2psse
 9.2 System Information
  9.2.1 case_info
  9.2.2 compare_case
  9.2.3 find_islands
  9.2.4 get_losses
  9.2.5 margcost
  9.2.6 isload
  9.2.7 loadshed
  9.2.8 printpf
  9.2.9 total_load
  9.2.10 totcost
 9.3 Modifying a Case
  9.3.1 extract_islands
  9.3.2 load2disp
  9.3.3 modcost
  9.3.4 scale_load
  9.3.5 apply_changes
  9.3.6 savechgtab
 9.4 Conversion between External and Internal Numbering
  9.4.1 ext2int, int2ext
  9.4.2 e2i_data, i2e_data
  9.4.3 e2i_field, i2e_field
 9.5 Forming Standard Power Systems Matrices
  9.5.1 makeB
  9.5.2 makeBdc
  9.5.3 makeJac
  9.5.4 makeLODF
  9.5.5 makePTDF
  9.5.6 makeYbus
 9.6 Miscellaneous
  9.6.1 define_constants
  9.6.2 feval_w_path
  9.6.3 have_fcn
  9.6.4 mpopt2qpopt
  9.6.5 mpver
  9.6.6 nested_struct_copy
10 Acknowledgments
A MIPS – Matpower Interior Point Solver
 A.1 Example 1
 A.2 Example 2
 A.3 Quadratic Programming Solver
 A.4 Primal-Dual Interior Point Algorithm
  A.4.1 Notation
  A.4.2 Problem Formulation and Lagrangian
  A.4.3 First Order Optimality Conditions
  A.4.4 Newton Step
B Data File Format
C Matpower Options
 C.1 Mapping of Old-Style Options to New-Style Options
D Matpower Files and Functions
 D.1 Directory Layout and Documentation Files
 D.2 Matpower Functions
 D.3 Example Matpower Cases
 D.4 Automated Test Suite
E Matpower Extras
F “Smart Market” Code
 F.1 Handling Supply Shortfall
 F.2 Example
 F.3 Smartmarket Files and Functions
G Optional Packages
 G.1 BPMPD_MEX – MEX interface for BPMPD
 G.2 CLP – COIN-OR Linear Programming
 G.3 CPLEX – High-performance LP and QP Solvers
 G.4 GLPK – GNU Linear Programming Kit
 G.5 Gurobi – High-performance LP and QP Solvers
 G.6 Ipopt – Interior Point Optimizer
 G.7 Artelys Knitro – Non-Linear Programming Solver
 G.8 MINOPF – AC OPF Solver Based on MINOS
 G.9 MOSEK – High-performance LP and QP Solvers
 G.10 Optimization Toolbox – LP, QP, NLP and MILP Solvers
 G.11 PARDISO – Parallel Sparse Direct and Multi-Recursive Iterative Linear Solvers
 G.12 SDP_PF – Applications of a Semidefinite Programming Relaxation of the Power Flow Equations
 G.13 TSPOPF – Three AC OPF Solvers by H. Wang
H Release History
 H.1 Pre 1.0 – released Jun 25, 1997
 H.2 Version 1.0 – released Sep 17, 1997
 H.3 Version 1.0.1 – released Sep 19, 1997
 H.4 Version 2.0 – released Dec 24, 1997
 H.5 Version 3.0 – released Feb 14, 2005
 H.6 Version 3.2 – released Sep 21, 2007
 H.7 Version 4.0 – released Feb 7, 2011
 H.8 Version 4.1 – released Dec 14, 2011
 H.9 Version 5.0 – released Dec 17, 2014
 H.10 Version 5.1 – released Mar 20, 2015
 H.11 Version 6.0 – released Dec 16, 2016
 H.12 Version 7.0 – released Jun 20, 2019
References