0% found this document useful (0 votes)
3 views

Part2 Project M1

The document details a project focused on modeling and simulating cell growth in a continuous bioreactor, including the development of a nonlinear model based on Monod kinetics and the simulation of various disturbances. It also discusses controller design, proposing both feedback and feedforward control structures to manage the bioreactor's output. Key findings include the effects of substrate concentration and growth rate on cell and substrate dynamics, as well as the establishment of steady state gains for the system.

Uploaded by

ryckeboer.flore
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Part2 Project M1

The document details a project focused on modeling and simulating cell growth in a continuous bioreactor, including the development of a nonlinear model based on Monod kinetics and the simulation of various disturbances. It also discusses controller design, proposing both feedback and feedforward control structures to manage the bioreactor's output. Key findings include the effects of substrate concentration and growth rate on cell and substrate dynamics, as well as the establishment of steady state gains for the system.

Uploaded by

ryckeboer.flore
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

TKP4140 Process Control

Project M: Cell growth in continuous bioreactor

Part I

Flore Ryckeboer

Marie Groothaert

Janne Stroeckx

October/November, 2024

1
Contents
1 Part 1: Modeling and Simulation.............................................................................. 3
1.1 Project description.......................................................................................... 3
Classification of variables ...................................................................................... 4
1.2 Nonlinear model ............................................................................................. 4
Assumptions ......................................................................................................... 4
Model ................................................................................................................... 4
Steady state data................................................................................................... 5
1.3 Simulation results........................................................................................... 6
1.4 Steady state gains ........................................................................................... 7
1.5 Discussion ..................................................................................................... 7
2 Part 2: Controller design......................................................................................... 9
2.1 Proposed control structures ............................................................................ 9
2.2 Controller tuning........................................................................................... 11
2.3 Bode plot ..................................................................................................... 14
2.4 Simulations .................................................................................................. 15
2.5 Results ........................................................................................................ 16
3 Overall conclusion............................................................................................... 17
4 Simulink.............................................................................................................. 18
Simulink part 1........................................................................................................ 18
Simulink part 2: feedback controller ......................................................................... 19
Simulink part 2: feedforward controller ..................................................................... 19
5 Matlab code ........................................................................................................ 19

2
1 Part 1: Modeling and Simulation
In this section the behavior of cell growth in a bioreactor is modelled and simulated. Starting
with a short introduction to describe the process, control objective and to classify the
variables. Next, a nonlinear function is derived to describe the dynamic behavior. To
simulate the model, a step change of 10% increase is applied, using Simulink. Finally the
steady state gains are calculated from the plots and the model and simulation is discussed.

1.1 Project description

c c

Figure 1: sketch of a continuous bioreactor

For this project a continuous bioreactor is modelled as shown in figure 1. It has a feed stream
F with substrate concentration sF that enters a continuously stirred tank reactor (CSTR). The
liquid level is assumed constant, the product stream D is therefore equal to the feed stream
F. The metabolic reaction can be written as following:

substrate (s) → cells (c) + metabolic product.

Since the reaction is auto-catalytic, the cell growth is assumed to be proportional to the
concentration of cells [g/l]. The rate of reaction is expressed by r = µ(s)*c [g/l · h], with µ(s) as
the specific rate of reaction. This dependency follows the “Monod”-kinetics µ(s) = µm*s/ (ks
+ s) [h-1], with µm as the specific maximal growth and ks is the saturation constant.

It is possible that disturbances wash out the cells, causing the reaction to stop. Therefore
the control objective is to keep the concentration of cells at a given value by manipulating F.

3
Classification of variables
We hereby classify the different variables into the following categories: states, manipulated
variables or input, controlled variables or output and disturbances. The input (F/V) is the
variable that will be manipulated to control the CV or output, c.

States (x): concentration of cells c


concentration of substrate s

Input (u): F/V

Outputs (y): concentration of cells c

Disturbances (d): concentration of substrate in the feed sf


Specific maximal growth µm
Saturation constant ks

1.2 Nonlinear model


