DEFINE_CONSTANTS Defines constants for named column indices to data matrices. This is simply a convenience script that defines the constants listed below, consisting primarily of named indices for the columns of the data matrices: bus, branch, gen and gencost. This includes input columns defined in caseformat as well as columns that are added in the power flow and OPF output. bus: PQ, PV, REF, NONE, BUS_I, BUS_TYPE, PD, QD, GS, BS, BUS_AREA, VM, VA, BASE_KV, ZONE, VMAX, VMIN, LAM_P, LAM_Q, MU_VMAX, MU_VMIN branch: F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, TAP, SHIFT, BR_STATUS, PF, QF, PT, QT, MU_SF, MU_ST, ANGMIN, ANGMAX, MU_ANGMIN, MU_ANGMAX gen: GEN_BUS, PG, QG, QMAX, QMIN, VG, MBASE, GEN_STATUS, PMAX, PMIN, MU_PMAX, MU_PMIN, MU_QMAX, MU_QMIN, PC1, PC2, QC1MIN, QC1MAX, QC2MIN, QC2MAX, RAMP_AGC, RAMP_10, RAMP_30, RAMP_Q, APF gencost: PW_LINEAR, POLYNOMIAL, MODEL, STARTUP, SHUTDOWN, NCOST, COST See CASEFORMAT, IDX_BUS, IDX_BRCH, IDX_GEN and IDX_COST for details on the meaning of these constants. Internally DEFINE_CONSTANTS calls IDX_BUS, IDX_BRCH, IDX_GEN and IDX_COST. In performance sensitive code, such as internal MATPOWER functions that are called frequently, it is preferred to call these functions directly rather than using the DEFINE_CONSTANTS script, which is less efficient. This script is included for convenience for interactive use or for high-level code where maximum performance is not a concern.
0001 %DEFINE_CONSTANTS Defines constants for named column indices to data matrices. 0002 % 0003 % This is simply a convenience script that defines the constants 0004 % listed below, consisting primarily of named indices for the 0005 % columns of the data matrices: bus, branch, gen and gencost. 0006 % This includes input columns defined in caseformat as well as 0007 % columns that are added in the power flow and OPF output. 0008 % 0009 % bus: 0010 % PQ, PV, REF, NONE, BUS_I, BUS_TYPE, PD, QD, GS, BS, BUS_AREA, VM, 0011 % VA, BASE_KV, ZONE, VMAX, VMIN, LAM_P, LAM_Q, MU_VMAX, MU_VMIN 0012 % 0013 % branch: 0014 % F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, 0015 % TAP, SHIFT, BR_STATUS, PF, QF, PT, QT, MU_SF, MU_ST, 0016 % ANGMIN, ANGMAX, MU_ANGMIN, MU_ANGMAX 0017 % 0018 % gen: 0019 % GEN_BUS, PG, QG, QMAX, QMIN, VG, MBASE, GEN_STATUS, PMAX, PMIN, 0020 % MU_PMAX, MU_PMIN, MU_QMAX, MU_QMIN, PC1, PC2, QC1MIN, QC1MAX, 0021 % QC2MIN, QC2MAX, RAMP_AGC, RAMP_10, RAMP_30, RAMP_Q, APF 0022 % 0023 % gencost: 0024 % PW_LINEAR, POLYNOMIAL, MODEL, STARTUP, SHUTDOWN, NCOST, COST 0025 % 0026 % See CASEFORMAT, IDX_BUS, IDX_BRCH, IDX_GEN and IDX_COST for 0027 % details on the meaning of these constants. Internally 0028 % DEFINE_CONSTANTS calls IDX_BUS, IDX_BRCH, IDX_GEN and IDX_COST. 0029 % In performance sensitive code, such as internal MATPOWER functions 0030 % that are called frequently, it is preferred to call these 0031 % functions directly rather than using the DEFINE_CONSTANTS script, 0032 % which is less efficient. 0033 % 0034 % This script is included for convenience for interactive use or 0035 % for high-level code where maximum performance is not a concern. 0036 0037 % MATPOWER 0038 % $Id: define_constants.m,v 1.9 2011/12/01 19:06:47 cvs Exp $ 0039 % by Doug Mitarotonda & Ray Zimmerman, PSERC Cornell 0040 % Copyright (c) 2009-2010 by Power System Engineering Research Center (PSERC) 0041 % 0042 % This file is part of MATPOWER. 0043 % See http://www.pserc.cornell.edu/matpower/ for more info. 0044 % 0045 % MATPOWER is free software: you can redistribute it and/or modify 0046 % it under the terms of the GNU General Public License as published 0047 % by the Free Software Foundation, either version 3 of the License, 0048 % or (at your option) any later version. 0049 % 0050 % MATPOWER is distributed in the hope that it will be useful, 0051 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0052 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0053 % GNU General Public License for more details. 0054 % 0055 % You should have received a copy of the GNU General Public License 0056 % along with MATPOWER. If not, see <http://www.gnu.org/licenses/>. 0057 % 0058 % Additional permission under GNU GPL version 3 section 7 0059 % 0060 % If you modify MATPOWER, or any covered work, to interface with 0061 % other modules (such as MATLAB code and MEX-files) available in a 0062 % MATLAB(R) or comparable environment containing parts covered 0063 % under other licensing terms, the licensors of MATPOWER grant 0064 % you additional permission to convey the resulting work. 0065 0066 %% define named indices into data matrices 0067 [PQ, PV, REF, NONE, BUS_I, BUS_TYPE, PD, QD, GS, BS, BUS_AREA, VM, ... 0068 VA, BASE_KV, ZONE, VMAX, VMIN, LAM_P, LAM_Q, MU_VMAX, MU_VMIN] = idx_bus; 0069 [F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, ... 0070 TAP, SHIFT, BR_STATUS, PF, QF, PT, QT, MU_SF, MU_ST, ... 0071 ANGMIN, ANGMAX, MU_ANGMIN, MU_ANGMAX] = idx_brch; 0072 [GEN_BUS, PG, QG, QMAX, QMIN, VG, MBASE, GEN_STATUS, PMAX, PMIN, ... 0073 MU_PMAX, MU_PMIN, MU_QMAX, MU_QMIN, PC1, PC2, QC1MIN, QC1MAX, ... 0074 QC2MIN, QC2MAX, RAMP_AGC, RAMP_10, RAMP_30, RAMP_Q, APF] = idx_gen; 0075 [PW_LINEAR, POLYNOMIAL, MODEL, STARTUP, SHUTDOWN, NCOST, COST] = idx_cost;