Home > matpower6.0 > extras > sdp_pf > t_insolvablepf_limitQ.m

t_insolvablepf_limitQ

PURPOSE ^

T_INSOLVABLEPF_LIMITQ Test for power flow insolvability condition

SYNOPSIS ^

function t_insolvablepf_limitQ(quiet)

DESCRIPTION ^

T_INSOLVABLEPF_LIMITQ  Test for power flow insolvability condition

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function t_insolvablepf_limitQ(quiet)
0002 %T_INSOLVABLEPF_LIMITQ  Test for power flow insolvability condition
0003 
0004 %   MATPOWER
0005 %   Copyright (c) 2013-2016, Power Systems Engineering Research Center (PSERC)
0006 %   by Daniel Molzahn, PSERC U of Wisc, Madison
0007 %   and Ray Zimmerman, PSERC Cornell
0008 %
0009 %   This file is part of MATPOWER.
0010 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0011 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0012 
0013 if nargin < 1
0014     quiet = 0;
0015 end
0016 
0017 num_tests = 4;
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 t0 = 'INSOLVABLEPF_LIMITQ : ';
0039 
0040 %% test an insolvable case
0041 load soln9mod_opf;     %% defines bus_soln, gen_soln, branch_soln, eta_limitQinsolvable_soln
0042 
0043 res = loadcase(casefile);
0044 res.bus = bus_soln;
0045 res.gen = gen_soln;
0046 res.branch = branch_soln;
0047 
0048 % Make the case insolvable
0049 mult = 10;
0050 res.bus(:,PD) = mult*res.bus(:,PD);
0051 res.bus(:,QD) = mult*res.bus(:,QD);
0052 res.gen(:,PG) = mult*res.gen(:,PG);
0053 
0054 mpopt = mpoption('out.all', 0, 'verbose', verbose);
0055 
0056 %% get test results for insolvable case
0057 t = [t0 '(insolvable case) :'];
0058 [insolvable,eta,mineigratio] = insolvablepf_limitQ(res,mpopt);
0059 t_ok(insolvable, [t ' insolvable']);
0060 t_is(eta, eta_limitQinsolvable_soln, 3, [t ' eta']);
0061 
0062 
0063 %% test a solvable case
0064 load soln9mod_opf;     %% defines bus_soln, gen_soln, branch_soln, eta_limitQsolvable_soln
0065 
0066 res = loadcase(casefile);
0067 res.bus = bus_soln;
0068 res.gen = gen_soln;
0069 res.branch = branch_soln;
0070 
0071 %% get test results for insolvable case
0072 t = [t0 '(solvable case) :'];
0073 [insolvable,eta,mineigratio] = insolvablepf_limitQ(res,mpopt);
0074 t_ok(~insolvable, [t ' solvable']);
0075 t_is(eta, eta_limitQsolvable_soln , 3, [t ' eta']);
0076 
0077 t_end;

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