Assumptions
It is assumed that the reactor is well mixed and that the feed stream is sterile and thus
doesn’t contain any cells. The level V is assumed to be constant, meaning that the feed
stream F and the product stream D are equal. The cell growth is assumed to be proportional
to the concentration of cells, causing the reaction to be auto-catalytic and first order.
Another assumption is that the cells grow exponentially, and that the specific rate of reaction
µ can be expressed by the “Monod”- kinetics.

Model
To derive the nonlinear model, the component balances of the substrate and cells are set up.
Assuming that V is constant, the inflow and outflow are equal and using the Monod kinetics
expression and relationship nA = V*CA, the general component balance: dnA/dt = FA,in – FA,out +
GEN, is filled in as follows:

Substra te c onc entration


𝑑𝑠
𝑉∗ = 𝐹𝑠,𝑖𝑛 − 𝐹𝑠,𝑜𝑢𝑡 + 𝐺𝐸𝑁
𝑑𝑡

𝑑𝑠 µ ∗𝑠
𝑉 ∗ 𝑑𝑡 = 𝐹 ∗ 𝑠𝑖 − 𝐹 ∗ 𝑠 − 𝑘𝑚+𝑠 ∗ 𝑉 ∗ 𝑐
𝑠

𝑑𝑠 𝐹 µ𝑚∗𝑠
= 𝑉 ∗ (𝑠𝐹 − 𝑠) − 𝑘𝑠+𝑠 ∗ 𝑐
𝑑𝑡

4
Cell c oncentra tion
𝑑𝑐
𝑉∗ = 𝐹𝑐,𝑖𝑛 − 𝐹𝑐,𝑜𝑢𝑡 + 𝐺𝐸𝑁
𝑑𝑡

𝑑𝑐 µ ∗𝑠
𝑉 ∗ 𝑑𝑡 = 𝐹 ∗ 𝑐𝑖 − 𝐹 ∗ 𝑐 − 𝑘𝑚+𝑠 ∗ 𝑉 ∗ 𝑐 ∗ 𝑌
𝑠

As we initially have no cells, ci equals zero:


𝑑𝑐 𝐹 µ𝑚∗𝑠
= − 𝑉 ∗ 𝑐 + 𝑘𝑠+𝑠 ∗ 𝑌 ∗ 𝑐
𝑑𝑡

The yield coefficient Y is added in the biomass equation, which accounts for the metabolic
products that are additionally formed from the substrate.

We used MATLAB to implement this model and the code is given in appendix 6.

Steady state data


For a correct simulation of the model we need the steady state values of the substrate
concentration and the cell concentrations. To get these we set the acquired component
balances equal to zero and solve for c and s. Then we get:
𝐹 µ𝑚 ∗ 𝑠
0= ∗ (𝑠𝐹 − 𝑠) − ∗𝑐
𝑉 𝑘𝑠 + 𝑠
𝐹 µ𝑚∗𝑠
0 = − 𝑉 ∗ 𝑐 + 𝑘𝑠+𝑠 ∗ 𝑐 ∗ 𝑌

From this we get that


0.17𝑚3
ℎ 0.1𝑔
∗ 𝑙
0.1+ 1𝑚3
0.17𝑚3 0.17𝑚3
0.17𝑚3 ℎ 0.1𝑔 0.5 0.4𝑔 ℎ
µ𝑚∗𝑠 1𝑔 ∗ ∗ −
1𝑚3 1𝑚3
𝑐 = 𝑢 ∗ (𝑠𝐹 − 𝑠) − = ℎ
( − 𝑙
0.17𝑚3
)∗ ℎ 𝑔
0.17𝑚3
= 0.173
𝑘𝑠+𝑠 1𝑚3 𝑙 0.5 0.4𝑔 0.1𝑔

∗ − ℎ3 0.5 ∗ 𝑙
ℎ 𝑔 1𝑚 ∗ 1𝑚3
ℎ 0.17𝑚3
0.5 0.4𝑔 ℎ
∗ −
ℎ 𝑔 1𝑚3

