Professional Documents
Culture Documents
Homework#1
Homework#1
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 2: The following is a correlation for calculating the molar volume of a gas
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
(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.