Anda di halaman 1dari 22

LABORATORIUM TEKNIK KIMIA

FAKULTAS TEKNIK
UPN “VETERAN” JAWA TIMUR Nama : MOCHAMAD DHANI D
NPM/Semester : 19031010178/1
Praktikum : PEMROGRAMAN KOMPUTER Sesi :1
Percobaan : MATRIX DAN PLOT PADA Paralel :D
MATLAB
Tanggal : 10 NOVEMBER 2019
Pembimbing : DR.T.IR.SUSILOWATI
LAPORAN RESMI

Soal :
1. Explain about matrix and plot ( 2 or 3 dimension ) that you know in Matlab.
Mention the types and their requirement
2. Make your program in the Matlab with input, output, selection statement,
looping, and matrix / plot ! Give your algorithm, flowchart, and printscreen
about input and output. Be creative!
3. Saya mempunyai kesetimbangan suatu reaksi apabila reaksi tersebut
memiliki nilai konstanta kesetimbangan sebesar 2,06 x 10-3 sec-1. Untuk
mengetahui orde pada reaksi tersebut diuat grafik garis terlurus.
a. Hitunglah berapa banyak M pada detik ke 1 – 10 apabila Mi =
(Jumlah 2 NPM terakhir)
2,303 𝑀𝑖
𝐾= 𝑙𝑜𝑔
𝑡 2𝑀𝑖 − 𝑀
b. Orde 0, perbandingan antara t (sec) dengan M
c. Orde 1, perbandingan antara t (sec) dengan Ln M
d. Orde 2, perbandingan antara t (sec) dengan 1/M

4. Filtrasi merupakan suatu proses pemisahan zat padat dari fluida


menggunakan media filter. Slurry CaCO3 23,47 kg/m3dimasukkan dalam
filter press pada tekanan konstan 338kN/m2 dengan temperature 298,15 K.
Luas filter plate and frame 0,873 m2 dan jumlah frame yang digunakan
adalah 25 plate. Hambatan cake (α) 1,863 x 107 m/kg. Hambatan filter
medium (Rm) 10,63 x 107 m-1. Viskositas air = 8,397 kg/m.s. Hitunglah
waktu yang dibutuhkan untuk mendapatkan 3,37 m3 filtrat! Tampilkan

166
grafik antera waktu (menit) vs volume yang didapat setiap menitnya hingga
mencapai yang diinginkan
Rumus :
µ 𝑥 𝛼 𝑥 𝐶𝑠 𝑅𝑚 𝑥 µ 𝑡 𝐾𝑝+𝑉
𝐾𝑝 = 𝐴 𝑥 (−𝛥𝑃) 𝐵= = +𝐵
𝐴 𝑥 (−𝛥𝑃) 𝑉 2

167
Jawaban

1. In MATLAB, matrix is a set of numbers in the form of a rectangular-


length array. At a specific value there is a scalar defined as a 1 × 1 matrix or a
matrix consisting of only 1 row called a row matrix and a matrix consisting of
1 column called a column matrix (or vector). MATLAB has another way of
storing numeric and non numerical values, but basically the matrix form is the
recommended form. A matrix is also called a two-dimensional array of
numbers.In MATLAB, you can create a matrix by entering elements in each
row as comma or space delimited numbers and using semicolons to mark the
end of each row. Based on the matrix order, matrix can be divided into several
types :
a. Square matrix
A matrix with an order of n x n or number of rows equal to the number of
columns present in the matrix. This matrix is also called square matrix
Example :

b. Line Matrix
Line Matrix is a matrix that consist of only one line Example :
A = [ 2 1 3 -7 ]
c. Column Matrix
Column Matrix is a matrix that consist of only one column. Example :

(Ndraha, 2015)

Plot is Graphs or plots in MATLAB serve to present the data, making it


easier to see as a whole. How to Create a graph in MATLAB can be done with
various formulation commands with various functions. Generally, there are 2
types of plot in MATLAB, that is 2 Dimension Plot and Dimension Plot 3.

168
a. 2 Dimensional Plot (2 Dimension Graphs)
2 dimensional computer graphics commonly called 2D or field are the
shapes of objects that have length and width. Graph 2 Dimension is a drawing
technique that is based on x (flat) axis coordinate and y (a vertical) axis. In
order to appear perfectly, the image to be displayed with this technique should
have the minimum and maximum x and y coordinates of the resolution used.
The 2D computer graph is a computer-based digital image, which is a two-
dimensional image object (2D). The 2D Graphic Model is a combination of
geometric models (also called vector graphics), digital images (raster
graphics), mathematical functions, and so on. These components can be
modified and manipulated by two-dimensional geometry transformations,
such as translation, rotation, and dilation. There are two commands in matlab
that serve to draw the function graph that is "ezplot" and "plot" ·

