Problem#1: Figure1: Cross Section of Beam
Problem#1: Figure1: Cross Section of Beam
The aim of this particular project was to apply optimization techniques learnt during the
course of the semester. Two problems are selected for that matter. The 1st problem is
regarding the design of cantilever beam for the minimization of cost. In this problem
application of KKT and nonlinear optimization techniques are shown. Whereas second
problem is a manufacturing LP problem for profit maximization. This problem highlights
several ways off solving linear programming problems.
Problem#1
It is also desired that depth of the beam shall not exceed twice its width. Where d is the
depth and b is the width of the beam. The maximum bending moment and Shear are M=140
kN. m, V=24 kN.
The purpose of the task is to formulate the optimum design problem and solve it using
various methods.
a = 165MPa = 165N/mm2 ;
Formulation of Constraints
6(1.4107 )
Bending stress constraints: 6M/bd2 a or 165
2
6(1.4 108 )
1 = 165 0
2
3 3(2.4104 )
Shear stress constraints: 2 50
2
3(2.4 104 )
2 = 50 0
2
Constraint: 2 2 0
3= 2 0
Mathematical constraints: ,
108
1 = 6(1.4 bd2 ) 165 0
104
g2 = 3(2.4 2bd) 50 0
g3 = d 2b 0
g4 = b 0
g5 = d 0
Assume b= x1 and d= x2
Minimize f= x1x2
104
2 = 3(2.4 ) 50 0
21 2
108 2
3(2.4 104 )
= x1 x2 + U1 (6 1.4 4
2 1.65 10 + S1 ) + U2 ( 5000 + S22 )
x1 x2 2x1 x2
2
+ U3 (2 21 + 3 )
108 104
= 2 1 (8.4 2 2 ) 2 (3.6 2 ) 23
1 1 2 1 2
108 104
= x1 2U1 (8.4 ) U2 (3.6 ) + U3
2 X1 X23 X1 X22
108
= 8.4 165 + 12
1 1 22
104
= 3.6 50 + 22
2 1 2
= 2 21 + 32
3
= 21 1
1
= 22 2
2
= 23 3
3
Because number of variables are more than the number of equation so switching
conditions have to be applied now.
Switching conditions
There are eight different possible cases enlisted below. One of these cases is going to give
the optimum solution.
Case 6 Solution
1 = 2 = 3 = 0;
108
2 1 (8.4 ) 23 = 0 . . ()
12 22
108
1 21 (8.4 3 ) + 3 = 0..(b)
1 2
108
8.4 2 165 = 0..(c)
1 2
104
3.6 50 + 22 = 0.(d)
1 2
2 21 = 0.....(e)
2 = 21
By using
2 = 21
1.312 103 = 13
1 = 108.37
As
2 = 21
So (2 = 2 10.837)
2 = 216.74
22 = 48496.0
From eq.(a) & eq.(b)
3 = 328.2
1 = 0.2
Since hessian of cost function and constraints is positive definite so it is a convex problem as
well.
MATLAB code
clear all
close all
% Design variables
[x1,x2] = meshgrid(0:1:300,0:1:300);
% Objective function
f = x1.*x2;
% Constraints
g1 = x2 - 2*x1;
g2 = (6*140*1e6./(x1.*x2.^2)) - 165;
g3 = (3*24*1e3./(2*x1.*x2)) - 50;
% plotting
fv = [0:10000:60000,23500];
cs = contour(x1,x2,f,fv); clabel(cs)
hold on
cs1 = contour(x1,x2,g1,[0,2],'r'); clabel(cs1)
cs2 = contour(x1,x2,g2,[0,-3],'k'); clabel(cs2)
cs3 = contour(x1,x2,g3,[0,-3],'g'); clabel(cs3)
title('Problem 1 Project')
text(200,250,'Feasable Region')
text(53,106,'g1')
text(238,150,'g2')
text(50,20,'g3')
xlabel('b (Beam width, mm)')
ylabel('d (Beam depth, mm)')
hold off
Problem#2
Formulation of Constraints
We have two production constraint and two implicit or mathematical constraints.
Resign constraint
1 = 20x1 + 12x2 1800
1 = 20x1 + 12x2 1800 0
Subject to
Basic X1 X2 X3 X4 b Ratio
variables
X3 20 12 1 0 1800 90
X4 1/15 1/15 0 1 8 120
Cost -25 -20 0 0 f-0
function
Basic X1 X2 X3 X4 b Ratio
variables
X1 1 3/5 1/20 0 90 150
X4 0 2/75 1/300 1 2 75
Cost 0 -5 5/4 0 F+2250
function
Basic X1 X2 X3 X4 b Ratio
variables
X1 1 0 -7/400 22.5 45 150
X2 0 1 9/80 37.5 75 75
Cost 0 0 1.81 187.5 F+2625
function
X1=45, X2=75
Function value is
= = (2625) = 2625
Solution using Graphical Method MATLAB
MATLAB code
clc
clear all
[x1,x2] = meshgrid(-10:25:150,-10:25:150);
f=25*x1+20*x2;
g1=20*x1+12*x2-1800;
g2=x1+x2-120;
g3=-x1;
g4=-x2;
cla reset
axis auto
xlabel('x1'),ylabel('x2')
title('Problem 2 Project')
hold on
cv1=[0 2];
const1=contour(x1,x2,g1,cv1,'b');
clabel(const1)
text(20,115,'g1')
cv2=[0 1];
const2=contour(x1,x2,g2,cv2,'c');
clabel(const2)
text(80,38,'g2')
cv3=[0 1];
const3=contour(x1,x2,g3,cv3,'p');
clabel(const3)
text(25,-4,'g3')
cv4=[0 .5];
const4=contour(x1,x2,g4,cv4,'r');
clabel(const4)
text(-4,25,'g4')
text(40,40,'Feasable Region')
fv=[0,1200,2250,2625,2400];
fs=contour(x1,x2,f,fv,'k');
clabel(fs)
grid
hold off
In order to solve the LP problem in excel solver, the first step is to write the objective
function and constraints in the excel spread sheet. Then we have to use the solver
add in from the excel menu this add in requires to give the reference cell number of
the objective function and constraint after entering the cell numbers of the
constraints and objective function the solvers gives the solution. Screen sot of solver
dialog box is given below.
If you examine the above dialog box all the function and constraints and solving
method is specified in the dialog box.
The solution of this problem according to above dilag box is shown in the figure
below.
Solution
A = [20 12
1/15 1/15];
b = [1800 8];
f = [-25 -20];
x = linprog(f,A,b)
Optimization terminated.
x =
45.0000
75.0000
Conclusion
The aim of this project was to represent the practical application of the different
optimization techniques for solution of some real life problems. The projects explains the
non-linear solutions and application of K.K.T in first part. Whereas second part is used to
highlight the LP problem solutions in various ways. As for as from a students point of view
this project is a summary of optimization course which is learnt during the course of the
semester.