0.17𝑚3
ℎ ∗0.1𝑔/𝑙
1𝑚³
𝑠= 0.5 0.4𝑔 0.17𝑚3 /ℎ
= 0.567
∗ −
ℎ 𝑔 1𝑚³

These are used in the MATLAB script as initial conditions to solve the differential equations.

5
Other steady state data was provided and these as well as the initial conditions are given in
table 1.
Table 1: steady state values

variable Description Steady state value Units


D Outlet flow 0.17 m3/h
sf Substrate 1 g/l
concentration feed
µm Specific maximal 0.5 h-1
growth
ks Saturation constant 0.1 g/l
Y Yield coefficient 0.4 gformed/cconsumed
V volume 1 m3
c Concentration cells 0.3794 g/l
s Concentration 0.0515 g/l
substrate

1.3 Simulation results


We simulated a 10% step response for the input u and for all three disturbances. The output
was obtained by setting the simulation time to 500 hours with the step taking place after 1
hour. The results from this simulation is given in figure 2.

Figure 2: initial simulation results ( 500 h)

6
1.4 Steady state gains
∆𝑦(∞)
The steady state gains were determined for stable systems, using 𝐾 = . These results
∆𝑢
are given in table 2.
Table 2: Steady state gains

Step on sF 𝑲=
(𝟎. 𝟐𝟏𝟑 − 𝟎. 𝟏𝟕𝟑)𝒈/𝒍
(𝟏. 𝟏 − 𝟏) 𝒈/𝒍
= 𝟎. 𝟑𝟗𝟗𝟗

Step on µm 𝐾=
(0.264 − 0.173)𝑔/𝑙
(0.55 − 0.5) ℎ−1
= 1.81334𝑔/(𝑙 ∗ ℎ)

Step on ks 𝐾=
(0.15068 − 0.1733)𝑔/𝑙
(0.11 − 0.1)𝑔/𝑙
= −2.2653

Step on u (= 𝐾=
(0.00558 − 0.17333)𝑔/𝑙
(0.187 − 0.17) ℎ−1
F/V) = −9.86812 𝑔 ⁄(𝑙 𝑚𝑖𝑛)

1.5 Discussion
The first column of plots illustrates the effect of an increased substrate concentration in the
feed stream. Both the cell and substrate concentration initially increase as a result of this
step change. After a certain period of time, the cell concentration reaches a new, higher
steady state situation. The substrate concentration follows another trend and makes a jump
before it reaches a new higher steady state value. These trends could be explained by the
autocatalytic and exponential characteristics of the growth process. As long as substrate is
provided, cell growth is stimulated and cells continue to multiply themselves. The jump
could be explained by overreaction. The cell growth needs some time to adapt to the
increased substrate concentration. After the step change, the cells begin to consume the
substrate more rapidly, causing the decrease, but stabilization between consumption and
substrate concentration is eventually reached.

The second step change is an increase in the maximal specific growth rate, µm. This causes
an increase in cell concentration and decrease in substrate concentration, both curves
reach a new steady state value. This is in line with what we would expect as a higher µ m
means a higher reaction rate, this in turn means that substrate is being converted into cells
faster. It is therefore not surprising that the cell concentration goes up and the substrate
concentration goes down until a new equilibrium is reached.

7
The third series of plots correspond to a step change in ks and result in the opposite trend.
The Monod constant, ks, is a specific parameter depending on the organism and represents
the relationship between growth rate and substrate concentration. A high value corresponds
to low substrate affinity, meaning that high concentrations of substrate are necessary to
reach half of the maximal growth rate 1 . Thus, the step change causes that higher
concentrations of substrate are needed to obtain the same growth process. The other
parameters, such as the feed’s substrate concentration, are kept constant. Consequently,
the growth rate slows down, which results in an increase in substrate concentration and a
decrease in cell concentration.

The last series of plots illustrate the effect of an increase in the input, or F/V. We previously
assumed that the volume of the tank is kept constant, therefore an increase in u means that
the flow of the feed stream increases. This causes that the product stream also has a flow
increase. Due to this change, substrate comes in faster while product and cells are removed
faster and the cell concentration in the reactor decreases.

All these trends make sense in physical terms.

