0% found this document useful (0 votes)
297 views

Assignment 2 Report

The document describes an optimization problem to minimize the cross-sectional area of an I-beam given design constraints. It involves determining the optimal dimensions (x1, x2, x3, x4) of the I-beam from available sizes. The constraints include withstanding bending stress, axial stress, and buckling stress. Exhaustive enumeration and branch and bound methods were used to solve the problem in Matlab and Excel, finding the same optimal solution that meets all constraints and minimizes the objective function.

Uploaded by

Muhammad Daniyal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
297 views

Assignment 2 Report

The document describes an optimization problem to minimize the cross-sectional area of an I-beam given design constraints. It involves determining the optimal dimensions (x1, x2, x3, x4) of the I-beam from available sizes. The constraints include withstanding bending stress, axial stress, and buckling stress. Exhaustive enumeration and branch and bound methods were used to solve the problem in Matlab and Excel, finding the same optimal solution that meets all constraints and minimizes the objective function.

Uploaded by

Muhammad Daniyal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Assignment 2 Umair Irfan Khan - 12635761

49928: Design Optimisation for Manufacturing


Assignment 2

Problem 1
Minimise
4x1 +5x2 + x3 +4x4 + 2x5 + 11x6 + 2x7

Subject to:
g1: 2x1 + 4x2 +5x3 + 7x4 + x5 + 4x6 + 10x7 ≥110
g2: 4x1 + x2 + 5x3 + 7x4 +3x7 ≤80
g3: 2x1 + 5x2 + 3x3 + 3x4 + x5 +8x6 + x7 ≥40
x1, x2, x3, x4 ∈ {1, 2,3, 4}
x5, x6, x7 ≥0

Exhaustive Enumeration
Exhaustive enumeration is an optimization technique for discrete variables in which all the
possible combinations of the variables are used to find all possible solutions of a
mathematical model and then the solutions are compared to determine the optimum values.

Matlab Code:

In our problem, there are four discrete variables and three continuous variables. So, to find
the optimum values of those 3 variables linprog was used in the matlab code.

First the range of the discrete variables were set. In our problem the range was from 1 to 4
for x1, x2, x3 and x4 variables. Another variable ‘fstar’ was defined as infinity. This variable
was used to compare the value of objective function ‘O’ for every combination. If the value of
‘O’ is less than the fstar value then that fstar retains the value of ‘O’. For every possible
combination, this comparison takes place. Four ‘for loops’ are run for four discrete variables.
And in those for loops linprog is run to determine the possible values of continuous values
satisfying our three given constraints. Every time 7 possible values of variables are used to
calculate the value of objective function ‘O’ and then compared with the stored value in fstar.
If O< fstar then fstar stores that value of objective function and Xstar stores the
corresponding combination of variables’ values. The loop ends when all the combinations
are checked and compared.

The optimum (minimum) solution was found out to be 42.2763 with corresponding values of
variables as:

x1= 1 ; x2= 3 ; x3= 4 ; x4= 1 ; x5= 0 ; x6= 0.1447 ; x7= 6.8421

Matlab result shown below:


Assignment 2 Umair Irfan Khan - 12635761

% Exhaustive enumeration optimization code for problem 1


clear
clc

x1=[1:1:4]; % setting range for discrete variable x1


x2=[1:1:4]; % setting range for discrete variable x2
x3=[1:1:4]; % setting range for discrete variable x3
x4=[1:1:4]; % setting range for discrete variable x4

fstar = inf;
xstar = [0 0 0 0]; Xstar=[0;0;0;0;0;0;0];
for i = 1:length(x1)
for j = 1:length(x2)
for k = 1:length(x3)
for l = 1:length(x4)

% Linear programming code to find continous variables x5, x6, x7


f=[4; 5; 1; 4; 2; 11; 2];
A=[-2 -4 -5 -7 -1 -4 -10; 4 1 5 7 0 0 3; -2 -5 -3 -3 -1 -8 -1]; % inequality constraints
b=[-110; 80; -40];
Aeq=[];
beq=[];
lb=[i; j; k; l; 0; 0; 0;];
ub=[i; j; k; l; inf; inf; inf];
X=linprog(f,A,b,Aeq,beq,lb,ub);

O = 4*X(1)+5*X(2)+X(3)+4*X(4)+2*X(5)+11*X(6)+2*X(7); % Objective function

if (O < fstar)
fstar = O;
xstar = [x1(i) x2(j) x3(k) x4(l)]; Xstar=X
end
end
end
end
end
Assignment 2 Umair Irfan Khan - 12635761

fprintf('optimum values of variables : \n'),disp(Xstar)


fprintf('Minimum objective function value: '),disp(fstar)

Branch and Bound


Branch and bound is a partial enumeration method in which one discrete variable is
considered at a time while the others are considered continuous and that value is retained
for the next combination at which the solution is optimum. In this we only consider only some
of the combinations that are feasible and provide optimum solution and ignore the rest.

