Commit a85aff0b by dongshufeng

refactor: add case14 data

parent 15403f04
//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.
// MATPOWER
// Copyright (c) 1996-2019, Power Systems Engineering Research Center (PSERC)
// by Ray Zimmerman, PSERC Cornell
//
// This file is part of MATPOWER.
// Covered by the 3-clause BSD License (see LICENSE file for details).
// See https://matpower.org for more info.
// define cost models
PW_LINEAR = 1;
POLYNOMIAL = 2;
// define the indices
MODEL = 1; // cost model, 1 = piecewise linear, 2 = polynomial
STARTUP = 2; // startup cost in US dollars
SHUTDOWN = 3; // shutdown cost in US dollars
NCOST = 4; // number N = n+1 of end/breakpoints in piecewise linear
// cost function, or of coefficients in polynomial cost fcn
COST = 5; // parameters defining total cost function begin in this col
// (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
// (MODEL = 2) : cn, ..., c1, c0
// N coefficients of an n-th order polynomial cost fcn,
// starting with highest order, where cost is
// f(p) = cn*p^n + ... + c1*p + c0
\ No newline at end of file
//IDX_CT Defines constants for named column indices to changes table
//
// [CT_LABEL, CT_PROB, CT_TABLE, CT_TBUS, CT_TGEN, CT_TBRCH, CT_TAREABUS, ...
// CT_TAREAGEN, CT_TAREABRCH, CT_ROW, CT_COL, CT_CHGTYPE, CT_REP, ...
// CT_REL, CT_ADD, CT_NEWVAL, CT_TLOAD, CT_TAREALOAD, CT_LOAD_ALL_PQ, ...
// CT_LOAD_FIX_PQ, CT_LOAD_DIS_PQ, CT_LOAD_ALL_P, CT_LOAD_FIX_P, ...
// CT_LOAD_DIS_P, CT_TGENCOST, CT_TAREAGENCOST, CT_MODCOST_F, ...
// CT_MODCOST_X] = idx_ct;
//
// CT_LABEL: column of changes table where the change set label is stored
//
// CT_PROB: column of changes table where the probability of the
// change set is stored
//
// CT_TABLE: column of the changes table where the type of system data
// table to be modified is stored;
// type CT_TBUS indicates bus table
// type CT_TGEN indicates gen table
// type CT_TBRCH indicates branch table
// type CT_TLOAD indicates a load modification (bus and/or gen tables)
// type CT_TAREABUS indicates area-wide change in bus table
// type CT_TAREAGEN indicates area-wide change in generator table
// type CT_TAREABRCH indicates area-wide change in branch table
// type CT_TAREALOAD indicates area-wide change in load
// (bus and/or gen tables)
//
// CT_ROW: column of changes table where the row number in the data
// table to be modified is stored. A value of "0" in this column
// has the special meaning "apply to all rows". For an area-wide
// type of change, the area number is stored here instead.
//
// CT_COL: column of changes table where the number of the column in
// the data table to be modified is stored
// For CT_TLOAD and CT_TAREALOAD, the value entered in this column
// is one of the following codes (or its negative), rather than
// a column index:
// type CT_LOAD_ALL_PQ modify all loads, real & reactive
// type CT_LOAD_FIX_PQ modify only fixed loads, real & reactive
// type CT_LOAD_DIS_PQ modify only dispatchable loads, real & reactive
// type CT_LOAD_ALL_P modify all loads, real only
// type CT_LOAD_FIX_P modify only fixed loads, real only
// type CT_LOAD_DIS_P modify only dispatchable loads, real only
// If the negative of one of these codes is used, then any affected
// dispatchable loads will have their costs scaled as well.
// For CT_TGENCOST and CT_TAREAGENCOST, in addition to an actual
// column index, this value can also take one of the following
// codes to indicate a scaling (CT_REL change type) or shifting
// (CT_ADD change type) of the specified cost functions:
// type CT_MODCOST_F scales or shifts the cost function vertically
// type CT_MODCOST_X scales or shifts the cost function horizontally
// See also MODCOST.
//
// CT_CHGTYPE: column of changes table where the type of change to
// be made is stored:
// type CT_REP replaces old value by value in CT_NEWVAL column
// type CT_REL multiplies old value by factor in CT_NEWVAL column
// type CT_ADD adds value in CT_NEWVAL column to old value
// MATPOWER
// Copyright (c) 2000-2016, Power Systems Engineering Research Center (PSERC)
// by Carlos E. Murillo-Sanchez, PSERC Cornell & Universidad Nacional de Colombia
// and Ray Zimmerman, PSERC Cornell
//
// This file is part of MATPOWER.
// Covered by the 3-clause BSD License (see LICENSE file for details).
// See https://matpower.org for more info.
// column labels for changes table
CT_LABEL = 1; // change set label
CT_PROB = 2; // change set probability
CT_TABLE = 3; // type of table to be modified (see possible values below)
CT_ROW = 4; // number of the row to be modified (0 means all rows)
CT_COL = 5; // number of the column to be modified
// (for some values in CT_TABLE column, this can be a
// special code instead of an actual column index)
CT_CHGTYPE = 6; // type of parameter modification to be made
// (see possible values below)
CT_NEWVAL = 7; // quantity to use for replacement value, scale factor
// or shift amount
// named values for CT_TABLE entry
CT_TBUS = 1; // bus table
CT_TGEN = 2; // gen table
CT_TBRCH = 3; // branch table
CT_TAREABUS = 4; // area-wide change in bus table
CT_TAREAGEN = 5; // area-wide change in gen table
CT_TAREABRCH = 6; // area-wide change in branch table
CT_TLOAD = 7; // single bus load change
CT_TAREALOAD = 8; // area-wide bus load change
CT_TGENCOST = 9; // gencost table
CT_TAREAGENCOST = 10; // area-wide change in gencost table
// named values for CT_CHGTYPE entry
CT_REP = 1; // replace old value with new one in column CT_NEWVAL
CT_REL = 2; // multiply old value by factor in column CT_NEWVAL
CT_ADD = 3; // add value in column CT_NEWVAL to old value
// codes for CT_COL entry when CT_TABLE entry is CT_TLOAD or CT_TAREALOAD
CT_LOAD_ALL_PQ = 1; // all loads, real and reactive
CT_LOAD_FIX_PQ = 2; // only fixed loads, real and reactive
CT_LOAD_DIS_PQ = 3; // only dispatchable loads, real and reactive
CT_LOAD_ALL_P = 4; // all loads, real only
CT_LOAD_FIX_P = 5; // only fixed loads, real only
CT_LOAD_DIS_P = 6; // only dispatchable loads, real only
// codes for CT_COL entry when CT_TABLE entry is CT_TGENCOST or CT_TAREAGENCOST
CT_MODCOST_F = -1; // scale or shift cost function vertically
CT_MODCOST_X = -2; // scale or shift cost function horizontally
\ No newline at end of file
//IDX_DCLINE Defines constants for named column indices to dcline matrix.
// Example:
//
// c = idx_dcline;
//
// Some examples of usage, after defining the constants using the line above,
// are:
//
// mpc.dcline(4, c.BR_STATUS) = 0; % take dcline 4 out of service
//
// The index, name and meaning of each column of the dcline matrix is given
// below:
//
// columns 1-17 must be included in input matrix (in case file)
// 1 F_BUS f, "from" bus number
// 2 T_BUS t, "to" bus number
// 3 BR_STATUS initial dcline status, 1 - in service, 0 - out of service
// 4 PF MW flow at "from" bus ("from" -> "to")
// 5 PT MW flow at "to" bus ("from" -> "to")
// 6 QF MVAr injection at "from" bus ("from" -> "to")
// 7 QT MVAr injection at "to" bus ("from" -> "to")
// 8 VF voltage setpoint at "from" bus (p.u.)
// 9 VT voltage setpoint at "to" bus (p.u.)
// 10 PMIN lower limit on PF (MW flow at "from" end)
// 11 PMAX upper limit on PF (MW flow at "from" end)
// 12 QMINF lower limit on MVAr injection at "from" bus
// 13 QMAXF upper limit on MVAr injection at "from" bus
// 14 QMINT lower limit on MVAr injection at "to" bus
// 15 QMAXT upper limit on MVAr injection at "to" bus
// 16 LOSS0 constant term of linear loss function (MW)
// 17 LOSS1 linear term of linear loss function (MW/MW)
// (loss = LOSS0 + LOSS1 * PF)
//
// columns 18-23 are added to matrix after OPF solution
// they are typically not present in the input matrix
// (assume OPF objective function has units, u)
// 18 MU_PMIN Kuhn-Tucker multiplier on lower flow lim at "from" bus (u/MW)
// 19 MU_PMAX Kuhn-Tucker multiplier on upper flow lim at "from" bus (u/MW)
// 20 MU_QMINF Kuhn-Tucker multiplier on lower VAr lim at "from" bus (u/MVAr)
// 21 MU_QMAXF Kuhn-Tucker multiplier on upper VAr lim at "from" bus (u/MVAr)
// 22 MU_QMINT Kuhn-Tucker multiplier on lower VAr lim at "to" bus (u/MVAr)
// 23 MU_QMAXT Kuhn-Tucker multiplier on upper VAr lim at "to" bus (u/MVAr)
//
// See also TOGGLE_DCLINE.
// MATPOWER
// Copyright (c) 2011-2016, Power Systems Engineering Research Center (PSERC)
// by Ray Zimmerman, PSERC Cornell
//
// This file is part of MATPOWER.
// Covered by the 3-clause BSD License (see LICENSE file for details).
// See https://matpower.org for more info.
// define the indices
c = struct( ...
'F_BUS', 1, ... // f, "from" bus number
'T_BUS', 2, ... // t, "to" bus number
'BR_STATUS', 3, ... // initial dcline status, 1 - in service, 0 - out of service
'PF', 4, ... // MW flow at "from" bus ("from" -> "to")
'PT', 5, ... // MW flow at "to" bus ("from" -> "to")
'QF', 6, ... // MVAr injection at "from" bus ("from" -> "to")
'QT', 7, ... // MVAr injection at "to" bus ("from" -> "to")
'VF', 8, ... // voltage setpoint at "from" bus (p.u.)
'VT', 9, ... // voltage setpoint at "to" bus (p.u.)
'PMIN', 10, ... // lower limit on PF (MW flow at "from" end)
'PMAX', 11, ... // upper limit on PF (MW flow at "from" end)
'QMINF', 12, ... // lower limit on MVAr injection at "from" bus
'QMAXF', 13, ... // upper limit on MVAr injection at "from" bus
'QMINT', 14, ... // lower limit on MVAr injection at "to" bus
'QMAXT', 15, ... // upper limit on MVAr injection at "to" bus
'LOSS0', 16, ... // constant term of linear loss function (MW)
'LOSS1', 17, ... // linear term of linear loss function (MW)
'MU_PMIN', 18, ... // Kuhn-Tucker multiplier on lower flow lim at "from" bus (u/MW)
'MU_PMAX', 19, ... // Kuhn-Tucker multiplier on upper flow lim at "from" bus (u/MW)
'MU_QMINF', 20, ... // Kuhn-Tucker multiplier on lower VAr lim at "from" bus (u/MVAr)
'MU_QMAXF', 21, ... // Kuhn-Tucker multiplier on upper VAr lim at "from" bus (u/MVAr)
'MU_QMINT', 22, ... // Kuhn-Tucker multiplier on lower VAr lim at "to" bus (u/MVAr)
'MU_QMAXT', 23 ); // Kuhn-Tucker multiplier on upper VAr lim at "to" bus (u/MVAr)
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论