Chemical Engineering Computing Kyambogo University Lecture 10
Chemical Engineering Computing Kyambogo University Lecture 10
FACULTY OF ENGINEERING
DEPARTMENT OF MINING, CHEMICAL & PETROLEUM
ENGINEERING
BACHELOR OF SCIENCE IN CHEMICAL AND PROCESS ENGINEERING
Course Code and Name: SCE 2202 COMPUTING FOR CHEMICAL ENGINEERING II
Course Level: YR II, SEM II (2023/2024)
Course Credit: 3 CU
Lecturer: Dr. Dan Egesa
Linear Programming
Linear programming involves an objective function (Gain or loss) and a Constraint (equality or
inequality) that specifies the availability of resources or the lack of resources. If we have an
Engineering problem, our task is to maximize or minimize the objective function while satisfying
all the constraints. The objective function and the constraints are both linear functions of unknown
variables.
Many Engineering problems can be formulated as Linear Programs.
Example 1.0
Maximize 𝑦 = 3𝑥 1 + 2𝑥 2 … (𝑖) 𝑠𝑢𝑏𝑗𝑒𝑐𝑡 𝑡𝑜 𝑥 2 − 𝑥 1 ≤ 3 … (𝑖𝑖 )𝑎𝑛𝑑 𝑥1 + 𝑥 2 ≤ 7 … (𝑖𝑖𝑖)
It’s very important for as to indicate a lower limit for the Constraints so the we limit our solution.
Equations (i), (ii), and (iii) are written as shown in the Spreadsheet. With the initial conditions of
𝑥 1and 𝑥 2 indicated as shown above.
We can now start solver. From the menu in Excel, Click on Data and then Solver (Note that, if
solver is not installed you go to File, Options and add it in).
Click on Solver.
As shown below we click on Objective is to maximize 𝑦 = 3𝑥 1 + 2𝑥 2 , so we click on ‘Max’ in
solver, choose the ‘Simplex LP’ method, click on Add, to add the Constraints,
We can press OK, and solver will disappear but the solution will remain.
In the solution, 𝑥1 = 2 𝑎𝑛𝑑 𝑥2 = 5 are the maximum values we can use within the given constraints and
the maximum value of ‘y’ within the constraints is 16.
This is how solver, obtains solutions to linear programming problems.
Butane and Lighter IBP 1.0122 6.0 1.8 6.65 0.4 13.1
Vacuum Residue 2 (Lubricating Oil) 38.482 8.5 33.2 51.45 37.1 5.7
Grease 33.257 4.4 9.7 30.55 33.5 2.7
LOSSES 0.01 0 0.02 0.15 0.011 0.15
AVAILABILITY IN 10,000BARRELS/DAY 60 25 30 45 50 35
Determine the Optimum Processing capacity for each of the crudes, while maximizing profits.
Solution:
Let 𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ,𝑥 5 ,𝑥 6 represent the amount of each crude to be processed.
𝑃𝑟𝑜𝑓𝑖𝑡 (𝑥1,2,3,4,5,6) = [(𝑆𝑃1,2,3,4,5 − 𝑃𝐶1,2,3,4,5,6) × %𝑦𝑖𝑒𝑙𝑑 𝑜𝑓 (𝐼𝐵𝑃 + 𝐿𝑁 + 𝐻𝑁 + 𝐾𝐸 + 𝐿𝐺 + 𝐻𝐺 + 𝐴𝑉 + 𝐷𝑙 + 𝑉𝑅1 + 𝑉𝑅2 + 𝐺𝑆) 1,2,3,4,5,6] × 10000
Respectively. (The 10000 can be chosen to be put now or later on in the solution.)
With this we can obtain the Objective Function y. The objective function is an equation that
mathematically describes the linear problem. The Constraints provide the limits.
We can go to excel feed in the values and obtain the net profit for each of the crudes as below.
We can now go ahead and present everything in Excel, invoke solver and find the solution, as
shown below.
Our initial guess is zero.
Due to their less vol (%) yield cuts in certain side draws, Kingfisher-2009, basrah-heavy and Doba-
Blend would not be processed at optimal conditions. (Satisfying Price, and Demand constraints).
The values may change over time, due to other conditions, and calculations can be made again.
With this we can solve the problem Using Solver as shown below:
We use the sum of squares method to create an our Objective function y and then without constraints we
Always check your formulas before invoking solver. The problem has no Constraints. A graph is not needed
in this case.
End**