4.6. Example: Mass Balances and Linear Algebra#

4.6.1. Learning Objectives#

After studying this notebook, completing the activities, and asking questions in class, you should be able to:

  • Solve a system of linear equations by creating a model and implementing it in matrix form in python.

  • Calculate results and interpret the meaning of the results.

# Import libraries
import numpy as np
import scipy.linalg as la

4.6.2. Atomic Species (Mass) Balance#

Reference: Example 4.7-1 in Elementary Principles of Chemical Process Engineering, Third Edition, Felder and Rousseau (2005)

Methane is burned with air in a continuous steady-state combustion reactor to yield a mixture of carbon monoxide, carbon dioxide, and water. The reactions taking place are:

CH\(_4\) + \(\frac{3}{2}\) O\(_2\) \(\rightarrow\) CO + 2 H\(_2\)O

CH\(_4\) + 2 O\(_2\) \(\rightarrow\) CO\(_2\) + 2 H\(_2\)O

The feed to the reactor contains 7.80 mole% CH\(_4\), 19.4% O\(_2\), and 72.8% N\(_2\). The percentage conversion of methane is 90.0%, and the gas leaving the reactor contains 8 mol CO\(_2\)/mol CO. What is the molar composition of the product stream?

Do the following using this handout:

  1. Draw a picture

  2. Propose a mathematical model using atomic species balances

  3. Perform degree of freedom analysis

  4. Convert your model to a linear system

  5. Solve with Python

  6. Print your answer to the screen with a reasonable number of significant digits

# Add your solution here