Download

Getting Started

What's New

Documentation

Optional Packages

Discussion Mailing List

Announcement List

FAQ


MATPOWER

A MATLAB Power System Simulation Package

by Ray D. Zimmerman, Carlos E. Murillo-Sánchez & Deqiang (David) Gan


MATPOWER is a package of MATLAB® M-files for solving power flow and optimal power flow problems. It is intended as a simulation tool for researchers and educators that is easy to use and modify. MATPOWER is designed to give the best performance possible while keeping the code simple to understand and modify. It was initially developed as part of the PowerWeb project.


Download MATPOWER

You will be asked to fill out a brief form the first time you download non-GPL software from this site.



MATPOWER
(current stable version is 4.1)

See also Optional Packages below.

For full documentation, see the
MATPOWER Users's Manual.

Terms of Use (MATPOWER 4 and later)

Please see the LICENSE file for the details. But here is the summary ...

  • Beginning with version 4, the code in MATPOWER is distributed under the GNU General Public License (GPL) with an exception added to clarify our intention to allow MATPOWER to interface with MATLAB® as well as any other MATLAB code or MEX-files a user may have installed, regardless of their licensing terms.
  • MATPOWER is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
  • While not required by the terms of the license, we do request that publications derived from the use of MATPOWER explicitly acknowledge that fact by citing [2].
[2]  R. D. Zimmerman, C. E. Murillo-Sánchez, and R. J. Thomas, "MATPOWER: Steady-State Operations, Planning and Analysis Tools for Power Systems Research and Education," Power Systems, IEEE Transactions on, vol. 26, no. 1, pp. 12-19, Feb. 2011.

Note:  Versions prior to MATPOWER 4 use a different license.


Getting Started

System Requirements

To use MATPOWER you will need:

Note: Though some MATPOWER functionality may work in earlier versions of MATLAB 6, it is not supported. MATPOWER 3.2 required MATLAB 6, MATPOWER 3.0 required MATLAB 5 and MATPOWER 2.0 and earlier only required MATLAB 4. MATPOWER 4.0 and later may work on earlier versions of Octave, but has not been tested on versions prior to 3.2.3.

Installation

  1. Download MATPOWER. You should end up with a file named matpowerXXX.zip, where XXX depends on the version of MATPOWER.
  2. Unzip the downloaded file. Move the resulting matpowerXXX directory to the location of your choice. These files should not need to be modified, so it is recommended that they be kept separate from your own code. Let $MATPOWER denote the path to this directory.
  3. Add the following directories to your MATLAB path:
    • $MATPOWER   — core MATPOWER functions
    • $MATPOWER/t — test scripts for MATPOWER
  4. At the MATLAB prompt, type 'test_matpower' (without the quotes) to run the test suite and verify that MATPOWER is properly installed and functioning.

Running MATPOWER

To run a simple Newton power flow on the 9-bus system specified in the file case9.m, with the default algorithm options, at the MATLAB prompt, type:

    runpf('case9')

To load the 30-bus system data from case30.m, increase its real power demand at bus 2 to 30 MW, then run an AC optimal power flow with default options, type:

    define_constants;
    mpc = loadcase('case30');
    mpc.bus(2, PD) = 30;
    runopf(mpc);

By default, the results of the simulation are pretty-printed to the screen, but the solution can also be optionally returned in a results struct. The following example shows how simple it is, after running a DC OPF on the 118-bus system in case118.m, to access the final objective function value, the real power output of generator 6 and the power flow in branch 51.

    results = rundcopf('case118');
    final_objective = results.f;
    gen6_output     = results.gen(6, PG);
    branch51_flow   = results.branch(51, PF);

For additional info, see the User's Manual and the on-line help documentation for the various MATPOWER functions. For example:

    help runpf
    help runopf
    help mpoption
    help caseformat


What's New in Version 4.1

Below is a summary of the changes since version 4.0 of MATPOWER. See the CHANGES file in the docs directory for all the gory details.

