Anda di halaman 1dari 9

Tugas Bab 6 Penyelesaian Persamaan Nonlinier Simultas

Aplikasi Komputer dalam Teknik Kimia


Nama : Nurul Izzati Hanifah
NPM : 1415041043

Persamaan di atas diselsaikan dengan cara terlebih dahulu menyusun syntax dalam bentuk mfiles.
function latihan61
clc,clear
x0=[-4;-4];%tebakan awal untuk penyelesaian
options=optimset('Display','iter');%pilihan untuk menampilkan output
[x,fval]=fsolve(@myfun,x0,options);%memanggil penyelesaian
%-------------------
function F = myfun(x)
F= [((x(1)-1)^3 + (x(2))^2);
x(1) + x(2)-1];
syntax ini disimpan dengan nama latihan61.m. setelah disimpan, kemudian syntax ini dirun
dengan cara memencet tombol fungsi F5 atau dengan menggunakan menu debug lalu pilih run.
Jika program yang disusun benar maka akan muncul hasil pada command window.
Sehingga x1=0 dan x2=1
function Latihan62a
clc,clear
[x,fval] = fsolve(@Kst,[0 0 0])
%---------------------------------------
function y=Kst(x)
Cd=x(1)
Cx=x(2)
Cz=x(3)
Ca=1.5-Cd-Cz
Cy =Cx+Cz
Cb= 1.5-Cd-Cy
Cc =Cd-Cy
K1=1.06;
K2=2.63;
K3=5;
y(1,1)=(K1*Ca*Cb)-(Cc*Cd);
y(2,1)=(K2*Cb*Cc)-(Cx*Cy);
y(3,1)=(K3*Ca*Cx)-(Cz);
Hasil eksekusi pada command line
Cd = 0.7053, Cx = 0.1778, Cz = 0.3740, Ca = 0.4207, Cy = 0.5518, Cb =0.2429, Cc = 0.1536

Equation solved.

fsolve completed because the vector of function values is near zero

as measured by the default value of the function tolerance, and

the problem appears regular as measured by the gradient.

<stopping criteria details>

x=

0.7053 0.1778 0.3740

fval =

1.0e-012 *

-0.3707

-0.4664

0.2279

Sehingga CA=0.4207, CB=0.2429, CC=0.1536, CD=0.7053 , CX=0.1778, CY=0.5518, dan Cz=0.3740

Syntax untuk CD=Cx=Cz=1


function Latihan621a
clc,clear
[x,fval] = fsolve(@Kst,[1 1 1])
%---------------------------------------
function y=Kst(x)
Cd=x(1)
Cx=x(2)
Cz=x(3)
Ca=1.5-Cd-Cz
Cy =Cx+Cz
Cb= 1.5-Cd-Cy
Cc =Cd-Cy
K1=1.63;
K2=2.63;
K3=5;
y(1,1)=(K1*Ca*Cb)-(Cc*Cd);
y(2,1)=(K2*Cb*Cc)-(Cx*Cy);
y(3,1)=(K3*Ca*Cx)-(Cz);
Hasil eksekusi pada command line
Cd = 0.7035, Cx = 0.1778, Cz = 0.3740, Ca = 0.4207, Cy = 0.5518, Cb =0.2429, Cc = 0.1536

Equation solved.

fsolve completed because the vector of function values is near zero

as measured by the default value of the function tolerance, and

the problem appears regular as measured by the gradient.

<stopping criteria details>

x=

0.7053 0.1778 0.3740

fval =

1.0e-010 *

0.0257

0.1386

-0.0543

Sehingga CA=0.4207, CB=0.2429, CC=0.1536, CD=0.7053 , CX=0.1778, CY=0.5518, dan Cz=0.3740

Syntax untuk CD=Cx=Cz=10


