SIBSAGAR COMMERCE
COLLEGE
ACADEMIC YEAR 2022
DEPARTMENT: BCA
TOPIC: TEA FACTORY LPP
SUBMITTED BY :
SUBMITTED TO:
SANJAY KUMAR YADAV MRS.
PALLABI RAJKUMARI
ROLL NO.: 21
BCA 5ST SEMESTER
This project propose a pratical optimization problem of product-mix based on labour
capacity, machine capacity and raw materials in a Tea Factory. The onjective is to
maximize the profit using Operation Research.
Problem Statement:
A Tea Factory produces 2-types of Tea (per day) Type-A and, Type-B. The raw
materials, machine capacity, labour capacity and profit per unit for each Type is given
in the below table:-
Type Raw material Machine Labour Profit per unit
(Kg) Capacity(min) Capacity (₹)
(min)
A 1.92 1.14 7.52 14
B 2.1 2 3.2 13
Resource 150 70 90
Availability
Formulation To Linear Programming Problem:
Let the factory produces x units of Type-A and, y units of Type-B tea.
Profit (per unit) for Type-A is ₹14 and, Type-B is ₹13.
Therefore, the total profit (₹) per day is given by:-
Z=14x + 13y
Raw materials need for Type-A is 1.92 Kg and, Type-B is 2.1 Kg. Therefore, Total
raw materials needed:-
1.92x + 2.1y
Since only 150 Kg of raw material is available. Therefore,
1.92x + 2.1y<=150
Machine Capacity need for Type-A is 1.14 minutes and, Type-B is 2 minutes.
Therefore, Total raw materials needed:-
1.14x + 2y
Since only 70 minutes of machine capacity can be used. Therefore,
1.14x + 2y<=70
Labour Capacity need for Type-A is 7.52 minutes and, Type-B is 3.2 minutes.
Therefore, Total raw materials needed:-
7.52x+ 3.2y
Since only 90 minutes of labour capacity can be used. Therefore,
7.52x + 3.2y<=90
Since the productions cannot be negative, Therefore, x, y, >= 0 Therefore, the LPP is
Max Z = 14x + 13y
Subject to constraints:-
1.92x + 2.1y <= 150
1.14x + 2y<= 70 7.52x +
3.2y<= 90 and non-negative constraints are
x, x2 >=0
Input Parameters
C=[14,13]; # Cost of the objective function
A=[1.92 2.1;1.14 2;7.52 3.2]; # Constraints Coeffcient Matrix
B=[150;70;90]; #Right hand side of the constraints
Calculating axis values
y=0:1:max(B); # Start:Step:End
x1=(B(1)-A(1,1).*y)./A(1,2); # x values fort Eq-1 x2=(B(2)-A(2,1).*y)./A(2,2);
# x values fort Eq-2 x3=(B(3)-A(3,1).*y)./A(3,2); %%% x values fort Eq-3
x1=max(0,x1); x2=max(0,x2);
x3=max(0,x3)
%%%%%% Ploting the graph %%%%%%
[H,Z]=meshgrid(0:0.1:80);
NB=14*H+13*Z;
cond1=1.92*H + 2.1*Z<=150;
cond2= 1.14*H + 2*Z<=70; cond3=7.52*H +
3.2*Z<=90;
NB(~cond1)=NaN;
NB(~cond2)=NaN;
NB(~cond3)=NaN;
[Z,h]=contour(H,Z,NB,20);
hold on
plot(y,x1,'r',y,x2,'k',y,x3,'b') xlabel('Value of x') ylabel('Value of y') legend({'d1=1.92x +
2.1y <= 150','d2=1.14x + 2y <= 70','d3=7.52x + 3.2y <= 90'})
Find Conner Points with Axes
cx1=find(y==0); %%% Points with x axis
c1=find(x1==0); %%% Points with y axis of Eq-1
Line1=[y(:,[c1 cx1]) ; x1(:,[c1 cx1])]'; c2=find(x2==0); %%% Points with y
axis of Eq-2 Line2=[y(:,[c2 cx1]) ; x2(:,[c2 cx1])]'; c3=find(x3==0);
%%% Points with y axis of Eq-3 Line3=[y(:,[c3 cx1]) ; x3(:,[c3 cx1])]';
corpt=unique([Line1;Line2;Line3],'rows');
HG=[0;0];
for i=1:size(A,1) %%% Calculating the intersecting point
hg1=A(i,:); b1=B(i,:);
for j=i+1:size(A,1) hg2=A(j,:);
b2=B(j,:);
Aa=[hg1;hg2];
Bb=[b1;b2];
Xx=Aa\Bb; HG=[HG Xx];
endfor endfor pt=HG'; allpt=[pt;corpt];
points=unique(allpt,'rows');
PT=teaFactoryConstraints(points);
PT=unique(PT,'rows'); %%%%% Compute Objective Function %%%%% for
i=1:size(PT,1); if(PT(i,1)>=0 && PT(i,2)>=0)
V(i,1)=PT(i,1);
V(i,2)=PT(i,2);
V(i,3)=C(1,1)*PT(i,1)+C(1,2)*PT(i,2);
endif
endfor
[fxval,indfx]=max(V(:,3)); disp('Value of x
='),disp(V(indfx,1)) disp('Value of y
='),disp(V(indfx,2)) disp('Max Z
='),disp(V(indfx,3))
Filename: teaFactoryConstraits.m
function out=teaFactoryConstraints(X) a=X(:,1);
b=X(:,2);
cons1=1.92*a+2.1*b-150; h1=find(cons1>0);
cons2=1.14*a + 2*b-70; h2=find(cons2>0);
cons3=7.52*a+ 3.2*b-90; h3=find(cons3>0);
all=unique([h1;h2;h3],'rows'); X(all,:)=[];
out=X; endfunction
Output:
Command Window: -