ChEn-3170: Computational Methods in Chemical Engineering Spring 2020 UMass Lowell; Prof. V. F. de Almeida 12Apr20
$ \newcommand{\Amtrx}{\boldsymbol{\mathsf{A}}} \newcommand{\Bmtrx}{\boldsymbol{\mathsf{B}}} \newcommand{\Cmtrx}{\boldsymbol{\mathsf{C}}} \newcommand{\Mmtrx}{\boldsymbol{\mathsf{M}}} \newcommand{\Imtrx}{\boldsymbol{\mathsf{I}}} \newcommand{\Pmtrx}{\boldsymbol{\mathsf{P}}} \newcommand{\Qmtrx}{\boldsymbol{\mathsf{Q}}} \newcommand{\Lmtrx}{\boldsymbol{\mathsf{L}}} \newcommand{\Umtrx}{\boldsymbol{\mathsf{U}}} \newcommand{\xvec}{\boldsymbol{\mathsf{x}}} \newcommand{\yvec}{\boldsymbol{\mathsf{y}}} \newcommand{\zvec}{\boldsymbol{\mathsf{z}}} \newcommand{\avec}{\boldsymbol{\mathsf{a}}} \newcommand{\bvec}{\boldsymbol{\mathsf{b}}} \newcommand{\cvec}{\boldsymbol{\mathsf{c}}} \newcommand{\rvec}{\boldsymbol{\mathsf{r}}} \newcommand{\norm}[1]{\bigl\lVert{#1}\bigr\rVert} \DeclareMathOperator{\rank}{rank} \DeclareMathOperator{\abs}{abs} $
your name
¶Context | Points |
---|---|
Precision of the answer | 80% |
Answer Markdown readability | 10% |
Code readability | 10% |
taking place in a closed reactor vessel.
At some initial time, the charge to the reactor vessel was:
Name | Parameter | Value | |
---|---|---|---|
initial mole fraction of A | $x_{A_0}$ | 0.21 | |
initial mole fraction of B | $x_{B_0}$ | 0.38 | |
initial mole fraction of C | $x_{C_0}$ | residual | |
mole equilibrium constant | $K_\text{x}$ | 38.7 |
'''Parameters for chemical equilibrium of A + B <-> C'''
'''Equilibrium function at values or array values'''
'''Function: plot equilibrium function'''
'''1.1 Plot equilibrium function'''
Comment on roots:
'''1.2) Equilibrium function derivative'''
"""1.2) Newton's method"""
'''1.2) Find root and equilibrium molar fractions'''
****************************************************** Newton's Method Iterations ****************************************************** k | f(e_k) | f'(e_k) | |del e_k| | e_k |convg| ------------------------------------------------------ 1 +2.678e+00 -2.342e+01 +1.143e-01 +0.000e+00 0.00 2 +5.191e-01 -1.434e+01 +3.619e-02 +0.000e+00 1.53 3 +5.198e-02 -1.147e+01 +4.532e-03 +0.000e+00 1.63 4 +8.153e-04 -1.111e+01 +7.338e-05 +0.000e+00 1.76 5 +2.137e-07 -1.111e+01 +1.925e-08 +0.000e+00 1.87 6 +1.477e-14 -1.111e+01 +1.330e-15 +0.000e+00 1.93 ****************************************************** Equilibrium mole fractions: x_a = 6.494e-02 x_b = 2.662e-01 x_c = 6.689e-01
'''1.3) Plot equilibrium function with root'''
'''1.4) Alternate initial molar fraction 1'''
****************************************************** Newton's Method Iterations ****************************************************** k | f(e_k) | f'(e_k) | |del e_k| | e_k |convg| ------------------------------------------------------ 1 -6.472e-01 -9.471e+00 +6.834e-02 +0.000e+00 0.00 2 +1.854e-01 -1.490e+01 +1.245e-02 +0.000e+00 1.63 3 +6.149e-03 -1.391e+01 +4.421e-04 +0.000e+00 1.76 4 +7.760e-06 -1.387e+01 +5.593e-07 +0.000e+00 1.86 5 +1.242e-11 -1.387e+01 +8.953e-13 +0.000e+00 1.93 ****************************************************** Equilibrium mole fractions: x_a = 6.494e-02 x_b = 2.662e-01 x_c = 6.689e-01
'''1.4) Alternate initial molar fraction 2'''
****************************************************** Newton's Method Iterations ****************************************************** k | f(e_k) | f'(e_k) | |del e_k| | e_k |convg| ------------------------------------------------------ 1 +2.926e-01 -1.456e+01 +2.010e-02 +0.000e+00 0.00 2 +1.604e-02 -1.296e+01 +1.237e-03 +0.000e+00 1.71 3 +6.076e-05 -1.286e+01 +4.723e-06 +0.000e+00 1.83 4 +8.856e-10 -1.286e+01 +6.884e-11 +0.000e+00 1.91 ****************************************************** Equilibrium mole fractions: x_a = 6.494e-02 x_b = 2.662e-01 x_c = 6.689e-01
'''1.4) Alternate initial molar fraction 3'''
'1.4 Alternate initial molar fraction 3'
Explanation of choices of initial molar fractions:
taking place in a closed reactor vessel.
At some initial time, the charge to the reactor vessel was:
Name | Parameter | Value | Name | Parameter | Value | |
---|---|---|---|---|---|---|
initial mole fraction of A | $x_{A_0}$ | 0.40 | stoic. A | $\nu_A$ | 1.8 | |
initial mole fraction of B | $x_{B_0}$ | 0.38 | stoic. B | $\nu_B$ | 2.3 | |
initial mole fraction of C | $x_{C_0}$ | 0.11 | stoic. C | $\nu_C$ | 1.5 | |
initial mole fraction of D | $x_{D_0}$ | 0.02 | stoic. D | $\nu_D$ | 2 | |
initial mole fraction of E | $x_{E_0}$ | residual | stoic. E | $\nu_E$ | 0.6 | |
mole equilibrium constant | $K_\text{x}$ | 101.7 | . | . | . |
'''2.1) Parameters for chemical equilibrium of A + B + C <-> D + E'''
reaction: 1.8 A + 2.3 B + 1.5 C <=> 2.0 D + 0.6 E
'''2.1) Molar fractions function'''
'''2.1) Derivative of the molar fractions funtio wrt normalized extent of reaction'''
'''2.1) Equilibrium function'''
'''2.1) Gradient with respect to molar fractions of the equilibrium function'''
'''2.1) Function: plot equilibrium function'''
'''2.1) Plot equilibrium function'''
"""2.2) Newton's method"""
'''2.2) Find root and equilibrium molar fractions'''
****************************************************** Newton's Method Iterations ****************************************************** k | K(e_k) | K'(e_k) | |del e_k| | e_k |convg| ------------------------------------------------------ 1 -1.625e+02 -1.687e+04 +9.630e-03 +0.000e+00 0.00 2 +3.259e+01 -1.234e+04 +2.641e-03 +0.000e+00 1.28 3 +5.571e+00 -1.311e+04 +4.249e-04 +0.000e+00 1.31 4 +1.274e-01 -1.326e+04 +9.604e-06 +0.000e+00 1.49 5 +6.345e-05 -1.326e+04 +4.783e-09 +0.000e+00 1.66 6 +1.583e-11 -1.326e+04 +1.194e-15 +0.000e+00 1.79 ****************************************************** Equilibrium mole fractions: x_A = 3.618e-01 x_B = 3.062e-01 x_C = 3.553e-02 x_D = 1.511e-01 x_E = 1.454e-01
'''2.3) Plot equilibrium function with root'''
taking place in a closed reactor vessel.
At some initial time, the charge to the reactor vessel was:
Name | Parameter | Value | Name | Parameter | Value | |
---|---|---|---|---|---|---|
initial mole fraction of A | $x_{A_0}$ | 0.03 | stoic. A | $\nu_A$ | 1.1 | |
initial mole fraction of B | $x_{B_0}$ | 0.05 | stoic. B | $\nu_B$ | 1.3 | |
initial mole fraction of C | $x_{C_0}$ | 0.02 | stoic. C | $\nu_C$ | 2.5 | |
initial mole fraction of D | $x_{D_0}$ | residual | stoic. D | $\nu_D$ | 2 | |
initial mole fraction of E | $x_{E_0}$ | 0.3 | stoic. E | $\nu_E$ | 1.8 | |
initial mole fraction of F | $x_{F_0}$ | 0.4 | stoic. F | $\nu_F$ | 2.2 | |
mole equilibrium constant | $K_\text{x}$ | 187.9 | . | . | . |
'''3.1) Parameters for chemical equilibrium of A + B + C <-> D + E + F'''
reaction: 1.1 A + 1.3 B + 2.5 C <=> 2.0 D + 1.8 E + 2.2 F
'''3.1) Plot equilibrium function'''
'''3.2) Find root and equilibrium molar fractions'''
****************************************************** Newton's Method Iterations ****************************************************** k | K(e_k) | K'(e_k) | |del e_k| | e_k |convg| ------------------------------------------------------ 1 +4.809e+01 -3.465e+04 +1.388e-03 +0.000e+00 0.00 2 +6.665e+00 -3.564e+04 +1.870e-04 +0.000e+00 1.30 3 +1.079e-01 -3.578e+04 +3.015e-06 +0.000e+00 1.48 4 +2.753e-05 -3.578e+04 +7.694e-10 +0.000e+00 1.65 5 +1.592e-12 -3.578e+04 +4.448e-17 +0.000e+00 1.79 ****************************************************** Equilibrium mole fractions: x_A = 5.130e-02 x_B = 7.548e-02 x_C = 6.742e-02 x_D = 1.665e-01 x_E = 2.724e-01 x_F = 3.669e-01
'''3.3) Plot equilibrium function with root'''