0001 function t_insolvablepf_limitQ(quiet)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 if nargin < 1
0035 quiet = 0;
0036 end
0037
0038 num_tests = 4;
0039
0040 t_begin(num_tests, quiet);
0041
0042 [PQ, PV, REF, NONE, BUS_I, BUS_TYPE, PD, QD, GS, BS, BUS_AREA, VM, ...
0043 VA, BASE_KV, ZONE, VMAX, VMIN, LAM_P, LAM_Q, MU_VMAX, MU_VMIN] = idx_bus;
0044 [GEN_BUS, PG, QG, QMAX, QMIN, VG, MBASE, GEN_STATUS, PMAX, PMIN, ...
0045 MU_PMAX, MU_PMIN, MU_QMAX, MU_QMIN, PC1, PC2, QC1MIN, QC1MAX, ...
0046 QC2MIN, QC2MAX, RAMP_AGC, RAMP_10, RAMP_30, RAMP_Q, APF] = idx_gen;
0047 [F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, ...
0048 TAP, SHIFT, BR_STATUS, PF, QF, PT, QT, MU_SF, MU_ST, ...
0049 ANGMIN, ANGMAX, MU_ANGMIN, MU_ANGMAX] = idx_brch;
0050 [PW_LINEAR, POLYNOMIAL, MODEL, STARTUP, SHUTDOWN, NCOST, COST] = idx_cost;
0051
0052 casefile = 't_case9mod_opf';
0053 if quiet
0054 verbose = 0;
0055 else
0056 verbose = 0;
0057 end
0058
0059 t0 = 'INSOLVABLEPF_LIMITQ : ';
0060
0061
0062 load soln9mod_opf;
0063
0064 res = loadcase(casefile);
0065 res.bus = bus_soln;
0066 res.gen = gen_soln;
0067 res.branch = branch_soln;
0068
0069
0070 mult = 10;
0071 res.bus(:,PD) = mult*res.bus(:,PD);
0072 res.bus(:,QD) = mult*res.bus(:,QD);
0073 res.gen(:,PG) = mult*res.gen(:,PG);
0074
0075 mpopt = mpoption('out.all', 0, 'verbose', verbose);
0076
0077
0078 t = [t0 '(insolvable case) :'];
0079 [insolvable,eta,mineigratio] = insolvablepf_limitQ(res,mpopt);
0080 t_ok(insolvable, [t ' insolvable']);
0081 t_is(eta, eta_limitQinsolvable_soln, 3, [t ' eta']);
0082
0083
0084
0085 load soln9mod_opf;
0086
0087 res = loadcase(casefile);
0088 res.bus = bus_soln;
0089 res.gen = gen_soln;
0090 res.branch = branch_soln;
0091
0092
0093 t = [t0 '(solvable case) :'];
0094 [insolvable,eta,mineigratio] = insolvablepf_limitQ(res,mpopt);
0095 t_ok(~insolvable, [t ' solvable']);
0096 t_is(eta, eta_limitQsolvable_soln , 3, [t ' eta']);
0097
0098 t_end;