TK5207 - Soal Latihan - Linear Programming
TK5207 - Soal Latihan - Linear Programming
Develop a linear programming formulation to maximize the profits for this operation.
Image:
LINEAR PROGRAMMING
Develop a linear programming formulation to maximize the profits for
this operation!
Solution
The engineer operating this plant must decide how much of each gas
to produce to maximize profits. If the amounts of regular and premium
produced weekly are designated as x1 and x2, respectively, the total
weekly profit can be calculated as:
Image:
LINEAR PROGRAMMING
The constraints can be developed in a similar fashion. For example,
the total raw gas used can be computed as
Image:
LINEAR PROGRAMMING
First, the constraints can be plotted on the
solution space. For example, the first
constraint can be reformulated as a line by
replacing the inequality by an equal sign and
solving for x2
Image:
LINEAR PROGRAMMING
Now, since we are interested in maximizing
Z, we can increase it to say, 600, and the
objective function is
Image:
LINEAR PROGRAMMING
The maximum value of Z corresponds to approximately 1400. At this
point, x1 and x2 are equal to approximately 4.9 and 3.9, respectively.
Thus, the graphical solution tells us that if we produce these quantities
of regular and premium, we will reap a maximum profit of about 1400.
Image:
THE SIMPLEX METHOD
Now let us suppose that our problem
involves a unique solution. The graphical
approach might suggest an enumerative
strategy for hunting down the maximum.
Image:
THE SIMPLEX METHOD
The simplex method is predicated on the assumption that the optimal solution will be
an extreme point. To do this, the constraint equations are reformulated as equalities
by introducing what are called slack variables.
As the name implies, a slack variable measures how much of a constrained resource
is available, that is, how much “slack” of the resource is available.
7𝑥1 + 11𝑥2 ≤ 77
We can define a slack variable S1 as the amount of raw gas that is not used for a
particular production level (x1, x2). If this quantity is added to the left side of the
constraint, it makes the relationship exact
7𝑥1 + 11𝑥2 + 𝑆1 ≤ 77
Image:
THE SIMPLEX METHOD
A different slack variable is developed for each constraint equation, resulting in what
is called the fully augmented version,
𝑀𝑎𝑥𝑖𝑚𝑖𝑧𝑒 𝑍 = 150𝑥1 + 175𝑥2
Constraints
Notice how we have set up the four equality equations so that the unknowns are
aligned in columns.
Image:
THE SIMPLEX METHOD
Normally we had n equations with n unknowns, to solve the system (Algebraic Soln)
Image:
THE SIMPLEX METHOD
This observation leads to the conclusion that the extreme points can be determined
from the standard form by setting two of the variables equal to zero. In our example,
this reduces the problem to a solvable form of 4 equations with 4 unknowns.
For example, for point E, setting x1 = S4 = 0 reduces the standard form to
Image:
THE SIMPLEX METHOD
Image:
THE SIMPLEX METHOD
% Inputs
n = 16; % Total number of unknowns
m = 10; % Number of equations
Image:
THE SIMPLEX METHOD
% Example 1: Calculate the combination C_10^16
n = 16; % Total number of elements
m = 10; % Number of elements to choose
Image:
THE SIMPLEX METHOD
Image:
THE SIMPLEX METHOD
Before proceeding to the next step, the beginning information can now be
summarized in a convenient tabular format called a tableau. As shown below, the
tableau provides a concise summary of the key information constituting the linear
programming problem.
Notice that for the purposes of the tableau, the objective function is expressed as
Z - 150x1 - 175x2 - 0S1 - 0S2 - 0S3 - 0S4 = 0
Image:
THE SIMPLEX METHOD
Image:
THE SIMPLEX METHOD
Recall that the basic strategy behind Gauss-Jordan involved converting the pivot element to 1 and
then eliminating the coefficients in the same column above and below the pivot element.
For this example, the pivot row is S2 (the leaving variable) and the pivot element is 10 (the coefficient
of the entering variable, x1). Dividing the row by 10 and replacing S2 by x1 gives
Next, the x1 coefficients in the other rows can be eliminated. For example, for the objective function
row, the pivot row is multiplied by -150 and the result subtracted from the first row to give
Image:
THE SIMPLEX METHOD
Similar operations can be performed on the remaining rows to give the new tableau,
This tableau can then be used to chart our next, and in this case final, step. Only one more variable,
x2, has a negative value in the objective function, and it is therefore chosen as the entering variable.
According to the intercept values (now calculated as the solution column over the coefficients in the x 2
column), the first constraint has the smallest positive value, and therefore, S1 is selected as the
leaving variable.
Image:
THE SIMPLEX METHOD
Start Excel Spreadsheet to solve the linear programming problem
Image:
THE SIMPLEX METHOD
Input all the available data including its constraint and set the solver
Image:
THE SIMPLEX METHOD
Input all the available data including its constraint and set the solver
Image:
MATLAB: LINPROG
x = linprog(f,A,b) solves min f'*x such that A*x ≤ b.
% Coefficients of the objective function
f = [-150, -175]; % Negative because linprog minimizes by default
% Coefficients of the constraints: Matrix A has size 4x2 (4 rows, 2 columns), Matrix b has size 4x1
A = [7, 11; % Raw gas constraint
10, 8; % Production time constraint
1, 0; % Regular storage constraint
0, 1]; % Premium storage constraint
b = [77; % Raw gas availability
80; % Production time availability
9; % Regular product storage limit
6]; % Premium product storage limit
% Solve the linear programming problem: Matrix x has size 2x1 (2 rows, 1 column)
[x, fval] = linprog(f, A, b, [], [], lb);
Image:
CONTOH: LINPROG
Problem: Power Plant Fuel Optimization
A power plant uses a mix of biomass (2,5 MW of electricity per ton of biomass) and coal (5 MW of electricity
per ton of coal) as fuel for electricity generation. The plant needs to optimize the electricity production while
considering the following constraints:
Constraints
1.Fuel Availability:
1. Biomass supply is limited to 50 tons per day.
2. Coal supply is limited to 40 tons per day.
2. Energy Storage:
•Total energy storage capacity is 300 MW.
3. Cost Efficiency:
•Biomass cost: $100/ton.
•Coal cost: $120/ton.
•Daily fuel budget: $8,000.
Image:
STEPS TO SOLVE
Steps to Solve the Problem
1.Define Variables:
1. x1: Amount of biomass (tons).
2. x2: Amount of coal (tons).
2.Set Up the Objective Function:
1. Maximize Z=2.5x1+5x2, but convert to minimization for linprog by using −2.5x1−5x2.
3.Set Up Constraints:
1. Use the inequalities from the problem statement to define A (constraint coefficients) and b (right-hand side).
4.Solve Using linprog:
1. Call MATLAB's linprog function to find the optimal x1 and x2.
5.Interpret Results:
1. Display the optimal values of x1 and x2, and the maximum electricity production.
Image:
JAWABAN
Objective Function
Maximize electricity production:
Z=2.5x1+5x2.
Constraints
1.Fuel Availability:
• x1≤50 (biomass availability)
• x2≤40 (coal availability)
2. Energy Storage:
2.5x1+5x2 ≤300
3. Cost Efficiency:
100x1+120x2 ≤ 8,000.
4. Non-Negativity:
x1≥0, x2≥0
Image:
MATLAB: LINPROG
% Objective function coefficients (electricity production per ton)
f = [-2.5, -5]; % Negative because linprog minimizes
% Display results
fprintf('Optimal biomass usage (x1): %.2f tons\n', x(1));
fprintf('Optimal coal usage (x2): %.2f tons\n', x(2));
fprintf('Maximum electricity production: %.2f MW\n', -fval);
Image:
PLEASE CONTACT ME!
AQSHA
Assistant (Research) Professor
Dept. of Bioenergy Engineering & Chemurgy
Dept. of Chemical Engineering
Institut Teknologi Bandung, Indonesia
Program Studi Teknik Kimia, Teknik Pangan, Teknik Bioenergi dan Kemurgi, Institut Teknologi Bandung 31