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