Anda di halaman 1dari 2

1 function[Td, T, Tc, p, x, y, Pt, e, err, Tcav] = a1(v)

2 % v(m/sec) is the cutting speed


3 % con is thermal conductivity of workpiece
4 % cont is thermal conductivity of tool
5 % roc is specific heat per volume
6 % fi is shear angle
7 % Ts is shear plane temperature
8 % vc is chip velocity
9 % Pf is friction power
10 % alp is thermal diffusivity of workpiece
11 % Tr is room temperature
12
13 clc
14
15 v = 5;
16
17 Ks = 2700;
18 h1 = 0.5;
19 con = 15;
20 cont = 70;
21 roc = 3.6;
22 KK = 550;
23 beta = 19*pi/180;
24 fi = 20*pi/180;
25 h2 = h1/tan(fi);
26 b = 5;
27 KKK = 850;
28 Ts = Ks*cos(fi+beta)/(roc*cos(fi)*cos(beta))+25;
29 vc = v*tan(fi);
30 Pf = Ks*b*h1*tan(beta)*vc*1000;
31 alp = con/roc;
32 Tr = 25;
33 Lc = 5*h1;
34 dx = Lc/KK;
35 dy = h2/35;
36 dt = dx/(1000*vc);
37 dz = 0.4;
38
39
40 % Initialize the shear plane temperature
41 for j = 1:20;
42 T(j,1) = Ts;
43 y(j) = j*dy;
44 end
45
46 % Calculate the thermal resistance r of the tool
47 w(1) = Lc+dz/2;
48 R(1) = dz/(2*w(1));
49 for I = 2:40
50 w(I) = Lc + 2*(I-1)*dz;
51 R(I) = dz/w(I);
52 end
53 w(41) = Lc + 79.5*dz;
54 R(41) = dz/(2*w(41));
55 r =0;
56 for I = 1:41
57 r = r+R(I)/cont;
58 end
59 i = 1;
60 Tcav(1) = Ts;
61 Pt(1) = 0;
62 e(1) = 0;
63 err(1) = 1.0;
64
65 % err is defined in the last line of the while loop
66 % Pf is the friction power
67 % Pc is power entering the chip
68 % Pt is power passing through tool
69 while abs(err(i))>0.02
70 Pc = Pf - Pt(i);
71 for k =1:(KKK-1)
72 pmax = Pc*20/(11*KK);
73 dp=pmax*10/(KK*9);
74 if k<=(KK/10)
75 p(k)= pmax;
76 elseif k>KK/10 && k<=KK
77 p(k) = pmax-dp*(k-KK/10);
78 else
79 p(k) = 0;
80 end
81 T(1,k+1) = (p(k)/(b*dx*dy*roc)-(T(1,k)-T(2,k))*alp/dy^2)*dt + T(1,k);
82 for j= 2:19
83 T(j,k+1) = (T(j-1,k+1)+T(j+1,k)-2*T(j,k))*alp*dt/dy^2+T(j,k);
84 end
85 T(20,k+1) = (T(19,k+1)-T(20,k))*alp*dt/dy^2+T(20,k);
86 end
87 % Calculate the temperatures Tc in the chip tool contact
88 % Then the avergae temperature Tcav
89 sum = 0;
90 for k = 1:KK
91 x(k) = (k-1)*dx;
92 Tc(k) = T(1,k);
93 sum = sum+Tc(k);
94 end
95 for m = 1:10
96 for n = 1:50;
97 Td(m,n) = round(T(2*m-1,12*n-11));
98 end
99 end
100 i = i+1;
101 Tcav(i) = sum/KK;
102 Pt(i) = (Tcav(i) - Tr)*b/r;
103 %e is the fraction of the friction power passing into the tool
104 e(i) = Pt(i)/Pf;
105 err(i) = (Tcav(i)-Tcav(i-1))/Tcav(i);
106 if i>8, break,end
107 % s is the vector of the contour temperatures
108 end
109
110 contourf(T,'showtext', 'on')
111 xlabel('j(X)')
112 ylabel('k(Y)')
113 title('Contour plot for Set 1 Values')
114 colorbar
115 A = max(max(T))
116 Q=find(A);
117 x(Q)
118 y(Q)
119 imax = 50;
120 jmax = 35;
121
122 tool_chip_temp = T(1, 1:(KK));
123 x = (1:KK)*dx;
124 figure(4)
125 plot(x, tool_chip_temp)
126 % plot(x, Tc)
127 xlabel('x (mm)')
128 ylabel('Temperature (C) at tool/chip interface')
129 grid on