Subroutine DoReduction create the reduced network based on input network data. [mpcreduced,BCIRC,ExBus] = DoReduction(DataB,ERP,CIndx,ExBus,NUMB,dim,BCIRC,newbusnum,oldbusnum,mpc,label) INPUT DATA: DataB: 1*n array, admittance value in input admittance matrix ERP: 1*n array, end of row pointer of the input admittance matrix CIndx: 1*n array, column indices of every row of the input admittance matrix. ExBus: 1*n array, external bus indices NUMB: 1*n array, bus indices dim: scalar, dimension of the input admittance matrix (should be square) BCIRC: 1*n array, branch circuit number newbusnum: 1*n array, internal bus indices oldbusnum: 1*n array, original bus indices OUTPUT DATA: mpcreduced: struct, reduced model, without external generator placement and load redistribution BCIRC: updated branch circuit number ExBus: updated external bus indices NOTE: The reduced model generated by this subroutine doesn't involve external generator placement and load redistribution. It's only good for analyze the reduced network (toplogy+reactance).
0001 function [mpcreduced,BCIRC,ExBus] = DoReduction(DataB,ERP,CIndx,ExBus,NUMB,dim,BCIRC,newbusnum,oldbusnum,mpc) 0002 % Subroutine DoReduction create the reduced network based on input network 0003 % data. 0004 % 0005 % [mpcreduced,BCIRC,ExBus] = DoReduction(DataB,ERP,CIndx,ExBus,NUMB,dim,BCIRC,newbusnum,oldbusnum,mpc,label) 0006 % 0007 % INPUT DATA: 0008 % DataB: 1*n array, admittance value in input admittance matrix 0009 % ERP: 1*n array, end of row pointer of the input admittance matrix 0010 % CIndx: 1*n array, column indices of every row of the input admittance 0011 % matrix. 0012 % ExBus: 1*n array, external bus indices 0013 % NUMB: 1*n array, bus indices 0014 % dim: scalar, dimension of the input admittance matrix (should be square) 0015 % BCIRC: 1*n array, branch circuit number 0016 % newbusnum: 1*n array, internal bus indices 0017 % oldbusnum: 1*n array, original bus indices 0018 % 0019 % OUTPUT DATA: 0020 % mpcreduced: struct, reduced model, without external generator placement 0021 % and load redistribution 0022 % BCIRC: updated branch circuit number 0023 % ExBus: updated external bus indices 0024 % 0025 % NOTE: The reduced model generated by this subroutine doesn't involve 0026 % external generator placement and load redistribution. It's only good for 0027 % analyze the reduced network (toplogy+reactance). 0028 0029 % MATPOWER 0030 % Copyright (c) 2014-2015 by Power System Engineering Research Center (PSERC) 0031 % by Yujia Zhu, PSERC ASU 0032 % 0033 % $Id: DoReduction.m 2655 2015-03-18 16:40:32Z ray $ 0034 % 0035 % This file is part of MATPOWER. 0036 % Covered by the 3-clause BSD License (see LICENSE file for details). 0037 % See http://www.pserc.cornell.edu/matpower/ for more info. 0038 0039 %% Define Boundary Buses 0040 [BoundBus]=DefBoundary(mpc,ExBus); 0041 %% Do Pivot including Tinney One 0042 [DataB,ERP,CIndx,PivOrd,PivInd] = PivotData(DataB,ERP,CIndx,ExBus,NUMB,BoundBus); 0043 %% Do LU factorization (Partial) 0044 [ERPU,CIndxU,ERPEQ,CIndxEQ] = PartialSymLU(CIndx,ERP,dim,length(ExBus),BoundBus); 0045 [DataEQ,DataShunt] = PartialNumLU (CIndx,CIndxU,DataB,dim,ERP,ERPU,length(ExBus),ERPEQ,CIndxEQ,BoundBus); 0046 %% Create the reduced model in MATPOWER format 0047 [mpcreduced,BCIRC,ExBus] = MakeMPCr(ERPEQ,DataEQ,CIndxEQ,DataShunt,ERP,DataB,ExBus,PivInd,PivOrd,BCIRC,newbusnum,oldbusnum,mpc,BoundBus); 0048 end