reserve_constraints

PURPOSE ^

Constructs the reserve constraints

SYNOPSIS ^

function [A_reserve b_Ureserve]= reserve_constraints (numBlocks,numCuts,numOfPeriods)

DESCRIPTION ^

 Constructs the reserve constraints
--------------------------------------------------------------------------
 Updated May 27, 2009
 Date: Aug 06, 2008, ver01
 By: Hooman Askari
 rewrite this with the format of slope_constraints

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Constructs the reserve constraints
0002 %--------------------------------------------------------------------------
0003 % Updated May 27, 2009
0004 % Date: Aug 06, 2008, ver01
0005 % By: Hooman Askari
0006 % rewrite this with the format of slope_constraints
0007 
0008 function [A_reserve b_Ureserve]= reserve_constraints (numBlocks,...
0009                                                       numCuts,...  
0010                                                       numOfPeriods)
0011         
0012 A_reserve_blocks = sparse(numBlocks, numBlocks * numOfPeriods);
0013 
0014 A_reserve_cuts = sparse(numCuts, numCuts * numOfPeriods);
0015 
0016 
0017 for iBlocks = 1 : numBlocks
0018   for iPeriods = 1:numOfPeriods
0019     % summation of xs should be equal to one
0020     A_reserve_blocks(iBlocks, (((iPeriods - 1)* numBlocks) + iBlocks )) = 1;
0021   end % end for iPeriods
0022  end % end for iBlocks
0023 
0024 for iCuts = 1 : numCuts
0025    for iPeriods = 1:numOfPeriods
0026          % summation of ys should be equal to one
0027          A_reserve_cuts (iCuts, ( (iPeriods - 1)* numCuts + iCuts )  ) = 1;
0028    end % end for iPeriods
0029 end % end for iCuts
0030 
0031 b_Ureserve_blocks = ones(numBlocks, 1);
0032 
0033 b_Ureserve_cuts = ones(numCuts, 1);
0034 
0035 [m1 n] = size(A_reserve_blocks);
0036 [m2 n] = size(A_reserve_cuts);
0037 
0038 A_reserve =  [sparse(m1, numCuts*numOfPeriods)  A_reserve_blocks                     sparse(m1, numCuts*numOfPeriods);
0039               sparse(m2, numCuts*numOfPeriods)   sparse(m2, numBlocks*numOfPeriods)  A_reserve_cuts ];  
0040 
0041 A_reserve = sparse(A_reserve);
0042 
0043 b_Ureserve = [b_Ureserve_blocks; b_Ureserve_cuts];   
0044       
0045 end

Generated on Wed 08-Jul-2009 18:57:55 by m2html © 2003