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

Module toggle_iflims

source code

Enable or disable set of interface flow constraints.

Functions [hide private]
 
toggle_iflims(ppc, on_off)
Enable or disable set of interface flow constraints.
source code
 
userfcn_iflims_ext2int(ppc, *args)
This is the 'ext2int' stage userfcn callback that prepares the input data for the formulation stage.
source code
 
userfcn_iflims_formulation(om, *args)
This is the 'formulation' stage userfcn callback that defines the user costs and constraints for interface flow limits.
source code
 
userfcn_iflims_int2ext(results, *args)
This is the 'int2ext' stage userfcn callback that converts everything back to external indexing and packages up the results.
source code
 
userfcn_iflims_printpf(results, fd, ppopt, *args)
This is the 'printpf' stage userfcn callback that pretty-prints the results.
source code
 
userfcn_iflims_savecase(ppc, fd, prefix, *args)
This is the 'savecase' stage userfcn callback that prints the Python file code to save the 'if' field in the case file.
source code
Variables [hide private]
  __package__ = 'pypower'
Function Details [hide private]

toggle_iflims(ppc, on_off)

source code 

Enable or disable set of interface flow constraints.

Enables or disables a set of OPF userfcn callbacks to implement interface flow limits based on a DC flow model.

These callbacks expect to find an 'if' field in the input ppc, where ppc['if'] is a dict with the following fields:

  • map n x 2, defines each interface in terms of a set of branch indices and directions. Interface I is defined by the set of rows whose 1st col is equal to I. The 2nd column is a branch index multiplied by 1 or -1 respectively for lines whose orientation is the same as or opposite to that of the interface.
  • lims nif x 3, defines the DC model flow limits in MW for specified interfaces. The 2nd and 3rd columns specify the lower and upper limits on the (DC model) flow across the interface, respectively. Normally, the lower limit is negative, indicating a flow in the opposite direction.

The 'int2ext' callback also packages up results and stores them in the following output fields of results['if']:

  • P - nif x 1, actual flow across each interface in MW
  • mu.l - nif x 1, shadow price on lower flow limit, ($/MW)
  • mu.u - nif x 1, shadow price on upper flow limit, ($/MW)

See Also: add_userfcn, remove_userfcn, run_userfcn, t.t_case30_userfcns.

Authors:
Ray Zimmerman (PSERC Cornell), Richard Lincoln

userfcn_iflims_ext2int(ppc, *args)

source code 

This is the 'ext2int' stage userfcn callback that prepares the input data for the formulation stage. It expects to find an 'if' field in ppc as described above. The optional args are not currently used.

userfcn_iflims_formulation(om, *args)

source code 

This is the 'formulation' stage userfcn callback that defines the user costs and constraints for interface flow limits. It expects to find an 'if' field in the ppc stored in om, as described above. The optional args are not currently used.

userfcn_iflims_int2ext(results, *args)

source code 

This is the 'int2ext' stage userfcn callback that converts everything back to external indexing and packages up the results. It expects to find an 'if' field in the results dict as described for ppc above. It also expects the results to contain solved branch flows and linear constraints named 'iflims' which are used to populate output fields in results['if']. The optional args are not currently used.

userfcn_iflims_printpf(results, fd, ppopt, *args)

source code 

This is the 'printpf' stage userfcn callback that pretty-prints the results. It expects a results dict, a file descriptor and a PYPOWER options vector. The optional args are not currently used.

userfcn_iflims_savecase(ppc, fd, prefix, *args)

source code 

This is the 'savecase' stage userfcn callback that prints the Python file code to save the 'if' field in the case file. It expects a PYPOWER case dict (ppc), a file descriptor and variable prefix (usually 'ppc'). The optional args are not currently used.