Home > matpower4.1 > t > t_hasPQcap.m

t_hasPQcap

PURPOSE ^

T_HASPQCAP Tests for HASPQCAP.

SYNOPSIS ^

function t_hasPQcap(quiet)

DESCRIPTION ^

T_HASPQCAP  Tests for HASPQCAP.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function t_hasPQcap(quiet)
0002 %T_HASPQCAP  Tests for HASPQCAP.
0003 
0004 %   MATPOWER
0005 %   $Id: t_hasPQcap.m,v 1.5 2010/04/26 19:45:26 ray Exp $
0006 %   by Ray Zimmerman, PSERC Cornell
0007 %   Copyright (c) 2005-2010 by Power System Engineering Research Center (PSERC)
0008 %
0009 %   This file is part of MATPOWER.
0010 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0011 %
0012 %   MATPOWER is free software: you can redistribute it and/or modify
0013 %   it under the terms of the GNU General Public License as published
0014 %   by the Free Software Foundation, either version 3 of the License,
0015 %   or (at your option) any later version.
0016 %
0017 %   MATPOWER is distributed in the hope that it will be useful,
0018 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0019 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0020 %   GNU General Public License for more details.
0021 %
0022 %   You should have received a copy of the GNU General Public License
0023 %   along with MATPOWER. If not, see <http://www.gnu.org/licenses/>.
0024 %
0025 %   Additional permission under GNU GPL version 3 section 7
0026 %
0027 %   If you modify MATPOWER, or any covered work, to interface with
0028 %   other modules (such as MATLAB code and MEX-files) available in a
0029 %   MATLAB(R) or comparable environment containing parts covered
0030 %   under other licensing terms, the licensors of MATPOWER grant
0031 %   you additional permission to convey the resulting work.
0032 
0033 if nargin < 1
0034     quiet = 0;
0035 end
0036 
0037 t_begin(4, quiet);
0038 
0039 %% generator data
0040 %    bus    Pg    Qg    Qmax    Qmin    Vg    mBase    status    Pmax    Pmin    Pc1    Pc2    Qc1min    Qc1max    Qc2min    Qc2max    ramp_agc    ramp_10    ramp_30    ramp_q    apf
0041 gen = [
0042     1    10    0    10    -10    1    100    1    10    2    0    0    0    0    0    0    0    0    0    0    0;
0043     1    10    0    10    -10    1    100    1    10    2    0    20    0    12    0    2    0    0    0    0    0;
0044     1    10    0    10    -10    1    100    1    10    2    0    20    -15    12    -15    2    0    0    0    0    0;
0045     1    10    0    10    -10    1    100    1    10    2    0    20    -12    0    -2    0    0    0    0    0    0;
0046     1    10    0    10    -10    1    100    1    10    2    0    20    -12    15    -2    15    0    0    0    0    0;
0047     1    10    0    10    -10    1    100    1    10    2    0    20    -12    12    -2    2    0    0    0    0    0;
0048     1    10    0    10    -10    1    100    1    10    2    0    20    0    12    0    8    0    0    0    0    0;
0049     1    10    0    10    -10    1    100    1    10    2    0    20    -15    12    -15    8    0    0    0    0    0;
0050     1    10    0    10    -10    1    100    1    10    2    0    20    -12    0    -8    0    0    0    0    0    0;
0051     1    10    0    10    -10    1    100    1    10    2    0    20    -12    15    -8    15    0    0    0    0    0;
0052     1    10    0    10    -10    1    100    1    10    2    0    20    -12    12    -8    8    0    0    0    0    0;
0053 ];
0054 
0055 t = 'hasPQcap(gen)';
0056 t_is(hasPQcap(gen), [0;1;1;1;1;1;1;0;1;0;0], 12, t);
0057 
0058 t = 'hasPQcap(gen, ''B'')';
0059 t_is(hasPQcap(gen, 'B'), [0;1;1;1;1;1;1;0;1;0;0], 12, t);
0060 
0061 t = 'hasPQcap(gen, ''U'')';
0062 t_is(hasPQcap(gen, 'U'), [0;1;1;1;0;1;0;0;1;0;0], 12, t);
0063 
0064 t = 'hasPQcap(gen, ''L'')';
0065 t_is(hasPQcap(gen, 'L'), [0;1;0;1;1;1;1;0;0;0;0], 12, t);
0066 
0067 t_end;

Generated on Mon 26-Jan-2015 15:00:13 by m2html © 2005