You are on page 1of 1

AHMADU BELLO UNIVERSITY, ZARIA

Faculty of Engineering
Department of Chemical Engineering

CHEN309: COMPUTER APPLICATIONS FOR CHEMICAL ENGINEERS


B.Eng. (Chemical Engineering) Test, First Semester 2019/2020 Session

Instructions: Attempt ALL questions. Date: Friday, May 28, 2021


Time allowed: 1 hour

1. Check each of the following and state with reason whether it is an acceptable variable
name in GNU Octave or not. [10 marks]

a. CHEN309GRADE f. whole-sale-price
b. dy/dx g. id&numb
c. -CGPA h. D^2
d. 3rho i. CA_0
e. Min Concentration j. sqrt(40)

2. Convert the following mathematical equations into their GNU Octave equivalents. [5
marks]

𝑘 𝑧
cosh⁡[𝐿(√ )(1− )]
𝐷𝐴𝐵 𝐿 0.00266𝑇 3/2
a. 𝐶𝐴 = 𝐶𝐴𝑜 𝑘
⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡⁡𝑏.⁡⁡⁡⁡𝐷𝐴𝐵 = 𝜎 +𝜎 2 1 1
cosh[𝐿√ ] Ω⁡𝑃⁡( 𝐴 𝐵 ) ⁡√ +
𝐷𝐴𝐵 2 𝑀𝐴 𝑀𝐵

3. If variables A and B are defined in GNU Octave command window as follows:


>> A = [1 2 3; 4 5 6; 7 8 9];
>> B = [1 0 6; 8 5 5; 6 6 3];
What would be the output of the following logical expressions? [5 marks]

a. (A==B)&(B > 0) b. (A>= 5)|(A~=B)

4. Four reactors are connected by pipes, where directions of flow are depicted by means
of arrows as shown in Figure Q4. The flow rate of the key component is given by the
volumetric flow rate Q(liter /sec) multiplied by the concentration C (g/liter) of the
component. The incoming flow rate is assumed to be equal to the outgoing rate.

350 g/sec 𝑸𝟏𝟑 𝑪𝟏


Reactor 1 Reactor 3 𝑸𝟑𝟑 𝑪𝟑

𝑸𝟑𝟐 𝑪𝟑
𝑸𝟐𝟏 𝑪𝟐 𝑸𝟒𝟑 𝑪𝟒

Reactor 2 Reactor 4 150 g/sec

𝑸𝟐𝟒 𝑪𝟐

Key component material balances around the 4 reactors are given as follows:
Reactor 1: 350 + 25𝐶2 = 75𝐶1 Reactor 2: 45𝐶3 = 45𝐶2
Reactor 3: 75𝐶1 + 30𝐶4 = 105𝐶3 Reactor 4: 150 + 20𝐶2 = 30𝐶4
a. Rewrite the above equations in Matrix-Vector format. [4 marks]
b. Write a GNU Octave code to calculate the concentration of the key component
at each reactor (i.e. 𝐶1 , 𝐶2 , 𝐶3 ⁡𝑎𝑛𝑑⁡𝐶4 ) [6 marks]

You might also like