Owens J., Legan J. (1987). Determination of the Monod substrate saturation constant for
11

microbial growth. FEMS Microbiology Letters. 419-432, 46(4)

8
2 Part 2: Controller design
In this part we attempt to design a controller for the process we modelled in part one. We
start this discussion by proposing a feedback controller and choosing if we want to add
either a cascade controller or a feedforward controller to it. We then compare the simple
feedback with our choice to determine the advantages and disadvantages of each. We end
this part by introducing bode plots and setting one up for our feedback controller.

2.1 Proposed control structures


We have a single-input-single-output system, otherwise known as SISO. Therefore we will
present two different control structures. The first is a feedback controller and for the second
we choose between a feedforward controller and a cascade controller.

Fee dback c ontrolle r

With the feedback controller we want to control the composition of the tank (and outflow).
We thus have a composition controller that measures the composition of the content of the
tank and then adjusts the valve position of the inlet stream. This process in shown in figure
3, here a black line refers to mass flow and a red line is a flow of information to a controller.
The block diagram for this process is then given in figure 4.

Figure 3: flow sheet for feedback controller

9
Figure 4: block diagram

Fee df orwa rd c ontrolle r

For the second controller we chose a feedforward controller over a cascade controller. We
made this decision because we are already using the flow, the most common slave
controller, as manipulated variable and so it is not very useful to also use it as a slave
controller. We propose a feedforward controller that uses measurements of the substrate
concentration in the feed stream to control the valve position of the feed stream. This
conformation is given in the flow sheet in figure 5 and the block diagram in figure 6.

Figure 5: flowsheet for feedforward controller

10
Figure 6: block diagram for feedforward controller

2.2 Controller tuning


Obta ining the tra nsfe r f unctions

We continue by identifying the transfer function of our inputs to our outputs. For this we use
the step experiments from part 1. We use the following formula to calculate the transfer
functions:
𝑘
𝑔(𝑠) =
𝜏∗𝑠+1
We already calculated k, the steady state gain, in part one, these calculations can be found
in table 2. And are repeated in the full overview in table 3. τ, the time constant, is determined
from the graphs in figure 2. It is defined as the difference between the initial start of the
change in the measured variable and 63% of the total change in the measured variable.
Table 3: calculations transfer functions

y0 y step0 step SS gain 0,63% τ


sf 0,173333 0,213332 1 1,1 0,39999 0,198532 55,7263
µm 0,173333 0,264 0,5 0,55 1,81334 0,230453 25,2555
ks 0,173333 0,15068 0,1 0,11 -2,2653 0,159062 53,1906
u 0,173333 0,005575 0,17 0,187 -9,868115294 0,067645 87,3719

With these values we can formulate the transfer functions for each disturbance as well as
for the input u.
−9,8681
𝑔𝑢 (𝑠) =
87,3719 ∗ 𝑠 + 1

11
0,39999
𝑔𝑆𝑓 (𝑠) =
55,7263 ∗ 𝑠 + 1
1,81334
𝑔𝜇𝑀 (𝑠) =
25,2555 ∗ 𝑠 + 1
−2,2653
𝑔𝐾𝑆 (𝑠) =
53,1906 ∗ 𝑠 + 1
PI c ontrolle r

We use these transfer functions to tune the PI controllers with the SIMC tuning rules. We
determine Kc, the controller gain and τI with the formulas given below:
1 1 𝑘
𝐾𝑐 = ∗ 𝑤𝑖𝑡ℎ 𝑘 ′ =
𝑘′ (𝜃 + 𝜏𝐶 ) 𝜏

𝜏𝐼 = min (𝜏, 4 ∗ (𝜏𝑐 + 𝜃))

To determine τC we assume tight control. We could choose τC=Θ, but as we have no delay
this would mean that τC=0 which would lead to the controller not being very robust. We
therefore compare different possible values going from τC=τ/2 to τC=τ/10. We determine
which τC we will use in the future by comparing the results from our simulations (more about
simulations can be found in section 2.4) and their integrated absolute error (IAE). The plots
for τ/2 and τ/10 can be seen in figures 7 and 8 and the values of the integral absolute error,
IAE, are given in table 4. It is evident from this that the smaller we choose τC, the smaller the
IAE and the quicker the response. This would theoretically mean a better controller which
makes sense as we go closer to a value of zero for τC. In reality the controller could become
unstable which is why we do not go further than τ/10. For further calculations we use τC= τ/10.

