J.C. Kantor (Kantor.1@nd.edu)
This IPython notebook demonstrates the solution to material balances for an ammonia synthesis reactor operating at chemical equilibrium.
Ammonia is produced on an enormous scale, and crucial to global agriculture. The main pathway is by way of the Haber-Bosch process based on the reaction
$$N_2 + 3\,H_2 \longleftrightarrow 2\,NH_3$$
For these calculations we will import pylab
and the fsolve
function from the scipy
library.
%matplotlib inline
from pylab import *
from scipy.optimize import fsolve
def f(x):
Kq = (2.0*x)**2*(4000.0-2.0*x)**2/((1000.0-x)*(3000.0-3.0*x)**3*200.0**2)
Ka = 0.001172
return Kq - Ka
f(0)
-0.001172
f(999.999)
1.481481481955498e+19
x = linspace(500,800)
plot(x,f(x))
[<matplotlib.lines.Line2D at 0x111734278>]
fsolve(f,650)[0]
682.08889272012129
x = fsolve(f,0.0)
print x
[ 682.08889272]
f(972.16)
24.622103766343365