You are on page 1of 12

MSE 726

INTRODUCTION TO ENGINEERING
DESIGN OPTIMIZATION
LAB – III REPORT

Submitted to:
Dr. Gary Wang

Submitted by:
Jerin Abraham Issac - 301379238
Rajat Paliwal – 301357914
Date: 27/02/2019

Date :dd
Contents
INTRODUCTION....................................................................................................................................... 2
TUNING OPTIONS USED ......................................................................... Error! Bookmark not defined.
PROBLEM STATEMENT ........................................................................................................................ 2
1. Problems of discrete variables: Compound gear train (GT) design problem Error! Bookmark not
defined.
2. A problem of high dimension: a function of 16 variables with xi in [-1 1] ..................................... 5
3. Multi-objective function without constraints .................................... Error! Bookmark not defined.
4. Multi-objective function with constraints .......................................... Error! Bookmark not defined.
CONCLUSION ........................................................................................................................................... 5
APPENDIX .................................................................................................................................................. 7

List of Tables
Table 1-1 ...................................................................................................................................................... 3
Table 2-1 ....................................................................................................... Error! Bookmark not defined.
Table 2-2 ....................................................................................................... Error! Bookmark not defined.
Table 2-3 ....................................................................................................... Error! Bookmark not defined.
Table 3-1 ....................................................................................................... Error! Bookmark not defined.
Table 3-2 ....................................................................................................... Error! Bookmark not defined.
Table 4-1 ....................................................................................................... Error! Bookmark not defined.
Table 4-2 ....................................................................................................... Error! Bookmark not defined.

List of Figure
Figure 3-1 Pareto plot .................................................................................. Error! Bookmark not defined.
Figure 4-1 Pareto plot .................................................................................. Error! Bookmark not defined.
INTRODUCTION
In this lab, we have used Global optimization toolbox (Genetic algorithm). Genetic algorithms
(GAs) are stochastic methods of global search and optimization that imitate the metaphor of
natural biological development. GAs work on a population of potential solutions and apply the
survival principle of the fittest to successively achieve better approaches to a solution. A new set
of approximations is created at each step according to the individual's level of fitness in the
problem area. The population "evolves" over successive generations to create individuals who
are better suited to their environment than those from whom they were created [1].
Three main rules used in genetic algorithms for creating next generation are:
 Selection rules
 Crossover rules
 Mutation rules
In this lab, we have worked on four different problems, where problems varied from a problem
of discrete variables to a problem of high dimension (16 variables). We also worked on multi-
objective function problems with and without constraint. We also experimented with tuning
options such as population size, mutation rate, and crossover rate.

PROBLEM STATEMENT
1. Formulate the optimization problem
 At least five variables
 At least one nonlinear equation
 One or more constraints
2. Solve the formulated problem
 As a team, only solves one problem and present the results in oral and written report
 Apply at least two solvers from three (fmincon, GA, or OASIS) to solve the problem
3. Analyze and justify the optimization results

1) Problem – Designing a two-stage compounded gear train as shown in


Figure 1-1, by minimizing the cost of material consumption and
maximizing the strength while maintaining the gear ratio as a
constraint.
The aim of this problem is to determine the optimum dimensions (diameter, number of teeth and
width) of four gears in a compound gear box with gear ratio of 10:1 such that the overall material
utilized will be minimum and the gear train should be capable to transmit 10 Bhp (7457 watts) of engine
power from one shaft to the other without breaking. If the first reduction occurs in between gear 1 and
gear 2 as shown in Figure 1-1, then the first required gear ratio is 10:3, while for the second reduction
i.e. in between gear 3 and gear 4 required ratio is 3:1 such that overall gear ratio between gear 1 and
gear 4 will be 10:1.
Figure 1-1Two stage compound gear train

Min:
f(1) ((π*x(5)^2)/4+( π *x(6)^2)/4+( π *x(7)^2)/4+( π *x(8)^2)/4)*x(9)

Subject to:
g(1) 170.988*x(1)^2+13422.55*x(5)*x(1)^2-1257.15-x(5)^2*x(1)*x(9)+7448.64*x(5)*x(9) ≤ 0
g(2) 9*x(3)^2+15.7*x(3)^2*x(7)-1.47*x(7)^2*x(3)*x(9)+8.7*x(9)*x(7)^2 ≤ 0
g(3) ((x(1))/(x(2)))-10/3 ≤ 0
g(4) ((x(3))/(x(4)))-3/1 ≤ 0
where,
x(1) = no. of teeth on gear 1
x(2) = no. of teeth on gear 2
x(3) = no. of teeth on gear 3
x(4) = no. of teeth on gear 4
x(5) = diameter of gear 1
x(6) = diameter of gear 2
x(7) = diameter of gear 3
x(8) = diameter of gear 4
x(9) = face width of all the gears considered same
f(1) = minimize the overall cost(mass) of the material
g(1) = stress generated on gear 1 should be less than the allowable safe stress
g(2) = stress generated on gear 3 should be less than the allowable safe stress
g(3) = gear ratio during first compounding stage i.e. gear ratio in between gear 1 and gear 2
g(4) = gear ratio during first compounding stage i.e. gear ratio in between gear 3 and gear 4

Solution: Above given problem is a minimization problem with upper bounds and lower bounds, thus we
have used “ga” for obtaining an optimum value. This function has four independent variables (x1, x2, x3,
x4). We ran the algorithm three times and the observations obtained are as following:

