You are on page 1of 6

BAB III

SISTEM PERSAMAAN NON LINIER

Dalam bidang Teknik Kimia sering dijumpai persoalan mencari akar persamaan non
linier f(x) = 0 yang sulit diselesaikan dengan manipulasi matematika analitis.
Matlab menyediakan fasilitas untuk menyelesaikan jenis persamaan-persamaan di atas
yang telah tersusun dalam fungsi yaitu ‘fzero’.
Syntax yang digunakan untuk menuliskan fzero adalah
z = (‘fzero’,initial guess)
(Rustamaji, 2010).
1. Persamaan Non Linier
a. Kasus 1
• Permasalahan :
Tentukan nilai x sehingga pernyataan matematika berikut benar.
y = f ( x ) = x 4 − 2x 2 = 0

• Alternatif Penyelesaian :
» y = solve('x^4-2*x^2')

y =
[ 0]
[ 0]
[ 2^(1/2)]
[ -2^(1/2)]
» numeric(y)

ans =

0
0
1.4142
-1.4142
atau
» y = roots([1 0 -2 0])

y =
0
1.4142
-1.4142
b. Kasus 2
• Permasalahan :
Tentukan nilai x sehingga pernyataan matematika berikut benar.
y = f ( x ) = xe x + x − 5e x − 5

• Alternatif Penyelesaian :
» f = inline('x*exp(x)+x-5*x-5')

f =

Inline function:
f(x) = x*exp(x)+x-5*x-5

» y = fzero(f,4)
Zero found in the interval: [1.44, 5.8102].

y =

1.8933

2. Sistem Persamaan Non Linier


• Permasalahan:
F1 = 5( x 2 − x12 )4 = 0
F2 = (1 − x1 ) = 0
2

Tentukan solusi dari sistem persamaan nonlinear di sekitar titik x 1 = 0, x2 = 0


tersebut.
• Alternatif penyelesaian:
function F=myfun(x)
% save this function on myfun.m
F = [5*(x(2)-x(1)^2)^4 (1-x(1))^2];

Hasil:
» fsolve('myfun',[0,0])
ans =
0.9922 0.9177

CONTOH SOAL TERMODINAMIKA


Sebuah fungsi persamaan gas ideal seperti berikut:

FV(V) = (Pa.V3) - (Pa.b.V2) – (R.T.V2) + (a.V) – (a.b)

Berapakah nilai V untuk menghasilkan nilai 0 pada fungsi FV?

dimana;

R=0.082 L.atm/mol.K

Tc=405.5 K

Pc=111.3 atm

T=450 K

a=(27/64)*((R^2*Tc^2)/Pc)

b=(R*Tc)/(8*Pc)

Pr=[0.5 2 5 10 20 40]

Pa=Pc*Pr

PENYELESAIAN CONTOH SOAL TERMODINAMIKA


1. File fungsi (save dengan nama file pers2a.m)
%pers2a.m

function FV=pers2a(V)

global P T R a b

FV=P*V^3-P*b*V^2-R*T*V^2+a*V-a*b

2. File eksekusi (save dengan nama file solpers2a.m)


%solpers2a.m

clc
clear
global P T R a b

R=0.082 %L.atm/mol.K
Tc=405.5 % K
Pc=111.3 %atm
T=450 % K

%Pr=40

a=(27/64)*((R^2*Tc^2)/Pc)
b=(R*Tc)/(8*Pc)

Pr=[0.5 2 5 10 20 40]
Pa=Pc*Pr'

for i=1:6
P=Pa(i)

Vtebakawal=R*T/P(1)
Vhasil(i,1)=fzero('pers2a',Vtebakawal)
Z=(P*Vhasil)/(R*T)
tabel(i,4)=P

end
tabel(:,1)=Pr
tabel(:,2)=Vhasil
tabel(:,3)=Z

figure(1)
subplot(3,1,1)
plot(Pr,Vhasil,'red')
title('Pr Vs Vhasil')
xlabel('Pr')
ylabel('Vhasil')

subplot(3,1,2)
plot(Pr,Z,'green')
title('Pr Vs Zhasil')
xlabel('Pr')
ylabel('Zhasil')

subplot(3,1,3)
plot(Pr,Pa,'blue')
title('Pr Vs P')
xlabel('Pr')
ylabel('P')
Gambar 12. Hasil Penyelesaian pers2a.m pada MATLAB (1)

Gambar 13. Hasil Penyelesaian pers2a.m pada MATLAB (2)


Gambar 14. Grafik Penyelesaian pers2a.m pada MATLAB

You might also like