0001 function t_testglobalopt(quiet)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 if nargin < 1
0016 quiet = 0;
0017 end
0018
0019 num_tests = 6;
0020
0021 t_begin(num_tests, quiet);
0022
0023 [PQ, PV, REF, NONE, BUS_I, BUS_TYPE, PD, QD, GS, BS, BUS_AREA, VM, ...
0024 VA, BASE_KV, ZONE, VMAX, VMIN, LAM_P, LAM_Q, MU_VMAX, MU_VMIN] = idx_bus;
0025 [GEN_BUS, PG, QG, QMAX, QMIN, VG, MBASE, GEN_STATUS, PMAX, PMIN, ...
0026 MU_PMAX, MU_PMIN, MU_QMAX, MU_QMIN, PC1, PC2, QC1MIN, QC1MAX, ...
0027 QC2MIN, QC2MAX, RAMP_AGC, RAMP_10, RAMP_30, RAMP_Q, APF] = idx_gen;
0028 [F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, ...
0029 TAP, SHIFT, BR_STATUS, PF, QF, PT, QT, MU_SF, MU_ST, ...
0030 ANGMIN, ANGMAX, MU_ANGMIN, MU_ANGMAX] = idx_brch;
0031 [PW_LINEAR, POLYNOMIAL, MODEL, STARTUP, SHUTDOWN, NCOST, COST] = idx_cost;
0032
0033 casefile = 't_case9mod_opf';
0034 if quiet
0035 verbose = 0;
0036 else
0037 verbose = 0;
0038 end
0039
0040 t0 = 'TESTGLOALOPT : ';
0041
0042
0043 load soln9mod_opf;
0044
0045 res = loadcase(casefile);
0046 res.bus = bus_soln;
0047 res.gen = gen_soln;
0048 res.branch = branch_soln;
0049
0050 mpopt = mpoption('out.all', 0, 'verbose', verbose);
0051
0052
0053 t = t0;
0054 [globalopt,comp,Apsd] = testGlobalOpt(res, mpopt);
0055 t_ok(globalopt, [t 'global optimum verification']);
0056 t_is(comp, comp_soln, 3, [t 'complimentarity conditions']);
0057 t_ok(Apsd, [t 'A is positive semidefinite']);
0058
0059
0060 load soln9mod_opf_Plim;
0061
0062 res = loadcase(casefile);
0063 res.bus = bus_soln;
0064 res.gen = gen_soln;
0065 res.branch = branch_soln;
0066
0067 mpopt1 = mpoption(mpopt, 'opf.flow_lim', 'P');
0068
0069
0070 t = [t0 '(P line lim) : '];
0071 [globalopt,comp,Apsd] = testGlobalOpt(res, mpopt1);
0072 t_ok(globalopt, [t 'global optimum verification']);
0073 t_is(comp, comp_soln, 3, [t 'complimentarity conditions']);
0074 t_ok(Apsd, [t 'A is positive semidefinite']);
0075
0076 t_end;