I have used excel solver to apply the branch and method on this problem. First, I set the
value of x1 as discrete varying it from 1 to 4, checking for the minimum value of objective
function. In the first tree, as shown below, x1=1 gave the minimum value of objective
function. So, for the next tree x1=1 was held constant while the value of x2 was changed
from 1 to 4 to find the minimum solution. Similarly, all the discrete variables were checked.
Since this was a linear programming problem, excel solver was set to simplex LP.

Thus, the optimal (minimum) solution of the objective function was found out to be, using
excel solver, as:

f(x)= 42.246

for

x1= 1

x2= 3

x3= 4

x4= 1

x5= 0

x6= 0.1447

x7= 6.842

Following are the branches of tree created from the solution of excel solver:
Assignment 2 Umair Irfan Khan - 12635761

NODE 1

Node 2 Node 3 Node 4 Node 5


x1= 1 x1=2 x1= 3 x1= 4
f(x)= 41.304* f(x)= 43.26 f(x)= 45.217 f(x)= 47.173

NODE 2
X1= 1
f(x)= 41.304

Node 6 Node 7 Node 8 Node 9


x1= 1 x1=1 x1= 1 x1= 1
x2=1 x2= 2 x2=3 x2=4
f(x)= 44.763 f(x)= 43.043 f(x)= 42.043* f(x)= 42.4
Assignment 2 Umair Irfan Khan - 12635761

NODE 8
X1= 1
x2= 3
f(x)= 42.043

Node 11 Node 12 Node 13


Node 10
x1=1 x1= 1 x1= 1
x1= 1
x2= 3 x2= 3 x2=3
x2=3
x3= 2 x3= 3 x3= 4
x3= 1
f(x)= 47.69 f(x)= 44.869 f(x)= 42.043*
f(x)= 50.88

NODE 13
X1= 1
x2= 3
x3= 4
f(x)= 42.043

Node 14 Node 15 Node 17


Node 16
x1= 1 x1=1 x1= 1
x1= 1
x2=3 x2= 3 x2=3
x2= 3
x3= 4 x3= 4 x3= 4
x3= 4
x4= 1 x4= 2 x4= 4
x4= 3
x5= 0 x5= 0 x5= 0
x5= 0
x6= 0.1447 x6= 0 x6= 0
x6= 0
x7= 6.842 x7= 6.2 x7= 4.8
x7= 5.5
f(x)= 42.276** f(x)= 43.4 f(x)= 48.6
f(x)= 46
Assignment 2 Umair Irfan Khan - 12635761

The solution from both the methods was found out to be same.
Assignment 2 Umair Irfan Khan - 12635761

Problem 2

Mathematical Model
In this problem, the dimensions of an I beam needs to be determined such that the
resulting cross-sectional area is minimum. The dimensions are shown in the figure
above as x1, x2, x3 and x4. So, these dimensions are our decision variables.
Following design parameters are also given:

 The beam is subjected to:


o Bending moment M= 400 kN.m
o Axial force P= 150 kN

𝑥1𝑥2
 The section modulus is given as S= 𝑥1 (𝑥3𝑥4 + ) cm3
6
1000M
 The bending stress in the beam is given as σb = MPa
S
10𝑃
 And the axial stress as σp = 𝑀𝑃𝑎
𝐴

The beam must be able to withstand the bending and axial stresses as well as
the buckling stresses. So, the dimensions should be such that satisfy the stress
constraints, which are given as:

Stress constraint: σb + σp − 200 ≤ 0 𝑀𝑃𝑎

σp 2
x1 4 (1+ )
Buckling constraint: x2 − 145 √ σb
σp 2
≤0
1+173( )
σb

Also, we have to select the dimensions from the following available sizes:
Assignment 2 Umair Irfan Khan - 12635761

x1: 54, 56, 58

x2: 1.0, 1.1, 1.2

x3: 38, 40, 42

x4: 0.5, 0.6, 0.7

So, our objective function is to minimize the cross-sectional area of the beam which
is given as:

A = x1x 2 + 2x3x 4 – 2x2 x4 cm2

The mathematical model is thus given as:

Minimize: f(x) = x1x 2 + 2x3x 4 – 2x2 x4

Subject to:

𝑔1: σb + σp − 200

σp 2
x1 4 (1 + )
𝑔2: − 145 √ σb
x2 σp 2
1 + 173 ( )
σb

With side constraints:

𝑥1 ∈ {60, 61,62}

𝑥2 ∈ {0.4, 0.5,0.6}

𝑥3 ∈ {32, 36,40}

𝑥4 ∈ {0.7, 0.8,0.9}

Exhaustive Enumeration
Exhaustive enumeration is a method in which all the possible combinations of discrete
variables are used to calculate the value of objective function, subject to constraints. The
results of these combinations are then compared to find the optimum solution.

Matlab code:

