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

Module runpf

source code

Runs a power flow.

Functions [hide private]
 
runpf(casedata=None, ppopt=None, fname='', solvedcase='')
Runs a power flow.
source code
Variables [hide private]
  __package__ = 'pypower'
Function Details [hide private]

runpf(casedata=None, ppopt=None, fname='', solvedcase='')

source code 

Runs a power flow.

Runs a power flow [full AC Newton's method by default] and optionally returns the solved values in the data matrices, a flag which is True if the algorithm was successful in finding a solution, and the elapsed time in seconds. All input arguments are optional. If casename is provided it specifies the name of the input data file or dict containing the power flow data. The default value is 'case9'.

If the ppopt is provided it overrides the default PYPOWER options vector and can be used to specify the solution algorithm and output options among other things. If the 3rd argument is given the pretty printed output will be appended to the file whose name is given in fname. If solvedcase is specified the solved case will be written to a case file in PYPOWER format with the specified name. If solvedcase ends with '.mat' it saves the case as a MAT-file otherwise it saves it as a Python-file.

If the ENFORCE_Q_LIMS options is set to True [default is false] then if any generator reactive power limit is violated after running the AC power flow, the corresponding bus is converted to a PQ bus, with Qg at the limit, and the case is re-run. The voltage magnitude at the bus will deviate from the specified value in order to satisfy the reactive power limit. If the reference bus is converted to PQ, the first remaining PV bus will be used as the slack bus for the next iteration. This may result in the real power output at this generator being slightly off from the specified values.

Enforcing of generator Q limits inspired by contributions from Mu Lin, Lincoln University, New Zealand (1/14/05).

Authors:
Ray Zimmerman (PSERC Cornell), Richard Lincoln