opf_slvr.m

来自「以上所传的内容为电力系统比较全面的分析程序,才用的是matlab编写m的文件」· M 代码 · 共 32 行

M
32
字号
function code = opf_slvr(alg)%OPF_SLVR    Which OPF solver is used by alg.%   code = opf_slvr(alg) returns a solver code given an algorithm code.%   The codes are:%       0 - 'constr' from Optimization Toolbox 1.x or 2.x%       1 - 'LPconstr', dense LP-based solver%       2 - 'LPconstr', sparse LP-based solver with relaxed constraints%       3 - 'LPconstr', sparse LP-based solver with full set of constraints%       4 - 'fmincon', from Optimization Toolbox 2.x and later%       5 - 'minopf', MINOS-based solver%   MATPOWER%   $Id: opf_slvr.m,v 1.5 2004/09/01 16:17:53 ray Exp $%   by Ray Zimmerman, PSERC Cornell%   Copyright (c) 1996-2004 by Power System Engineering Research Center (PSERC)%   See http://www.pserc.cornell.edu/matpower/ for more info.if alg < 500    code = rem(alg, 100) / 20;    if code ~= 0 & code ~= 1 & code ~= 2 & code ~= 3        error(['opf_slvr: unknown OPF algorithm (', num2str(alg) , ')']);    endelseif alg == 520    code = 4;elseif alg == 500    code = 5;else    error(['opf_slvr: unknown OPF algorithm (', num2str(alg) , ')']);endreturn;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?