Department of Chemical Engineering
National Institute of Technology Warangal
CH306: Computational Methods in Chemical Engineering
Lab Handout - 2
ee aa ee ee
What will be the results of multiplication between the following A and B matrices? Compare
the results with the element by element multiplications
OS Ul geass, 28 71 24
ioe sas Ta 09 56 12
oe 87 01 03
Toe sa 18 26 119
Noe Oe saa A= 25 26 45
2. What will be the left and right divisions for the following A and B matrices?
‘Og ststeaa 26 12 05
aA ote hr 170 B= 83 19 -32
Lo aay 15 -0.01 5.1
07°19 241 09 -21 19
i)A= 18 32 11 A= 11 M4 27
3. Solve the following set of equations by using in different ways (for example using linsolve,
matrix divisions etc.)
i) x +2y -Z2=11; xt y-2
i) = &x+y=2; xt2yt2
05; -2x+S5y+z=45
4 x+2y=6
4. The material and energy balance equations in a single effect evaporator which concentrates
fruit juice are given below:
Energy Balance: 44.9mp — 65.1mp — 1113.7m, = —952,2 = 103
Comp Material Balance: 0.1m, — 0.55mp
Total Material Balance: mp — mp —my = 0
where my.mp and my are the mass flow rates of the feed, product and the vapor resp. Compute
these quantities.
Columnt‘Three components present in a feed stream are separated in two distillation columns as shown
in above flow chart. The feed rate is 10Kg/h. The vapor streams released from columns | and
2are rich in B and A components, respectively, and the bottom stream from column 2 is rich
in. The compositions of the feed and the product streams are shown in the above figure.
A paint manufacturer plans to prepare a special shade of paint by blending three shades of
enamels designated as 4, B, and C. The amounts of these enamels in the new paint are x, y, and
2 respectively. Three pigments are necessary in the new enamel. The weight percentages if the
pigments present in 4, B, and C are given in below table. The desired percentages of these
pigments are 40, 27 and 33 respectively
Enamel 4 Enamel B Enamel C
Pl P2 P3. PL P2 P3 Pl P2 P3
80. 0 20 0 70 30 30 1S 5S
Find the x, y and z,
Three chemical compounds X, Y and Z react in aqueous medium to form a product. The
concentrations of these compounds are important in yield of the product. For three sets of
experiments with solutions od different compositions, the yields of iven i
Sree Pe yields of the product are given in the
Comer (imol/m) T Produet (mol)
%
x
1S. a7) B 26.4
2.1 44 25 23.1
2.6 5.8 3.3 30.2
‘The volumes of the three solutions
Te sail Gn all experiments) are x, y and z in m?
» tespectively. FindLab Handout a
Department of Chemical Engineering
National Institute of Technology Warangal
CH306: Computational Methods in Chemical Engineering
NOTE: WRITE THE PROGRAMS IN SCRIPT FIL!
1. Find the roots of following transcendental equations in the specified intervals by fzero and root
finding numerical methods (try using different initial guesses).
a) xe* =5 in (1,2)
b) x= 3sinGeyin ED @ )
ce) 2 Ty =3 in (05,15)
. Find the roots of the following polynomial equations
a) x8 12x? 441x-30=0
b) x*—9.1x3 + 12.65 x? - 3.925 x +.0.375 =0
Write programs to solve below problems numerically. Compare your result with values
obtained using MATLAB solvers.
5. For turbulent flow through pipes, the friction factor isa function of Reynolds number (Re) and
relative roughness (). The correlation between Re and @ is given by
1 @ , 281
; Fe 70.8684 Ine + 77) a
Using 6 = 2.5*103 and Re = 5* 10° compute friction factor
4. IN atubular reactor with axial dispersion
Peclet number (Pe) is related to the fi
(ie.. mand 0°) as
(with closed-closed boundary conditions), the reactor
rst and second moments of the residence time distribution
2
5o7 [Pe—1 + exp(—Pe)] = 0? ee
Pe
a "
For a particular experiment, & = 0.25. Solve the above equation to find Pe
5. The following polynomial equation gives adiabatic flame temperature (in K) for burning
methanol with 100% excess air in a furnace. The adiabatic flame temperature preseribes the
upper limit of temperature, which should be taken into account for designing the furnace
13 x 10°°73 +.4.9 x72 4 0.47T — 681.7 =0
Find the adiabatic temperature
6. Compute the molar volume of methane at 350 K and |
equations of state (EOS):
a) Van der Waals EOS:
01.325 kPa from the following cubic
(0+3) = ar
27 RTE RT
era, n= a
5
b) Redlich-Kwong EOS:
RT
/ a
Pb GR
For methane, 7. = 190.7 K and Pe = 4.641x10° Pa, Compare the molar volumes
these EOS with that given by the ideal gas law,
(Ped
YT V Gen) JDepartment of Chemical Engineering
National Institute of Technology Warangal
CH306: Computational Methods in Chemical Engineering
Lab Handout - 4
NOTE: WRITE THE PROGRAMS IN SCRIPT FILE
Write MATLAB program to find the roots of below system of equations using fsolve function
and Newton-Raphson method. Tabulate values in successive iterations. Preferably solve the
reduced non-linear equations using either of Gauss eliminations or Gauss Seidel methods.
Find the roots of the following set of equations using initial estimate for the two unknowns as
(0.0).
x} -25x3 + 4x, = 3,7
0.7x3 + 3x, — 18x,
it
Find the roots of the following three equations. Check your program for different initial guess
values.
sin(x) + y? + In(z) = 7
3x +2y-z3 =-1
xtytz=
. Two isothermal liquid-phase chemical reactions with rate constants ky and k2 are taking place in a
CSTR at steady state
B+C>D ~ry =k 2egcc
The material balance equations for A, B, C and D are as follows
vo (Cao ~ Ca) — KiCaceV = 0
vo (Cao — Ce) — (kx cace + kecacc) V = 0
vo(Cco ~ Cc) + (iCal — kacacc)V = 0
(Coo ~ Cy) — kyceccV = 0
Given, vy =1 m°, V=75 m*, cao= cao = 1 mol/ m}, cco = coo = 0, ki = 1.2 mmol sec), kz = 0.6
m’/(mol sec), using this data solve above set of equations.Department of Chemical Engineering
National Institute of Technology Warangal
CH306: Computational Methods in Chemical Engineering
‘ Handout Hare
NOTE: WRITE THE PROGRAMS IN SCRIPT FILE!
sets given below write MATLAB programs to find best fit polynomial using
ion (LSR). Compare the coefficients obtained from
nts. Also
For the data
Polyfit function and Least Square Reg)
polyfit function with regression coeffie
1. The vapor pressure of water at different temperatures are given in the following table.
TR |] 3 imeans 310g algae 15) 320 325 330
Lpe(mmltg) | 814 10.54 | 13.53 17.21
Fit the second order polynomials using polytit and LSR.
v
The concentration of a reactant in a liquid-phase reaction carried out in a batch reactor changes
with time as shown in the table below.
i(hour)
[e(mol
1 on 3 4
Fit polynomials of Gegrees 2 and 3, and also exponential curve to this data. Compare the data.
3. The diffusivity of zine in copper varies with the temperature as showa in table below.
Temper.iure (K) 3500 600 700 800 900 1000 |
| Diffusiviiy (m/sec) | 4.3x1075 | 84x10™ [ 19x10" | Lixto” | 26x10" | 3.2x10%
The temperatu
is temperz
dependence of the diffusivity is given by D = Do exp(-Ow/R7), where Do (m?/sec)
independent exponential, Q,(J/mol) is the activation energy for diffusion, R is the
gas constant, and I’ is the temperature. Fit this equation to the given data and find Dp and Qy
9 *Dooupleg le)
4. A liquid phase first-order reaction, A — Bs carried out ina batch reactor. The concentration of A
in the reactor is monitored with time. as shown in the table given below. |
[rmin) I 100 200 300 400
‘Ci imolim') 500 325 250 210
=
The initial concentration of A in the reactor (Cio) is 1000 mol/m’. For a first-order reaction,
Into) = kt, where k is the reaction rate constant. Fit this equation to the data given in table
and compute rate constant. ,
“
|
The heat capacity of tie benzene varies with temperature as shown in table below.
[Ky 285 [2907]. 295 1] 300 [305_, ] 310
|
B, where both the forward and backward reactions are of first
order with rate constants ky and 2, the following ODE gives the conversion of A with time:
dx,
— = ky (1 — x4) — ka (M + x4)
dt
5x 10-*s"! amd M
Royal Os sear
where M is the ratio of the initial concentrations of B and A. The initial condition is x«(0) = 0
Compute the conversion profile of A up to 1 hour. Use ode23 solver and compare results
graphically with explicit numerical methods
Given that the concentration of a species 4 in a constant volume batch reactor obeys following
dca F 73 3 J
equation £4 = —ke¥ with the initial concentration Cu(1=0) = 2.3 mol/L and k = 0.23 Limol/s
Compute the time it takes for C, to be reduced to 1 mol/L,
One mechanism of deactivation of a solid catalyst is by parallel reaction, in which the reactant
produces a side product (P), which deposits on the catalyst surface and deactivates it. In bateh
reactor, the rate equations for the reaction and catalyst deactivation are as follows:
dcq
— TA a kichSa
dt 4
da
——= = kyc}a?
ae = Race
where a is the activity of a catalyst pellet, c, is the concentration of 4, ka is the rate constant for
deactivation of catalyst, k,’ is the modified reaction rate constant, and t is time.
Given ky’ = 3.5 x 10? m>mol~°5 and kq = 1x 10? m3mol-??.
The initial condition is: at t = 0, cq = Cay = 100 mol m= and a = 1. Solve these ODEs up to 5
min, and find the concentration profile of 4 and activity profile of the catalyst.Department of Chemical Engineering
National Institute of Technology Warangal
CH306: Computational Methods in Chemical Engineering
Lab Handout — 8 (ODE Boundary Value Problems)
NOT!
: WRITE THE PROGRAMS IN SCRIPT FILES
Solve boundary value problems using finite difference method.
Solve the following BVPs.
i. S2= x+y: y(0) = 0; yA) = 0; Solve the ODE for four sub intervals
x? + y; y(0) = 0; y(1) = 0; Solve the ODE using step size 0.25.
In the pressure driven flow of a fluid between two stationary plates separated by distance d and
driven by a pressure drop AP /Ax , the governing equations on the velocity w of the fluid are given
with boundary conditions u(y=0) = 0 and u(y =d) = 0. For distance between plates
ap a
1, viscosity = 1 and 2= = -100, obtain velocity profile as a function of distance between
plates. Plot d vs u. Note all the units are in reduced dimensions.
Let us consider the following ODE.
d’y_ dy
Cee 0
Where ¢ and x are parameters. ODEs of this type appear in the models for axial dispersion with a
chemical reaction in a tubular reactor. The boundary conditions are:
and atz=1,y'=
atz=0,y'=
€
Solve the above ODE at ¢ =0.2, « =1.5 and n = 1.5
A heat generating liquid is flowing in plug flow through an insulated pipe. The coordinate, x, is
the direction along the axis of the pipe. The temperature of the liquid is uniform at a given cross
section, and therefore, is a function of x only. The heat generation depends on temperature. The
energy balance equation is given by
brag t Regge t v=o
where Re and Pr are Reynolds and Prandtl number respectively. The dimensionless terms, @ and
é, are defined as
T-T,
Q=
Ty —T
Where L is the length of the pipe, and 7) and 7), are the temperatures at the inlet and outlet of the
pipe, respectively. The dimensionless parameter, q .is related to heat generation. The boundary
conditions are: at & =0, @=0 and & =1, 0=1. Given Pr = 0.002, and Re = 10 and q = 5*10°6
Solve the problem and plot 6 vs E.
and § =