ore_mining_constraint

PURPOSE ^

Constructs the ore and dyke material mining constraint

SYNOPSIS ^

function [A_ore_mining b_ore_mining] = ore_mining_constraint(Blocks120, numOfPeriods)

DESCRIPTION ^

 Constructs the ore and dyke material mining constraint 
--------------------------------------------------------------------------
 Date: July 30, 2010, ver01
 By: Eugene Ben-Awuah
--------------------------------------------------------------------------

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Constructs the ore and dyke material mining constraint
0002 %--------------------------------------------------------------------------
0003 % Date: July 30, 2010, ver01
0004 % By: Eugene Ben-Awuah
0005 %--------------------------------------------------------------------------
0006 
0007 function [A_ore_mining b_ore_mining] = ore_mining_constraint...
0008                                        (Blocks120, numOfPeriods) 
0009                                         
0010 
0011 [numBlocks n] = size([Blocks120.EBV]');
0012 
0013 A_ore_mining_x = sparse(numBlocks * numOfPeriods, numBlocks * numOfPeriods);
0014 A_ore_mining_y = sparse(numBlocks * numOfPeriods, numBlocks * numOfPeriods); 
0015 
0016 counter = 0;
0017    
0018  for iBlocks = 1: numBlocks
0019      
0020          for iPeriods = 1:numOfPeriods
0021              % summation of xs should be equal to one
0022              counter = counter + 1;
0023              
0024              A_ore_mining_x(counter, (iPeriods - 1)*...
0025                  numBlocks + iBlocks) = 1;
0026  
0027              A_ore_mining_y(counter, (iPeriods - 1)* numBlocks + iBlocks) = - 1;
0028          end % end for iPeriods
0029      
0030  end %iBlocks
0031  
0032  b_ore_mining = sparse(counter, 1);
0033  %A_ore_mining_x = sparse(A_ore_mining_x);
0034  A_ore_mining_z = (A_ore_mining_x);
0035  %A_ore_mining_y = sparse(A_ore_mining_y);
0036  
0037  A_ore_mining = [sparse(counter, numBlocks*numOfPeriods)...
0038                  A_ore_mining_x, A_ore_mining_z...
0039                  A_ore_mining_y, sparse(counter, numOfPeriods)...
0040                  sparse(counter, numOfPeriods), sparse(counter, numOfPeriods)...
0041                  sparse(counter, numOfPeriods)];
0042 end

Generated on Fri 30-Jul-2010 16:56:05 by m2html © 2003