Skip to main content
v2026.11,986 entries · CC-BY 4.0

MATPOWER: Power System Simulation for MATLAB and Octave

MATPOWER is free open-source software for power flow and optimal power flow in MATLAB and Octave. Install steps, version needs and what to cite.

Written and maintained by CASRAI Editorial Board

Published

On this page

MATPOWER is a free, open-source package of MATLAB-language M-files for simulating and optimizing steady-state electric power systems. It runs in both MATLAB and GNU Octave, covers power flow, continuation power flow and optimal power flow, and is distributed under a 3-clause BSD license. To install it, download it from matpower.org (or clone the GitHub repository), change into its folder in MATLAB or Octave, and run install_matpower.

What MATPOWER is and what it covers

The MATPOWER project describes its software as free, open-source tools for electric power system simulation and optimization. The GitHub README titles it “A Power System Simulation Package for MATLAB and Octave” and calls it a tool for researchers and educators. The project’s own site lists the problems it solves:

  • power flow (PF);
  • continuation power flow (CPF);
  • extensible optimal power flow (OPF);
  • unit commitment (UC);
  • stochastic, secure multi-interval OPF and UC.

The project’s home page reports more than two decades of use, downloads of over 40,000 a year and more than 1.5 million downloads in total, with users in academia, government and industry (read 2026-11-19). The current release shown on the site is MATPOWER 8.1. Version 7.1 appeared in October 2020, version 8.0b1 in December 2022 and version 8.0 in May 2024.

The name is easy to misread. MATPOWER is not a MATLAB function for raising numbers to a power, and it is not a MathWorks product. It is a separate, community-maintained code base that happens to run on MATLAB. If you arrived here wanting 2^3 or x.^2, jump to the section on writing a power in MATLAB.

How to install MATPOWER

The README gives three ways to obtain the code, and one command to make it usable:

  1. Download a versioned ZIP file from matpower.org.
  2. Clone the repository with git clone https://github.com/MATPOWER/matpower.git.
  3. Download the repository as a ZIP file from GitHub.

After unpacking, start MATLAB or Octave, change into the MATPOWER directory and run install_matpower. That command adds the required directories to the MATLAB or Octave path. Running test_matpower afterwards is optional and runs the package’s test suite. The README also mentions a Docker image (matpower/matpower) and a MATLAB Online option for people who prefer not to install locally.

A practical reading of these requirements: the three install routes give you the same package, so the choice is about workflow. A ZIP download suits a one-off study or a teaching lab. A Git clone makes it easy to record exactly which revision produced a set of results, and the Docker image or MATLAB Online avoids changing the local MATLAB path. This is an editorial suggestion rather than something the README states, and none of it changes the one command that makes the package usable.

Which MATLAB or Octave version does it need?

The version requirement depends on which generation of features you want. The comparison below is taken from the README.

What you want to use Minimum MATLAB Minimum GNU Octave
All features, including MP-Core (the current code base) R2016a (version 9.0) 6.2
Legacy features only (MATPOWER 7.1 and earlier) R2009b (version 7.9) 4 or later

If a lab machine or teaching cluster is stuck on an older MATLAB release, the table is the quickest way to see whether a current MATPOWER download can run there at all. Check the installed version with MATLAB’s own version command before you download.

How to run a power flow or an optimal power flow

The README opens its examples with three short calls. They use test systems (case files) that ship with the package, so they work immediately after installation.

  • AC power flow, 9-bus system: runpf('case9') runs a Newton power flow on the case9 data.
  • AC optimal power flow with a changed load: mpc = loadcase('case30'); mpc.bus(2,PD) = 30; runopf(mpc); loads the 30-bus case into a data structure, sets the real power demand at bus 2 to 30 and solves the optimal power flow.
  • DC optimal power flow, 118-bus system: results = rundcopf('case118') returns a results structure; results.f holds the objective value.

The pattern is the same for every study. A case is a MATLAB data structure (often called mpc) describing buses, branches and generators. You load it with loadcase, change whatever your scenario requires and pass it to a run... function. Everything beyond these three calls (solver options, other formulations, the MOST and MIPS add-ons) is documented in the User’s Manual, which this page does not reproduce.

What to cite when you use MATPOWER in a paper

The project states that citing it is required for all publications that use the software. Which paper you cite depends on what you used. The data table below this page’s body lists each reference with its venue, year and DOI. In practice:

  • For any use of MATPOWER’s power flow or optimal power flow, cite the 2011 IEEE Transactions on Power Systems paper by Zimmerman, Murillo-Sanchez and Thomas.
  • If you used MOST (MATPOWER Optimal Scheduling Tool), also cite the 2013 IEEE Transactions on Smart Grid paper by Murillo-Sanchez, Zimmerman, Anderson and Thomas.
  • If you used MIPS (the MATPOWER Interior Point Solver), also cite the 2007 paper by Wang and co-authors in IEEE Transactions on Power Systems.
  • The software and the User’s Manual have their own Zenodo DOIs for the exact version used (8.1 at the time of reading), plus a concept DOI that resolves across all versions.
  • Some case files, including the ACTIVSg, PEGASE and RTE data sets, ask for additional citations. Those are listed in each case file’s help text, so read it before you publish results that rely on the data.

Reporting the MATPOWER version, the case file and any modified data lets another researcher repeat a study. See the dictionary entry on DOIs for how persistent identifiers like the Zenodo ones work, and the dictionary entry on open-source software for the wider term.

