Anda di halaman 1dari 10

SOAL LAPRES 2 :

1. Jelaskan secara rinci perbedaan dari persamaan Akar-akar kuadrat, Metode


Bisection dan Interpolasi Linier (dalam bentuk tabel)!
2. Selesaikan persamaan berikut dengan metode bisection dan interpolasi linear
secara manual (3 iterasi) dan menggunakan aplikasi matlab (algoritma, flowchart,
listing, hasil run)!
2 4𝑥 3 252
a. 𝑓(𝑥) = √81 + + 16𝑥 − 𝑥 2 + 𝑥 4 − 12 (kelompok 1)
12 9
6 5 6
b. 𝑓(𝑥) = 12 𝑥 2 + 2 𝑥 4 + 6⁄ − 5𝑥 − 30 (kelompok 2)
10
56 28 3
c. 𝑓(𝑥) = 𝑥5 − 𝑥 4 − 𝑥 2 + 9 𝑥 3 + 13 (kelompok 3)
4 7
9 39 5
d. 𝑓(𝑥) = 8 𝑥 4 + 𝑥 3 + 24 − 2 𝑥 2 − 𝑥 −3 − 13 (kelompok 4)
3
5 28 7 3 1⁄
e. 𝑓(𝑥) = 13 𝑥 4 + 10 𝑥 3 + 13 − 10 𝑥 2 − 5 𝑥 − 2 + 12 (kelompok 5)
2 7 1⁄ 3
f. 𝑓(𝑥) = 4 𝑥 4 − 12𝑥 3 + 10 𝑥 −2 − 8𝑥 − 3 − √125 (kelompok 6)
7 5 7
g. 𝑓(𝑥) = 4 𝑥 4 − 10 𝑥 3 + 10 𝑥 2 + 12𝑥 − 8𝑥 −2 (kelompok 7)

3. Diketahui persamaan Van Der Waals sebagai berikut :


𝑎
(𝑃 + 2 ) (𝑣 − 𝑏) = 𝑅𝑇
𝑣
Dimana :
1
27 𝑅 2 𝑇𝑐2 𝑅𝑇𝑐 − ⁄2
𝑎 = 64 ( ) ; 𝑏 = (8𝑃 ) (kelompok 1-4)
𝑃𝑐 𝑐

−1⁄3
𝑅 2 𝑇𝑐2 𝑅𝑇𝑐
𝑎 = 4/16 ( ) ; 𝑏= (kelompok 5-7)
𝑃𝑐 𝑃𝑐
𝑃𝑣
𝑍 = 𝑅𝑇

𝑣 = Volume molar, L/mol


𝑇 = suhu, K
𝑅 = konstanta gas universal = 0.08206 atm.L/mol.K
𝑇𝑐 = suhu kritis, K (405.5 K untuk Amonia)
𝑃𝑐 = tekanan kritis, atm (111.3 atm untuk Amonia)
Hitung volume molar dan faktor kompresibilitas(Z) untuk gas amonia
menggunakan persamaan keadaan Van Der Waals diatas, dengan ketentuan :
a. Kelompok 1&5 : kondisi tekanan 56 atm dan suhu 177oC
b. Kelompok 2&6 : kondisi tekanan 60 atm dan suhu 250oC
c. Kelompok 3&7 : kondisi tekanan 45 atm dan suhu 150oC
d. Kelompok 4: kondisi tekanan 65 atm dan suhu 275oC
(diselesaikan dengan metode bisection dan interpolasi linear pada aplikasi Matlab
beserta algoritma, flowchart, listing, dan hasil run).
7 5 7
𝑓(𝑥) = 𝑥 4 − 𝑥 3 + 𝑥 2 + 12𝑥 − 8𝑥 −2
4 10 10
Metode Bisection
Misalkan x1 = -1 dan x2 = 4 , maka :
Literasi 1
7 5 7
𝑓(−1) = 4 (−1)4 − 10 (−1)3 + 10 (−1)2 + 12(−1) − 8(−1)−2 = -4,9667
7 5 7
𝑓(4) = 4 (4)4 − 10 (4)3 + 10 (4)2 + 12(4) − 8(4)−2 = 21162,7
−1+4
𝑥𝑡 = = 1,5
2

7 5 7
𝑓(1,5) = (1,5)4 − (1,5)3 + (1,5)2 + 12(1,5) − 8(1,5)−2
4 10 10
= 46,7605
Literasi 2
7 5 7
𝑓(−1) = 4 (−1)4 − 10 (−1)3 + 10 (−1)2 + 12(−1) − 8(−1)−2 = -4,9667
7 5 7
𝑓(1,5) = (1,5)4 − (1,5)3 + (1,5)2 + 12(1,5) − 8(1,5)−2
4 10 10
= 46,7605
−1+1,5
𝑥𝑡 = = 0,25
2
7 5 7
𝑓(0,25) = 4 (0,25)4 − 10 (0,25)3 + 10 (0,25)2 + 12(0,25) − 8(0,25)−2

