Home > matpower6.0 > define_constants.m

DEFINE_CONSTANTS Defines useful constants for indexing data, etc. 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. It also defines constants for the change tables used by apply_changes(). 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 change tables: 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 See CASEFORMAT, IDX_BUS, IDX_BRCH, IDX_GEN, IDX_COST and IDX_CT for details on the meaning of these constants. Internally DEFINE_CONSTANTS calls IDX_BUS, IDX_BRCH, IDX_GEN, IDX_COST and IDX_CT. 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.

- idx_brch IDX_BRCH Defines constants for named column indices to branch matrix.
- idx_bus IDX_BUS Defines constants for named column indices to bus matrix.
- idx_cost IDX_COST Defines constants for named column indices to gencost matrix.
- idx_ct IDX_CT Defines constants for named column indices to changes table
- idx_gen IDX_GEN Defines constants for named column indices to gen matrix.

- example_ieee39 EXAMPLE_IEEE39 Examples of using maximum loadability limit (MLL) search with
- example_ieee9 EXAMPLE_IEEE9 Examples of using maximum loadability limit (MLL) search with
- maxloadlim MAXLOADLIM computes the maximum loadability limit in one direction. It
- postproc_maxloadlim POSTPROC_MAXLOADLIM Performs some post processing on the results returned
- prepare_maxloadlim PREPARE_MAXSLL prepares the mpc case for computing the maximum
- print_maxloadlim PRINT_MAXLOADLIM(MPC,RESULTS) prints the results in RESULTS of the
- Test_maxloadlim TEST_MAXLOADLIM
- userfcn_direction_mll_formulation USERFCN_DIRECTION_MLL_FORMULATION adds one variable and as many
- checklimits CHECKLIMITS Checks a solved power flow case for limit violations.
- loss2bus LOSS2BUS Accumulates branch real power losses at downstream buses.
- plot_mpc PLOT_MPC Plot an electrically meaningful drawing of a MATPOWER case.
- qcqp_opf QCQP_OPF Builds a quadratically-constrained quadratic program.
- insolvablepfsos INSOLVABLEPFSOS A sufficient condition for power flow insolvability
- insolvablepfsos_limitQ INSOLVABLEPFSOS_LIMITQ A sufficient condition for power flow insolvability
- loadmd LOADMD Loads all required data and constructs MD for MOST.
- c118swf CASE118 Power flow data for IEEE 118 bus test case.
- most_ex1_ed MOST_EX1_ED Examples of deterministic economic dispatch.
- most_ex2_dcopf MOST_EX2_DCOPF Examples of deterministic DC optimal power flow.
- most_ex3_dcopf_w_uc MOST_EX3_DCOPF_W_UC Examples of deterministic DC optimal power flow with UC.
- most_ex4_dcopf_ss MOST_EX4_DCOPF_SS Examples of secure and stochastic DC OPF problems.
- most_ex5_mpopf MOST_EX5_MPOPF Examples of deterministic multiperiod DC OPF problems.
- most_ex6_uc MOST_EX6_UC Examples of deterministic unit commitment problems.
- most_ex7_suc MOST_EX7_SUC Examples of secure and stochastic unit commitment problems.

