Home > matpower4.1 > idx_cost.m

idx_cost

PURPOSE ^

IDX_COST Defines constants for named column indices to gencost matrix.

SYNOPSIS ^

function [PW_LINEAR, POLYNOMIAL, MODEL, STARTUP, SHUTDOWN, NCOST, COST] = idx_cost

DESCRIPTION ^

IDX_COST   Defines constants for named column indices to gencost matrix.
   Example:

   [PW_LINEAR, POLYNOMIAL, MODEL, STARTUP, SHUTDOWN, NCOST, COST] = idx_cost;

   Some examples of usage, after defining the constants using the line above,
   are:

    start = gencost(4, STARTUP);       % get startup cost of generator 4
    gencost(2, [MODEL, NCOST:COST+1]) = [ POLYNOMIAL 2 30 0 ];
    % set the cost of generator 2 to a linear function COST = 30 * Pg
 
   The index, name and meaning of each column of the gencost matrix is given
   below:
 
   columns 1-5
    1  MODEL       cost model, 1 = piecewise linear, 2 = polynomial
    2  STARTUP     startup cost in US dollars
    3  SHUTDOWN    shutdown cost in US dollars
    4  NCOST       number of cost coefficients to follow for polynomial cost
                   function, or number of data points for piecewise linear
    5  COST        parameters defining total cost function begin in this col
                  (MODEL = 1) : p0, f0, p1, f1, ..., pn, fn
                       where p0 < p1 < ... < pn and the cost f(p) is defined
                       by the coordinates (p0,f0), (p1,f1), ..., (pn,fn) of
                       the end/break-points of the piecewise linear cost
                  (MODEL = 2) : cn, ..., c1, c0
                       n+1 coefficients of an n-th order polynomial cost fcn,
                       starting with highest order, where cost is
                       f(p) = cn*p^n + ... + c1*p + c0
 
   additional constants, used to assign/compare values in the MODEL column
    1  PW_LINEAR   piecewise linear generator cost model
    2  POLYNOMIAL  polynomial generator cost model

   See also DEFINE_CONSTANTS.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [PW_LINEAR, POLYNOMIAL, MODEL, STARTUP, SHUTDOWN, NCOST, COST] = idx_cost
0002 %IDX_COST   Defines constants for named column indices to gencost matrix.
0003 %   Example:
0004 %
0005 %   [PW_LINEAR, POLYNOMIAL, MODEL, STARTUP, SHUTDOWN, NCOST, COST] = idx_cost;
0006 %
0007 %   Some examples of usage, after defining the constants using the line above,
0008 %   are:
0009 %
0010 %    start = gencost(4, STARTUP);       % get startup cost of generator 4
0011 %    gencost(2, [MODEL, NCOST:COST+1]) = [ POLYNOMIAL 2 30 0 ];
0012 %    % set the cost of generator 2 to a linear function COST = 30 * Pg
0013 %
0014 %   The index, name and meaning of each column of the gencost matrix is given
0015 %   below:
0016 %
0017 %   columns 1-5
0018 %    1  MODEL       cost model, 1 = piecewise linear, 2 = polynomial
0019 %    2  STARTUP     startup cost in US dollars
0020 %    3  SHUTDOWN    shutdown cost in US dollars
0021 %    4  NCOST       number of cost coefficients to follow for polynomial cost
0022 %                   function, or number of data points for piecewise linear
0023 %    5  COST        parameters defining total cost function begin in this col
0024 %                  (MODEL = 1) : p0, f0, p1, f1, ..., pn, fn
0025 %                       where p0 < p1 < ... < pn and the cost f(p) is defined
0026 %                       by the coordinates (p0,f0), (p1,f1), ..., (pn,fn) of
0027 %                       the end/break-points of the piecewise linear cost
0028 %                  (MODEL = 2) : cn, ..., c1, c0
0029 %                       n+1 coefficients of an n-th order polynomial cost fcn,
0030 %                       starting with highest order, where cost is
0031 %                       f(p) = cn*p^n + ... + c1*p + c0
0032 %
0033 %   additional constants, used to assign/compare values in the MODEL column
0034 %    1  PW_LINEAR   piecewise linear generator cost model
0035 %    2  POLYNOMIAL  polynomial generator cost model
0036 %
0037 %   See also DEFINE_CONSTANTS.
0038 
0039 %   MATPOWER
0040 %   $Id: idx_cost.m,v 1.12 2010/05/27 14:29:05 ray Exp $
0041 %   by Ray Zimmerman, PSERC Cornell
0042 %   Copyright (c) 1996-2010 by Power System Engineering Research Center (PSERC)
0043 %
0044 %   This file is part of MATPOWER.
0045 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0046 %
0047 %   MATPOWER is free software: you can redistribute it and/or modify
0048 %   it under the terms of the GNU General Public License as published
0049 %   by the Free Software Foundation, either version 3 of the License,
0050 %   or (at your option) any later version.
0051 %
0052 %   MATPOWER is distributed in the hope that it will be useful,
0053 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0054 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0055 %   GNU General Public License for more details.
0056 %
0057 %   You should have received a copy of the GNU General Public License
0058 %   along with MATPOWER. If not, see <http://www.gnu.org/licenses/>.
0059 %
0060 %   Additional permission under GNU GPL version 3 section 7
0061 %
0062 %   If you modify MATPOWER, or any covered work, to interface with
0063 %   other modules (such as MATLAB code and MEX-files) available in a
0064 %   MATLAB(R) or comparable environment containing parts covered
0065 %   under other licensing terms, the licensors of MATPOWER grant
0066 %   you additional permission to convey the resulting work.
0067 
0068 %% define cost models
0069 PW_LINEAR   = 1;
0070 POLYNOMIAL  = 2;
0071 
0072 %% define the indices
0073 MODEL       = 1;    %% cost model, 1 = piecewise linear, 2 = polynomial
0074 STARTUP     = 2;    %% startup cost in US dollars
0075 SHUTDOWN    = 3;    %% shutdown cost in US dollars
0076 NCOST       = 4;    %% number breakpoints in piecewise linear cost function,
0077                     %% or number of coefficients in polynomial cost function
0078 COST        = 5;    %% parameters defining total cost function begin in this col
0079                     %% (MODEL = 1) : p0, f0, p1, f1, ..., pn, fn
0080                     %%      where p0 < p1 < ... < pn and the cost f(p) is defined
0081                     %%      by the coordinates (p0,f0), (p1,f1), ..., (pn,fn) of
0082                     %%      the end/break-points of the piecewise linear cost
0083                     %% (MODEL = 2) : cn, ..., c1, c0
0084                     %%      n+1 coefficients of an n-th order polynomial cost fcn,
0085                     %%      starting with highest order, where cost is
0086                     %%      f(p) = cn*p^n + ... + c1*p + c0

Generated on Mon 26-Jan-2015 15:00:13 by m2html © 2005