= -126,0960
Literasi 3
7 5 7
𝑓(0,25) = 4 (0,25)4 − 10 (0,25)3 + 10 (0,25)2 + 12(0,25) − 8(0,25)−2

= -126,0960
7 5 7
𝑓(1,5) = (1,5)4 − (1,5)3 + (1,5)2 + 12(1,5) − 8(1,5)−2
4 10 10
= 46,7605
0.25+1,5
𝑥𝑡 = = 0,875
2
7 5 7
𝑓(0,875) = (0,875)4 − (0,875)3 + (0,875)2 + 12(0,875) − 8(0,875)−2
4 10 10
= -0,4262

Metode Interpoladi Linear


Misalkan x1 = -1 dan x2 = 4 , maka :
Literasi 1
7 5 7
𝑓(−1) = 4 (−1)4 − 10 (−1)3 + 10 (−1)2 + 12(−1) − 8(−1)−2 = -4,9667
7 5 7
𝑓(4) = 4 (4)4 − 10 (4)3 + 10 (4)2 + 12(4) − 8(4)−2 = 21162,7
21162,7
𝑥𝑡 = 4 − 21162,7−(−4,9667) (4 − (−1)) = −0,9988
7 5 7
𝑓(−0,9988) = (−0,9988)4 − (−0,9988)3 + (−0,9988)2 + 12(−0,9988) − 8(−0,9988)−2
4 10 10
= -4,9968
Literasi 2
7 5 7
𝑓(−0,9988) = (−0,9988)4 − (−0,9988)3 + (−0,9988)2 + 12(−0,9988) − 8(−0,9988)−2
4 10 10
= -4,9968
7 5 7
𝑓(4) = 4 (4)4 − 10 (4)3 + 10 (4)2 + 12(4) − 8(4)−2 = 21162,7
21162,7
𝑥𝑡 = 4 − 21162,7−(−4,9968) (4 − (−4,9968)) = −0,9976
7 5 7
𝑓(−0,9976) = (−0,9976)4 − (−0,9976)3 + (−0,9976)2 + 12(−0,9976) − 8(−0,9976)−2
4 10 10
= -5,0272
Literasi 3
7 5 7
𝑓(−0,9976) = (−0,9976)4 − (−0,9976)3 + (−0,9976)2 + 12(−0,9976) − 8(−0,9976)−2
4 10 10
= -5,0272
7 5 7
𝑓(4) = 4 (4)4 − 10 (4)3 + 10 (4)2 + 12(4) − 8(4)−2 = 21162,7
21162,7
𝑥𝑡 =4− (4 − (−5,0272)) = −0,9965
21162,7 − (−5,0272)
7 5 7
𝑓(−0,9965) = (−0,9965)4 − (−0,9965)3 + (−0,9965)2 + 12(−0,9965) − 8(−0,9965)−2
4 10 10
= -5,0578

Script Program

