You are on page 1of 10

Nama : Rahmat Kurniawan Nasution

Nim : 1507112497
UTS KOMPUTASI PROSES

1. Write custom function to calculate the sum of odd and even number
from data input by user. Data input by user must be≤10. If data input >
10, then show message box that prompt to input data≤10, write
algorithm or flowchart (write inyour examination paper)!?
2. Write custom function for solving P, see equation below:
RT 𝑎
P= −
ύ − b ύ(ύ + b)
Where
R2 Tc 2 RTc
𝑎 = 0,42748 ( ) 𝑎, 𝑏 = 0,08664 ( )
Pc Pc

T 1
Ts = ,𝛼 =
Tc Tr 0,5
Check the function to calculate ρ for data:
R =0,082, T =450, v=0,64, Pc=100
3. For chemical reaction
2A B + 2C
The equilibrium constant expression is
[B][C]2
K=
[A]2

this reaction, the value of equilibrium constant K at a certain


temperature is 0.288 mol L-1.

A reaction mixture is prepared in which the initial concentrations are


[A] = 1, [B] = 0, [C] = 0 mol L-1. From mass balance and stoichiometry,
the concentrations at equilibrium are [A] = 1-2x , [B] = x, [C] = 2x mol
4𝑥 3
L-1, from which the expression for K is 1−4𝑥−4𝑥 2 . Find the value of x
that make the expression have a value of 0.288, and calculate the
concentration of A,B,C at equilibrium!

4. The following data were collected by chemical engineer. The response


y is filtration time, x1 is temperature, and x2 is pressure.
a. Fit a second-order model ( y = a + b*x2 + c*x2 + d*x1^2 +
e*x2^2 )
b. Create graph and give operating condition would you
recommend if the objective is to
Nama : Rahmat Kurniawan Nasution
Nim : 1507112497
UTS KOMPUTASI PROSES

minimize the filtration time

x1 x2 y
-1 -1 54
-1 1 45
1 -1 32
1 1 47
-1.414 0 50
1.414 0 53
0 -1.414 47
0 1.414 51
0 0 41
0 0 39
0 0 44
0 0 42
0 0 40

Penyelesaian:

1 3. Buatlah fungsi yang


1. Buka Ms Excel menyatakan penjumalahan
2. Pilih insert
dan pilih developer bilangan ganjil dan genap. Mulai
Userform dan pilih
kemudian pilih lah membuat fungsi dengan
module
Visual Basic mengetik “Public Function ‘Name
of Function (Value)’ 4. Hitung jumlah data
melalui n = Cells.Count

8. Tentukan nilai 7. Untuk bilangan 6. Tentukan keadaan sel dengan 5. Tunjukkan letak dan
penjumlahan. Pada ganjil digunakan menggunakan logika if-then. Pada nilai dari setiap data
proses ini dibuat Mod 2 =1 dan proses ini digunakan Mod 2 yang melalui penggunaan
sum = sum + Cells Bilangan genap Mod menyatakan nilai suatu bilangan (ganjil/ logika For-Next “For i=1
(i) 2 =0 genap) To n”

9. Akhiri logika
11. Buat message box
dengan End if dan 12. Buat MsgBox
jika data yang
Next i dan buat 10. Gunakan fungsi (“ Please input
digunakan > 10 dengan
persamaan SumOdd untuk data <= 10 data <=10”) untuk
menggunakan logika
= Sum untuk proses proses ini
If-Then
ini

13. Akhiri logika


dengan SumOdd =
“Please input data
<= 10) dan end if
Nama : Rahmat Kurniawan Nasution
Nim : 1507112497
UTS KOMPUTASI PROSES

Gambar 1.1 Pekerjaan VBA

Gambar 1.2 Hasil Excel Untuk Sumodd


Nama : Rahmat Kurniawan Nasution
Nim : 1507112497
UTS KOMPUTASI PROSES

Gambar 1.3 Hasil Excel Untuk SumEven