12
Figure 7: simulation for τc = τ/10

Figure 8: simulation with τc = τ /2

Table 4: The integrated absolute error for different values of τc.

Chosen τc IAE
τ/2 0.8989
τ/4 0.4495
τ/6 0.1998
τ/8 0.1165
τ/10 0.1003

13
We now calculate KC and τI :
1 1 𝜏 1 10 10
𝐾𝑐 = ∗ = ∗ 𝜏 = = = −1,01336
𝑘′ (𝜃 + 𝜏𝐶 ) 𝑘 0 + 𝑘 −9,83812
10
𝜏𝐼 = min(𝜏, 4 ∗ (𝜏𝑐 + 𝜃)) = min(87,3719 ; 4 ∗ 8,7372) = min(87,3719 ; 34,94) = 34,94

Fee df orwa rd c ontrolle r


−𝑔𝑑
The transfer function for the feedforward controller could be obtained using 𝑐𝐹𝐹 = 𝑔
where gd is the transfer function of the disturbance, which is the substrate feed stream (s F),
and g is the process transfer function. This formula is used, assuming that the feedforward
controller is ideal with a perfect measurement of the disturbance. The process transfer
−9.9 0.4
function g is 87.4𝑠+1 , and the disturbance transfer function g d is 55.7𝑠+1 . Therefore 𝑐𝐹𝐹,𝑖𝑑𝑒𝑎𝑙 =
0.4
−𝑔𝑑 − 34.9𝑠+0.4
= 55.7𝑠+1
−9.9 = . For cFF to be realizable, the order of the pole polynomial needs to
𝑔 549.9𝑠+9.9
87.4𝑠+1

be greater than or equal to the order of the zero polynomial, which is the case. Furthermore,
the delay cannot have a negative value, which is also not applicable. Lastly, a too high value
for the gain needs to be avoided, which is again not the case.

2.3 Bode plot


To obtain the Bode plot, L(s) = g(s) * c(s) had to be determined, where g(s) is the process
transfer function and c(s) is the PI-controller transfer function. This gives the following
equation:

𝑘 𝜏𝐼 𝑠 + 1 𝑘𝐾𝑐 𝜏𝐼 𝑠 + 𝑘𝐾𝑐 𝑘𝐾𝑐 (𝜏𝐼 𝑠 + 1) 10(34.9𝑠 + 1)


𝐿 =𝑔∗𝑐= 𝐾𝑐 = 2
= =
𝜏𝑠 + 1 𝜏𝐼 𝑠 𝜏𝐼 𝜏𝑠 + 𝜏𝐼 𝑠 𝜏𝐼 𝑠(𝜏𝑠 + 1) 34.9𝑠(87.4𝑠 + 1)

L(s) has one zero, corresponding to T = 𝜏𝐼 𝑠 = 34.9 and two poles, in which one has the same
value of the zero, and the other one is 𝜏1 = 87.4. In the bode plot the poles and zeros
determine the break frequencies. The gain margin (GM) is defined as 1/ |L(jω180)|, where the
phase is -180° and is infinite. The phase margin (PM) can be calculated as the phase at ωc +
180°, in which |L(jωc)|=1 and has a value of 89° (Figure 9).

14
Figure 9: Bode plot of feedback. The magnitude is given in absolute value, the phase in degrees. The magnitude and
frequency axis are in log-scale. Break frequencies, corresponding to the poles and zeros of L(s) are illustrated in dashed
lines. The first one is a pole, the second one corresponds to a pole and zero, since these had the same value. The gain
margin (GM) is infinite, the phase margin (PM) is illustrated as full black line.

Figure 10: Bode plot of feedback with asymptotes. The slope is steeper between the two break frequencies (pink). The left
(green) and right (blue) parts of the break frequencies have the same slope.

