Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

AHMADU BELLO UNIVERSITY, ZARIA

FACULTY OF ENGINEERING
DEPARTMENT OF CHEMICAL ENGINEERING

CHEN 309: Computer Applications for Chemical Engineers (First Semester, 2019-2020 Session)

Homework # 1
Submission date: Wednesday, 12th February, 2020

Problem 1: Use GNU Octave as a calculator to evaluate the following:


2.672 −2.8
(a) √2𝜋+0.352 +(2−𝑒 −0.4 )
3∗ln⁡(120) 3(3−1)(ln⁡(120))2 4(4−1)(ln⁡(120))3
(b) 1 + + +
1! 2! 3!
√15+3.23
(c) 15 𝜋
𝑙𝑜𝑔10 (1625)−sin⁡( )
2
3
𝑛𝜋 𝑛𝜋
(d) ∑ (cos + sin )
𝑛=1 2 2
𝜋 2 𝜋 2
(e) sin ( 4 ) + ⁡𝑐𝑜𝑠 ( 4 )

Problem 2: The following is a correlation for calculating the molar volume of a gas

𝑅⁡𝑇 𝑃⁡𝑇 𝑃⁡𝑇 0.422 0.172


𝑉= (1 + 𝐵 0 𝑃 ⁡𝑇𝑐 + 𝜔𝐵1 𝑃 ⁡𝑇𝑐 ) where 𝐵 0 = 0.083 − 𝑇 1.6
⁡⁡⁡𝑎𝑛𝑑⁡𝐵1 = 0.139 − 𝑇 4.2
⁡⁡⁡
𝑃 𝑐 𝑐 ( ) ( )
𝑇𝑐 𝑇𝑐

Given that Tc = 405.5 K, Pc = 113.5 bar, and 𝜔 = 0.25 for ammonia. Write a GNU Octave code to
evaluate the molar volume V of ammonia at T=300 K and P = 50 bar. Use R = 83.14 cm3 bar/(mol. K).

Problem 3: Create the following matrix by using vector notation for creating vectors with
constant spacing and/or the linspace command in GNU Octave. Do not type individual
elements explicitly.

10 20 30 40 50 60 70
𝐴=[ 100 95 90 85 80 75 70 ]⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡
0.0000 3.3333 6.6667 10.0000 13.3333 16.6667 20.0000
10.000 8.3333 6.6667 5.0000 3.3333 1.6667 0.0000

Problem 4: Use GNU Octave to create the following three matrices:


3 −3 2 5 4 8 2 5 2
𝐴 = [5 1 −1] ⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝐵 = [−7 8 9 ] ⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝐶 = [6 2 1]⁡
8 0 6 1 1 −2 8 −3 7

(a) Calculate A+B and B+A to show that addition of matrices is commutative
(b) Calculate A+(B+C) and (A+B) + C to show that addition of matrices is associative
(c) Calculate 5(A+C) and 5A+5C to show that, when matrices are multiplied by a scalar, the
multiplication is distributive.
(d) Calculate A*(B+C) and A*B + A*C to show that matrix multiplication is distributive.

Problem 5: Use GNU Octave to solve the following system of five linear equations:
3𝑢 + 1.5𝑣 + 𝑤 + 0.5𝑥 + 4𝑦 = −11.75
−2𝑢 + 𝑣 + 4𝑤 − 3.5𝑥 + 2𝑦 = 19
6𝑢 − 3𝑣 + 2𝑤 + 2.5𝑥 + 𝑦 = −23
𝑢 + 4𝑣 − 3𝑤 + 0.5𝑥 − 2𝑦 = −1.5
3𝑢 + 2𝑣 − 𝑤 + 1.5𝑥 − 3𝑦 = −3.

You might also like