➢ Plot

Plot (y) is a command in MATLAB to view the y chart based on the


values of y1, y2, y3, y4 ,. . . yn which is already known. Later the plot
will generate a graph based on the coordinates of points (1, y1), (2,
y2), (3, y3) ,. . . , (n, yn) connecting the point coordinates (i, yi) and
(i + 1, yi + 1) with a straight line.
Example :

Suppose we will draw a graph of y with the values of y1, y2, y3,
y4, y5, y6 are 1, 5, -6, 8, 9, and 19 respectively.
Solution:

>> y = [1 5 -6 8 9 19];

>> plot (y)

169
➢ Ezplot
Ezplot (y) is a command in MATLAB to view the y chart based on
known equations.
Example :

Suppose we will create a graph y = x2 Solution:


>> y1 = inline ('x ^ 2'); %

>> ezplot (y1)

b. 3 Dimensional Plot (3 Dimensional Graphs)


3 dimensional computer graphics are called 3D or are the shapes of
objects that have length, width and height. Graph 3 Dimension is a drawing
technique which is based on the x-axis coordinate point (flat), y- axis
(vertical), and z-axis (tilt). In computer graphics, 3D is a graphical form that
uses three dimensional geometry data representation. In MATLAB is
known as the plot3 function, which is used to display 3- dimensional graphs.
Plot3 requires 3 arguments with plot3 (x, y, z), where x, y, z represent 3 parts
of the same length vector.
(Mufdholifah, 2012)

170
2. I. Algoritma
1. Start program
2. Display Area of triangle
3. Input height and pedestal
4. Processing for x1=x1:1:10 dan while x<=10
5. Processing L=1/2*pedestal*height
6. Display plot
7. End

171
II. Flowchart

Start

Menampilkan
Program Perulangan
dan Luas Segitiga

Memasukkan
Tinggi dan
Alas

For
X1=x
1:1:10

No
If x<=10
Yes
Memproses
rumus
L=0.5*x1*x

Menampilkan
hasil luas

Memproses
Plot

Menampilkan
Plot

Selesai

