Control of a Two-Tank Blending System​
​Authors: Housam Binous and Ahmed Bellagi

Figure below shows a sketch of a two-tank blending system.​​
​​Total material balance is :​​
ρA1
h1
t
=ρ
V1
t
=
m1
t
=q1+q5-q3
​​​
ρA2
h2
t
=ρ
V2
t
=
m2
t
=q3+q2-q4
​​​Partial material balance is :​​
ρV1
x3
t
=q1x1+q5x5-q3x3
​​​
ρV2
x4
t
=q3x3+q2x2-q4x4
​​where x is the weight fraction of component A. We assume the system is dilute. Hence, ρ ≈ constant.​We assume
V1
t
=0
and
V1
t
=0
(i.e. tank volumes : V1 and V2 are kept constant by using an overflow line) then
q3=q1+q5
and q4=q3+q2.​We also assume that the transmitters and control valves have negligible dynamics. ​Here, we propose to control the weight fraction of component A in the blender outlet stream,
x
4, by manipulating the mass flow rate of stream 2 (labeled q2).​​
q2=q2n-
K
c
e(t)+
1
τ
I
e(t)twithe(t)=
x
sp
-x4(t)
. ​Given: V1=V2=1 m3, x1=0.1, x2=0.3, x5=0.2, q1=1, q2=3, q5=1, q2n=3, ρ=1000. ​We suppose that the mass flow rate of stream 1, q1, is decreased to 0.9 at t=0.​For each one of the scenarios below, we plot the outlet weight fraction and flow rate versus time.​1. there is no control action.​2. A P-controller is used to control the weight fraction of the outlet steam of tank 2. Controller gain is Kc = 100.
x
sp
=0.24
wt %.​3. A PI-controller is used to control the the weight fraction of the outlet steam of tank 2. Controller gain is Kc = 10 and the reset time is τI = 2. ​4. If qs1 is kept equal to 1 at all times and the set point is fixed equal to 0.27 at t=0. A PI-controller is used to control the composition of the outlet stream of tank 2. Controller gain is Kc = 10 and the reset time is τI = 5.​​Reference:​[1] D. E. Seborg, T. F. Edgar, D. A. Mellichamp, and F. J. Doyle III, Process Dynamics and Control, 4th ed., New York: Wiley, 2017.
Open loop response or no control action
In[]:=
ss=Flatten@NSolve[{q1x1+q5x5q3x3,q3q1+q5,q2x2+q3x3q4x4,q4q3+q2},{x4,x3,q3,q4}]
Out[]=
x4
q1x1+q2x2+q5x5
q1+q2+q5
,x3
q1x1+q5x5
q1+q5
,q3q1+q5,q4q1+q2+q5
In[]:=
x1=0.1;x2=0.3;x5=0.2;
In[]:=
q1=1;q2=3;q5=1;
In[]:=
ss
Out[]=
{x40.24,x30.15,q32,q45}
In[]:=
rho=1000;V=1;
In[]:=
q1=If[t<0,1,1×0.9]
Out[]=
If[t<0,1,1×0.9]
In[]:=
q3=2.;
In[]:=
sol=NDSolve[{rhoVx3'[t]q1x1+q5x5-(q1+q5)x3[t],x3[0]0.15,​​rhoVx4'[t]q2x2+q3x3[t]-(q2+q3)x4[t],x4[0]0.24},{x3,x4},{t,0,5000}]
Out[]=
x3InterpolatingFunction
Domain: 0.,5.00×
3
10

Output: scalar
,x4InterpolatingFunction
Domain: 0.,5.00×
3
10

Output: scalar

In[]:=
Plot[x4[t]/.sol,{t,0,4000},PlotRangeAll,PlotStyleDarker@Blue,FrameTrue,GridLinesAutomatic,AspectRatio1,ImageSize400{1,1},FrameLabel{Style["time",16,Italic],Style["wt fraction in tank 2 outlet stream",16]}]
Out[]=
In[]:=
Plot[x3[t]/.sol,{t,0,4000},PlotRangeAll,PlotStyleDarker@Red,FrameTrue,GridLinesAutomatic,AspectRatio1,ImageSize400{1,1},FrameLabel{Style["time",16,Italic],Style["wt fraction in tank 1 outlet stream",16]}]
Out[]=
Closed loop response - proportional only control action
Closed loop response - proportional-integral control action
Closed loop response - proportional-integral control action - response to a set point change