Exhaustive enumeration is applied on this problem using ‘for loops’ in matlab. First the range
of the discrete variable is set. Initially, a variable ‘fstar’ is assigned inf value which will be
compared by the solution of objective function for each combination of discrete variables.
Then for loops for all four discrete variables are run. Each combination of four variables is
then used to determine the value of objective function A, as well as, the value of constraining
equations. The loops have been given the condition that if both the constraints are satisfied
Assignment 2 Umair Irfan Khan - 12635761

and that A is smaller than the value stored in ‘fstar’ variable, then save the value of A as
‘fstar’. This value of ‘fstar’ will then be used to compare with the values of A calculated by the
next combination of discrete variables. These loops run till the solution of all the possible
combinations are compared with value of ‘fstar’. The minimum value of objective function is
saved in ‘fstar’ and its corresponding combination of variables are returned as the optimum
solution. Following is the solution returned by the code:

Minimum area was found to be 112.60 cm2 with dimensions as follows:

x1=58 cm ; x2=1 cm; x3=40 cm; x4=0.7 cm

while both g1 and g2 constraints are satisfied

clear
clc

x1=[54:2:58];
x2=[1.0:0.1:1.2];
x3=[38:2:42];
x4=[0.5:0.1:0.7];

fstar = inf;
xstar = [0 0 0 0];
for i = 1:length(x1)
for j = 1:length(x2)
for k = 1:length(x3)
for l = 1:length(x4)

A = x1(i)*x2(j)+2*x3(k)*x4(l)-2*x2(j)*x4(l);% The Objective function

S=x1(i)*(x3(k)*x4(l)+x1(i)*x2 (j)/6);% design parameters


M=400;
P=150;
StressB=1000*M/S;
StressP=10*P/A;
% Inequality constraints
g1 = StressB+StressP-200;
g2 = x1 (i)/x2(j)-145*nthroot((1+StressP/StressB)^2/(1+173*(StressP/StressB)^2),4);

if (g1 <= 0) && (g2 <= 0) && (A < fstar)


fstar = A;
Assignment 2 Umair Irfan Khan - 12635761

xstar = [x1(i) x2(j) x3(k) x4(l)];


end
end
end
end
end
fprintf('Minimum Cross Section=% .2f \n ...x1=% .1f x2=% .1f x3=% .1f x4=% .1f \n',...
fstar,xstar(1),xstar(2),xstar(3),xstar(4));
fprintf('optimal widths and thickness : '),disp(xstar)
fprintf('Minimum cross-section : '),disp(fstar)
fprintf('Constraint g1 : '),disp(g1)
fprintf('Constraint g2 : '),disp(g2)

Branch and Bound


I have used excel solver to apply the branch and bound method on this problem. First, I set
the value of discrete variable x1 as 54, 56 and 58, and checked for the minimum value of
objective function one by one, while considering the other variables as continuous. In the
first tree, as shown below, x1=58 gave the minimum value of objective function. So, for the
next tree x1=58 was held constant while the value of x2 was set as 1, 1.1 and 1.2 to find the
minimum solution for each iteration. Similarly, all the discrete variables were checked. Since
this was a non-linear programming problem, excel solver was set to GRG NLP.

Thus, the optimal (minimum) solution of the objective function was found out to be, using
excel solver, as:

Area= 112.6 cm2

For dimensions

x1= 58

x2= 1

x3= 40

x4= 0.7

Following are the branches of tree created from the solution of excel solver:
Assignment 2 Umair Irfan Khan - 12635761

NODE 1

Node 2 Node 3 Node 4


x1= 54 x1=56 x1= 58
f(x)= 118.111 f(x)= 112.486 f(x)= 111.314*

NODE 4
x1=58
f(x)=111.314

Node 5 Node 6 Node 7


x1= 58 x1=58 x1= 58
x2=1 x2=1.1 x2= 1.2
f(x)= 111.314* f(x)= 114.937 f(x)= 118.58
Assignment 2 Umair Irfan Khan - 12635761

NODE 5
x1=58
x2= 1
f(x)=111.314

Node 8
Node 9 Node 10
x1= 58
x1=58 x1= 58
x2=1
x2=1 x2= 1
x3= 38
x3= 40 x3= 42
Not feasible
f(x)= 111.25* f(x)= 111.314
Constraints not satisfied

NODE 9
x1=58
x2= 1
x3= 40
f(x)=111.25

Node 11 Node 12
x1= 58 x1=58 Node 13
x2=1 x2=1 x1= 58
x3= 40 x3= 40 x2= 1
x4= 0.5 x4= 0.6 x3= 40
f(x) = 97 f(x)= 104.8 x4= 0.7
Not feasible Not feasible f(x)= 112.6**
Stress constraint not satisfied Stress constraint not satisfied

Although, the combinations of variables in nodes 11 and 12 provide the minimum values of
areas, they do not satisfy the stress constraint, so our optimum solution is node 13.

As shown below for node 11, one of the constraint was not less than zero.
Assignment 2 Umair Irfan Khan - 12635761

Final solution by excel solver is shown below:

The solution from both the methods was found out to be the same.

You might also like