New features:

  • More new high performance OPF solvers:
    • Support for the Knitro interior point optimizer for large scale non-linear optimization. Use OPF_ALG = 600 to select Knitro to solve the AC OPF. Requires the Matlab Optimization Toolbox and a license for Knitro, available from http://www.ziena.com/. See help mpoption for more Knitro options.
    • Support for Gurobi to solve LP and QP problems. Set option OPF_ALG_DC = 700 to use Gurobi to solve the DC OPF. Requires Gurobi, available from http://www.gurobi.com/, and the Gurobi MEX interface. See help mpoption for more Gurobi options.
    • Updated for compatibility with CPLEX 12.3.
    • Changed options so that FMINCON uses its interior-point solver by default. Much faster on larger systems.
  • Support for basic modeling of DC transmission lines.
  • New case files with more recent versions of Polish system.
  • Power flow can handle networks with islands.

Bugs fixed:

  • Computation of quadratic user-defined costs had a potentially fatal error. Thanks to Stefanos Delikaraoglou for finding this.
  • Calculation of reserve prices in toggle_reserves() had an error.

INCOMPATIBLE CHANGES:

  • Optional packages TSPOPF and MINOPF must be updated to latest versions.

Documentation

There are two primary sources of documentation for MATPOWER.

The User's Manual is included in the distribution (docs/manual.pdf) or it can be downloaded separately from the link above.

Each M-file has its own documentation which can be accessed by typing at the MATLAB prompt:

    help <name of M-file>

Documentation for the case data file format can be found by typing:

    help caseformat

If something is still unclear after checking the manual and the help, the source code is the documentation. ;-)

Tech Notes

There are also two MATPOWER Technical Notes that may be of interest:

[TN1] :  R. D. Zimmerman, Uniform Price Auctions and Optimal Power Flow, MATPOWER Technical Note 1, February 2010.
[TN2] :  R. D. Zimmerman, AC Power Flows, Generalized OPF Costs and their Derivatives using Complex Matrix Notation, MATPOWER Technical Note 2, February 2010.

Publications & Presentations

[1]  R. D. Zimmerman, C. E. Murillo-Sánchez, and R. J. Thomas, "MATPOWER's Extensible Optimal Power Flow Architecture," Power and Energy Society General Meeting, 2009 IEEE, pp. 1-7, July 26-30 2009.
(Digital Object Identifier: 10.1109/PES.2009.5275967)
Presentation: download slides
[2]  R. D. Zimmerman, C. E. Murillo-Sánchez, and R. J. Thomas, "MATPOWER Steady-State Operations, Planning and Analysis Tools for Power Systems Research and Education," Power Systems, IEEE Transactions on, vol. 26, no. 1, pp. 12-19, Feb. 2011.
(Digital Object Identifier: 10.1109/TPWRS.2010.2051168)

Optional Packages

There are a number of optional packages that MATPOWER can take advantage of to provide additional options for OPF solvers. Each is distributed under its own license and must be obtained separately. Please see the individual Terms of Use for details.

BPMPD_MEX MEX-file version of the high performance BPMPD interior point LP and QP solver. Speeds up DC and LP-based OPF solvers, and improves robustness of MINOPF.
CPLEX Includes high-performance, large-scale LP and QP solvers that MATPOWER can use for the DC OPF. Requires the Matlab interface to CPLEX, available from http://www.ibm.com/software/integration/optimization/cplex-optimizer/.
GUROBI Includes high-performance, large-scale LP and QP solvers that MATPOWER can use for the DC OPF. Requires the Gurobi MEX Matlab interface.
IPOPT An interior point optimizer for large scale non-linear optimization that MATPOWER can use for both AC and DC OPF problems. Requires the Matlab MEX interface for IPOPT, available from https://projects.coin-or.org/Ipopt/.
KNITRO A general purpose optimization solver specializing in nonlinear problems that MATPOWER can use for AC OPFs. Requires the Knitro libraries, available from http://www.ziena.com/ and the Optimization Toolbox from The MathWorks.
MINOPF A MINOS-based AC OPF solver implemented as a Fortran MEX file.
MOSEK Includes high-performance, large-scale LP and QP solvers that MATPOWER can use for the DC OPF. Requires the Matlab interface to MOSEK, available from http://www.mosek.com/.
TSPOPF A package of three AC OPF solvers implemented as C MEX files. Suitable for large scale problems.

Discussion Mailing List

An e-mail list MATPOWER-L@cornell.edu has been set up to facilitate discussion of MATPOWER. Only list subscribers are permitted to post to the list.

