Anda di halaman 1dari 3

Amar Firmansyah

10/301551/TK/37041
Coding Program
function hitunganT
clc
clear
global D F0 Cpa Cpb Cpc Cpi P U delHR0 R Ar Tref Tc T0 E pi;
pi=3.14;
D=15;
P=6;
U=0.0055;
Cpa=13;
Cpb=15.2;
Cpc=12;
Cpi=10;
delHR0=-32000;
R=82;
Ar=14.7;
E=902000;
Tref=273;
Tc=480;
T0=510;
F0=20;
zspan=linspace(0,1000,100);
x0=0.01;
g0=[x0 T0];
fprintf('\t =
Hasil Perhitungan Profil Suhu dan Konversi terhadap Posisi pada PFR
=\n')
fprintf('\t = \t \t \t \t \t \t oleh Amar Firmansyah \t \t \t \t \t \t \t =\n')
fprintf('\t = \t \t \t \t \t \t 10/301551/TK/37041 \t \t \t \t \t \t \t =\n')
fprintf('\t
=========================================================================\n')
fprintf('\tZ \t konversi(X)\tSuhu(T)\n')
[z,g] =ode45(@func,zspan,g0);
Hasil_Perhitungan=[z,g]
figure(1)
subplot(1,2,1)
plot(z,g(:,1))
xlabel('panjang reaktor, meter')
ylabel('konversi, x')
subplot(1,2,2)
plot(z,g(:,2))
xlabel('panjang reaktor, meter')
ylabel('suhu, K')
end
function dA=func(z,g)
global D F0 Cpa Cpb Cpc Cpi P U delHR0 R Ar Tref Tc E pi;
x=g(1);
T=g(2);
delHR=delHR0+(3.*Cpc-Cpb-Cpa).*(T-Tref);
k=Ar*exp(-E/(R*T));
dxdz=(pi*D^2/(4*F0*x))*k*((1-x)*(0.5-0.4*x))/((1+0.4*x)^2)*(P/R/T)^2;
dTdz=(0.4*F0*(-1*delHR)*dxdz-pi*D*U*(T-Tc))/(0.4*F0*(1-x)*Cpa+F0*(0.50.4*x)*Cpb+1.2*F0*x*Cpc+0.1*F0*Cpi);
dA=[dxdz;dTdz];
end

Hasil Run Program