Hi all !
Here's a Python code giving composition of a "batch distillation" as a
function of time.
Although, the problem is not directly from the book prescribed "The
elementary principles of chemical processes" (its from another book
from our college syllabus), but is quite general in Chemical
engineering.
Thanks.
Shubham Singh Tomar.
#-------------------------------------------------------------------------------
# Name: Batch distillation
# Purpose:
#
# Author: Shubham
#
# Created: 27/04/2013
# Copyright: (c) Shubham 2013
# Licence: <your licence>
#-------------------------------------------------------------------------------
from scipy import *
from scipy.integrate import odeint
from matplotlib import *
from pylab import *
D = 10
a = 2.41
W_int = 100
x_w_int = 0.5
t = arange(0,6,1)
def batch(x_w,t):
W_t = -D*t + W_int
y = a*x_w/(1.0 + x_w*(a-1.0))
dx_wdt = -(D/W_t)*(y-x_w)
return dx_wdt
x_w_sol = odeint(batch, x_w_int, t)
figure()
plot(t,x_w_sol,'-o')
xlabel('Time,hours')
ylabel('x_w')
grid()
show()
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Ascend-sim-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ascend-sim-users