Home > matpower4.1 > update_mupq.m

update_mupq

PURPOSE ^

UPDATE_MUPQ Updates values of generator limit shadow prices.

SYNOPSIS ^

function gen = update_mupq(baseMVA, gen, mu_PQh, mu_PQl, data)

DESCRIPTION ^

UPDATE_MUPQ  Updates values of generator limit shadow prices.
   GEN = UPDATE_MUPQ(BASEMVA, GEN, MU_PQH, MU_PQL, DATA)

   Updates the values of MU_PMIN, MU_PMAX, MU_QMIN, MU_QMAX based
   on any shadow prices on the sloped portions of the generator
   capability curve constraints.

   MU_PQH - shadow prices on upper sloped portion of capability curves
   MU_PQL - shadow prices on lower sloped portion of capability curves
   DATA   - "data" struct returned by MAKEAPQ

   See also MAKEAPQ.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function gen = update_mupq(baseMVA, gen, mu_PQh, mu_PQl, data)
0002 %UPDATE_MUPQ  Updates values of generator limit shadow prices.
0003 %   GEN = UPDATE_MUPQ(BASEMVA, GEN, MU_PQH, MU_PQL, DATA)
0004 %
0005 %   Updates the values of MU_PMIN, MU_PMAX, MU_QMIN, MU_QMAX based
0006 %   on any shadow prices on the sloped portions of the generator
0007 %   capability curve constraints.
0008 %
0009 %   MU_PQH - shadow prices on upper sloped portion of capability curves
0010 %   MU_PQL - shadow prices on lower sloped portion of capability curves
0011 %   DATA   - "data" struct returned by MAKEAPQ
0012 %
0013 %   See also MAKEAPQ.
0014 
0015 %   MATPOWER
0016 %   $Id: update_mupq.m,v 1.9 2011/06/16 17:48:24 cvs Exp $
0017 %   by Ray Zimmerman, PSERC Cornell
0018 %   and Carlos E. Murillo-Sanchez, PSERC Cornell & Universidad Autonoma de Manizales
0019 %   Copyright (c) 1996-2011 by Power System Engineering Research Center (PSERC)
0020 %
0021 %   This file is part of MATPOWER.
0022 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0023 %
0024 %   MATPOWER is free software: you can redistribute it and/or modify
0025 %   it under the terms of the GNU General Public License as published
0026 %   by the Free Software Foundation, either version 3 of the License,
0027 %   or (at your option) any later version.
0028 %
0029 %   MATPOWER is distributed in the hope that it will be useful,
0030 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0031 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0032 %   GNU General Public License for more details.
0033 %
0034 %   You should have received a copy of the GNU General Public License
0035 %   along with MATPOWER. If not, see <http://www.gnu.org/licenses/>.
0036 %
0037 %   Additional permission under GNU GPL version 3 section 7
0038 %
0039 %   If you modify MATPOWER, or any covered work, to interface with
0040 %   other modules (such as MATLAB code and MEX-files) available in a
0041 %   MATLAB(R) or comparable environment containing parts covered
0042 %   under other licensing terms, the licensors of MATPOWER grant
0043 %   you additional permission to convey the resulting work.
0044 
0045 %% extract the constraint parameters
0046 [ipqh, ipql, Apqhdata, Apqldata] = ...
0047     deal(data.ipqh, data.ipql, data.h, data.l);
0048 
0049 %% define named indices into data matrices
0050 [GEN_BUS, PG, QG, QMAX, QMIN, VG, MBASE, GEN_STATUS, PMAX, PMIN, ...
0051     MU_PMAX, MU_PMIN, MU_QMAX, MU_QMIN, PC1, PC2, QC1MIN, QC1MAX, ...
0052     QC2MIN, QC2MAX, RAMP_AGC, RAMP_10, RAMP_30, RAMP_Q, APF] = idx_gen;
0053 
0054 %% combine original limit multipliers into single value
0055 muP = gen(:, MU_PMAX) - gen(:, MU_PMIN);
0056 muQ = gen(:, MU_QMAX) - gen(:, MU_QMIN);
0057 
0058 %% add P and Q components of multipliers on upper sloped constraint
0059 muP(ipqh) = muP(ipqh) - mu_PQh .* Apqhdata(:,1)/baseMVA;
0060 muQ(ipqh) = muQ(ipqh) - mu_PQh .* Apqhdata(:,2)/baseMVA;
0061 
0062 %% add P and Q components of multipliers on lower sloped constraint
0063 muP(ipql) = muP(ipql) - mu_PQl .* Apqldata(:,1)/baseMVA;
0064 muQ(ipql) = muQ(ipql) - mu_PQl .* Apqldata(:,2)/baseMVA;
0065 
0066 %% split back into upper and lower multipliers based on sign
0067 gen(:, MU_PMAX) = (muP > 0) .*  muP;
0068 gen(:, MU_PMIN) = (muP < 0) .* -muP;
0069 gen(:, MU_QMAX) = (muQ > 0) .*  muQ;
0070 gen(:, MU_QMIN) = (muQ < 0) .* -muQ;

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