Frequently Asked Questions

1. How can I use MATPOWER’s OPF to minimize transmission losses?
Assign positive, constant, equal marginal 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 research/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, continuation 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. You are even welcome to ask whether others have already found a way to solve your problem using MATPOWER. Just please don’t ask us to do your research/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 see the Citing MATPOWER page for details on how to cite MATPOWER properly.
4. Can I use MATPOWER 4.0–5.0 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.

MATPOWER 5.1 and later uses the more permissive 3-clause BSD license.

5. Why does MATPOWER power flow not converge?
While there are many reasons for the non-convergence of a power flow solution, the following hints/tips may be useful for debugging the problem.
  1. Check that the data in the case file is consistent with the MATPOWER case data format.
  2. Check that all transmission line data is in per unit. MATPOWER requires the branch data to be entered in per unit.
  3. Check whether there are isolated buses in the case file that are not marked with BUS_TYPE = NONE (4) or if there are islands without generation. This information can be obtained using the routine case_info().
  4. By default, MATPOWER’s AC power flow uses a Newton’s method to solve the nonlinear power flow equations and, unfortunately, the Newton’s method is sensitive to the initial guess given. There is no way to choose an initial guess that always guarantees convergence. The following experiments may be useful in such a case:
    1. Change the starting point (voltage angles and magnitudes) and see if the power flow converges.
    2. Run a fast decoupled power flow (see help mpoption for details).
    3. Run an OPF with active generation fixed (cost-coefficients should not matter), voltage limits relaxed except at generator buses, and reactive generation and branch flow limits relaxed.
  5. AC power flow does not converge if the system load exceeds the steady-state loading limit. To check if this is the case, run a continuation power flow that gradually increases the loading/generation.
    define_constants;
    mpcbase = loadcase('casefile');
    mpcbase.bus(:, PD) = 0;
    mpcbase.bus(:, QD) = 0;
    mpcbase.gen(:, PG) = 0;
    mpctarget = loadcase('casefile');
    results = runcpf(mpcbase, mpctarget);
    results.cpf.max_lam
    If the resulting value of results.cpf.max_lam (the scaling factor associated with the maximum loading the system can handle) is less than 1, it indicates that the load for the case exceeds the steady-state loading limit, and loads must be scaled down at least by a factor of results.cpf.max_lam to get a convergent power flow solution.
  6. Try the incremental approach suggested by Jose Marin in these two posts on the MATPOWER discussion mailing list (original outline, additional suggestion).