Home > matpower5.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 %   Copyright (c) 2005-2015 by Power System Engineering Research Center (PSERC)
0006 %   by Ray Zimmerman, PSERC Cornell
0007 %
0008 %   $Id: t_hasPQcap.m 2644 2015-03-11 19:34:22Z ray $
0009 %
0010 %   This file is part of MATPOWER.
0011 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0012 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0013 
0014 if nargin < 1
0015     quiet = 0;
0016 end
0017 
0018 t_begin(4, quiet);
0019 
0020 %% generator data
0021 %    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
0022 gen = [
0023     1    10    0    10    -10    1    100    1    10    2    0    0    0    0    0    0    0    0    0    0    0;
0024     1    10    0    10    -10    1    100    1    10    2    0    20    0    12    0    2    0    0    0    0    0;
0025     1    10    0    10    -10    1    100    1    10    2    0    20    -15    12    -15    2    0    0    0    0    0;
0026     1    10    0    10    -10    1    100    1    10    2    0    20    -12    0    -2    0    0    0    0    0    0;
0027     1    10    0    10    -10    1    100    1    10    2    0    20    -12    15    -2    15    0    0    0    0    0;
0028     1    10    0    10    -10    1    100    1    10    2    0    20    -12    12    -2    2    0    0    0    0    0;
0029     1    10    0    10    -10    1    100    1    10    2    0    20    0    12    0    8    0    0    0    0    0;
0030     1    10    0    10    -10    1    100    1    10    2    0    20    -15    12    -15    8    0    0    0    0    0;
0031     1    10    0    10    -10    1    100    1    10    2    0    20    -12    0    -8    0    0    0    0    0    0;
0032     1    10    0    10    -10    1    100    1    10    2    0    20    -12    15    -8    15    0    0    0    0    0;
0033     1    10    0    10    -10    1    100    1    10    2    0    20    -12    12    -8    8    0    0    0    0    0;
0034     1    10    0    10    -10    1    100    1    10    2    0    20    0    0    -20    20    0    0    0    0    0;
0035     1    10    0    10    -10    1    100    1    10    2    0    20    0    0    -22    18    0    0    0    0    0;
0036     1    10    0    10    -10    1    100    1    10    2    0    20    0    0    -18    22    0    0    0    0    0;
0037 ];
0038 
0039 t = 'hasPQcap(gen)';
0040 t_is(hasPQcap(gen), [0;1;1;1;1;1;1;0;1;0;0;1;1;1], 12, t);
0041 
0042 t = 'hasPQcap(gen, ''B'')';
0043 t_is(hasPQcap(gen, 'B'), [0;1;1;1;1;1;1;0;1;0;0;1;1;1], 12, t);
0044 
0045 t = 'hasPQcap(gen, ''U'')';
0046 t_is(hasPQcap(gen, 'U'), [0;1;1;1;0;1;0;0;1;0;0;1;1;1], 12, t);
0047 
0048 t = 'hasPQcap(gen, ''L'')';
0049 t_is(hasPQcap(gen, 'L'), [0;1;0;1;1;1;1;0;0;0;0;1;1;1], 12, t);
0050 
0051 t_end;

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