Home > matpower7.1 > lib > 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 N = n+1 of data points to follow defining an
                   n-segment piecewise linear cost function, or of cost
                   coefficients defining an n-th order polynomial cost function
    5  COST        parameters defining total cost function f(p) begin in
                   this column
                   (MODEL = 1) : p1, f1, p2, f2, ..., pN, fN
                       where p1 < p2 < ... < pN and the cost f(p) is defined
                       by the coordinates (p1,f1), (p2,f2), ..., (pN,fN) of
                       the end/break-points of the piecewise linear cost fcn
                   (MODEL = 2) : cn, ..., c1, c0
                       N coefficients of an n-th order polynomial cost
                       function, 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 N = n+1 of data points to follow defining an
0022 %                   n-segment piecewise linear cost function, or of cost
0023 %                   coefficients defining an n-th order polynomial cost function
0024 %    5  COST        parameters defining total cost function f(p) begin in
0025 %                   this column
0026 %                   (MODEL = 1) : p1, f1, p2, f2, ..., pN, fN
0027 %                       where p1 < p2 < ... < pN and the cost f(p) is defined
0028 %                       by the coordinates (p1,f1), (p2,f2), ..., (pN,fN) of
0029 %                       the end/break-points of the piecewise linear cost fcn
0030 %                   (MODEL = 2) : cn, ..., c1, c0
0031 %                       N coefficients of an n-th order polynomial cost
0032 %                       function, starting with highest order, where cost is
0033 %                       f(p) = cn*p^n + ... + c1*p + c0
0034 %
0035 %   additional constants, used to assign/compare values in the MODEL column
0036 %    1  PW_LINEAR   piecewise linear generator cost model
0037 %    2  POLYNOMIAL  polynomial generator cost model
0038 %
0039 %   See also DEFINE_CONSTANTS.
0040 
0041 %   MATPOWER
0042 %   Copyright (c) 1996-2019, Power Systems Engineering Research Center (PSERC)
0043 %   by Ray Zimmerman, PSERC Cornell
0044 %
0045 %   This file is part of MATPOWER.
0046 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0047 %   See https://matpower.org for more info.
0048 
0049 %% define cost models
0050 PW_LINEAR   = 1;
0051 POLYNOMIAL  = 2;
0052 
0053 %% define the indices
0054 MODEL       = 1;    %% cost model, 1 = piecewise linear, 2 = polynomial
0055 STARTUP     = 2;    %% startup cost in US dollars
0056 SHUTDOWN    = 3;    %% shutdown cost in US dollars
0057 NCOST       = 4;    %% number N = n+1 of end/breakpoints in piecewise linear
0058                     %% cost function, or of coefficients in polynomial cost fcn
0059 COST        = 5;    %% parameters defining total cost function begin in this col
0060                     %% (MODEL = 1) : p1, f1, p2, f2, ..., pN, fN
0061                     %%      where p1 < p2 < ... < pN and the cost f(p) is defined
0062                     %%      by the coordinates (p1,f1), (p2,f2), ..., (pN,fN) of
0063                     %%      the end/break-points of the piecewise linear cost
0064                     %% (MODEL = 2) : cn, ..., c1, c0
0065                     %%      N coefficients of an n-th order polynomial cost fcn,
0066                     %%      starting with highest order, where cost is
0067                     %%      f(p) = cn*p^n + ... + c1*p + c0

Generated on Fri 09-Oct-2020 11:21:31 by m2html © 2005