Home > matpower4.0 > mpoption.m

mpoption

PURPOSE ^

MPOPTION Used to set and retrieve a MATPOWER options vector.

SYNOPSIS ^

function [options, names] = mpoption(varargin)

DESCRIPTION ^

MPOPTION  Used to set and retrieve a MATPOWER options vector.

   OPT = MPOPTION
       returns the default options vector

   OPT = MPOPTION(NAME1, VALUE1, NAME2, VALUE2, ...)
       returns the default options vector with new values for up to 7
       options, NAME# is the name of an option, and VALUE# is the new
       value.

   OPT = MPOPTION(OPT, NAME1, VALUE1, NAME2, VALUE2, ...)
       same as above except it uses the options vector OPT as a base
       instead of the default options vector.

   Examples:
       opt = mpoption('PF_ALG', 2, 'PF_TOL', 1e-4);
       opt = mpoption(opt, 'OPF_ALG', 565, 'VERBOSE', 2);

   The currently defined options are as follows:

      idx - NAME, default          description [options]
      ---   -------------          -----------------------------------------
   power flow options
       1  - PF_ALG, 1              AC power flow algorithm
           [   1 - Newton's method                                         ]
           [   2 - Fast-Decoupled (XB version)                             ]
           [   3 - Fast-Decoupled (BX version)                             ]
           [   4 - Gauss-Seidel                                            ]
       2  - PF_TOL, 1e-8           termination tolerance on per unit
                                   P & Q mismatch
       3  - PF_MAX_IT, 10          maximum number of iterations for
                                   Newton's method
       4  - PF_MAX_IT_FD, 30       maximum number of iterations for 
                                   fast decoupled method
       5  - PF_MAX_IT_GS, 1000     maximum number of iterations for 
                                   Gauss-Seidel method
       6  - ENFORCE_Q_LIMS, 0      enforce gen reactive power limits
                                   at expense of |V|
           [    0 - do NOT enforce limits                                  ]
           [    1 - enforce limits, simultaneous bus type conversion       ]
           [    2 - enforce limits, one-at-a-time bus type conversion      ]
       10 - PF_DC, 0               DC modeling for power flow & OPF
           [    0 - use AC formulation & corresponding algorithm options   ]
           [    1 - use DC formulation, ignore AC algorithm options        ]
   OPF options
       11 - OPF_ALG, 0             solver to use for AC OPF
           [    0 - choose default solver based on availability in the     ]
           [        following order, 540, 560                              ]
           [  300 - constr, MATLAB Optimization Toolbox 1.x and 2.x        ]
           [  320 - dense successive LP                                    ]
           [  340 - sparse successive LP (relaxed)                         ]
           [  360 - sparse successive LP (full)                            ]
           [  500 - MINOPF, MINOS-based solver, requires optional          ]
           [        MEX-based MINOPF package, available from:              ]
           [        http://www.pserc.cornell.edu/minopf/                   ]
           [  520 - fmincon, MATLAB Optimization Toolbox >= 2.x            ]
           [  540 - PDIPM, primal/dual interior point method, requires     ]
           [        optional MEX-based TSPOPF package, available from:     ]
           [        http://www.pserc.cornell.edu/tspopf/                   ]
           [  545 - SC-PDIPM, step-controlled variant of PDIPM, requires   ]
           [        TSPOPF (see 540)                                       ]
           [  550 - TRALM, trust region based augmented Langrangian        ]
           [        method, requires TSPOPF (see 540)                      ]
           [  560 - MIPS, MATLAB Interior Point Solver                     ]
           [        primal/dual interior point method (pure MATLAB)        ]
           [  565 - MIPS-sc, step-controlled variant of MIPS               ]
           [        primal/dual interior point method (pure MATLAB)        ]
           [  580 - IPOPT, requires MEX interface to IPOPT solver          ]
           [        available from: https://projects.coin-or.org/Ipopt/    ]
       16 - OPF_VIOLATION, 5e-6    constraint violation tolerance
       17 - CONSTR_TOL_X, 1e-4     termination tol on x for constr/fmincon
       18 - CONSTR_TOL_F, 1e-4     termination tol on f for constr/fmincon
       19 - CONSTR_MAX_IT, 0       max number of iterations for constr/fmincon
                                   [       0 => 2*nb + 150                 ]
       20 - LPC_TOL_GRAD, 3e-3     termination tolerance on gradient, LP-based
                                   solver
       21 - LPC_TOL_X, 1e-4        termination tolerance on x (min step size),
                                   LP-based solver
       22 - LPC_MAX_IT, 400        maximum number of iterations, LP-based slvr
       23 - LPC_MAX_RESTART, 5     maximum number of restarts, LP-based solver
       24 - OPF_FLOW_LIM, 0        qty to limit for branch flow constraints
           [   0 - apparent power flow (limit in MVA)                      ]
           [   1 - active power flow (limit in MW)                         ]
           [   2 - current magnitude (limit in MVA at 1 p.u. voltage)      ]
       25 - OPF_IGNORE_ANG_LIM, 0  ignore angle difference limits for branches
                                   even if specified           [   0 or 1  ]
       26 - OPF_ALG_DC, 0          solver to use for DC OPF
           [    0 - choose default solver based on availability in the     ]
           [        following order, 600, 100, 500, 200                    ]
           [  100 - BPMPD, requires optional MEX-based BPMPD_MEX package   ]
           [        available from: http://www.pserc.cornell.edu/bpmpd/    ]
           [  200 - MIPS, MATLAB Interior Point Solver                     ]
           [        primal/dual interior point method (pure MATLAB)        ]
           [  250 - MIPS-sc, step-controlled variant of MIPS               ]
           [  300 - MATLAB Optimization Toolbox, QUADPROG, LINPROG         ]
           [  400 - IPOPT, requires MEX interface to IPOPT solver          ]
                    available from: https://projects.coin-or.org/Ipopt/    ]
           [  500 - CPLEX, requires Matlab interface to CPLEX solver       ]
           [  600 - MOSEK, requires Matlab interface to MOSEK solver       ]
                    available from: http://www.mosek.com/                  ]
   output options
       31 - VERBOSE, 1             amount of progress info printed
           [   0 - print no progress info                                  ]
           [   1 - print a little progress info                            ]
           [   2 - print a lot of progress info                            ]
           [   3 - print all progress info                                 ]
       32 - OUT_ALL, -1            controls pretty-printing of results
           [  -1 - individual flags control what prints                    ]
           [   0 - do not print anything                                   ]
           [       (overrides individual flags, except OUT_RAW)            ]
           [   1 - print everything                                        ]
           [       (overrides individual flags, except OUT_RAW)            ]
       33 - OUT_SYS_SUM, 1         print system summary        [   0 or 1  ]
       34 - OUT_AREA_SUM, 0        print area summaries        [   0 or 1  ]
       35 - OUT_BUS, 1             print bus detail            [   0 or 1  ]
       36 - OUT_BRANCH, 1          print branch detail         [   0 or 1  ]
       37 - OUT_GEN, 0             print generator detail      [   0 or 1  ]
                                   (OUT_BUS also includes gen info)
       38 - OUT_ALL_LIM, -1        controls what constraint info is printed
           [  -1 - individual flags control what constraint info prints    ]
           [   0 - no constraint info (overrides individual flags)         ]
           [   1 - binding constraint info (overrides individual flags)    ]
           [   2 - all constraint info (overrides individual flags)        ]
       39 - OUT_V_LIM, 1           control output of voltage limit info
           [   0 - do not print                                            ]
           [   1 - print binding constraints only                          ]
           [   2 - print all constraints                                   ]
           [   (same options for OUT_LINE_LIM, OUT_PG_LIM, OUT_QG_LIM)     ]
       40 - OUT_LINE_LIM, 1        control output of line flow limit info
       41 - OUT_PG_LIM, 1          control output of gen P limit info
       42 - OUT_QG_LIM, 1          control output of gen Q limit info
       52 - RETURN_RAW_DER, 0      return constraint and derivative info
                                   in results.raw (in fields g, dg, df, d2f)
   FMINCON options
       55 - FMC_ALG, 1             algorithm used by fmincon for OPF
                                   for Optimization Toolbox 4 and later
            [  1 - active-set                                              ]
            [  2 - interior-point, w/default 'bfgs' Hessian approx         ]
            [  3 - interior-point, w/ 'lbfgs' Hessian approx               ]
            [  4 - interior-point, w/exact user-supplied Hessian           ]
            [  5 - interior-point, w/Hessian via finite differences        ]

   IPOPT options
       60 - IPOPT_OPT, 0           See IPOPT_OPTIONS for details.

   MINOPF options
       61 - MNS_FEASTOL, 0 (1e-3)  primal feasibility tolerance,
                                   set to value of OPF_VIOLATION by default
       62 - MNS_ROWTOL, 0  (1e-3)  row tolerance
                                   set to value of OPF_VIOLATION by default
       63 - MNS_XTOL, 0    (1e-3)  x tolerance
                                   set to value of CONSTR_TOL_X by default
       64 - MNS_MAJDAMP, 0 (0.5)   major damping parameter
       65 - MNS_MINDAMP, 0 (2.0)   minor damping parameter
       66 - MNS_PENALTY_PARM, 0 (1.0)  penalty parameter
       67 - MNS_MAJOR_IT, 0 (200)  major iterations
       68 - MNS_MINOR_IT, 0 (2500) minor iterations
       69 - MNS_MAX_IT, 0 (2500)   iterations limit
       70 - MNS_VERBOSITY, -1
           [  -1 - controlled by VERBOSE option                            ]
           [   0 - print nothing                                           ]
           [   1 - print only termination status message                   ]
           [   2 - print termination status and screen progress            ]
           [   3 - print screen progress, report file (usually fort.9)     ]
       71 - MNS_CORE, 0 (1200 * nb + 2 * (nb + ng)^2) memory allocation
       72 - MNS_SUPBASIC_LIM, 0 (2*nb + 2*ng) superbasics limit
       73 - MNS_MULT_PRICE, 0 (30) multiple price

   MIPS (including MIPS-sc), PDIPM, SC-PDIPM, and TRALM options
       81 - PDIPM_FEASTOL, 0       feasibility (equality) tolerance
                                   for MIPS, PDIPM and SC-PDIPM, set
                                   to value of OPF_VIOLATION by default
       82 - PDIPM_GRADTOL, 1e-6    gradient tolerance for MIPS, PDIPM
                                   and SC-PDIPM
       83 - PDIPM_COMPTOL, 1e-6    complementary condition (inequality)
                                   tolerance for MIPS, PDIPM and SC-PDIPM
       84 - PDIPM_COSTTOL, 1e-6    optimality tolerance for MIPS, PDIPM
                                   and SC-PDIPM
       85 - PDIPM_MAX_IT,  150     maximum number of iterations for MIPS,
                                   PDIPM and SC-PDIPM
       86 - SCPDIPM_RED_IT, 20     maximum number of MIPS-sc or SC-PDIPM
                                   reductions per iteration
       87 - TRALM_FEASTOL, 0       feasibility tolerance for TRALM
                                   set to value of OPF_VIOLATION by default
       88 - TRALM_PRIMETOL, 5e-4   primal variable tolerance for TRALM
       89 - TRALM_DUALTOL, 5e-4    dual variable tolerance for TRALM
       90 - TRALM_COSTTOL, 1e-5    optimality tolerance for TRALM
       91 - TRALM_MAJOR_IT, 40     maximum number of major iterations
       92 - TRALM_MINOR_IT, 100    maximum number of minor iterations
       93 - SMOOTHING_RATIO, 0.04  piecewise linear curve smoothing ratio
                                   used in SC-PDIPM and TRALM

   CPLEX options
       95 - CPLEX_LPMETHOD, 0      solution algorithm for continuous LPs
           [   0 - automatic: let CPLEX choose                             ]
           [   1 - primal simplex                                          ]
           [   2 - dual simplex                                            ]
           [   3 - network simplex                                         ]
           [   4 - barrier                                                 ]
           [   5 - sifting                                                 ]
           [   6 - concurrent (dual, barrier, and primal)                  ]
       96 - CPLEX_QPMETHOD, 0      solution algorithm for continuous QPs
           [   0 - automatic: let CPLEX choose                             ]
           [   1 - primal simplex optimizer                                ]
           [   2 - dual simplex optimizer                                  ]
           [   3 - network optimizer                                       ]
           [   4 - barrier optimizer                                       ]
       97 - CPLEX_OPT, 0           See CPLEX_OPTIONS for details

   MOSEK options
       111 - MOSEK_LP_ALG, 0       solution algorithm for continuous LPs
                                       (MSK_IPAR_OPTIMIZER)
           [   0 - automatic: let MOSEK choose                             ]
           [   1 - interior point                                          ]
           [   4 - primal simplex                                          ]
           [   5 - dual simplex                                            ]
           [   6 - primal dual simplex                                     ]
           [   7 - automatic simplex (MOSEK chooses which simplex method)  ]
           [   10 - concurrent                                             ]
       112 - MOSEK_MAX_IT, 0 (400)     interior point max iterations
                                           (MSK_IPAR_INTPNT_MAX_ITERATIONS)
       113 - MOSEK_GAP_TOL, 0 (1e-8)   interior point relative gap tolerance
                                           (MSK_DPAR_INTPNT_TOL_REL_GAP)
       114 - MOSEK_MAX_TIME, 0 (-1)    maximum time allowed for solver
                                           (MSK_DPAR_OPTIMIZER_MAX_TIME)
       115 - MOSEK_NUM_THREADS, 0 (1)  maximum number of threads to use
                                           (MSK_IPAR_INTPNT_NUM_THREADS)
       116 - MOSEK_OPT, 0              See MOSEK_OPTIONS for details

   deprecated options
       43 - OUT_RAW, 0             print raw data for Perl database
                                   interface code              [   0 or 1  ]
       51 - SPARSE_QP, 1           pass sparse matrices to QP and LP
                                   solvers if possible         [   0 or 1  ]

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [options, names] = mpoption(varargin)
0002 %MPOPTION  Used to set and retrieve a MATPOWER options vector.
0003 %
0004 %   OPT = MPOPTION
0005 %       returns the default options vector
0006 %
0007 %   OPT = MPOPTION(NAME1, VALUE1, NAME2, VALUE2, ...)
0008 %       returns the default options vector with new values for up to 7
0009 %       options, NAME# is the name of an option, and VALUE# is the new
0010 %       value.
0011 %
0012 %   OPT = MPOPTION(OPT, NAME1, VALUE1, NAME2, VALUE2, ...)
0013 %       same as above except it uses the options vector OPT as a base
0014 %       instead of the default options vector.
0015 %
0016 %   Examples:
0017 %       opt = mpoption('PF_ALG', 2, 'PF_TOL', 1e-4);
0018 %       opt = mpoption(opt, 'OPF_ALG', 565, 'VERBOSE', 2);
0019 %
0020 %   The currently defined options are as follows:
0021 %
0022 %      idx - NAME, default          description [options]
0023 %      ---   -------------          -----------------------------------------
0024 %   power flow options
0025 %       1  - PF_ALG, 1              AC power flow algorithm
0026 %           [   1 - Newton's method                                         ]
0027 %           [   2 - Fast-Decoupled (XB version)                             ]
0028 %           [   3 - Fast-Decoupled (BX version)                             ]
0029 %           [   4 - Gauss-Seidel                                            ]
0030 %       2  - PF_TOL, 1e-8           termination tolerance on per unit
0031 %                                   P & Q mismatch
0032 %       3  - PF_MAX_IT, 10          maximum number of iterations for
0033 %                                   Newton's method
0034 %       4  - PF_MAX_IT_FD, 30       maximum number of iterations for
0035 %                                   fast decoupled method
0036 %       5  - PF_MAX_IT_GS, 1000     maximum number of iterations for
0037 %                                   Gauss-Seidel method
0038 %       6  - ENFORCE_Q_LIMS, 0      enforce gen reactive power limits
0039 %                                   at expense of |V|
0040 %           [    0 - do NOT enforce limits                                  ]
0041 %           [    1 - enforce limits, simultaneous bus type conversion       ]
0042 %           [    2 - enforce limits, one-at-a-time bus type conversion      ]
0043 %       10 - PF_DC, 0               DC modeling for power flow & OPF
0044 %           [    0 - use AC formulation & corresponding algorithm options   ]
0045 %           [    1 - use DC formulation, ignore AC algorithm options        ]
0046 %   OPF options
0047 %       11 - OPF_ALG, 0             solver to use for AC OPF
0048 %           [    0 - choose default solver based on availability in the     ]
0049 %           [        following order, 540, 560                              ]
0050 %           [  300 - constr, MATLAB Optimization Toolbox 1.x and 2.x        ]
0051 %           [  320 - dense successive LP                                    ]
0052 %           [  340 - sparse successive LP (relaxed)                         ]
0053 %           [  360 - sparse successive LP (full)                            ]
0054 %           [  500 - MINOPF, MINOS-based solver, requires optional          ]
0055 %           [        MEX-based MINOPF package, available from:              ]
0056 %           [        http://www.pserc.cornell.edu/minopf/                   ]
0057 %           [  520 - fmincon, MATLAB Optimization Toolbox >= 2.x            ]
0058 %           [  540 - PDIPM, primal/dual interior point method, requires     ]
0059 %           [        optional MEX-based TSPOPF package, available from:     ]
0060 %           [        http://www.pserc.cornell.edu/tspopf/                   ]
0061 %           [  545 - SC-PDIPM, step-controlled variant of PDIPM, requires   ]
0062 %           [        TSPOPF (see 540)                                       ]
0063 %           [  550 - TRALM, trust region based augmented Langrangian        ]
0064 %           [        method, requires TSPOPF (see 540)                      ]
0065 %           [  560 - MIPS, MATLAB Interior Point Solver                     ]
0066 %           [        primal/dual interior point method (pure MATLAB)        ]
0067 %           [  565 - MIPS-sc, step-controlled variant of MIPS               ]
0068 %           [        primal/dual interior point method (pure MATLAB)        ]
0069 %           [  580 - IPOPT, requires MEX interface to IPOPT solver          ]
0070 %           [        available from: https://projects.coin-or.org/Ipopt/    ]
0071 %       16 - OPF_VIOLATION, 5e-6    constraint violation tolerance
0072 %       17 - CONSTR_TOL_X, 1e-4     termination tol on x for constr/fmincon
0073 %       18 - CONSTR_TOL_F, 1e-4     termination tol on f for constr/fmincon
0074 %       19 - CONSTR_MAX_IT, 0       max number of iterations for constr/fmincon
0075 %                                   [       0 => 2*nb + 150                 ]
0076 %       20 - LPC_TOL_GRAD, 3e-3     termination tolerance on gradient, LP-based
0077 %                                   solver
0078 %       21 - LPC_TOL_X, 1e-4        termination tolerance on x (min step size),
0079 %                                   LP-based solver
0080 %       22 - LPC_MAX_IT, 400        maximum number of iterations, LP-based slvr
0081 %       23 - LPC_MAX_RESTART, 5     maximum number of restarts, LP-based solver
0082 %       24 - OPF_FLOW_LIM, 0        qty to limit for branch flow constraints
0083 %           [   0 - apparent power flow (limit in MVA)                      ]
0084 %           [   1 - active power flow (limit in MW)                         ]
0085 %           [   2 - current magnitude (limit in MVA at 1 p.u. voltage)      ]
0086 %       25 - OPF_IGNORE_ANG_LIM, 0  ignore angle difference limits for branches
0087 %                                   even if specified           [   0 or 1  ]
0088 %       26 - OPF_ALG_DC, 0          solver to use for DC OPF
0089 %           [    0 - choose default solver based on availability in the     ]
0090 %           [        following order, 600, 100, 500, 200                    ]
0091 %           [  100 - BPMPD, requires optional MEX-based BPMPD_MEX package   ]
0092 %           [        available from: http://www.pserc.cornell.edu/bpmpd/    ]
0093 %           [  200 - MIPS, MATLAB Interior Point Solver                     ]
0094 %           [        primal/dual interior point method (pure MATLAB)        ]
0095 %           [  250 - MIPS-sc, step-controlled variant of MIPS               ]
0096 %           [  300 - MATLAB Optimization Toolbox, QUADPROG, LINPROG         ]
0097 %           [  400 - IPOPT, requires MEX interface to IPOPT solver          ]
0098 %                    available from: https://projects.coin-or.org/Ipopt/    ]
0099 %           [  500 - CPLEX, requires Matlab interface to CPLEX solver       ]
0100 %           [  600 - MOSEK, requires Matlab interface to MOSEK solver       ]
0101 %                    available from: http://www.mosek.com/                  ]
0102 %   output options
0103 %       31 - VERBOSE, 1             amount of progress info printed
0104 %           [   0 - print no progress info                                  ]
0105 %           [   1 - print a little progress info                            ]
0106 %           [   2 - print a lot of progress info                            ]
0107 %           [   3 - print all progress info                                 ]
0108 %       32 - OUT_ALL, -1            controls pretty-printing of results
0109 %           [  -1 - individual flags control what prints                    ]
0110 %           [   0 - do not print anything                                   ]
0111 %           [       (overrides individual flags, except OUT_RAW)            ]
0112 %           [   1 - print everything                                        ]
0113 %           [       (overrides individual flags, except OUT_RAW)            ]
0114 %       33 - OUT_SYS_SUM, 1         print system summary        [   0 or 1  ]
0115 %       34 - OUT_AREA_SUM, 0        print area summaries        [   0 or 1  ]
0116 %       35 - OUT_BUS, 1             print bus detail            [   0 or 1  ]
0117 %       36 - OUT_BRANCH, 1          print branch detail         [   0 or 1  ]
0118 %       37 - OUT_GEN, 0             print generator detail      [   0 or 1  ]
0119 %                                   (OUT_BUS also includes gen info)
0120 %       38 - OUT_ALL_LIM, -1        controls what constraint info is printed
0121 %           [  -1 - individual flags control what constraint info prints    ]
0122 %           [   0 - no constraint info (overrides individual flags)         ]
0123 %           [   1 - binding constraint info (overrides individual flags)    ]
0124 %           [   2 - all constraint info (overrides individual flags)        ]
0125 %       39 - OUT_V_LIM, 1           control output of voltage limit info
0126 %           [   0 - do not print                                            ]
0127 %           [   1 - print binding constraints only                          ]
0128 %           [   2 - print all constraints                                   ]
0129 %           [   (same options for OUT_LINE_LIM, OUT_PG_LIM, OUT_QG_LIM)     ]
0130 %       40 - OUT_LINE_LIM, 1        control output of line flow limit info
0131 %       41 - OUT_PG_LIM, 1          control output of gen P limit info
0132 %       42 - OUT_QG_LIM, 1          control output of gen Q limit info
0133 %       52 - RETURN_RAW_DER, 0      return constraint and derivative info
0134 %                                   in results.raw (in fields g, dg, df, d2f)
0135 %   FMINCON options
0136 %       55 - FMC_ALG, 1             algorithm used by fmincon for OPF
0137 %                                   for Optimization Toolbox 4 and later
0138 %            [  1 - active-set                                              ]
0139 %            [  2 - interior-point, w/default 'bfgs' Hessian approx         ]
0140 %            [  3 - interior-point, w/ 'lbfgs' Hessian approx               ]
0141 %            [  4 - interior-point, w/exact user-supplied Hessian           ]
0142 %            [  5 - interior-point, w/Hessian via finite differences        ]
0143 %
0144 %   IPOPT options
0145 %       60 - IPOPT_OPT, 0           See IPOPT_OPTIONS for details.
0146 %
0147 %   MINOPF options
0148 %       61 - MNS_FEASTOL, 0 (1e-3)  primal feasibility tolerance,
0149 %                                   set to value of OPF_VIOLATION by default
0150 %       62 - MNS_ROWTOL, 0  (1e-3)  row tolerance
0151 %                                   set to value of OPF_VIOLATION by default
0152 %       63 - MNS_XTOL, 0    (1e-3)  x tolerance
0153 %                                   set to value of CONSTR_TOL_X by default
0154 %       64 - MNS_MAJDAMP, 0 (0.5)   major damping parameter
0155 %       65 - MNS_MINDAMP, 0 (2.0)   minor damping parameter
0156 %       66 - MNS_PENALTY_PARM, 0 (1.0)  penalty parameter
0157 %       67 - MNS_MAJOR_IT, 0 (200)  major iterations
0158 %       68 - MNS_MINOR_IT, 0 (2500) minor iterations
0159 %       69 - MNS_MAX_IT, 0 (2500)   iterations limit
0160 %       70 - MNS_VERBOSITY, -1
0161 %           [  -1 - controlled by VERBOSE option                            ]
0162 %           [   0 - print nothing                                           ]
0163 %           [   1 - print only termination status message                   ]
0164 %           [   2 - print termination status and screen progress            ]
0165 %           [   3 - print screen progress, report file (usually fort.9)     ]
0166 %       71 - MNS_CORE, 0 (1200 * nb + 2 * (nb + ng)^2) memory allocation
0167 %       72 - MNS_SUPBASIC_LIM, 0 (2*nb + 2*ng) superbasics limit
0168 %       73 - MNS_MULT_PRICE, 0 (30) multiple price
0169 %
0170 %   MIPS (including MIPS-sc), PDIPM, SC-PDIPM, and TRALM options
0171 %       81 - PDIPM_FEASTOL, 0       feasibility (equality) tolerance
0172 %                                   for MIPS, PDIPM and SC-PDIPM, set
0173 %                                   to value of OPF_VIOLATION by default
0174 %       82 - PDIPM_GRADTOL, 1e-6    gradient tolerance for MIPS, PDIPM
0175 %                                   and SC-PDIPM
0176 %       83 - PDIPM_COMPTOL, 1e-6    complementary condition (inequality)
0177 %                                   tolerance for MIPS, PDIPM and SC-PDIPM
0178 %       84 - PDIPM_COSTTOL, 1e-6    optimality tolerance for MIPS, PDIPM
0179 %                                   and SC-PDIPM
0180 %       85 - PDIPM_MAX_IT,  150     maximum number of iterations for MIPS,
0181 %                                   PDIPM and SC-PDIPM
0182 %       86 - SCPDIPM_RED_IT, 20     maximum number of MIPS-sc or SC-PDIPM
0183 %                                   reductions per iteration
0184 %       87 - TRALM_FEASTOL, 0       feasibility tolerance for TRALM
0185 %                                   set to value of OPF_VIOLATION by default
0186 %       88 - TRALM_PRIMETOL, 5e-4   primal variable tolerance for TRALM
0187 %       89 - TRALM_DUALTOL, 5e-4    dual variable tolerance for TRALM
0188 %       90 - TRALM_COSTTOL, 1e-5    optimality tolerance for TRALM
0189 %       91 - TRALM_MAJOR_IT, 40     maximum number of major iterations
0190 %       92 - TRALM_MINOR_IT, 100    maximum number of minor iterations
0191 %       93 - SMOOTHING_RATIO, 0.04  piecewise linear curve smoothing ratio
0192 %                                   used in SC-PDIPM and TRALM
0193 %
0194 %   CPLEX options
0195 %       95 - CPLEX_LPMETHOD, 0      solution algorithm for continuous LPs
0196 %           [   0 - automatic: let CPLEX choose                             ]
0197 %           [   1 - primal simplex                                          ]
0198 %           [   2 - dual simplex                                            ]
0199 %           [   3 - network simplex                                         ]
0200 %           [   4 - barrier                                                 ]
0201 %           [   5 - sifting                                                 ]
0202 %           [   6 - concurrent (dual, barrier, and primal)                  ]
0203 %       96 - CPLEX_QPMETHOD, 0      solution algorithm for continuous QPs
0204 %           [   0 - automatic: let CPLEX choose                             ]
0205 %           [   1 - primal simplex optimizer                                ]
0206 %           [   2 - dual simplex optimizer                                  ]
0207 %           [   3 - network optimizer                                       ]
0208 %           [   4 - barrier optimizer                                       ]
0209 %       97 - CPLEX_OPT, 0           See CPLEX_OPTIONS for details
0210 %
0211 %   MOSEK options
0212 %       111 - MOSEK_LP_ALG, 0       solution algorithm for continuous LPs
0213 %                                       (MSK_IPAR_OPTIMIZER)
0214 %           [   0 - automatic: let MOSEK choose                             ]
0215 %           [   1 - interior point                                          ]
0216 %           [   4 - primal simplex                                          ]
0217 %           [   5 - dual simplex                                            ]
0218 %           [   6 - primal dual simplex                                     ]
0219 %           [   7 - automatic simplex (MOSEK chooses which simplex method)  ]
0220 %           [   10 - concurrent                                             ]
0221 %       112 - MOSEK_MAX_IT, 0 (400)     interior point max iterations
0222 %                                           (MSK_IPAR_INTPNT_MAX_ITERATIONS)
0223 %       113 - MOSEK_GAP_TOL, 0 (1e-8)   interior point relative gap tolerance
0224 %                                           (MSK_DPAR_INTPNT_TOL_REL_GAP)
0225 %       114 - MOSEK_MAX_TIME, 0 (-1)    maximum time allowed for solver
0226 %                                           (MSK_DPAR_OPTIMIZER_MAX_TIME)
0227 %       115 - MOSEK_NUM_THREADS, 0 (1)  maximum number of threads to use
0228 %                                           (MSK_IPAR_INTPNT_NUM_THREADS)
0229 %       116 - MOSEK_OPT, 0              See MOSEK_OPTIONS for details
0230 %
0231 %   deprecated options
0232 %       43 - OUT_RAW, 0             print raw data for Perl database
0233 %                                   interface code              [   0 or 1  ]
0234 %       51 - SPARSE_QP, 1           pass sparse matrices to QP and LP
0235 %                                   solvers if possible         [   0 or 1  ]
0236 
0237 %   MATPOWER
0238 %   $Id: mpoption.m,v 1.46 2010/11/24 22:31:32 cvs Exp $
0239 %   by Ray Zimmerman, PSERC Cornell
0240 %   Copyright (c) 1996-2010 by Power System Engineering Research Center (PSERC)
0241 %
0242 %   This file is part of MATPOWER.
0243 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0244 %
0245 %   MATPOWER is free software: you can redistribute it and/or modify
0246 %   it under the terms of the GNU General Public License as published
0247 %   by the Free Software Foundation, either version 3 of the License,
0248 %   or (at your option) any later version.
0249 %
0250 %   MATPOWER is distributed in the hope that it will be useful,
0251 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0252 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0253 %   GNU General Public License for more details.
0254 %
0255 %   You should have received a copy of the GNU General Public License
0256 %   along with MATPOWER. If not, see <http://www.gnu.org/licenses/>.
0257 %
0258 %   Additional permission under GNU GPL version 3 section 7
0259 %
0260 %   If you modify MATPOWER, or any covered work, to interface with
0261 %   other modules (such as MATLAB code and MEX-files) available in a
0262 %   MATLAB(R) or comparable environment containing parts covered
0263 %   under other licensing terms, the licensors of MATPOWER grant
0264 %   you additional permission to convey the resulting work.
0265 
0266 %%-----  set up default option values  -----
0267 i = 1;
0268 if rem(nargin, 2)       %% odd number of arguments
0269     options = varargin{1};  %% base options vector passed in
0270     i = 2;                  %% start processing parameters with 2nd one
0271 else                    %% even number of parameters
0272     options = [             %% use defaults for base options vector
0273     
0274         %% power flow options
0275         1;      %% 1  - PF_ALG
0276         1e-8;   %% 2  - PF_TOL
0277         10;     %% 3  - PF_MAX_IT
0278         30;     %% 4  - PF_MAX_IT_FD
0279         1000;   %% 5  - PF_MAX_IT_GS
0280         0;      %% 6  - ENFORCE_Q_LIMS
0281         0;      %% 7  - RESERVED7
0282         0;      %% 8  - RESERVED8
0283         0;      %% 9  - RESERVED9
0284         0;      %% 10 - PF_DC
0285         
0286         %% OPF options
0287         0;      %% 11 - OPF_ALG
0288         100;    %% 12 - OPF_ALG_POLY, deprecated
0289         200;    %% 13 - OPF_ALG_PWL, deprecated
0290         10;     %% 14 - OPF_POLY2PWL_PTS, deprecated
0291         0;      %% 15 - OPF_NEQ, not a user option (number of eq constraints
0292                 %%          for copf_solver, lpopf_solver, set by program)
0293         5e-6;   %% 16 - OPF_VIOLATION
0294         1e-4;   %% 17 - CONSTR_TOL_X
0295         1e-4;   %% 18 - CONSTR_TOL_F
0296         0;      %% 19 - CONSTR_MAX_IT
0297         3e-3;   %% 20 - LPC_TOL_GRAD
0298         1e-4;   %% 21 - LPC_TOL_X
0299         400;    %% 22 - LPC_MAX_IT
0300         5;      %% 23 - LPC_MAX_RESTART
0301         0;      %% 24 - OPF_FLOW_LIM
0302         0;      %% 25 - OPF_IGNORE_ANG_LIM
0303         0;      %% 26 - OPF_ALG_DC
0304         0;      %% 27 - RESERVED27
0305         0;      %% 28 - RESERVED28
0306         0;      %% 29 - RESERVED29
0307         0;      %% 30 - RESERVED30
0308         
0309         %% output options
0310         1;      %% 31 - VERBOSE
0311         -1;     %% 32 - OUT_ALL
0312         1;      %% 33 - OUT_SYS_SUM
0313         0;      %% 34 - OUT_AREA_SUM
0314         1;      %% 35 - OUT_BUS
0315         1;      %% 36 - OUT_BRANCH
0316         0;      %% 37 - OUT_GEN
0317         -1;     %% 38 - OUT_ALL_LIM
0318         1;      %% 39 - OUT_V_LIM
0319         1;      %% 40 - OUT_LINE_LIM
0320         1;      %% 41 - OUT_PG_LIM
0321         1;      %% 42 - OUT_QG_LIM
0322         0;      %% 43 - OUT_RAW
0323         0;      %% 44 - RESERVED44
0324         0;      %% 45 - RESERVED45
0325         0;      %% 46 - RESERVED46
0326         0;      %% 47 - RESERVED47
0327         0;      %% 48 - RESERVED48
0328         0;      %% 49 - RESERVED49
0329         0;      %% 50 - RESERVED50
0330         
0331         %% other options
0332         1;      %% 51 - SPARSE_QP
0333         0;      %% 52 - RETURN_RAW_DER
0334         0;      %% 53 - RESERVED53
0335         0;      %% 54 - RESERVED54
0336         1;      %% 55 - FMC_ALG
0337         0;      %% 56 - RESERVED56
0338         0;      %% 57 - RESERVED57
0339         0;      %% 58 - RESERVED58
0340         0;      %% 59 - RESERVED59
0341         0;      %% 60 - IPOPT_OPT
0342         
0343         %% MINOPF options
0344         0;      %% 61 - MNS_FEASTOL
0345         0;      %% 62 - MNS_ROWTOL
0346         0;      %% 63 - MNS_XTOL
0347         0;      %% 64 - MNS_MAJDAMP
0348         0;      %% 65 - MNS_MINDAMP
0349         0;      %% 66 - MNS_PENALTY_PARM
0350         0;      %% 67 - MNS_MAJOR_IT
0351         0;      %% 68 - MNS_MINOR_IT
0352         0;      %% 69 - MNS_MAX_IT
0353         -1;     %% 70 - MNS_VERBOSITY
0354         0;      %% 71 - MNS_CORE
0355         0;      %% 72 - MNS_SUPBASIC_LIM
0356         0;      %% 73 - MNS_MULT_PRICE
0357         0;      %% 74 - RESERVED74
0358         0;      %% 75 - RESERVED75
0359         0;      %% 76 - RESERVED76
0360         0;      %% 77 - RESERVED77
0361         0;      %% 78 - RESERVED78
0362         0;      %% 79 - RESERVED79
0363         0;      %% 80 - FORCE_PC_EQ_P0, for c3sopf
0364         
0365         %% MIPS, PDIPM, SC-PDIPM, and TRALM options
0366         0;      %% 81 - PDIPM_FEASTOL
0367         1e-6;   %% 82 - PDIPM_GRADTOL
0368         1e-6;   %% 83 - PDIPM_COMPTOL
0369         1e-6;   %% 84 - PDIPM_COSTTOL
0370         150;    %% 85 - PDIPM_MAX_IT
0371         20;     %% 86 - SCPDIPM_RED_IT
0372         0;      %% 87 - TRALM_FEASTOL
0373         5e-4;   %% 88 - TRALM_PRIMETOL
0374         5e-4;   %% 89 - TRALM_DUALTOL
0375         1e-5;   %% 90 - TRALM_COSTTOL
0376         40;     %% 91 - TRALM_MAJOR_IT
0377         100;    %% 92 - TRALM_MINOR_IT
0378         0.04;   %% 93 - SMOOTHING_RATIO
0379         0;      %% 94 - RESERVED94
0380         
0381         %% CPLEX options
0382         0;      %% 95 - CPLEX_LPMETHOD
0383         0;      %% 96 - CPLEX_QPMETHOD
0384         0;      %% 97 - CPLEX_OPT
0385         0;      %% 98 - RESERVED98
0386         0;      %% 99 - RESERVED99
0387         0;      %% 100 - RESERVED100
0388         0;      %% 101 - RESERVED101
0389         0;      %% 102 - RESERVED102
0390         0;      %% 103 - RESERVED103
0391         0;      %% 104 - RESERVED104
0392         0;      %% 105 - RESERVED105
0393         0;      %% 106 - RESERVED106
0394         0;      %% 107 - RESERVED107
0395         0;      %% 108 - RESERVED108
0396         0;      %% 109 - RESERVED109
0397         0;      %% 110 - RESERVED110
0398 
0399         %% MOSEK options
0400         0;      %% 111 - MOSEK_LP_ALG
0401         0;      %% 112 - MOSEK_MAX_IT
0402         0;      %% 113 - MOSEK_GAP_TOL
0403         0;      %% 114 - MOSEK_MAX_TIME
0404         0;      %% 115 - MOSEK_NUM_THREADS
0405         0;      %% 116 - MOSEK_OPT
0406     ];
0407 end
0408 
0409 %%-----  set up option names  -----
0410 %% power flow options
0411 names = char(   'PF_ALG', ...               %% 1
0412                 'PF_TOL', ...               %% 2
0413                 'PF_MAX_IT', ...            %% 3
0414                 'PF_MAX_IT_FD', ...         %% 4
0415                 'PF_MAX_IT_GS', ...         %% 5
0416                 'ENFORCE_Q_LIMS', ...       %% 6
0417                 'RESERVED7', ...            %% 7
0418                 'RESERVED8', ...            %% 8
0419                 'RESERVED9', ...            %% 9
0420                 'PF_DC' );                  %% 10
0421 
0422 %% OPF options
0423 names = char(   names, ...
0424                 'OPF_ALG', ...              %% 11
0425                 'OPF_ALG_POLY', ...         %% 12
0426                 'OPF_ALG_PWL', ...          %% 13
0427                 'OPF_POLY2PWL_PTS', ...     %% 14
0428                 'OPF_NEQ', ...              %% 15
0429                 'OPF_VIOLATION', ...        %% 16
0430                 'CONSTR_TOL_X', ...         %% 17
0431                 'CONSTR_TOL_F', ...         %% 18
0432                 'CONSTR_MAX_IT', ...        %% 19
0433                 'LPC_TOL_GRAD'  );          %% 20
0434 names = char(   names, ...
0435                 'LPC_TOL_X', ...            %% 21
0436                 'LPC_MAX_IT', ...           %% 22
0437                 'LPC_MAX_RESTART', ...      %% 23
0438                 'OPF_FLOW_LIM', ...         %% 24
0439                 'OPF_IGNORE_ANG_LIM', ...   %% 25
0440                 'OPF_ALG_DC', ...           %% 26
0441                 'RESERVED27', ...           %% 27
0442                 'RESERVED28', ...           %% 28
0443                 'RESERVED29', ...           %% 29
0444                 'RESERVED30'    );          %% 30
0445 
0446 %% output options
0447 names = char(   names, ...
0448                 'VERBOSE', ...              %% 31
0449                 'OUT_ALL', ...              %% 32
0450                 'OUT_SYS_SUM', ...          %% 33
0451                 'OUT_AREA_SUM', ...         %% 34
0452                 'OUT_BUS', ...              %% 35
0453                 'OUT_BRANCH', ...           %% 36
0454                 'OUT_GEN', ...              %% 37
0455                 'OUT_ALL_LIM', ...          %% 38
0456                 'OUT_V_LIM', ...            %% 39
0457                 'OUT_LINE_LIM'  );          %% 40
0458 names = char(   names, ...
0459                 'OUT_PG_LIM', ...           %% 41
0460                 'OUT_QG_LIM', ...           %% 42
0461                 'OUT_RAW', ...              %% 43
0462                 'RESERVED44', ...           %% 44
0463                 'RESERVED45', ...           %% 45
0464                 'RESERVED46', ...           %% 46
0465                 'RESERVED47', ...           %% 47
0466                 'RESERVED48', ...           %% 48
0467                 'RESERVED49', ...           %% 49
0468                 'RESERVED50'    );          %% 50
0469 %% other options
0470 names = char(   names, ...
0471                 'SPARSE_QP', ...            %% 51
0472                 'RETURN_RAW_DER', ...       %% 52
0473                 'RESERVED53', ...           %% 53
0474                 'RESERVED54', ...           %% 54
0475                 'FMC_ALG', ...              %% 55
0476                 'RESERVED56', ...           %% 56
0477                 'RESERVED57', ...           %% 57
0478                 'RESERVED58', ...           %% 58
0479                 'RESERVED59', ...           %% 59
0480                 'IPOPT_OPT'     );          %% 60
0481 %% MINOS options
0482 names = char(   names, ...
0483                 'MNS_FEASTOL', ...          %% 61
0484                 'MNS_ROWTOL', ...           %% 62
0485                 'MNS_XTOL', ...             %% 63
0486                 'MNS_MAJDAMP', ...          %% 64
0487                 'MNS_MINDAMP', ...          %% 65
0488                 'MNS_PENALTY_PARM', ...     %% 66
0489                 'MNS_MAJOR_IT', ...         %% 67
0490                 'MNS_MINOR_IT', ...         %% 68
0491                 'MNS_MAX_IT', ...           %% 69
0492                 'MNS_VERBOSITY' );          %% 70
0493 %% other flags
0494 names = char(   names, ...
0495                 'MNS_CORE', ...             %% 71
0496                 'MNS_SUPBASIC_LIM', ...     %% 72
0497                 'MNS_MULT_PRICE', ...       %% 73
0498                 'RESERVED74', ...           %% 74
0499                 'RESERVED75', ...           %% 75
0500                 'RESERVED76', ...           %% 76
0501                 'RESERVED77', ...           %% 77
0502                 'RESERVED78', ...           %% 78
0503                 'RESERVED79', ...           %% 79
0504                 'FORCE_PC_EQ_P0'    );      %% 80
0505 
0506 %% MIPS, PDIPM, SC-PDIPM, and TRALM options
0507 names = char(   names, ...
0508                 'PDIPM_FEASTOL', ...        %% 81
0509                 'PDIPM_GRADTOL', ...        %% 82
0510                 'PDIPM_COMPTOL', ...        %% 83
0511                 'PDIPM_COSTTOL', ...        %% 84
0512                 'PDIPM_MAX_IT', ...         %% 85
0513                 'SCPDIPM_RED_IT', ...       %% 86
0514                 'TRALM_FEASTOL', ...        %% 87
0515                 'TRALM_PRIMETOL', ...       %% 88
0516                 'TRALM_DUALTOL', ...        %% 89
0517                 'TRALM_COSTTOL', ...        %% 90
0518                 'TRALM_MAJOR_IT', ...       %% 91
0519                 'TRALM_MINOR_IT', ...       %% 92
0520                 'SMOOTHING_RATIO'   );      %% 93
0521 
0522 %% CPLEX options
0523 names = char(   names, ...
0524                 'RESERVED94', ...           %% 94
0525                 'CPLEX_LPMETHOD', ...       %% 95
0526                 'CPLEX_QPMETHOD', ...       %% 96
0527                 'CPLEX_OPT', ...            %% 97
0528                 'RESERVED98', ...           %% 98
0529                 'RESERVED99', ...           %% 99
0530                 'RESERVED100', ...          %% 100
0531                 'RESERVED101', ...          %% 101
0532                 'RESERVED102', ...          %% 102
0533                 'RESERVED103', ...          %% 103
0534                 'RESERVED104', ...          %% 104
0535                 'RESERVED105', ...          %% 105
0536                 'RESERVED106', ...          %% 106
0537                 'RESERVED107', ...          %% 107
0538                 'RESERVED108', ...          %% 108
0539                 'RESERVED109', ...          %% 109
0540                 'RESERVED110'   );          %% 110
0541 
0542 %% MOSEK options
0543 names = char(   names, ...
0544                 'MOSEK_LP_ALG', ...         %% 111
0545                 'MOSEK_MAX_IT', ...         %% 112
0546                 'MOSEK_GAP_TOL', ...        %% 113
0547                 'MOSEK_MAX_TIME', ...       %% 114
0548                 'MOSEK_NUM_THREADS', ...    %% 115
0549                 'MOSEK_OPT' );              %% 116
0550 
0551 %%-----  process parameters  -----
0552 while i <= nargin
0553     %% get parameter name and value
0554     pname = varargin{i};
0555     pval  = varargin{i+1};
0556     
0557     %% get parameter index
0558     namestr = names';
0559     namestr = namestr(:)';
0560     namelen = size(names, 2);
0561     pidx = ceil(findstr([pname blanks(namelen-length(pname))], namestr) / namelen);
0562     if isempty(pidx)
0563         error('"%s" is not a valid named option', pname);
0564     end
0565     % fprintf('''%s'' (%d) = %d\n', pname, pidx, pval);
0566 
0567     %% update option
0568     options(pidx) = pval;
0569 
0570     i = i + 2;                              %% go to next parameter
0571 end

Generated on Mon 26-Jan-2015 14:56:45 by m2html © 2005