Lecture on 1-22 1 SA305 Spring 2014 Blending Models Blending various substances together in various ways and mediums can be modeled with linear programs. We begin with an example. Example 1.1. Sunco Oil manufactures three types of gasoline (gas 1, gas 2 and gas 3). Each type is produced by blending three types of crude oil (crude 1, crude 2 and crude 3). The sales price per barrel of gasoline and the purchase price per barrel of crude oil are given in following table: Gasoline Sale Price per barrel Gas 1 $70 $60 Gas 2 Gas 3 $50 Oil Crude 1 Crude 2 Crude 3 Purchase Price per barrel $45 $25 $20 Sunco can purchase up to 5000 barrels of each type of crude oil daily. The three types of gasoline differ in their octane rating and sulfur content. The crude oil blended to form gas 1 must have an average octane rating of at least 90 and contain at most 1% sulfur. The crude oil blended to form gas 2 must have an average octane rating of at least 89 and contain at most 2% sulfur. The crude oil blended to form gas 3 must have an octane rating of at least 87 and contain at most 1% sulfur. The octane rating and the sulfur content of the three types of oil are given in following table: Crude Crude Crude Crude oil 1 2 3 Octane rating 92 86 90 Sulfur content 0.5% 2.0% 3.0% It costs $4 to transform one barrel of oil into one barrel of gasoline, and Sunco’s refinery can produce up to 14,000 barrels of gasoline daily. Sunco’s customers require the following amounts of each gasoline: gas 1: 3000 barrels per day; gas 2:2000 barrels per day; gas 3:1000 barrels per day. The company considers it an obligation to meet these demands. Formulate an LP that will enable Sunco to maximize daily profits. Step 1: fix our decision variables. Set g(crude type, gas type) = the amount of crude type in barrels we use to produce gas type so gij = the amount of crude type i in barrels we use to produce gas type j. With this let’s make some notes. 1 We know that the values of i and j can be 1,2, or 3. (number of barrels of crude type i used) = gi1 + gi2 + gi3 (number of barrels of gas type j produced) = g1j + g2j + g3j (total barrels of gas produced) = g11 + g12 + g13 + g21 + g22 + g23 + g31 + g32 + g33 Step 2: Create the objective function. The big idea here is that profit=[revenue] - [costs] which is profit = [70(g11 + g21 + g31 ) + 60(g12 + g22 + g32 ) + 50(g13 + g23 + g33 )] − [45(g11 + g12 + g13 ) + 25(g21 + g22 + g23 ) + 20(g31 + g32 + g33 ) +4(g11 + g12 + g13 + g21 + g22 + g23 + g31 + g32 + g33 )] . This is what we want to maximize. Step 3: Write down all the constraints. Obviously we have nonnegativity variable constraints gij ≥ 0 for all i and j. The purchase constraints on each type of crude is gi1 + gi2 + gi3 ≤ 5000 for each i = {1, 2, 3}. The refinery’s production restriction is g11 + g12 + g13 + g21 + g22 + g23 + g31 + g32 + g33 ≤ 14000 The customer requirements for each type of gas is g11 + g21 + g31 ≥ 3000 g12 + g22 + g32 ≥ 2000 g13 + g23 + g33 ≥ 1000. Next let’s work with each gas type octane rating: Now we must create the blending constraints. These are the difficult ones. First let’s work with each gas type octane rating: A key idea is that the ratio of the amount of crude type i used to make gas type j is number of barrels of crude i used to make gas j total number of barrels of gas type j made 2 = gij g1j + g2j + g3j And then we can multiply this ratio times the octane level and create a constraint: 92(ratio of crude 1 in gas j)+86(ratio of crude 2 in gas j)+90(ratio of crude 3 in gas j) ≥ (the required octane level for gas j) So for gas 1 we have 92 g21 g31 g11 + 86 + 90 ≥ 90 g11 + g21 + g31 g11 + g21 + g31 g11 + g21 + g31 and for gas 2 we have 92 g12 g22 g32 + 86 + 90 ≥ 89 g12 + g22 + g32 g12 + g22 + g32 g12 + g22 + g32 and for gas 3 we have 92 g23 g33 g13 + 86 + 90 ≥ 87. g13 + g23 + g33 g13 + g23 + g33 g13 + g23 + g33 These at a first glance look non-linear! However note that each fraction has the same denominator. And hence we can multiply both sides the make the linear equations: 92g11 + 86g21 + 90g31 ≥ 90(g11 + g21 + g31 ) 92g12 + 86g22 + 90g32 ≥ 89(g12 + g22 + g32 ) 92g13 + 86g23 + 90g33 ≥ 87(g13 + g23 + g33 ). Now the sulfur constraints. Again we use the same idea about ratios to get: .005g11 + .02g21 + .03g31 ≤ .01(g11 + g21 + g31 ) .005g12 + .02g22 + .03g32 ≤ .02(g12 + g22 + g32 ) .005g13 + .02g23 + .03g33 ≤ .01(g13 + g23 + g33 ) We can subtract these constraints to make writing of these equations shorter. And our model becomes 3 max s.t. 31g11 + 41g21 + 46g31 + 11g12 + 31g22 + 36g32 + g13 + 21g23 + 26g33 gij ≥ 0 gi1 + gi2 + gi3 ≤ 5000 for each i = {1, 2, 3} g11 + g12 + g13 + g21 + g22 + g23 + g31 + g32 + g33 ≤ 14000 g11 + g21 + g31 ≥ 3000 g12 + g22 + g32 ≥ 2000 g13 + g23 + g33 ≥ 1000 2g11 − 4g21 ≥ 0 3g12 − 3g22 + g32 ≥ 0 5g13 − g23 + 3g33 ≥ 0 .005g11 − .01g21 − .02g31 ≥ 0 .015g12 − .01g32 ≥ 0 .005g13 − .01g23 − .02g33 ≥ 0 4