Improve the response of the flow rate in a mixing tank:
c
1
chemical 1 concentration​​
c
2
chemical 2 concentration​​
q
1
chemical 1 flow rate
q
2
chemical 2 flow rate
q
10
chemical 1 initial flow rate
q
20
chemical 2 initial flow rate
q
0
sum of initial flow rates​​
q
mixture flow rate
In[]:=
tank=StateSpaceModel
eqns
,
vars
,DescriptorStateSpace->True,
labels
/.
q
0
->
q
10
+
q
20
/.
pars
Out[]=
​
​
​
input flow rate 1
input flow rate 2
tank volume
1
0
0
0
0
-1
1
1
tank concentration
16.6667
1000
0
0
-30.
-16.6667
10.
20.
output flow rate
0
0
0
0.015
0
-1
0
0
output flow rate
​
​
​
0
0
1
0
0
The response to a disturbance in the flow rate
q
2
is sluggish:
In[]:=
or
ol
=OutputResponse[tank,{0,UnitBox[t-5]},{t,0,300}];​​Plot[
or
ol
,{t,0,300},PlotRangeAll]
Out[]=
50
100
150
200
250
300
0.005
0.010
0.015
Design a state-feedback controller to accelerate the response:
In[]:=
p={-0.2,-0.03};​​=StateFeedbackGains[tank,p,"Data"]
Out[]=
SystemsModelControllerData
Design: pole placement
»
Feedback inputs count: 2

The closed-loop system:
In[]:=
csys=["ClosedLoopSystem"]//Chop
Out[]=
​
1
0
0
-0.185
0
-1.
1.
1.
​
16.6667
1000
0
-3.08333
-30.
-16.6667
10.
20.
​
0
0
0
0.015
0
-1.
0
0
output flow rate
​
​
​
0
0
1.
0
0
The response of the closed-loop system is faster:
In[]:=
or
cl
=OutputResponse[csys,{0,UnitBox[t-5]},{t,0,300}];​​Plot{
or
ol
,
or
cl
},{t,0,300},
plotOpts

Out[]=
open-loop
closed-loop