2.4 Simulations
We continue this discussion by simulating the proposed control structures in Simulink, the
Simulink structures can be found in the appendix. We observe the closed-loop behavior by
applying step changes in the disturbances and set point with an increase of 10% from the
15
nominal value. We also calculated the IAE value for both process, this gave an IAE of 0.1003
for the feedback process and an IAE value of 0.1013 for the feedforward process.

Figure 11: simulation feedback model

Figure 12: simulation feedforward model

2.5 Results
The bode plot gives an indication of the stability of the process. The closed-loop system is
stable if the loop gain corresponding to ω180 ((|L(jω180)|) is less than 1. ω180 is the frequency
where the frequency shift around the loop L(s) is -180°. Since the phase never crosses -180°,
16
the signal cannot go unstable. Stability is a systems property, meaning that if the system is
stable for this signal, it is stable for all signals. The stability is visible in the plot as the gain
margin (GM) and phase margin (PM). The GM is infinite, meaning that an increase in the gain
will never make the process go unstable. The value of the PM is 81,9°. This is the extra
allowed phase shift, before the system will go unstable.

When comparing the feedforward controller with the feedback controller we see that the
feedforward controller the cell concentration back brings to the steady state value faster
than just the feedback controller on its own. We can also see that the value of the IAE for the
feedforward controller better is than the IAE value for the feedback controller for most of the
values of τC except for τC=τ/10. This might make it seem like the feedback controller is better
but it could also be because we chose a value for τC that is too small in reality. This could
lead to an unstable controller when implemented in the real world.

3 Overall conclusion
We started of the project in part one by analyzing the process we were given, it is composed
of a stirred bioreactor . We classified all our variables and made the necessary assumptions
in order to formulate a non-linear model that describes the process. We found the following
equations for the substrate and cell concentration:
𝑑𝑠 𝐹 µ𝑚 ∗ 𝑠
= ∗ (𝑠𝐹 − 𝑠) − ∗𝑐
𝑑𝑡 𝑉 𝑘𝑠 + 𝑠
𝑑𝑐 𝐹 µ𝑚 ∗ 𝑠
=− ∗𝑐+ ∗𝑌∗𝑐
𝑑𝑡 𝑉 𝑘𝑠 + 𝑠
With these equations we could calculate the steady state values which we used to
implement our model in MATLAB and Simulink. We simulated a 10% step response for the
input u and for all three disturbances from which we then calculated the steady state gains.

In part 2 the objective was to design a controller for our model. We chose two different
control structures: a feedback controller and a feedback controller with a feedforward
controller. From the step response simulations in part one we were able to identify the
transfer functions from our inputs to our outputs:
0,39999
𝑔𝑆𝑓 (𝑠) =
55,7263 ∗ 𝑠 + 1
1,81334
𝑔𝜇𝑀 (𝑠) =
25,2555 ∗ 𝑠 + 1

17
−2,2653
𝑔𝐾𝑆 (𝑠) =
53,1906 ∗ 𝑠 + 1
These transfer functions were then used to implement a PI-controller and a feedforward
controller. We simulated both of these and studied the closed-loop behavior after applying
step changes in the setpoint and the disturbances.

The stability of the closed loop feedback process was illustrated by the bode plot. Since the
gain margin was infinite and the phase margin was greater than 50°, the process can be
assumed stable. Increasing the gain won’t affect the stability, and a phase shift 89° is
allowed before the process will go unstable.

To conclude the report we have some suggestions for in the future. First of all, it would be
nice to get feedback earlier on in the project. We made a mistake when determining our
model and as we only got the feedback two weeks after the first deadline, we had already
started part two with the wrong model. It might have been helpful if there was multiple
deadlines before the final one or if the assistants knew the correct outcome of at least part
of the project. we understand that a project can have different outcomes to it and that a
universal correction key might not be possible for each project but some feedback might be
helpful.

4 Simulink
Simulink part 1

18
Simulink part 2: feedback controller

Simulink part 2: feedforward controller

5 Matlab code
See zip-files.
19

You might also like