


Constructs the mining capacity goal -------------------------------------------------------------------------- Date: July 30, 2010, ver01 By: Eugene Ben-Awuah --------------------------------------------------------------------------


0001 % Constructs the mining capacity goal 0002 %-------------------------------------------------------------------------- 0003 % Date: July 30, 2010, ver01 0004 % By: Eugene Ben-Awuah 0005 %-------------------------------------------------------------------------- 0006 0007 function [A_miningG miningGoal miningGoal_LB]=... 0008 mining_capacity_goal(Blocks120, numOfPeriods, miningTarget, miningSlack) 0009 0010 %Initially, set the mining target high and give the optimization room to achieve it. 0011 [numBlocks n] = size([Blocks120.EBV]'); 0012 0013 %Goal1: Sum of ore, waste and dyke material gives the blocktonnage 0014 BlockTonnage = [Blocks120.BlockTonnage]; 0015 0016 %Check calculated mining target against your set mining target 0017 miningTarget1=(sum(BlockTonnage))/numOfPeriods 0018 0019 miningG = zeros(numOfPeriods,numBlocks*numOfPeriods); 0020 for iPeriods = 1:numOfPeriods 0021 miningG(iPeriods,((numBlocks*(iPeriods-1)+1):iPeriods*numBlocks))... 0022 = BlockTonnage(1,:); 0023 end 0024 0025 A_miningG = sparse(miningG); 0026 0027 %Create matrix for mining goal deviational variable, d1. It occurs once in 0028 %every period; resulting in a 5x5 identity matrix. the other deviational 0029 %variables do not occur in this goal, hence we use a 5x5 zero matrix to 0030 %represent each of them. 0031 miningD1 = eye(numOfPeriods,numOfPeriods); 0032 miningD1 = sparse(miningD1); 0033 0034 %Creating the mining Goal target matrix: size=(number of contraints x Periods),1 0035 %miningGoal = repmat(miningTarget, numOfPeriods,1); 0036 miningGoal = [miningTarget]'; 0037 miningGoal = sparse(miningGoal); 0038 0039 %Create a lower bound for the mining target to introduce a slack during 0040 %optimization since the equality constraint in such large problems results 0041 %in infeasibility. You can first try with equality before using this lower 0042 %bound slack. 0043 miningTarget_LB = miningTarget-miningSlack; 0044 miningGoal_LB = [miningTarget_LB]'; 0045 miningGoal_LB = sparse(miningGoal_LB); 0046 0047 % the mulitplier vector in the goal matrix have different sizes 0048 % and units. (some are tonnage some are grade....). It is necessary to 0049 % transform the constraints matrix in a way that it unit less to be 0050 % solved by the MIP code. 0051 % divide each row vector by its norm [A(i,:)* A(i,:)']^1/2 0052 % A_miningNormVector(m,1) is vertical vector holding the respective 0053 % norm of each row of the A_mining matrix 0054 [m,n] = size(A_miningG); 0055 0056 for i = 1:m 0057 A_miningNormVector(i,1) = norm(A_miningG(i,:)); 0058 end 0059 0060 for i = 1:m 0061 normA = A_miningNormVector(i,1); 0062 A_miningG(i,:) = A_miningG(i,:)/normA; 0063 0064 %normalizing the deviational variable 0065 miningD1(i,:) = miningD1(i,:)/normA; 0066 0067 % normalizing the goal 0068 miningGoal(i)= miningGoal(i)/normA; 0069 0070 %normalizing mining goal lower bound 0071 miningGoal_LB(i)= miningGoal_LB(i)/normA; 0072 end 0073 0074 A_miningG = [zeros(m, numBlocks*numOfPeriods)... 0075 zeros(m, numBlocks*numOfPeriods)... 0076 zeros(m, numBlocks*numOfPeriods)... 0077 A_miningG, miningD1, zeros(m,m), zeros(m,m), zeros(m,m)]; 0078 end 0079 0080