Home > matpower5.1 > extras > sdp_pf > t_insolvablepfsos_limitQ.m

t_insolvablepfsos_limitQ

PURPOSE ^

T_INSOLVABLEPF Test for power flow insolvability condition

SYNOPSIS ^

function t_insolvablepfsos_limitQ(quiet)

DESCRIPTION ^

T_INSOLVABLEPF  Test for power flow insolvability condition

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

Generated on Fri 20-Mar-2015 18:23:34 by m2html © 2005