Package pypower :: Module isload
[hide private]
[frames] | no frames]

Source Code for Module pypower.isload

 1  # Copyright (C) 2005-2011 Power System Engineering Research Center (PSERC) 
 2  # Copyright (C) 2011 Richard Lincoln 
 3  # 
 4  # PYPOWER is free software: you can redistribute it and/or modify 
 5  # it under the terms of the GNU General Public License as published 
 6  # by the Free Software Foundation, either version 3 of the License, 
 7  # or (at your option) any later version. 
 8  # 
 9  # PYPOWER is distributed in the hope that it will be useful, 
10  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
11  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
12  # GNU General Public License for more details. 
13  # 
14  # You should have received a copy of the GNU General Public License 
15  # along with PYPOWER. If not, see <http://www.gnu.org/licenses/>. 
16   
17  """Checks for dispatchable loads. 
18  """ 
19   
20  from idx_gen import PMAX, PMIN 
21   
22   
23 -def isload(gen):
24 """Checks for dispatchable loads. 25 26 Returns a column vector of 1's and 0's. The 1's correspond to rows of the 27 C{gen} matrix which represent dispatchable loads. The current test is 28 C{Pmin < 0 and Pmax == 0}. This may need to be revised to allow sensible 29 specification of both elastic demand and pumped storage units. 30 31 @author: Ray Zimmerman (PSERC Cornell) 32 @author: Richard Lincoln 33 """ 34 return (gen[:, PMIN] < 0) & (gen[:, PMAX] == 0)
35