Home > matpower4.0 > makeAang.m

makeAang

PURPOSE ^

MAKEAANG Construct constraints for branch angle difference limits.

SYNOPSIS ^

function [Aang, lang, uang, iang] = makeAang(baseMVA, branch, nb, mpopt)

DESCRIPTION ^

MAKEAANG  Construct constraints for branch angle difference limits.
   [AANG, LANG, UANG, IANG]  = MAKEAANG(BASEMVA, BRANCH, NB, MPOPT)

   Constructs the parameters for the following linear constraint limiting
   the voltage angle differences across branches, where Va is the vector
   of bus voltage angles. NB is the number of buses.

       LANG <= AANG * Va <= UANG

   IANG is the vector of indices of branches with angle difference limits.

   Example:
       [Aang, lang, uang, iang]  = makeAang(baseMVA, branch, nb, mpopt);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Aang, lang, uang, iang]  = makeAang(baseMVA, branch, nb, mpopt)
0002 %MAKEAANG  Construct constraints for branch angle difference limits.
0003 %   [AANG, LANG, UANG, IANG]  = MAKEAANG(BASEMVA, BRANCH, NB, MPOPT)
0004 %
0005 %   Constructs the parameters for the following linear constraint limiting
0006 %   the voltage angle differences across branches, where Va is the vector
0007 %   of bus voltage angles. NB is the number of buses.
0008 %
0009 %       LANG <= AANG * Va <= UANG
0010 %
0011 %   IANG is the vector of indices of branches with angle difference limits.
0012 %
0013 %   Example:
0014 %       [Aang, lang, uang, iang]  = makeAang(baseMVA, branch, nb, mpopt);
0015 
0016 %   MATPOWER
0017 %   $Id: makeAang.m,v 1.8 2010/04/26 19:45:25 ray Exp $
0018 %   by Ray Zimmerman, PSERC Cornell
0019 %   and Carlos E. Murillo-Sanchez, PSERC Cornell & Universidad Autonoma de Manizales
0020 %   Copyright (c) 1996-2010 by Power System Engineering Research Center (PSERC)
0021 %
0022 %   This file is part of MATPOWER.
0023 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0024 %
0025 %   MATPOWER is free software: you can redistribute it and/or modify
0026 %   it under the terms of the GNU General Public License as published
0027 %   by the Free Software Foundation, either version 3 of the License,
0028 %   or (at your option) any later version.
0029 %
0030 %   MATPOWER is distributed in the hope that it will be useful,
0031 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0032 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0033 %   GNU General Public License for more details.
0034 %
0035 %   You should have received a copy of the GNU General Public License
0036 %   along with MATPOWER. If not, see <http://www.gnu.org/licenses/>.
0037 %
0038 %   Additional permission under GNU GPL version 3 section 7
0039 %
0040 %   If you modify MATPOWER, or any covered work, to interface with
0041 %   other modules (such as MATLAB code and MEX-files) available in a
0042 %   MATLAB(R) or comparable environment containing parts covered
0043 %   under other licensing terms, the licensors of MATPOWER grant
0044 %   you additional permission to convey the resulting work.
0045 
0046 %% options
0047 ignore_ang_lim = mpopt(25);     %% OPF_IGNORE_ANG_LIM
0048 
0049 %% define named indices into data matrices
0050 [F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, ...
0051     TAP, SHIFT, BR_STATUS, PF, QF, PT, QT, MU_SF, MU_ST, ...
0052     ANGMIN, ANGMAX, MU_ANGMIN, MU_ANGMAX] = idx_brch;
0053 
0054 if ignore_ang_lim
0055   Aang  = sparse(0, nb);
0056   lang  = [];
0057   uang  = [];
0058   iang  = [];
0059 else
0060   iang = find((branch(:, ANGMIN) & branch(:, ANGMIN) > -360) | ...
0061               (branch(:, ANGMAX) & branch(:, ANGMAX) < 360));
0062   iangl = find(branch(iang, ANGMIN));
0063   iangh = find(branch(iang, ANGMAX));
0064   nang = length(iang);
0065 
0066   if nang > 0
0067     ii = [(1:nang)'; (1:nang)'];
0068     jj = [branch(iang, F_BUS); branch(iang, T_BUS)];
0069     Aang = sparse(ii, jj, [ones(nang, 1); -ones(nang, 1)], nang, nb);
0070     uang = Inf * ones(nang,1);
0071     lang = -uang;
0072     lang(iangl) = branch(iang(iangl), ANGMIN) * pi/180;
0073     uang(iangh) = branch(iang(iangh), ANGMAX) * pi/180;
0074   else
0075     Aang = sparse(0, nb);
0076     lang =[];
0077     uang =[];
0078   end
0079 end

Generated on Mon 26-Jan-2015 14:56:45 by m2html © 2005