Feel free to use this list to discuss anything related to MATPOWER, to ask questions about MATPOWER, or to provide feedback to the developers of MATPOWER, such as bug reports, patches or ideas for improvements (though we make no guarantees about if/when they might be included).

Also, if you have any of your own MATLAB power systems code that you would like to contribute, feel free to contact us via this list about making it available on the MATPOWER web site.

Joining the list

To join the MATPOWER mailing list, send a plain-text e-mail to MATPOWER-L-request@cornell.edu with the following line in the body of the message.

    join

You must send the request from the e-mail address where you want to receive the list's messages. And be sure it is a plain text e-mail, that is, with no formatting, font styles or HTML code.

Sending mail to the list

To send an e-mail to all of the subscribers of the MATPOWER mailing list, simply address your e-mail to MATPOWER-L@cornell.edu. Only subscribers are permitted to send e-mail to the list.

Leaving the list

You can unsubscribe from the list at any time by sending an e-mail to MATPOWER-L-request@cornell.edu with the following line in the body of the message.

    leave

List Archives

There is an archive of the MATPOWER e-mail list hosted by The Mail Archive.

    http://www.mail-archive.com/matpower-l@cornell.edu/

It can be searched or browsed by thread or by date.

Note: There have been two URLs published for these archives, so you may find broken links out there pointing to (1), but (2) is the only one that works currently, so just edit the links accordingly.
(1) http://www.mail-archive.com/matpower-l@list.cornell.edu/
(2) http://www.mail-archive.com/matpower-l@cornell.edu/


Announcement Mailing List

To be notified when new versions of MATPOWER become available, sign up for the MATPOWER-ANNOUNCE-L mailing list by sending an e-mail, from the address where you would like receive the announcements, to:

  MATPOWER-ANNOUNCE-L-request@cornell.edu

Leave the subject line blank. The body of the message should be the single word:

  join

You can unsubscribe from the announcement list at any time by sending an e-mail to MATPOWER-ANNOUNCE-L-request@cornell.edu with the following line in the body of the message.

    leave

There is also an archive of the announcement list hosted by The Mail Archive.

    http://www.mail-archive.com/matpower-announce-l@cornell.edu/


Frequently Asked Questions

1. How can I use MATPOWER's OPF to minimize transmission losses?

Assign positive, constant, equal costs to all generators and use the standard OPF. Since generation must equal demand plus losses, if demand is constant, loss is minimized by minimizing overall generation. With equal costs on all generators, MATPOWER's default objective of minimizing total cost is equivalent to minimizing total generation, which is in turn equivalent to minimizing transmission losses.

2. Would you please show me how to use MATPOWER to solve [my homework problem]?

If you're thinking of posting a question of that nature to MATPOWER-L, please don't ... the answer is "No, we won't". We simply do not have the time to understand every type of problem we are asked about and respond with example code to show you how MATPOWER can be used to solve it. MATPOWER solves power flow and optimal power flow problems and has a number of other related capabilities. You need to determine whether those capabilities are applicable to your problem. If you have checked the User's Manual and the mailing list archives and still have questions about MATPOWER's specific capabilities, we are happy to clarify. And if you have specific questions, comments, or suggestions related to using MATPOWER, those are also welcome. Just please don't ask us to do your homework for you.

3. Am I required by the license to cite MATPOWER in publications based on MATPOWER or derived works?

No, but it's still the right thing to do. Please cite the following in your publications that rely on MATPOWER:

   R. D. Zimmerman, C. E. Murillo-Sánchez, and R. J. Thomas, "MATPOWER: Steady-State Operations, Planning and Analysis Tools for Power Systems Research and Education," Power Systems, IEEE Transactions on, vol. 26, no. 1, pp. 12-19, Feb. 2011.
(Digital Object Identifier: 10.1109/TPWRS.2010.2051168)

4. Can I use MATPOWER with GPL-incompatible M-files and MEX-files?

I am not a lawyer. However, a GPL v3 section 7 "additional permission" exception is included with the intent to explicitly permit interfacing of MATPOWER with any M-files and MEX-files, regardless of licensing, such as MINOPF, BPMPD_MEX and Matlab's Optimization Toolbox.


PSERC Logo MATPOWER
Copyright © 1997-2014 PSERC
Tue, Jan 14, 2014