Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introductory Tutorial
K.Rameshkumar
Department of Mechanical
Engineering
Amrita School of Engineering
Coimbatore 641 112
GRAPHICS
COMPUTATIO
NS
EXTERNAL
INTERFACE
(Mex-Files)
TOOLBOXES
>> clear
% removes any old variables from the workspace
>> clear all
% removes any old variables from the workspace
>> clc
Clears command window & command history
>> format short
% outputs results in decimal form (5 decimal places of
accuracy)
>> format short e : (Floating point format with 5 digits)
>> format long : (Scaled fixed point format with 15 digits)
>> help format : prints the contents of the manual % for
the command ``format'.
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
>> y=y'
y=
2
1
5
>> z=x+y
z=
3
3
8
>> linspace(0,10,5)
ans =
0 2.500 5.000 7.500
10.000
>> t=1:2:10
t=
1
3
5
9
9
Solutions
Ex1
>> x=[0, 1.5, 3, 4, 5, 7, 9,10]
x=
0 1.50 3.00 4.00 5.00 7.00
9.00 10.00
>> y=0.5*x-2
y = -2.00 -1.25 -0.50
0 0.50 1.50
2.50 3.00
Ex2
>> theta =[0,pi/4, pi/2, 3*pi/4, pi, 5*pi/4]
theta =
0 0.7854 1.5708 2.3562
3.1416 3.9270
>> r=2
r =Jan 18, 2016
2
11
Lesson 3 :Creating
Simple plots
Ex1
Plot y=sinx, 0 x 2, taking 100 linearly
spaced points in the given interval. Label
the axes and put Plot created by me
Ex2
Plot y=e0.4xsinx, 0 x 4, taking 10,50,
and 100 points in the interval
Ex3
Plot 3D plot using plot3(x,y,z) to plot the
circular helix, x(t)=sint, y(t)=cost, z(t)=t, 0
2 20
Jan 18, 2016
12
Plot - Ex1
>>
>>
>>
>>
x=linspace(0,2*pi,100);
plot(x,sin(x))
xlabel('x'),ylabel('sin(x)')
title('Plot Created by RAMESH')
Plot Created by RAMESH
sin(x)
0.5
-0.5
-1
Jan 18, 2016
4
x
8
13
Plot - Ex2
>> x=linspace(0,4*pi,100);
>> y=exp(-0.4*x).*sin(x);
>> plot(x,y)
0.6
0.5
0.4
0.3
0.2
0.1
0
-0.1
-0.2
10
12
14
14
Plot - Ex3
>> t=linspace(0,20,100);
>> plot3(sin(t),cos(t),t)
20
15
10
5
0
1
0.5
0
-0.5
-1
-1
-0.5
0.5
15
Plot 4
>>x=0:10:1000;
>>y=x.^3;
>>semilogx(x,y)
>>semilogy(x,y)
>>loglog(x,y)
10
10
10
10
10
10
x 10
10
8
7
10
100
200
300
400
500
600
700
800
900
1000
5
4
10
10
10
10
0 1
10
10
10
10
10
10 1
10
10
10
16
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
-1
-0.8
-0.6
-0.4
-0.2
0.2
0.4
0.6
0.8
17
Linear programming
problem
18
Linear programming
problem
Vector Form
A . x b,
19
Solving Linear
programming problem
21
LPP Ex1
22
23
24
x1
2
4 x1
2
2 x2
4 x1 x2 2 x2 1
25
26
Constrained Optimization
problem
Design a uniform column
of tubular section, with hinge joints at
both ends, to carry a compressive load P = 2500 kgf for minimum
cost. The column is made up of a material that has a yield stress
(y ) of 500 kgf/cm2, modulus of elasticity (E) of 0.85 106
kgf/cm2, and weight density () of 0.0025 kgf/cm3. The length of
the column is 250 cm. The stress induced in the column should
be less than the buckling stress as well as the yield stress. The
mean diameter of the column is restricted to lie between 2 and
14 cm, and columns with thicknesses outside the range 0.2 to 0.8
cm are not available in the market. The cost of the column
includes material and construction costs and can be taken as 5W
+ 2d, where W is the weight in kilograms force and d is the mean
diameter of the column in centimetres.
27
Problem Formulation
The design variables are the mean diameter (d) and
tube thickness (t ):
28
Mathematical Model
29
Optimum Solution
30
31
32
Constrained Minimization
Using GA
x12
2 2
x2
1 x1 2
10 x1 x2 0 Non Linear
0 x1 1
2 x2 13
Jan 18, 2016
Bound
Bound
33
34
35
36
Optimization using SA
600
400
200
100
0
-100
50
-50
0
0
-50
50
100
-100
function f =
sa_dejong(x)
f= 3*sin(x(1))
37
38
Optimization of Cutting
Parameters of Turning
Process using Multi
Objective Genetic Algorithm
39
Problem Definition
To optimize the cutting parameters of
turning operation based on Surface
Roughness
and
Material
removal
Rate
40
Spindle
Speed rpm
Feed (mm)
Depth of
Cut (mm)
1100
0.08
0.6
1600
0.20
1.0
2300
0.32
1.6
41
L9(3*3) Array
Speed in
rpm
Feed in
mm/rev
Depth of
cut in mm
1100
0.08
0.6
1100
0.2
1100
0.32
1.6
1600
0.08
1600
0.2
1.6
1600
0.32
0.6
2300
0.08
1.6
2300
0.2
0.6
2300
0.32
Taguchi Array
42
Speed in
rpm
Feed
Doc
Ra
Predicte
d Ra
1100
0.08
0.6
4.08
3.95
1100
0.2
1.9
2.23
1100
0.32
1.6
3.39
3.41
1600
0.08
0.69
0.78
1600
0.2
1.6
1.44
1.14
1600
0.32
0.6
3.23
3.06
2300
0.08
1.6
0.59
0.64
2300
0.2
0.6
1.43
1.39
2300
0.32
3.25
3.40
43
Regression analysis
Regression
Statistics
Multiple R
R Square
Adjusted R
Square
Standard Error
Observations
0.9893
0.9787
0.9147
0.3758
9.0000
ANOVA
Regression
Residual
Total
Intercept
V
f
d
V*f
Jan 18, 2016
f*d
df
6
2
8
Coefficient
s
16.2631
-0.0050
-9.3597
-18.8819
-0.0066
32.7558
SS
12.9598
0.2824
13.2422
Standard
Error
2.1121
0.0010
6.1062
3.3220
0.0044
6.4781
Significanc
F
eF
15.2982
0.0626
MS
2.1600
0.1412
t Stat
7.7000
-4.8828
-1.5328
-5.6838
-1.5179
5.0564
P-value
0.0165
0.0395
0.2650
0.0296
0.2684
0.0370
44
Objective Function
F(x) = [F1(x), F2(x)]
F1(x) =Ra
= 16.26-0.005(V)-9.36(f)-18.88(d)-0.006(V x f)
+32.76(f x d) +0.006(Vxd)
F2(x) =Material removal rate (Mr)
= 1000 x V x f x d
Min F(x) = [F1(x), -F2(x)]
Jan 18, 2016
45
Constraints
Factors
Bounds
Spindle
speed
rpm
Lower
1100
Upper
2300
Feed,
mm/rev
0.08
0.32
Depth
of Cut,
mm
0.6
1.6
Vmin V
vmax
Fmin f
Jan 18, 2016
fmax
46
Multi Objective GA
function
% Multi objective GA function
function f=mga(x)
f(1)=16.26-0.005*x(1)-9.36*x(2)18.88*x(3)-0.006*(x(1)*x(2))
+32.76*(x(2)*x(3))+0.006*(x(3)*x(1));
f (2)=-1*x(1)*x(2)*x(3)*3.14*40;
47
48
Thank you
49