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

Generated on Fri 09-Oct-2020 11:21:31 by m2html © 2005