You are on page 1of 3

ENG202: Numerical Methods for Engineering

Homework 2 (H2)
Spring 2023

Note:
• Each student has to solve only one exercise in the manual. The exercise to solve should be selected based on the
student’s ID number.
• Each implementation should be done individually. Sharing your solution (in entirety or partially) will be considered
plagiarism.
• If any exercise is unclear, use your best judgment to solve the problem. Specify the assumptions made, if any.
• Make sure that your answers are as comprehensive as possible, i.e., plot the functions to be solved, check the final
solutions, etc.
• Name the jupyter notebook as H2_yourname_yourID.ipynb and the pdf file with the derivation of your solution as
H2_yourname_yourID.pdf. Upload them to your Moodle account before the deadline.
• Any queries regarding the homework assignment should be discussed only with the Instructor/T.A.s
• The electronic copy of your homework report in the form of PDF file and accompanying python file should be uploaded
into your Moodle account before 23:59 on Monday, 20 February 2023.

Students ID ending with an odd number

Exercise: Extraction using solvents is a common technique used in many fields, including chemistry,
pharmaceuticals, and food processing. This process involves the use of a solvent, such as water,
ethanol, or hexane, to dissolve and separate a target substance from a mixture. A countercurrent stage
extraction process is shown in Figure 1.

Figure 1. Illustration of countercurrent stage extraction process.

In the countercurrent stage extraction systems, a stream containing a weight fraction of the target
substance enters at a mass flow rate of . Simultaneously, a solvent carrying a weight fraction
of the same substance enters from the other side at a flow rate of . Thus, for stage i, a mass balance
can be represented as:
. (1)
At each stage, an equilibrium is assumed to be established between and , as in

, (2)

where denotes the distribution coefficient.

1. Derive the system of linear equations for extractor with N stages in terms of weight fraction .
Note that the first and last equations should be modified to account for inflow weight fractions
and .
2. Write the python code to solve the mass balance equations for the N-stage extraction process using
the Thomas method for tridiagonal system of equations.
3. Solve the mass balance equations for three-, five- and ten-stage extraction processes using the
developed python code.
Compare the results obtained from the code with those obtained from using the Numpy solver.
Assume: kg/h , , kg/h, and .
4. Plot and concentrations on the same graph for the three-stage extraction processes. Prepare
similar plots for five- and ten-stage extraction processes.
5. Report the outlet concentrations and for three--, five- and ten-stage extraction processes.
Plot the outlet concentrations versus the number of stages.

Students ID ending with an even number

Exercise: The Lower Colorado River consists of a series of four reservoirs as shown in Fig. 2.

Figure 2. Illustration of chloride balance for the Great Lakes.

The mass balances can be setup for each reservoir. As an example, the mass balance for the Lake Erie
can be written as
. (3)
The system of linear algebraic equations can be derived and solved to calculate chloride concentration
in each reservoir.
The chlorine concentration in the inlet stream of each reservoir changes according to the following
table.
Chlorine Concentration in inlet stream, cin,i
Lake Month
1 2 3 4 5 6 7 8 9 10 11 12
Superior 0.740 0.921 0.999 0.955 0.799 0.571 0.325 0.122 0.011 0.021 0.147 0.360
Michigan 1.48 1.84 2.00 1.91 1.60 1.14 0.649 0.243 0.022 0.041 0.294 0.721
Huron 2.96 3.68 3.99 3.82 3.20 2.28 1.30 0.486 0.045 0.082 0.589 1.44
Erie 3.70 4.60 4.99 4.77 4.00 2.85 1.62 0.608 0.056 0.103 0.736 1.80
Ontario 4.44 5.52 5.99 5.73 4.80 3.42 1.95 0.730 0.067 0.123 0.883 2.16
1. Derive the chloride mass balances for all reservoirs and combine them in a system of linear
equations.
6. Write the python code to solve the system of mass balance equations using the Gauss Jordan
method.
7. Solve the mass balance equations using the developed python code.
Compare the results obtained from the code with those obtained from using the Numpy solver.
Assume:
m3/h , m3/h, m3/h, m3/h and m3/h.
8. Report the monthly chlorine concentration in a tabular format.
Plot the variation of chlorine concentration for all lakes over the months on a single graph.

You might also like