0001 %DEFINE_CONSTANTS Defines useful constants for indexing data, etc. 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. It also 0008 % defines constants for the change tables used by apply_changes(). 0009 % 0010 % bus: 0011 % PQ, PV, REF, NONE, BUS_I, BUS_TYPE, PD, QD, GS, BS, BUS_AREA, VM, 0012 % VA, BASE_KV, ZONE, VMAX, VMIN, LAM_P, LAM_Q, MU_VMAX, MU_VMIN 0013 % 0014 % branch: 0015 % F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, 0016 % TAP, SHIFT, BR_STATUS, PF, QF, PT, QT, MU_SF, MU_ST, 0017 % ANGMIN, ANGMAX, MU_ANGMIN, MU_ANGMAX 0018 % 0019 % gen: 0020 % GEN_BUS, PG, QG, QMAX, QMIN, VG, MBASE, GEN_STATUS, PMAX, PMIN, 0021 % MU_PMAX, MU_PMIN, MU_QMAX, MU_QMIN, PC1, PC2, QC1MIN, QC1MAX, 0022 % QC2MIN, QC2MAX, RAMP_AGC, RAMP_10, RAMP_30, RAMP_Q, APF 0023 % 0024 % gencost: 0025 % PW_LINEAR, POLYNOMIAL, MODEL, STARTUP, SHUTDOWN, NCOST, COST 0026 % 0027 % change tables: 0028 % CT_LABEL, CT_PROB, CT_TABLE, CT_TBUS, CT_TGEN, CT_TBRCH, CT_TAREABUS, 0029 % CT_TAREAGEN, CT_TAREABRCH, CT_ROW, CT_COL, CT_CHGTYPE, CT_REP, 0030 % CT_REL, CT_ADD, CT_NEWVAL, CT_TLOAD, CT_TAREALOAD, CT_LOAD_ALL_PQ, 0031 % CT_LOAD_FIX_PQ, CT_LOAD_DIS_PQ, CT_LOAD_ALL_P, CT_LOAD_FIX_P, 0032 % CT_LOAD_DIS_P, CT_TGENCOST, CT_TAREAGENCOST, CT_MODCOST_F, 0033 % CT_MODCOST_X 0034 % 0035 % See CASEFORMAT, IDX_BUS, IDX_BRCH, IDX_GEN, IDX_COST and IDX_CT for 0036 % details on the meaning of these constants. Internally 0037 % DEFINE_CONSTANTS calls IDX_BUS, IDX_BRCH, IDX_GEN, IDX_COST and IDX_CT. 0038 % In performance sensitive code, such as internal MATPOWER functions 0039 % that are called frequently, it is preferred to call these 0040 % functions directly rather than using the DEFINE_CONSTANTS script, 0041 % which is less efficient. 0042 % 0043 % This script is included for convenience for interactive use or 0044 % for high-level code where maximum performance is not a concern. 0045 0046 % MATPOWER 0047 % Copyright (c) 2009-2016, Power Systems Engineering Research Center (PSERC) 0048 % by Doug Mitarotonda & Ray Zimmerman, PSERC Cornell 0049 % 0050 % This file is part of MATPOWER. 0051 % Covered by the 3-clause BSD License (see LICENSE file for details). 0052 % See http://www.pserc.cornell.edu/matpower/ for more info. 0053 0054 %% define named indices into data matrices 0055 [PQ, PV, REF, NONE, BUS_I, BUS_TYPE, PD, QD, GS, BS, BUS_AREA, VM, ... 0056 VA, BASE_KV, ZONE, VMAX, VMIN, LAM_P, LAM_Q, MU_VMAX, MU_VMIN] = idx_bus; 0057 [F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, ... 0058 TAP, SHIFT, BR_STATUS, PF, QF, PT, QT, MU_SF, MU_ST, ... 0059 ANGMIN, ANGMAX, MU_ANGMIN, MU_ANGMAX] = idx_brch; 0060 [GEN_BUS, PG, QG, QMAX, QMIN, VG, MBASE, GEN_STATUS, PMAX, PMIN, ... 0061 MU_PMAX, MU_PMIN, MU_QMAX, MU_QMIN, PC1, PC2, QC1MIN, QC1MAX, ... 0062 QC2MIN, QC2MAX, RAMP_AGC, RAMP_10, RAMP_30, RAMP_Q, APF] = idx_gen; 0063 [PW_LINEAR, POLYNOMIAL, MODEL, STARTUP, SHUTDOWN, NCOST, COST] = idx_cost; 0064 [CT_LABEL, CT_PROB, CT_TABLE, CT_TBUS, CT_TGEN, CT_TBRCH, CT_TAREABUS, ... 0065 CT_TAREAGEN, CT_TAREABRCH, CT_ROW, CT_COL, CT_CHGTYPE, CT_REP, ... 0066 CT_REL, CT_ADD, CT_NEWVAL, CT_TLOAD, CT_TAREALOAD, CT_LOAD_ALL_PQ, ... 0067 CT_LOAD_FIX_PQ, CT_LOAD_DIS_PQ, CT_LOAD_ALL_P, CT_LOAD_FIX_P, ... 0068 CT_LOAD_DIS_P, CT_TGENCOST, CT_TAREAGENCOST, CT_MODCOST_F, ... 0069 CT_MODCOST_X] = idx_ct;

Generated on Fri 16-Dec-2016 12:45:37 by