CHE407 Part 9
CHE407 Part 9
Unsteady state:
𝑑𝑇
𝑞 + 𝑤𝐶 𝑇𝑖 − 𝑇𝑜 − 𝑤𝐶 𝑇 − 𝑇𝑜 = 𝜌𝐶𝑉
𝑑𝑡
Steady state:
𝑞𝑠 + 𝑤𝐶 𝑇𝑖𝑠 − 𝑇𝑜 − 𝑤𝐶 𝑇𝑠 − 𝑇𝑜 =0
′
1 𝜏𝑚 1 1
𝑇𝑚 𝑠 = − = −
𝑠 𝜏𝑚 𝑠 + 1 𝑠 1
(𝑠 + 𝜏 )
𝑚
′
𝑇𝑚 𝑡 = 1 − 𝑒 −𝑡/𝜏 𝑚
0.85 = 1 − 𝑒 −15/𝜏 𝑚
𝜏𝑚 = 7.91 𝑠 = 0.132 𝑚𝑖𝑛
′
𝑇𝑚 (𝑠) 1
′
=
𝑇 (𝑠) 0.132 𝑠 + 1
Simulink Model
clear all
clc
Kcplot(3,1)=0.0;
offset(3,1)=0.0;
for i=1:3
z=[10,30,80];
Kc=z(1,i);
[t,x,y]=sim('hw_part_c',30);
plot(t,y(:,1))
hold on
[norow,nocol]=size(y);
offset(i,1)=y(norow,2)-y(norow,1);
Kcplot(i,1)=Kc;
end
grid
title('Deviation in Tank Temperature vs time for Kc=10,30,80');
hold off
figure;
plot(Kcplot,offset);
title('Offset vs Kc For Set Point Tracking');
Simulink Model:
clear all
clc
Kcplot(3,1)=0.0;
offset(3,1)=0.0;
for i=1:3
z=[10,30,80];
Kc=z(1,i);
[t,x,y]=sim('hw_part_d',20);
plot(t,y(:,1))
hold on
[norow,nocol]=size(y);
offset(i,1)=y(norow,2)-y(norow,1);
Kcplot(i,1)=Kc;
end
grid
title('Deviation in Tank Temperature vs Time For Kc=10,30,80');
hold off
figure;
plot(Kcplot,offset);
title('Offset vs Kc For Set Point Tracking');
Simulink Model:
clear all
clc
h(1,:)='g-';
h(2,:)='r-';
h(3,:)='b:';
h(4,:)='--';
h(5,:)='k-';
taui=1;
for i=1:3
z=[10,30,80];
Kc=z(1,i);
[t,x,y]=sim('hw_part_e',50);
plot(t,y(:,1),h(i,:))
hold on
end
grid
hold off
clear all
clc
h(1,:)='g-';
h(2,:)='r-';
h(3,:)='b:';
h(4,:)='--';
h(5,:)='k-';
Kc=10;
for i=1:2
z=[1,5];
taui=z(1,i);
[t,x,y]=sim('hw_part_e',50);
plot(t,y(:,1),h(i,:))
hold on
end
grid
hold off
Simulink Model
clear all
clc
h(1,:)='g-';
h(2,:)='r-';
h(3,:)='b:';
h(4,:)='--';
h(5,:)='k-';
taui=1;
for i=1:3
z=[10,30,80];
Kc=z(1,i);
[t,x,y]=sim('hw_part_f',50);
plot(t,y(:,1),h(i,:))
hold on
end
grid
hold off
clear all
clc
h(1,:)='g-';
h(2,:)='r-';
h(3,:)='b:';
h(4,:)='--';
h(5,:)='k-';
Kc=10;
for i=1:2
z=[1,5];
taui=z(1,i);
[t,x,y]=sim('hw_part_f',50);
plot(t,y(:,1),h(i,:))
hold on
end
grid
hold off
Simulink model
clear all
clc
h(1,:)='g-';
h(2,:)='r-';
h(3,:)='b:';
h(4,:)='--';
h(5,:)='k-';
for i=1:3
z=[0.132,5,10];
taum=z(1,i);
[t,x,y]=sim('hw_part_g',50);
plot(t,y(:,1),h(i,:))
hold on
end
grid
hold off