What products does MATLAB offer?

MATPOWER needs only base MATLAB (or Octave), but the question is common enough to answer. MathWorks’ product listing (checked 2026-11-19) groups its software into a MATLAB family (covering areas such as parallel computing, AI and statistics, math and optimization, deployment and code generation), a Simulink family, application products organized by field, and online versions (MATLAB Online and Simulink Online). Student, home and campus licensing options are listed on the same page. Simscape Electrical, a tool for electrical-system modeling, sits within the Simulink family’s physical modeling products.

That is a different category from MATPOWER. MathWorks sells and supports its products commercially; MATPOWER is an independent open-source package that uses the MATLAB language. To compare it with another power-system tool, see the guide to PowerWorld Simulator; for the MATLAB/Simulink platform itself, see MATLAB and Simulink.

How to write power in MATLAB, and power of 2

These two searches are about MATLAB’s arithmetic operators, not MATPOWER. MathWorks’ documentation for power gives two equivalent forms: C = A.^B and C = power(A,B). The operator raises each element of A to the corresponding power in B. The sizes must match or be compatible, and compatible arrays expand implicitly: a scalar combines with every element of the other array.

For powers of 2, the documentation’s own example makes 2 the first base: with a = [2 3] and b = (1:3)', the expression a.^b returns [2 3; 4 9; 8 27], so the first column is 2, 4, 8. The same rule gives 2.^[1 2 3] as [2 4 8]. For a single number, 2^3 is 8. Without the dot, the ^ operator means a matrix power, which is a different operation that needs a square matrix. The documentation also notes that the inverse of a matrix, written A^-1 or inv(A), differs from inverting each element with A.^-1. The site’s guide to exponentiation in MATLAB goes through both operators and realpow in detail, and the guide to vectorizing MATLAB code shows where element-wise operators fit.

Because MATPOWER is a research tool with a long publication record, the dated release history also matters for reproducibility. A study run on 7.1 and one run on 8.0 or 8.1 may differ in feature set, so state the version number in the methods section alongside the case file, and pair it with the matching Zenodo DOI from the data table. Where a case file was edited, as in the mpc.bus(2,PD) = 30 example above, say what was changed and why.

Common misunderstandings

  • “MATPOWER is part of MATLAB.” It is not. It is a separate open-source package that requires MATLAB or Octave to run.
  • “It needs a paid MATLAB license.” The README lists GNU Octave 6.2 or later as a supported alternative for all features.
  • “Citing the software is enough.” The citing page lists the 2011 paper as required for all publications, with the MOST, MIPS and case-file references added when those parts were used.
  • “MATPOWER only does power flow.” The project lists continuation power flow, optimal power flow, unit commitment and multi-interval stochastic formulations as well.
  • “The newest MATPOWER runs on any MATLAB.” The full feature set needs R2016a or newer; older releases are limited to the legacy features of version 7.1 and earlier.

Frequently asked questions

How to install MATPOWER?

Download the versioned ZIP from matpower.org, clone the GitHub repository or download the repository ZIP. Then change into the MATPOWER folder in MATLAB or Octave and run install_matpower, which adds the needed directories to the path. test_matpower is an optional check.

How to write power in Matlab?

Use A.^B for element-wise powers or power(A,B), which does the same. Use ^ without a dot only for a matrix power of a square matrix. This is MATLAB syntax and unrelated to the MATPOWER package.

How to do power of 2 in Matlab?

Write 2^n for a single number or 2.^v for every element of a vector v. In MathWorks’ documentation example, [2 3].^(1:3)' produces a first column of 2, 4 and 8.

What products does MATLAB offer?

MathWorks lists a MATLAB family, a Simulink family, field-specific application products, online versions and student, home and campus licensing. MATPOWER is not among them; it is an independent open-source package.

Is MATPOWER free?

Yes. The README gives the license as 3-clause BSD, and the project describes the tools as free and open source. You still need MATLAB or Octave to run it.

Sources

Data: What to cite when publishing results from MATPOWER, by component used

Reference list compiled from the MATPOWER project's 'Citing MATPOWER' page, showing which publication or DOI to cite for each component of the package, with venue, year and DOI.

Period covered: 2007/2026.

What to cite when publishing results from MATPOWER, by component used
Component usedReference to citeVenueYear (year)DOI
Power flow and optimal power flow (all uses)Zimmerman, Murillo-Sanchez, Thomas: MATPOWER: Steady-State Operations, Planning and Analysis Tools for Power Systems Research and EducationIEEE Transactions on Power Systems 26(1):12-19201110.1109/TPWRS.2010.2051168
MOST (optimal scheduling tool)Murillo-Sanchez, Zimmerman, Anderson, Thomas: MOST paperIEEE Transactions on Smart Grid 4(4):2220-2229201310.1109/TSG.2013.2281001
MIPS (interior point solver)Wang et al.: MIPS paperIEEE Transactions on Power Systems 22(3):1185-1193200710.1109/TPWRS.2007.901301
MATPOWER software, version 8.1MATPOWER software releaseZenodo10.5281/zenodo.15871662
MATPOWER software, any versionMATPOWER software concept recordZenodo10.5281/zenodo.3236535
User's Manual, version 8.1MATPOWER User's ManualZenodo10.5281/zenodo.15871661
User's Manual, any versionMATPOWER User's Manual concept recordZenodo10.5281/zenodo.3236519

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about MATPOWER: Power System Simulation for MATLAB and Octave

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →