Home > matpower5.0 > 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 %   $Id: t_insolvablepfsos_limitQ.m 2272 2014-01-17 14:15:47Z ray $
0006 %   by Daniel Molzahn, PSERC U of Wisc, Madison
0007 %   and Ray Zimmerman, PSERC Cornell
0008 %   Copyright (c) 2013-2014 by Power System Engineering Research Center (PSERC)
0009 %
0010 %   This file is part of MATPOWER.
0011 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0012 %
0013 %   MATPOWER is free software: you can redistribute it and/or modify
0014 %   it under the terms of the GNU General Public License as published
0015 %   by the Free Software Foundation, either version 3 of the License,
0016 %   or (at your option) any later version.
0017 %
0018 %   MATPOWER is distributed in the hope that it will be useful,
0019 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0020 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0021 %   GNU General Public License for more details.
0022 %
0023 %   You should have received a copy of the GNU General Public License
0024 %   along with MATPOWER. If not, see <http://www.gnu.org/licenses/>.
0025 %
0026 %   Additional permission under GNU GPL version 3 section 7
0027 %
0028 %   If you modify MATPOWER, or any covered work, to interface with
0029 %   other modules (such as MATLAB code and MEX-files) available in a
0030 %   MATLAB(R) or comparable environment containing parts covered
0031 %   under other licensing terms, the licensors of MATPOWER grant
0032 %   you additional permission to convey the resulting work.
0033 
0034 if nargin < 1
0035     quiet = 0;
0036 end
0037 
0038 num_tests = 2;
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 : ';
0060 
0061 %% test an insolvable case
0062 load soln9mod_opf;     %% defines bus_soln, gen_soln, branch_soln, Vslack_min_soln, sigma_soln, etacomp_soln
0063 
0064 res = loadcase(casefile);
0065 res.bus = bus_soln;
0066 res.gen = gen_soln;
0067 res.branch = branch_soln;
0068 
0069 % Make the case insolvable
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 %% get test results for insolvable case
0078 t = [t0 '(insolvable case) :'];
0079 insolvable = insolvablepfsos_limitQ(res,mpopt);
0080 t_ok(insolvable, [t ' insolvable']);
0081 
0082 
0083 %% test a solvable case
0084 load soln9mod_opf;     %% defines bus_soln, gen_soln, branch_soln, Vslack_min_soln, sigma_soln, etacomp_soln
0085 
0086 res = loadcase(casefile);
0087 res.bus = bus_soln;
0088 res.gen = gen_soln;
0089 res.branch = branch_soln;
0090 
0091 %% get test results for insolvable case
0092 t = [t0 '(solvable case) :'];
0093 insolvable = insolvablepfsos_limitQ(res,mpopt);
0094 t_ok(~insolvable, [t ' solvable']);
0095 
0096 t_end;

Generated on Mon 26-Jan-2015 15:21:31 by m2html © 2005