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

Module modcost

source code

Modifies generator costs by shifting or scaling (F or X).

Functions [hide private]
 
modcost(gencost, alpha, modtype='SCALE_F')
Modifies generator costs by shifting or scaling (F or X).
source code
 
polyshift(c, a)
Returns the coefficients of a horizontally shifted polynomial.
source code
Variables [hide private]
  __package__ = 'pypower'
Function Details [hide private]

modcost(gencost, alpha, modtype='SCALE_F')

source code 

Modifies generator costs by shifting or scaling (F or X).

For each generator cost F(X) (for real or reactive power) in gencost, this function modifies the cost by scaling or shifting the function by alpha, depending on the value of modtype, and and returns the modified gencost. Rows of gencost can be a mix of polynomial or piecewise linear costs.

modtype takes one of the 4 possible values (let F_alpha(X) denote the the modified function):

   SCALE_F (default) : F_alpha(X)         == F(X) * ALPHA
   SCALE_X           : F_alpha(X * ALPHA) == F(X)
   SHIFT_F           : F_alpha(X)         == F(X) + ALPHA
   SHIFT_X           : F_alpha(X + ALPHA) == F(X)
Authors:
Ray Zimmerman (PSERC Cornell), Richard Lincoln

polyshift(c, a)

source code 

Returns the coefficients of a horizontally shifted polynomial.

d = polyshift(c, a) shifts to the right by a, the polynomial whose coefficients are given in the column vector c.

Example: For any polynomial with n coefficients in c, and any values for x and shift a, the f - f0 should be zero:

   x = rand
   a = rand
   c = rand(n, 1);
   f0 = polyval(c, x)
   f  = polyval(polyshift(c, a), x+a)