function Latihan622a
clc,clear
[x,fval] = fsolve(@Kst,[10 10 10])
%---------------------------------------
function y=Kst(x)
Cd=x(1)
Cx=x(2)
Cz=x(3)
Ca=1.5-Cd-Cz
Cy =Cx+Cz
Cb= 1.5-Cd-Cy
Cc =Cd-Cy
K1=1.63;
K2=2.63;
K3=5;
y(1,1)=(K1*Ca*Cb)-(Cc*Cd);
y(2,1)=(K2*Cb*Cc)-(Cx*Cy);
y(3,1)=(K3*Ca*Cx)-(Cz);
Hasil eksekusi pada command line
Cd = 1.0701, Cx = -0.3227, Cz = 1.1305, Ca = -0.7006, Cy = 0.8078, Cb =-0.3779, Cc = 0.2623

Equation solved.

fsolve completed because the vector of function values is near zero

as measured by the default value of the function tolerance, and

the problem appears regular as measured by the gradient.

<stopping criteria details>

x=

1.0701 -0.3227 1.1305

fval =

1.0e-008 *

-0.0282

-0.4336

-0.2859

Sehingga CA=-0.7006, CB=-0.779, CC=0.2623, CD=1.0701 , CX=-0.3227, CY=0.8078, dan Cz=1.1305


Penyelesaian
Kita Asumsikan Bahwa Reaktor dalam keadaan steadystate dan memliki Volume 1L dan
Laju umpan 1L/s
Dilihat dari umpan dapat diamati bahwa umpan hanya mengandung Ca sehingga tidak
ada Cb,Cc dan Cd Cb=Cc=Cd=Cb0=Cc0=Cd0=0. Serta umpan(Ca0) diasumsikan
sebesar 1gmol/L
Langkah selanjutnya buatlah Matlab File(m.file)(Latihan 6.3)
Syntaxnya
function Latihan63
clc,clear
[x,fval] = fsolve(@Kst,[0.5 0.5 0.5 0.5])%Tebakan Awal dari Konsentrasi
Produk
%---------------------------------------------------------------
function y=Kst(x)
Ca0=1;
Cb0=0;
Cc0=0;
Cd0=0;
k1=1.5;
k2=0.1;
k3=0.1;
k4=0.5;
V=1;
Q=1;
Ca=x(1)
Cb=x(2)
Cc=x(3)
Cd=x(4)
y(1,1)= Ca0+(V*(-k1*Ca-(k2*((Ca)^(3/2)))+(k3*((Cc)^2)))/Q)-Ca;
y(2,1)= Cb0+(V*(2*k1*Ca-(k4*((Cb)^2))/Q))-Cb;
y(3,1)= Cc0+(V*(k2*((Ca)^(3/2))-(k3*((Cc)^2))+(k4*Cb^2)/Q))-Cc;
y(4,1)= Cd0+(V*(k4*Cb^2)/Q)-Cd;
%Mengetahui Nilai Laju Reaksi (r='gmol/L.s
r1=k1*Ca
r2=k2*Ca^(3/2)
r3=k3*Cc^2
r4=k4*Cb^2
Hasil pada command line
Equation solved.

fsolve completed because the vector of function values is near zero

as measured by the default value of the function tolerance, and

the problem appears regular as measured by the gradient.

<stopping criteria details>

x=

0.3953 0.8362 0.3614 0.3496

fval =

1.0e-007 *
0.0609

-0.2499

0.1890

0.2499

Equation solved.

fsolve completed because the vector of function values is near zero

as measured by the default value of the function tolerance, and

the problem appears regular as measured by the gradient.

<stopping criteria details>

x=

0.3953 0.8362 0.3614 0.3496

fval =

1.0e-007 *

0.0609

-0.2499

0.1890

0.2499

Dimana Laju Reaksi (r)=


Dan Konsentrasi setiap Komponen (mengacu ke nilai x pada syntax)
Ca = 0.3953, Cb = 0.8362, Cc = 0.3614, Cd =0.3496
r1 =

0.5929

r2 =

0.0249

r3 =

0.0131

r4 =

0.3496

Anda mungkin juga menyukai