2.5 Documentation

There are four primary sources of documentation for Matpower. The first is this manual, which gives an overview of Matpower’s capabilities and structure and describes the modeling and formulations behind the code. It can be found in your Matpower distribution at <MATPOWER>/docs/MATPOWER-manual.pdf and the latest version is always available at: \currentmumurl.

Secondly, the MOST User’s Manual describes MOST and its problem formulation, features, data formats and options. It is located at <MATPOWER>/docs/MOST-manual.pdf in your Matpower distribution and the latest version is also available online at: \currentmostmanurl.

The Matpower Online Function Reference is the third source of documentation, allowing you to view not only the help text, but also the code itself for each Matpower function directly from a web browser. It is available online at: https://matpower.org/docs/ref

Last, but certainly not least, is the built-in help command. As with Matlab’s built-in functions and toolbox routines, you can type help followed by the name of a command or M-file to get help on that particular function. Nearly all of Matpower’s M-files have such documentation and this should be considered the main reference for the calling options for each individual function. See Appendix D for a list of Matpower functions.

As an example, the help for runopf looks like:

>> help runopf
 RUNOPF  Runs an optimal power flow.
    [RESULTS, SUCCESS] = RUNOPF(CASEDATA, MPOPT, FNAME, SOLVEDCASE)

    Runs an optimal power flow (AC OPF by default), optionally returning
    a RESULTS struct and SUCCESS flag.

    Inputs (all are optional):
        CASEDATA : either a MATPOWER case struct or a string containing
            the name of the file with the case data (default is 'case9')
            (see also CASEFORMAT and LOADCASE)
        MPOPT : MATPOWER options struct to override default options
            can be used to specify the solution algorithm, output options
            termination tolerances, and more (see also MPOPTION).
        FNAME : name of a file to which the pretty-printed output will
            be appended
        SOLVEDCASE : name of file to which the solved case will be saved
            in MATPOWER case format (M-file will be assumed unless the
            specified name ends with '.mat')

    Outputs (all are optional):
        RESULTS : results struct, with the following fields:
            (all fields from the input MATPOWER case, i.e. bus, branch,
                gen, etc., but with solved voltages, power flows, etc.)
            order - info used in external <-> internal data conversion
            et - elapsed time in seconds
            success - success flag, 1 = succeeded, 0 = failed
            (additional OPF fields, see OPF for details)
        SUCCESS : the success flag can additionally be returned as
            a second output argument

    Calling syntax options:
        results = runopf;
        results = runopf(casedata);
        results = runopf(casedata, mpopt);
        results = runopf(casedata, mpopt, fname);
        results = runopf(casedata, mpopt, fname, solvedcase);
        [results, success] = runopf(...);

        Alternatively, for compatibility with previous versions of MATPOWER,
        some of the results can be returned as individual output arguments:

        [baseMVA, bus, gen, gencost, branch, f, success, et] = runopf(...);

    Example:
        results = runopf('case30');

    See also RUNDCOPF, RUNUOPF.