172
III. Listing
clc;
disp('Looping Program');
disp('==================');
disp(' Area Of Triangle ');
x=input('Input height = ');
x1=input('Input Pedestal = ');
for x1=x1:1:10
while x<=10
L=0.5*x1*x;
x=x+1;
fprintf('%0s%4.2f%0s\n',’The result is = ',L,' cm');
plot(L,x,'-squarer');
grid on
hold on
end
end

173
IV. Hasil Listing

174
Plot

175
3. I. Algoritma
1. Memulai program
2. Menampilkan Program no 3
3. Menginputkan 2 NPM terakhir,Waktu awal,Interval waktu,Waktu akhir
4. Memproses rumus k=2.06*(10^(-3))
5. Melakukan perulangan for ul=to:ti:ta
6. Memproses rumus M=(2*Mi)-(exp(log(Mi)-(k*to)))
7. Menampilkan waktu awal dan hasil M
8. Menampilkan pilihan orde
9. Menginputkan orde yang ingin digunakan
a. Pilihan 1
1. Menampilkan Grafik orde 0
2. Memproses Plot
3. Menampilkan Plot
b. Pilihan 2
1. Menampilkan Grafik orde 1
2. Memproses Plot
3. Menampilkan Plot
c. Pilihan 3
1. Menampilkan Grafik orde 2
2. Memproses Plot
3. Menampilkan Plot
10. Selesai

176
II. Flowchart

Start

Menampilkan
Program No 3

Memasukkan 2 NPM
terakhir,Waktu
awal,Interval waktu,
waktu akhir

For
Ul=to:ti:ta

Memproses rumus M=(2*Mi)-


(exp(log(Mi)-(k*to)))

Menampilkan hasil
M

Menampilkan
pilihan orde

Memasukkan pilihan
orde

Pilihan 1 Yes
Memproses plot
Orde 0

No

Menampilkan plot

A B

177
A B

Pilihan 2 Yes
Memproses plot
Orde 1

No

Menampilkan plot

Pilihan 3 Yes
Memproses plot
Orde 2

No

Menampilkan plot

Selesai

178
III. Listing
clc;
disp('Program No 3');
disp('============');
Mi=input('Masukkan 2 NPM terakhir = ');
to=input('Masukkan waktu awal = ');
ti=input('Masukkan interval waktu = ');
ta=input('Masukkan waktu akhir = ');
disp(' Waktu M');
k=2.06*(10^(-3));
for ul=to:ti:ta
M=(2*Mi)-(exp(log(Mi)-(k*to)));
fprintf('%4i%10.2f\n',to,M);
to=to+ti;
end
disp('Untuk Pilihan Orde');
disp('1. Orde 0 ');
disp('2. Orde 1 ');
disp('3. Orde 2 ');
pil=input('Masukkan orde yang ingin digunakan = ');
switch pil
case 1
x=linspace(to,ta,10);
y=(2*Mi)-(exp(log(Mi)-(k*x)));
plot(x,y,'-b',x,y,'.r');
xlabel('Waktu (sec)');
ylabel('M');
title('Grafik Orde 0');
grid on
hold on
case 2

179
x=linspace(to,ta,10);
y=log((2*Mi)-(exp(log(Mi)-(k*x))));
plot(x,y,'-b',x,y,'.r');
xlabel('Waktu (sec)');
ylabel('Ln M');
title('Grafik Orde 1');
grid on
hold on
case 3
x=linspace(to,ta,10);
y=1./((2*Mi)-(exp(log(Mi)-(k*x))));
plot(x,y,'-b',x,y,'.r');
xlabel('Waktu (sec)');
ylabel('1/M');
title('Grafik Orde 0');
grid on
hold on
end

180
IV. Hasil Listing

• Orde 0

181
• Orde 1

• Orde 2

182
4. I. Algoritma
1. Memulai program
2. Menampilkan Perhitungan Waktu Filtrasi untuk mendapatkan Vm3 Filtrat
3. Memproses rumus A=n*luas;
Kp=(vis*a*Cs)/((A^2)*P);
B=(vis*Rm)/(A*P);
t=((Kp/2)*(V^2))+(B*V);
z=t/60;
laju=V/z;
tmenit=t/60;
4. Menampilkan hasil
5. Memproses Plot
6. Menampilkan Plot perbandingan antara t(menit) dengan V(m3)
7.Selesai

183
II. Flowchart

Start

Menampilkan
Program Perulangan
dan Luas Segitiga

Memproses rumus
A=n*luas;
Kp=(vis*a*Cs)/((A^2)*P);
B=(vis*Rm)/(A*P);
t=((Kp/2)*(V^2))+(B*V);
z=t/60;
laju=V/z;
tmenit=t/60;

Menampilkan Hasil
perhitungan

Memproses
plot

Menampilkan Plot
perbandingan antara
t(menit) dengan
V(m3)

End

184
III. Listing
clc;
disp('Perhitungan Waktu Filtrasi untuk mendapatkan Vm3 Filtrat');
disp('<><><><><><><><><><><><><><><><><><><><><><><><>');
luas=0.873;
V=3.37;
P=338000;
Cs=23.47;
Rm=10.63*(10^7);
a= 1.863*(10^7);
vis=8.937;
n=25;
A=n*luas;
Kp=(vis*a*Cs)/((A^2)*P);
B=(vis*Rm)/(A*P);
t=((Kp/2)*(V^2))+(B*V);
z=t/60;
laju=V/z;
tmenit=t/60;
fprintf('%0s%4.4f%2s%\n','Waktu yang dibutuhkan untuk mendapat Vm3 filtrat
adalah ',tmenit,' (menit) ');
x=linspace(1,t/60,60);
y=laju*x;
plot(x,y,'.r',x,y,'-b');
xlabel('t (second)');
ylabel('Volume (m3)');
title(' Perbandingan antara t(menit) dengan V(m3)');
grid on
hold on

185
IV. Hasil Listing

186
DAFTAR PUSTAKA

Mufdholifah, Wiwin. 2012. “Cara Membuat Grafik Pada Matlab”. (http://


aribahwiwinimtinan.blogspot.co.id/2012/11/cara - membuat - grafik - pada-
matlab.html). Diakses pada tanggal 17 November 2019 pukul 18.43 WIB.
Ndraha, Otoni. 2015. “Jenis-Jenis Matriks”. (http://otonindraha.blogspot.co.id/
2015/ 03/jenis-jenis-matriks.html). Diakses pada 17 November 2019 pukul
19.06 WIB.

187

Anda mungkin juga menyukai