clear all;
clc;
syms x
disp(' Menghitung Nilai Persamaan Suatu Fungsi ');
disp(' Dengan Metode Bisection dan Interpolasi ');
f=input('Masukkan Fungsi Persamaan = ');
x1=input('Masukkan Nilai x1 = ');
x2=input('Masukkan Nilai x2 = ');
t=input('Masukkan Nilai Toleransi = ');
f1=subs(f,x,x1);
f2=subs(f,x,x2);
literasi=0;
disp('1. Metode Bisection');
disp('2. Metode Interpolasi Linear');
a=input('Masukkan Pilihan Metode Yang Anda Inginkan = ');
switch a
case 1
disp('1. Metode Bisection');
x3=(x1+x2)/2;
f3=subs(f,x,x3);
if (f1*f2)>0
x1=input('Masukkan Nilai x1 = ');
x2=input('Masukkan Nilai x2 = ');
f1=subs(f,x,x1);
f2=subs(f,x,x2);
else
x3=(x1+x2)/2;
f3=subs(f,x,x3);
end
disp
('============================================================
======');
disp ('No. xi xi+1 xt f(xi) f(xi+1) f(xt) ');
disp
('============================================================
======');
while abs(f3)>t
literasi = literasi+1;
disp(sprintf('%1g %.4f %.4f %.4f %.4f %.4f %.4f', literasi, x1, x2,
x3, f1, f2, f3));
if (f1*f3)<0
x2=x3;
f2=f3;
else
x1=x3;
f1=f3;
end
x3=(x1+x2)/2;
f3=subs(f,x,x3);
end
case 2
disp('2. Interpolasi Linear');
x3=x2-((f2*(x2-x1))/(f2-f1));
f3=subs(f,x,x3);
if (f1*f2)>0
x1=input('Masukkan Nilai x1 = ');
x2=input('Masukkan Nilai x2 = ');
f1=subs(f,x,x1);
f2=subs(f,x,x2);
else
x3=x2-((f2*(x2-x1))/(f2-f1));;
f3=subs(f,x,x3);
end
disp
('============================================================
======');
disp ('No. xi xi+1 xt f(xi) f(xi+1) f(xt) ');
disp
('============================================================
======');
while abs(f3)>t
literasi = literasi+1;
disp(sprintf('%1g %.4f %.4f %.4f %.4f %.4f %.4f', literasi, x1, x2,
x3, f1, f2, f3));
if (f1*f3)<0
x2=x3;
f2=f3;
else
x1=x3;
f1=f3;
end
x3=x2-((f2*(x2-x1))/(f2-f1));
f3=subs(f,x,x3);
end
end

3.Input Persamaan = (P+(a/(v^2))*(v-b))-R*T


V1= 0.001
V2= 10
Toleransi = 0.0001
Script Program
clear all;
clc;
syms v
disp(' Persamaan Van Der Waals = ((P + (a/(v^2))(v-b)= RT ');
disp(' Dengan Metode Bisection dan Interpolasi ');
literasi=0;
R=0.08206;
Tc=405.5;
Pc=111.3;
P=45;
T=150;
a=(4/16)*((R^2*Tc^2)/Pc)^(-1/3);
b=(R*Tc/Pc);
f=input('Masukkan Fungsi Persamaan = ');
v1=input('Masukkan Nilai v1 = ');
v2=input('Masukkan Nilai v2 = ');
t=input('Masukkan Nilai Toleransi = ');
fv1=subs(f,v,v1);
fv2=subs(f,v,v2);
disp('1. Metode Bisection');
disp('2. Metode Interpolasi Linear');
i=input('Masukkan Pilihan Metode Yang Anda Inginkan = ');
switch i
case 1
disp('1. Metode Bisection');
v3=(v1+v2)/2;
fv3=subs(f,v,v3);
Z=(P*v3)/(R*T);
if (fv1*fv2)>0
v1=input('Masukkan Nilai v1 lain = ');
v2=input('Masukkan Nilai v2 lain = ');
fv1=subs(f,v,v1);
fv2=subs(f,v,v2);
else
v3=(v1+v2)/2;
fv3=subs(f,v,v3);
Z=(P*v3)/(R*T);
end
disp
('============================================================
===============');
disp ('No. vi vi+1 vt f(vi) f(vi+1) f(vt) Z ');
disp
('============================================================
===============');
while abs(fv3)>t
literasi = literasi+1;
disp(sprintf('%.0f %.4f %.4f %.4f %.4f %.4f %.4f %.4f',
literasi, v1, v2, v3, fv1, fv2, fv3, Z));
if (fv1*fv3)<0
v2=v3;
fv2=fv3;
else
v1=v3;
fv1=fv3;
end
v3=(v1+v2)/2;
fv3=subs(f,v,v3);
Z=(P*v3)/(R*T);
end
case 2
disp('2. Interpolasi Linear');
v3=v2-(fv2*(v2-v1))/(fv2-fv1);
fv3=subs(f,v,v3);
Z=(P*v3)/(R*T);
if (fv1*fv2)>0
v1=input('Masukkan Nilai v1 lain = ');
v2=input('Masukkan Nilai v2 lain = ');
fv1=subs(f,v,v1);
fv2=subs(f,v,v2);
else
v3=v2;
fv3=subs(f,v,v3);
Z=(P*v3)/(R*T);
end
disp
('============================================================
======');
disp ('No. vi vi+1 vt f(vi) f(vi+1) f(vt) Z ');
disp
('============================================================
======');
while abs(fv3)>t
literasi = literasi+1;
disp(sprintf('%.0f %.4f %.4f %.4f %.4f %.4f %.4f %.4f',
literasi, v1, v2, v3, fv1, fv2, fv3, Z));
if (fv1*fv3)<0
v2=v3;
fv2=fv3;
else
v1=v3;
fv1=fv3;
end
v3=v2-(fv2*(v2-v1))/(fv2-fv1);
fv3=subs(f,v,v3);
Z=(P*v3)/(R*T);
end
end

Anda mungkin juga menyukai