Number of Number of function Global Optimum Point


S.No. Options
iterations evaluations optimum [x1,x2,x3,x4]
1 ga 52 2120 9.7457e-10 [16,25,59,47]
2 ga 53 2160 1.2634e-09 [22,18,49,56]
3 ga 54 2200 2.3576e-09 [20,21,52,56]
Table 1-1

Comments:
 In all three iterations the gear ratio (x1*x2/x3*x4) is coming close to 1/6.931, therefore obtained
global optimum values are very much close to zero.
 Minimum number of iterations is 52, occurred for optimum point [16,25,59,47].
 Minimum number of function evaluations is 2120, observed for optimum point [16,25,59,47].
1. A problem of high dimension: a function of 16 variables with xi in [-1 1]

CONCLUSION
In this Lab, we have learned to evaluate an objective function for obtaining an optimum point using
Global optimization toolbox (Genetic algorithm) and solving multi-objective functions with and without
constraints. We have also iterated different values of population size, mutation rates, and crossover rates
to interpret the results obtained.
APPENDIX

PROBLEM 1

Objective function code:

function f = Prob1_fun(x)
f = ((1/6.931)-(x(1)*x(2))/(x(3)*x(4)))^2;
end

Script file:

clc;
clear all;
IntCon = [1 2 3 4];
ObjectiveFunction = @Prob1_fun;
nvars = 4;
A = [];
b = [];
Aeq = [];
beq = [];
lb = [14 14 14 14];
ub = [60 60 60 60];
nonlcon = [];

options = optimoptions(@ga);
options.Display = 'iter';
[x,fval] =
ga(ObjectiveFunction,nvars,A,b,[],[],lb,ub,nonlcon,IntCon,o
ptions)

PROBLEM 2

Objective function code:

function f = Prob2_fun(x)
for i = 1:16
for j = 1:16
a = [1 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1;
0 1 1 0 0 0 1 0 0 1 0 0 0 0 0 0;
0 0 1 0 0 0 1 0 1 1 0 0 0 1 0 0;
0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0;
0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1;
0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0;
0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0;
0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0;
0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1;
0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0;
0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1;];
f = a(i,j)*(x(i)^2+x(i)+1)*(x(j)^2+x(j)+1);
end
end
end

Script file:
Tuning option - Population size

clc;
clear all;
ObjectiveFunction = @Prob2_fun;
nvars = 16;
A = [];
b = [];
Aeq = [];
beq = [];
lb = -1;
ub = 1;
nonlcon = [];
options = optimoptions('ga','PopulationSize',200);
options.Display = 'iter';
[x,fval] =
ga(ObjectiveFunction,nvars,A,b,[],[],lb,ub,nonlcon,options)
;

Tuning option – Mutation rate

clc;
clear all;
ObjectiveFunction = @Prob2_fun;
nvars = 16;
A = [];
b = [];
Aeq = [];
beq = [];
lb = -1;
ub = 1;
nonlcon = [];
options=optimoptions('ga','MutationFcn',{@mutationuniform,0
.08});
options.Display = 'iter';
[x,fval] =
ga(ObjectiveFunction,nvars,A,b,[],[],lb,ub,nonlcon,options)
;

Tuning option – Crossover rate

clc;
clear all;
ObjectiveFunction = @Prob2_fun;
nvars = 16;
A = [];
b = [];
Aeq = [];
beq = [];
lb = -1;
ub = 1;
nonlcon = [];
options = optimoptions('ga','CrossoverFraction',0.8);
options.Display = 'iter';
[x,fval] =
ga(ObjectiveFunction,nvars,A,b,[],[],lb,ub,nonlcon,options)
;

PROBLEM 3

Objective function code:

function f = Prob3_fun(x)
for i = 1:3
f(1) = 1 -exp(-(x(i)-(1/sqrt(3)))^2);
end
for i = 1:3
f(2) = 1 -exp(-(x(i)+(1/sqrt(3)))^2);
end
end
Script file:

clc;
clear all;
ObjectiveFunction = @Prob3_fun;
nvars = 3;
A = [];
b = [];
Aeq = [];
beq = [];
lb = [];
ub = [];
nonlcon = [];
options=optimoptions(@gamultiobj);
options.Display = 'iter';
[x,fval] =
gamultiobj(ObjectiveFunction,nvars,A,b,Aeq,beq,lb,ub,nonlco
n,options);

PROBLEM 3

Objective function code:

function f = Prob4_fun(x)
f(1) = 1 - exp(-4*x(1))*(sin(6*pi*x(1))^6);
g = 1 + 9*(sum(x(2:10))/9)^0.25;
f(2) = (f(1)/g)^2;
end

Constraint function:

function [c,ceq] = Prob4_confun(x)


for i = 2:10
g = 1 + 9*(x(i)/9)^0.25;
end
c = [g];
ceq = [];
end
plot(fval(:,1),fval(:,2),'r*');

Script file:

clc;
clear all;
ObjectiveFunction = @Prob4_fun;
constraintfun = @Prob4_confun;
nvars = 10;

A = [];
b = [];
Aeq = [];
beq = [];
lb = [0 0 0 0 0 0 0 0 0 0];
ub = [1 1 1 1 1 1 1 1 1 1];
nonlcon = [];
options=optimoptions(@gamultiobj);
options.Display = 'iter';
[x,fval] =
gamultiobj(ObjectiveFunction,nvars,A,b,Aeq,beq,lb,ub,[],opt
ions);

You might also like