Home > matpower6.0 > t > t_opf_fmincon.m

t_opf_fmincon

PURPOSE ^

T_OPF_FMINCON Tests for FMINCON-based optimal power flow.

SYNOPSIS ^

function t_opf_fmincon(quiet)

DESCRIPTION ^

T_OPF_FMINCON  Tests for FMINCON-based optimal power flow.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function t_opf_fmincon(quiet)
0002 %T_OPF_FMINCON  Tests for FMINCON-based optimal power flow.
0003 
0004 %   MATPOWER
0005 %   Copyright (c) 2004-2016, Power Systems Engineering Research Center (PSERC)
0006 %   by Ray Zimmerman, PSERC Cornell
0007 %
0008 %   This file is part of MATPOWER.
0009 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0010 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0011 
0012 if nargin < 1
0013     quiet = 0;
0014 end
0015 
0016 num_tests = 125;
0017 
0018 t_begin(num_tests, quiet);
0019 
0020 [PQ, PV, REF, NONE, BUS_I, BUS_TYPE, PD, QD, GS, BS, BUS_AREA, VM, ...
0021     VA, BASE_KV, ZONE, VMAX, VMIN, LAM_P, LAM_Q, MU_VMAX, MU_VMIN] = idx_bus;
0022 [GEN_BUS, PG, QG, QMAX, QMIN, VG, MBASE, GEN_STATUS, PMAX, PMIN, ...
0023     MU_PMAX, MU_PMIN, MU_QMAX, MU_QMIN, PC1, PC2, QC1MIN, QC1MAX, ...
0024     QC2MIN, QC2MAX, RAMP_AGC, RAMP_10, RAMP_30, RAMP_Q, APF] = idx_gen;
0025 [F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, ...
0026     TAP, SHIFT, BR_STATUS, PF, QF, PT, QT, MU_SF, MU_ST, ...
0027     ANGMIN, ANGMAX, MU_ANGMIN, MU_ANGMAX] = idx_brch;
0028 [PW_LINEAR, POLYNOMIAL, MODEL, STARTUP, SHUTDOWN, NCOST, COST] = idx_cost;
0029 
0030 casefile = 't_case9_opf';
0031 if quiet
0032     verbose = 0;
0033 else
0034     verbose = 0;
0035 end
0036 
0037 t0 = 'fmincon OPF : ';
0038 mpopt = mpoption('opf.violation', 1e-6, 'fmincon.tol_x', 1e-6, 'fmincon.tol_f', 1e-9);
0039 mpopt = mpoption(mpopt, 'out.all', 0, 'verbose', verbose, 'opf.ac.solver', 'FMINCON');
0040 
0041 %% use active-set method for Matlab 7.6-7.9 (R2008a-R2009b)
0042 vstr = have_fcn('matlab', 'vstr');
0043 if strcmp(vstr, '7.6') || strcmp(vstr, '7.7') || ...
0044         strcmp(vstr, '7.8') || strcmp(vstr, '7.9')
0045     mpopt = mpoption(mpopt, 'fmincon.alg', 1);
0046 end
0047 
0048 if have_fcn('fmincon')
0049     %% set up indices
0050     ib_data     = [1:BUS_AREA BASE_KV:VMIN];
0051     ib_voltage  = [VM VA];
0052     ib_lam      = [LAM_P LAM_Q];
0053     ib_mu       = [MU_VMAX MU_VMIN];
0054     ig_data     = [GEN_BUS QMAX QMIN MBASE:APF];
0055     ig_disp     = [PG QG VG];
0056     ig_mu       = (MU_PMAX:MU_QMIN);
0057     ibr_data    = (1:ANGMAX);
0058     ibr_flow    = (PF:QT);
0059     ibr_mu      = [MU_SF MU_ST];
0060     ibr_angmu   = [MU_ANGMIN MU_ANGMAX];
0061 
0062     %% get solved AC OPF case from MAT-file
0063     load soln9_opf;     %% defines bus_soln, gen_soln, branch_soln, f_soln
0064 
0065     %% run OPF
0066     t = t0;
0067     [baseMVA, bus, gen, gencost, branch, f, success, et] = runopf(casefile, mpopt);
0068     t_ok(success, [t 'success']);
0069     t_is(f, f_soln, 3, [t 'f']);
0070     t_is(   bus(:,ib_data   ),    bus_soln(:,ib_data   ), 10, [t 'bus data']);
0071     t_is(   bus(:,ib_voltage),    bus_soln(:,ib_voltage),  3, [t 'bus voltage']);
0072     t_is(   bus(:,ib_lam    ),    bus_soln(:,ib_lam    ),  3, [t 'bus lambda']);
0073     t_is(   bus(:,ib_mu     ),    bus_soln(:,ib_mu     ),  2, [t 'bus mu']);
0074     t_is(   gen(:,ig_data   ),    gen_soln(:,ig_data   ), 10, [t 'gen data']);
0075     t_is(   gen(:,ig_disp   ),    gen_soln(:,ig_disp   ),  3, [t 'gen dispatch']);
0076     t_is(   gen(:,ig_mu     ),    gen_soln(:,ig_mu     ),  3, [t 'gen mu']);
0077     t_is(branch(:,ibr_data  ), branch_soln(:,ibr_data  ), 10, [t 'branch data']);
0078     t_is(branch(:,ibr_flow  ), branch_soln(:,ibr_flow  ),  3, [t 'branch flow']);
0079     t_is(branch(:,ibr_mu    ), branch_soln(:,ibr_mu    ),  2, [t 'branch mu']);
0080 
0081     %% run with automatic conversion of single-block pwl to linear costs
0082     t = [t0 '(single-block PWL) : '];
0083     mpc = loadcase(casefile);
0084     mpc.gencost(3, NCOST) = 2;
0085     [r, success] = runopf(mpc, mpopt);
0086     [f, bus, gen, branch] = deal(r.f, r.bus, r.gen, r.branch);
0087     t_ok(success, [t 'success']);
0088     t_is(f, f_soln, 3, [t 'f']);
0089     t_is(   bus(:,ib_data   ),    bus_soln(:,ib_data   ), 10, [t 'bus data']);
0090     t_is(   bus(:,ib_voltage),    bus_soln(:,ib_voltage),  3, [t 'bus voltage']);
0091     t_is(   bus(:,ib_lam    ),    bus_soln(:,ib_lam    ),  3, [t 'bus lambda']);
0092     t_is(   bus(:,ib_mu     ),    bus_soln(:,ib_mu     ),  2, [t 'bus mu']);
0093     t_is(   gen(:,ig_data   ),    gen_soln(:,ig_data   ), 10, [t 'gen data']);
0094     t_is(   gen(:,ig_disp   ),    gen_soln(:,ig_disp   ),  3, [t 'gen dispatch']);
0095     t_is(   gen(:,ig_mu     ),    gen_soln(:,ig_mu     ),  3, [t 'gen mu']);
0096     t_is(branch(:,ibr_data  ), branch_soln(:,ibr_data  ), 10, [t 'branch data']);
0097     t_is(branch(:,ibr_flow  ), branch_soln(:,ibr_flow  ),  3, [t 'branch flow']);
0098     t_is(branch(:,ibr_mu    ), branch_soln(:,ibr_mu    ),  2, [t 'branch mu']);
0099     xr = [r.var.val.Va;r.var.val.Vm;r.var.val.Pg;r.var.val.Qg;0;r.var.val.y];
0100     t_is(r.x, xr, 8, [t 'check on raw x returned from OPF']);
0101 
0102     %% get solved AC OPF case from MAT-file
0103     load soln9_opf_Plim;       %% defines bus_soln, gen_soln, branch_soln, f_soln
0104 
0105     %% run OPF with active power line limits
0106     t = [t0 '(P line lim) : '];
0107     mpopt1 = mpoption(mpopt, 'opf.flow_lim', 'P');
0108     [baseMVA, bus, gen, gencost, branch, f, success, et] = runopf(casefile, mpopt1);
0109     t_ok(success, [t 'success']);
0110     t_is(f, f_soln, 3, [t 'f']);
0111     t_is(   bus(:,ib_data   ),    bus_soln(:,ib_data   ), 10, [t 'bus data']);
0112     t_is(   bus(:,ib_voltage),    bus_soln(:,ib_voltage),  3, [t 'bus voltage']);
0113     t_is(   bus(:,ib_lam    ),    bus_soln(:,ib_lam    ),  3, [t 'bus lambda']);
0114     t_is(   bus(:,ib_mu     ),    bus_soln(:,ib_mu     ),  2, [t 'bus mu']);
0115     t_is(   gen(:,ig_data   ),    gen_soln(:,ig_data   ), 10, [t 'gen data']);
0116     t_is(   gen(:,ig_disp   ),    gen_soln(:,ig_disp   ),  3, [t 'gen dispatch']);
0117     t_is(   gen(:,ig_mu     ),    gen_soln(:,ig_mu     ),  3, [t 'gen mu']);
0118     t_is(branch(:,ibr_data  ), branch_soln(:,ibr_data  ), 10, [t 'branch data']);
0119     t_is(branch(:,ibr_flow  ), branch_soln(:,ibr_flow  ),  3, [t 'branch flow']);
0120     t_is(branch(:,ibr_mu    ), branch_soln(:,ibr_mu    ),  2, [t 'branch mu']);
0121 
0122     %%-----  test OPF with quadratic gen costs moved to generalized costs  -----
0123     mpc = loadcase(casefile);
0124     mpc.gencost = [
0125         2   1500    0   3   0.11    5   0;
0126         2   2000    0   3   0.085   1.2 0;
0127         2   3000    0   3   0.1225  1   0;
0128     ];
0129     [baseMVA, bus_soln, gen_soln, gencost, branch_soln, f_soln, success, et] = runopf(mpc, mpopt);
0130     branch_soln = branch_soln(:,1:MU_ST);
0131 
0132     A = sparse(0,0);
0133     l = [];
0134     u = [];
0135     nb = size(mpc.bus, 1);      % number of buses
0136     ng = size(mpc.gen, 1);      % number of gens
0137     thbas = 1;                thend    = thbas+nb-1;
0138     vbas     = thend+1;       vend     = vbas+nb-1;
0139     pgbas    = vend+1;        pgend    = pgbas+ng-1;
0140     qgbas    = pgend+1;       qgend    = qgbas+ng-1;
0141     nxyz = 2*nb + 2*ng;
0142     N = sparse((1:ng)', (pgbas:pgend)', mpc.baseMVA * ones(ng,1), ng, nxyz);
0143     fparm = ones(ng,1) * [ 1 0 0 1 ];
0144     [junk, ix] = sort(mpc.gen(:, 1));
0145     H = 2 * spdiags(mpc.gencost(ix, 5), 0, ng, ng);
0146     Cw = mpc.gencost(ix, 6);
0147     mpc.gencost(:, 5:7) = 0;
0148 
0149     %% run OPF with quadratic gen costs moved to generalized costs
0150     t = [t0 'w/quadratic generalized gen cost : '];
0151     [r, success] = opf(mpc, A, l, u, mpopt, N, fparm, H, Cw);
0152     [f, bus, gen, branch] = deal(r.f, r.bus, r.gen, r.branch);
0153     t_ok(success, [t 'success']);
0154     t_is(f, f_soln, 3, [t 'f']);
0155     t_is(   bus(:,ib_data   ),    bus_soln(:,ib_data   ), 10, [t 'bus data']);
0156     t_is(   bus(:,ib_voltage),    bus_soln(:,ib_voltage),  3, [t 'bus voltage']);
0157     t_is(   bus(:,ib_lam    ),    bus_soln(:,ib_lam    ),  3, [t 'bus lambda']);
0158     t_is(   bus(:,ib_mu     ),    bus_soln(:,ib_mu     ),  2, [t 'bus mu']);
0159     t_is(   gen(:,ig_data   ),    gen_soln(:,ig_data   ), 10, [t 'gen data']);
0160     t_is(   gen(:,ig_disp   ),    gen_soln(:,ig_disp   ),  3, [t 'gen dispatch']);
0161     t_is(   gen(:,ig_mu     ),    gen_soln(:,ig_mu     ),  3, [t 'gen mu']);
0162     t_is(branch(:,ibr_data  ), branch_soln(:,ibr_data  ), 10, [t 'branch data']);
0163     t_is(branch(:,ibr_flow  ), branch_soln(:,ibr_flow  ),  3, [t 'branch flow']);
0164     t_is(branch(:,ibr_mu    ), branch_soln(:,ibr_mu    ),  2, [t 'branch mu']);
0165     t_is(r.cost.usr, f, 12, [t 'user cost']);
0166 
0167     %%-----  run OPF with extra linear user constraints & costs  -----
0168     %% single new z variable constrained to be greater than or equal to
0169     %% deviation from 1 pu voltage at bus 1, linear cost on this z
0170     %% get solved AC OPF case from MAT-file
0171     load soln9_opf_extras1;   %% defines bus_soln, gen_soln, branch_soln, f_soln
0172     A = sparse([1;1;2;2],[10;25;10;25],[-1;1;1;1],2,25);
0173     u = [Inf; Inf];
0174     l = [-1; 1];
0175 
0176     N = sparse(1, 25, 1, 1, 25);    %% new z variable only
0177     fparm = [1 0 0 1];              %% w = r = z
0178     H = sparse(1,1);                %% no quadratic term
0179     Cw = 100;
0180 
0181     t = [t0 'w/extra constraints & costs 1 : '];
0182     [r, success] = opf(casefile, A, l, u, mpopt, N, fparm, H, Cw);
0183     [f, bus, gen, branch] = deal(r.f, r.bus, r.gen, r.branch);
0184     t_ok(success, [t 'success']);
0185     t_is(f, f_soln, 3, [t 'f']);
0186     t_is(   bus(:,ib_data   ),    bus_soln(:,ib_data   ), 10, [t 'bus data']);
0187     t_is(   bus(:,ib_voltage),    bus_soln(:,ib_voltage),  3, [t 'bus voltage']);
0188     t_is(   bus(:,ib_lam    ),    bus_soln(:,ib_lam    ),  2, [t 'bus lambda']);
0189     t_is(   bus(:,ib_mu     ),    bus_soln(:,ib_mu     ),  2, [t 'bus mu']);
0190     t_is(   gen(:,ig_data   ),    gen_soln(:,ig_data   ), 10, [t 'gen data']);
0191     t_is(   gen(:,ig_disp   ),    gen_soln(:,ig_disp   ),  3, [t 'gen dispatch']);
0192     t_is(   gen(:,ig_mu     ),    gen_soln(:,ig_mu     ),  3, [t 'gen mu']);
0193     t_is(branch(:,ibr_data  ), branch_soln(:,ibr_data  ), 10, [t 'branch data']);
0194     t_is(branch(:,ibr_flow  ), branch_soln(:,ibr_flow  ),  3, [t 'branch flow']);
0195     t_is(branch(:,ibr_mu    ), branch_soln(:,ibr_mu    ),  2, [t 'branch mu']);
0196     t_is(r.var.val.z, 0.025419, 6, [t 'user variable']);
0197     t_is(r.cost.usr, 2.5419, 4, [t 'user cost']);
0198 
0199     %%-----  test OPF with capability curves  -----
0200     mpc = loadcase('t_case9_opfv2');
0201     %% remove angle diff limits
0202     mpc.branch(1, ANGMAX) = 360;
0203     mpc.branch(9, ANGMIN) = -360;
0204 
0205     %% get solved AC OPF case from MAT-file
0206     load soln9_opf_PQcap;   %% defines bus_soln, gen_soln, branch_soln, f_soln
0207     
0208     %% run OPF with capability curves
0209     t = [t0 'w/capability curves : '];
0210     [baseMVA, bus, gen, gencost, branch, f, success, et] = runopf(mpc, mpopt);
0211     t_ok(success, [t 'success']);
0212     t_is(f, f_soln, 3, [t 'f']);
0213     t_is(   bus(:,ib_data   ),    bus_soln(:,ib_data   ), 10, [t 'bus data']);
0214     t_is(   bus(:,ib_voltage),    bus_soln(:,ib_voltage),  3, [t 'bus voltage']);
0215     t_is(   bus(:,ib_lam    ),    bus_soln(:,ib_lam    ),  3, [t 'bus lambda']);
0216     t_is(   bus(:,ib_mu     ),    bus_soln(:,ib_mu     ),  2, [t 'bus mu']);
0217     t_is(   gen(:,ig_data   ),    gen_soln(:,ig_data   ), 10, [t 'gen data']);
0218     t_is(   gen(:,ig_disp   ),    gen_soln(:,ig_disp   ),  3, [t 'gen dispatch']);
0219     t_is(   gen(:,ig_mu     ),    gen_soln(:,ig_mu     ),  3, [t 'gen mu']);
0220     t_is(branch(:,ibr_data  ), branch_soln(:,ibr_data  ), 10, [t 'branch data']);
0221     t_is(branch(:,ibr_flow  ), branch_soln(:,ibr_flow  ),  3, [t 'branch flow']);
0222     t_is(branch(:,ibr_mu    ), branch_soln(:,ibr_mu    ),  2, [t 'branch mu']);
0223 
0224     %%-----  test OPF with angle difference limits  -----
0225     mpc = loadcase('t_case9_opfv2');
0226     %% remove capability curves
0227     mpc.gen(2:3, [PC1, PC2, QC1MIN, QC1MAX, QC2MIN, QC2MAX]) = zeros(2,6);
0228 
0229     %% get solved AC OPF case from MAT-file
0230     load soln9_opf_ang;   %% defines bus_soln, gen_soln, branch_soln, f_soln
0231     
0232     %% run OPF with angle difference limits
0233     t = [t0 'w/angle difference limits : '];
0234     [baseMVA, bus, gen, gencost, branch, f, success, et] = runopf(mpc, mpopt);
0235     t_ok(success, [t 'success']);
0236     t_is(f, f_soln, 3, [t 'f']);
0237     t_is(   bus(:,ib_data   ),    bus_soln(:,ib_data   ), 10, [t 'bus data']);
0238     t_is(   bus(:,ib_voltage),    bus_soln(:,ib_voltage),  3, [t 'bus voltage']);
0239     t_is(   bus(:,ib_lam    ),    bus_soln(:,ib_lam    ),  3, [t 'bus lambda']);
0240     t_is(   bus(:,ib_mu     ),    bus_soln(:,ib_mu     ),  1, [t 'bus mu']);
0241     t_is(   gen(:,ig_data   ),    gen_soln(:,ig_data   ), 10, [t 'gen data']);
0242     t_is(   gen(:,ig_disp   ),    gen_soln(:,ig_disp   ),  3, [t 'gen dispatch']);
0243     t_is(   gen(:,ig_mu     ),    gen_soln(:,ig_mu     ),  3, [t 'gen mu']);
0244     t_is(branch(:,ibr_data  ), branch_soln(:,ibr_data  ), 10, [t 'branch data']);
0245     t_is(branch(:,ibr_flow  ), branch_soln(:,ibr_flow  ),  3, [t 'branch flow']);
0246     t_is(branch(:,ibr_mu    ), branch_soln(:,ibr_mu    ),  2, [t 'branch mu']);
0247     t_is(branch(:,ibr_angmu ), branch_soln(:,ibr_angmu ),  2, [t 'branch angle mu']);
0248 
0249     %%-----  test OPF with ignored angle difference limits  -----
0250     %% get solved AC OPF case from MAT-file
0251     load soln9_opf;   %% defines bus_soln, gen_soln, branch_soln, f_soln
0252 
0253     %% run OPF with ignored angle difference limits
0254     t = [t0 'w/ignored angle difference limits : '];
0255     mpopt1 = mpoption(mpopt, 'opf.ignore_angle_lim', 1);
0256     [baseMVA, bus, gen, gencost, branch, f, success, et] = runopf(mpc, mpopt1);
0257     %% ang limits are not in this solution data, so let's remove them
0258     branch(1, ANGMAX) = 360;
0259     branch(9, ANGMIN) = -360;
0260     t_ok(success, [t 'success']);
0261     t_is(f, f_soln, 3, [t 'f']);
0262     t_is(   bus(:,ib_data   ),    bus_soln(:,ib_data   ), 10, [t 'bus data']);
0263     t_is(   bus(:,ib_voltage),    bus_soln(:,ib_voltage),  3, [t 'bus voltage']);
0264     t_is(   bus(:,ib_lam    ),    bus_soln(:,ib_lam    ),  3, [t 'bus lambda']);
0265     t_is(   bus(:,ib_mu     ),    bus_soln(:,ib_mu     ),  2, [t 'bus mu']);
0266     t_is(   gen(:,ig_data   ),    gen_soln(:,ig_data   ), 10, [t 'gen data']);
0267     t_is(   gen(:,ig_disp   ),    gen_soln(:,ig_disp   ),  3, [t 'gen dispatch']);
0268     t_is(   gen(:,ig_mu     ),    gen_soln(:,ig_mu     ),  3, [t 'gen mu']);
0269     t_is(branch(:,ibr_data  ), branch_soln(:,ibr_data  ), 10, [t 'branch data']);
0270     t_is(branch(:,ibr_flow  ), branch_soln(:,ibr_flow  ),  3, [t 'branch flow']);
0271     t_is(branch(:,ibr_mu    ), branch_soln(:,ibr_mu    ),  2, [t 'branch mu']);
0272 
0273     %%-----  test OPF with opf.use_vg  -----
0274     %% get solved AC OPF case from MAT-file
0275     load soln9_opf_vg;  %% defines bus_soln, gen_soln, branch_soln, f_soln
0276                         %%    and bus_soln1, gen_soln1, branch_soln1, f_soln1
0277     
0278     %% run with opf.use_vg = 1
0279     t = [t0 'w/opf.use_vg = 1 : '];
0280     mpc = loadcase(casefile);
0281     mpc.gen = mpc.gen([1 2 1 3], :);
0282     mpc.gencost = mpc.gencost([1 2 1 3], :);
0283     mpc.gen([1 3], [PMAX PMIN]) = mpc.gen([1 3], [PMAX PMIN]) / 2;
0284     mpc.gen(3, [QMIN, QMAX]) = 0;   %% no reactive capability for gen 3
0285     mpc.gencost([1 3], COST:end) = mpc.gencost([1 3], COST:end) / 2;
0286     mpc.gen(1, VG) = 1.05;
0287     mpc.gen(3, VG) = 1.06;
0288     mpopt1 = mpoption(mpopt, 'opf.use_vg', 1);
0289     r = runopf(mpc, mpopt1);
0290     t_ok(r.success, [t 'success']);
0291     t_is(r.f, f_soln, 3, [t 'f']);
0292     t_is(   r.bus(:,ib_data   ),    bus_soln(:,ib_data   ), 10, [t 'bus data']);
0293     t_is(   r.bus(:,ib_voltage),    bus_soln(:,ib_voltage),  3, [t 'bus voltage']);
0294     t_is(   r.bus(:,ib_lam    ),    bus_soln(:,ib_lam    ),  3, [t 'bus lambda']);
0295     t_is(   r.bus(:,ib_mu     ),    bus_soln(:,ib_mu     ),  2, [t 'bus mu']);
0296     t_is(   r.gen(:,ig_data   ),    gen_soln(:,ig_data   ), 10, [t 'gen data']);
0297     t_is(   r.gen(:,ig_disp   ),    gen_soln(:,ig_disp   ),  3, [t 'gen dispatch']);
0298     t_is(   r.gen(:,ig_mu     ),    gen_soln(:,ig_mu     ),  3, [t 'gen mu']);
0299     t_is(r.branch(:,ibr_data  ), branch_soln(:,ibr_data  ), 10, [t 'branch data']);
0300     t_is(r.branch(:,ibr_flow  ), branch_soln(:,ibr_flow  ),  3, [t 'branch flow']);
0301     t_is(r.branch(:,ibr_mu    ), branch_soln(:,ibr_mu    ),  2, [t 'branch mu']);
0302 
0303     %% run with opf.use_vg = 0.9
0304     t = [t0 'w/opf.use_vg = 0.9 : '];
0305     mpopt1 = mpoption(mpopt, 'opf.use_vg', 0.9);
0306     r = runopf(mpc, mpopt1);
0307     t_ok(r.success, [t 'success']);
0308     t_is(r.f, f_soln1, 3, [t 'f']);
0309     t_is(   r.bus(:,ib_data   ),    bus_soln1(:,ib_data   ), 10, [t 'bus data']);
0310     t_is(   r.bus(:,ib_voltage),    bus_soln1(:,ib_voltage),  3, [t 'bus voltage']);
0311     t_is(   r.bus(:,ib_lam    ),    bus_soln1(:,ib_lam    ),  3, [t 'bus lambda']);
0312     t_is(   r.bus(:,ib_mu     ),    bus_soln1(:,ib_mu     ),  2, [t 'bus mu']);
0313     t_is(   r.gen(:,ig_data   ),    gen_soln1(:,ig_data   ), 10, [t 'gen data']);
0314     t_is(   r.gen(:,ig_disp   ),    gen_soln1(:,ig_disp   ),  3, [t 'gen dispatch']);
0315     t_is(   r.gen(:,ig_mu     ),    gen_soln1(:,ig_mu     ),  3, [t 'gen mu']);
0316     t_is(r.branch(:,ibr_data  ), branch_soln1(:,ibr_data  ), 10, [t 'branch data']);
0317     t_is(r.branch(:,ibr_flow  ), branch_soln1(:,ibr_flow  ),  3, [t 'branch flow']);
0318     t_is(r.branch(:,ibr_mu    ), branch_soln1(:,ibr_mu    ),  2, [t 'branch mu']);
0319 else
0320     t_skip(num_tests, 'fmincon not available');
0321 end
0322 
0323 t_end;

Generated on Fri 16-Dec-2016 12:45:37 by m2html © 2005