Nama : Rahmat Kurniawan Nasution
Nim : 1507112497
UTS KOMPUTASI PROSES

2
Pilih Developer pada Ms.
Pilih Insert Useform dan Buat Fungsi Penentuan
Excel, kemudian Pilih
Pilih Module Nilai Tekanan
Visula Basic

Fungsi Dibuat Dengan


IP(R, T, v, Tc, Pc)

Tr=T/TC, α=1/Tr0,5
Fungsi Dibuat Dengan
a=0,42748*(R2*TC2/pc)α
IP(R, T, v, Tc, Pc)
b=0,08664*( R*TC/pc)

R=0,082; T=450
Buat Hasil = ((R * T) / (v
v=0,64; TC = 400;
- b)) - (a / (v * (v + b)))
PC = 100

Pada Ms. Excel Tentukan


Nilai P dengan Rumus =
IP(R;T;v; TC;PC).
Diperoleh Nilai P=
50,1995
Nama : Rahmat Kurniawan Nasution
Nim : 1507112497
UTS KOMPUTASI PROSES

Gambar 2.1 Hasil Pekerjaan VBA

Gambar 2.2 Hasil P dengan Excel


Nama : Rahmat Kurniawan Nasution
Nim : 1507112497
UTS KOMPUTASI PROSES

FLOW CHART

3
Buat Stoikiometri Reaksi 3
Diperoleh Data Kesetimbangan
Dengan Memasukan Data Dimasukan
Reaksi
Awal dan Akhir Reaksi Dengan K = 0,288
1 Untuk [A] [B] [C]
2A ← B + 2C

Didapatkan
Persamaan
Dimana
2 4

[A] = 0,485 Diperoleh Hasil [A]=1-2X


[B] = 0,257 [B]= X
[C] = 0,514 8 [C]= 2X

7
iX

88 i
,2 ila

ir
ila

=0 N

kh
N

K nti

A
an

il
G
ik

as
s

H
itu

n
bs

su
5
Su

isu
D
Di Solver
X = 0,257198 4X^3 – 1,152X^2 + 1,152X = 0,288
6

Gambar 3.1 Data Kesetimbangan Reaksi [A][B][C]


Nama : Rahmat Kurniawan Nasution
Nim : 1507112497
UTS KOMPUTASI PROSES

Gambar 3.2 Hasil Solver X dengan Nilai K = 0,288

Gambar 3.3 Hasil Akhir Konsentrasi [A][B][C] dengan


Menggantikan Nilai X
Nama : Rahmat Kurniawan Nasution
Nim : 1507112497
UTS KOMPUTASI PROSES

Maka hasil dari P dan T Dari data yang disediakan


pada nilai terendah tersebut dibuat tambahan data x12
adalah dan x22 yang disebut
P = -0,2828 dan T = 0,2828 sebagai x3 dan x4

Sehingga diperoleh nilai


M1 = -1,97005
M2 = 1,45722 Setelah data didapatkan
Nilai terendahnya M3 = 3,71259 buatlah fungsi LINEST
diperoleh M4 = 2,462213 dan untuk mendapatkan nilai
= 40,7235 D = 41,20069 M1, M2, M3 dan M4 dan D
M2 = 1,45722

Sehingga didapatkan data- Setelah diperoleh nilai-nilai


data untuk plot grafik sebagai tersebut dibuat grafik
fungsi suhu dan tekanan, lalu dengan membuat data x1
ditentukan nilai paling rendah dan x2 sebagai fungsi suhu
dari data tersebut dan tekanan
Nama : Rahmat Kurniawan Nasution
Nim : 1507112497
UTS KOMPUTASI PROSES

60
50
50-60
40
40-50
30
30-40
20
1,1312 20-30
10 0,2828 10-20
0 -0,5656 0-10
-1.414
-1.1312
-0.8484
-0.5656
-0.2828
0

-1,414
0.2828
0.5656
0.8484
1.1312
Hasil Pekerjaan Kurva 1.414

You might also like