Coding Assignments.
Coding Assignments.
Coding Assignment
Consider a continuous well-mixed unstaged absorption tank of volume V depicted in Fig. 1 used to eliminate
a pollutant A from a gaseous effluent stream. A liquid with molar flow rate F without any A passes through
the tank to absorb A from a gaseous stream with the molar flow rate G with inlet mole fraction yA,i . There is
no mass transfer resistance within individual phases and the equilibrium mole fraction in both the bulk phases
follows a cubic relationship (i.e yA = k eq x3A ) for the relevant regime of operation. The volume of A in both the
phases are negligible. The molar densities of both the bulk phases (i.e. ρL , ρG ) remain constant throughout
the operation. The liquid hold up in the tank is kept constant and the gaseous hold up is negligible in the
tank. (i.e. VG ≈ 0,VL = const. ≈ V ). In steady state, the liquid and gas flow rate are 1 mol/min and 0.5
mol/min. and inlet mol fraction in the gas phase is 0.4. The density of the liquid phase is 0.02 mol/l. Volume
of the reactor is 10 l. keq = 80. You would like to maintain the mole fraction of A in the outlet stream at the
steady state value. You have an instrument to measure the concentration of A in the gaseous stream as well
as a valve to control the flow rate of the liquid feed. You would be using a feedback controller.
1. Write down the appropriate conservation and constitutive equations to develop the process model in
absence of a control loop. Find the realistic steady state of the process by solving the non-linear
equation numerically.
2. Identify the manipulated and disturbance variables, linearize the equations and Derive the respective
kd , kp and τp from the respective transfer functions considering yA to be the output.
3. In this part, you have to numerically solve the dynamic equations in absence of a controller for a step
change of yAi with magnitude P from the steady state obtained in previous part (Hint: Use ode45) .
Write a function that takes P as an input, and computes and compares the non-linear solution with
the solution from the transfer function approach by plotting them in the same axis.
1
4. Attach the output plots for P =0.1 and P =0.4 to your report.
5. Now, consider you are using a PI controller with gain Kc , and time constant τl for this specific control
loop. Write down the dynamics of the output as a function of time in response to a step change of yA i
6. Next, you will be implementing the PI controller numerically. It might be tempting to implement the PI
controller by an Euler integrator. But Euler integration with a constant step size may lead to numerical
instability for some value of the parameters. However ODE solver like ode45 takes care of this problem
using adaptive timesteps. Specially in this problem we don’t want to confuse between the controller
instability and numerical instability. ode45 requires you to Write down a system of ODEs that you
would solve to observe the response of this controller. Write down these equations.
8. Numerically implement the controller using ode45. Specifically, write down a function that takes P ,
Kc and τl as inputs and computes the controlled response of yA (t) from the numerical implementation
as well as from the transfer function approach and plots them in the same axis.
9. Attach the output plots for P =0.1 and P =0.4 and magnitudes of {Kc , τl } = {10, 0.2}, {100, 0.02}, {200, 0.2},
{650, 0.2} . kc and τl are in units of mol/min and min respectively. There will be total 4*2=8 plots.
10. Identify if any of the solution are unstable from linear or non-linear approach. Show if the respective
system are unstable analyzing the characteristic equation.