116
Simulation modelling of a Fed-batch Bioreactor for controller development Master’s Thesis in Computer aided Mechanical and Manufacturing engineering Neville Lawless 24/8/11 School of Mechanical and Manufacturing engineering DUBLIN CITY UNIVERSITY Glasnevin, Dublin 9, Ireland

Simulation modelling of a Fed-batch Bioreactor for controller development

Embed Size (px)

Citation preview

Page 1: Simulation modelling of a Fed-batch Bioreactor for controller development

Simulation modelling of a Fed-batch

Bioreactor for controller development

Master’s Thesis in Computer aided Mechanical and Manufacturing

engineering

Neville Lawless

24/8/11

School of Mechanical and Manufacturing engineering

DUBLIN CITY UNIVERSITY

Glasnevin, Dublin 9,

Ireland

Page 2: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page II

ABSTRACT

The ability to control the specific growth rate (µ) in fed-batch fermentation is

dependent on the accuracy of real time measurements of biomass

concentration in the reactor. In the Laboratory of Integrated Bioprocessing in

DCU there are numerous means by which these measurements are taken

online, of which Dielectric Spectrometry and Bio-calorimetry are two. These

methods are used in their respective reactors ( Bio-engineering reactor and

Rc1 Biocalorimeter) and the results from each, in various different batches,

has been used to validate two types of simulation models developed.

The first approach taken is termed mechanistic modelling, in which Matlab

has been used to solve ordinary differential equations that have been

demonstrated in other research to provide adequate results. This has led to 3

variations of the Matlab code that uses the Biomass and feed rate data to

successfully model the profile of glucose consumption and estimate the

specific growth rate of Biomass in a fed-batch bioreactor. The best

performance from the 3 variations was through the use of Proportional-

Integral feedback term as a component in an exponential feed rate input. The

PI term was calculated from the error in specific growth rate against a set

point and was fed back into the system to take corrective action.

The second modelling approach which has been taken was through the use of

artificial neural networks. It has been successfully demonstrated that they

provide a much better accuracy in glucose prediction, and specific growth

rate estimation. It was shown that the accuracy for each parameter is

hindered by the scope of the model. A single model for each variable would

yield much better accuracy but the associated robustness of a model that can

be used for prediction of many parameters is then lost and a greater level of

complexity is incorporated into the control system implementation.

Finally, literature has been reviewed on the topic of Bioreactor control. This is

done with a view towards development of a model based estimator of

controller inputs for optimisation of Biomass yield in the reactor.

Page 3: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page III

Acknowledgments

I would sincerely like to thank Mr. Brian Freeland for his continual help and

patience over the course of this project. Without his advice and guidance this

research could not have happened.

I would furthermore like to thank Ms. Moira Monika Schuler for her helpful

contribution to this work, and Mr. Dermot Brabazon for providing the

opportunity to do this thesis, it is much appreciated.

Finally I would like to thank all my family, especially my mam for all the

support over the last five years in college, also my friend and of course my

girlfriend Sarah who has the patience of a saint with me.

Cheers,

Neville.

Page 4: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page IV

Contents

ABSTRACT ..................................................................................................................................... II

ACKNOWLEDGMENTS .............................................................................................................. III

CONTENTS .................................................................................................................................... IV

TABLE OF FIGURES ..................................................................................................................... VI

1 INTRODUCTION ................................................................................................................. 1

1.1 PROCESS ANALYTICAL TECHNOLOGY (PAT) ............................................................................ 3

2 BIOPROCESS MONITORING ............................................................................................ 6

2.1 BIO-ENGINEERING REACTOR .................................................................................................... 6 2.1.1 Dielectric Spectroscopy ..................................................................................................... 9 2.1.2 Rc1 Bio-calorimeter ........................................................................................................ 10

3 BIOREACTOR CONTROL ................................................................................................ 12

3.1 MOTIVATION FOR CONTROL ................................................................................................... 12 3.2 MODELLING A PHYSICOCHEMICAL SYSTEM ............................................................................ 13

3.2.1 Identification of variables and parameters ...................................................................... 13 3.2.2 Application of natural laws relating these variables ....................................................... 14 3.2.3 Mathematical solution of the resulting equations .......................................................... 15 3.2.4 Interpretation of the results ............................................................................................ 15

3.3 STEPS TOWARDS CONTROLLER DESIGN ................................................................................... 15 3.3.1 Open loop control ........................................................................................................... 17 3.3.2 Closed loop/feedback control ........................................................................................... 18 3.3.3 Feedforward control ........................................................................................................ 26 3.3.4 Control Relevant Modeling ............................................................................................ 27

3.4 STANDARD OPERATING PROCEDURES FOR BIOREACTOR CONTROL ...................................... 29 3.4.1 Overview of Control System Design .............................................................................. 29 3.4.2 Steps in Control System Design ..................................................................................... 30

4 SIMULATION MODELLING ............................................................................................ 36

4.1 MECHANISTIC MODEL OF FED-BATCH FERMENTATION .......................................................... 36 4.2 MODEL EQUATIONS ................................................................................................................. 37 4.3 MATLAB CODE WALK THROUGH ............................................................................................ 43

4.3.1 Solving Ordinary Differential Equations ....................................................................... 47 4.3.2 PI-Feedback control ........................................................................................................ 48

4.1 ARTIFICIAL NEURAL NETWORK MODELLING ........................................................................ 51 4.1.1 What is a Neural Network?[1] ....................................................................................... 52 4.1.2 Principles of ANN .......................................................................................................... 53 4.1.3 Neural Network Architecture ......................................................................................... 54 4.1.4 Neural Network Models ................................................................................................. 55

5 RESULTS & DISCUSSION ................................................................................................ 59

MECHANISTIC MODELS .................................................................................................................... 59 5.1 INITIAL CONDITIONS MODEL .................................................................................................. 59 5.2 BIO-ENGINEERING REACTOR .................................................................................................. 60

Page 5: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page V

5.3 RC1 BIO-CALORIMETER REACTOR ......................................................................................... 65 5.4 ANN FOR BIO-ENGINEERING REACTOR ................................................................................. 67 5.5 RC1 BIOCALORIMETER ............................................................................................................. 71

6 ETHICS & RESPONSIBILITY ........................................................................................... 74

7 CONCLUSION .................................................................................................................... 75

8 APPENDIX A ....................................................................................................................... 77

8.1 MATLAB MODEL WITH FEED-RATE ESTIMATION FOR S AND µ PREDICTION .......................... 77 8.1.1 Start model ..................................................................................................................... 77 8.1.2 F and µ estimation function ........................................................................................... 80 8.1.3 Substrate prediction function ......................................................................................... 81

8.2 MATLAB MODEL WITH FEED-RATE INPUT FOR S AND µ PREDICTION ..................................... 82 8.2.1 Start model ..................................................................................................................... 82 8.2.2 F and µ estimation function ........................................................................................... 83 8.2.3 Substrate prediction function ......................................................................................... 83

8.3 MATLAB MODEL WITH FEEDBACK CONTROL FOR S AND µ PREDICTION ................................ 83 8.3.1 Start model ..................................................................................................................... 83 8.3.2 F and µ estimation function ........................................................................................... 87 8.3.3 Substrate prediction function ......................................................................................... 87

9 APPENDIX B ........................................................................................................................ 88

9.1 BIO-ENGINEERING REACTOR .................................................................................................. 88 9.1.1 Reactor Data with Feed rate estimation.......................................................................... 88 9.1.2 Reactor Data with Feed rate input ................................................................................. 93 9.1.3 Reactor Data with Feedback control ............................................................................... 95

9.2 RC1 BIO-CALORIMETER REACTOR ....................................................................................... 101 9.2.1 Rc1 with Feed rate estimation ...................................................................................... 101

10 REFERENCES .................................................................................................................... 108

Page 6: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page VI

Table of figures

FIGURE 1: BIOENGINEERING REACTOR SCHEMATIC SETUP [2] .................................................................................... 8

FIGURE 2: EXPERIMENTAL SET-UP WITH A 3.6 LITERS BIOREACTOR (1) FROM BIOENGINEERING. ............................... 8

FIGURE 3: DIELECTRIC CAPACITANCE PROBE ............................................................................................................. 9

FIGURE 4: RC1 EXPERIMENTAL SETUP ....................................................................................................................... 11

FIGURE 5: RC1 BIO-CALORIMETER WITH CONTROL IMPLEMENTATION. ................................................................... 11

FIGURE 6: SIMPLE DIAGRAM ILLUSTRATING OPEN LOOP CONTROL. [3] .................................................................... 18

FIGURE 7: SIMPLE BLOCK DIAGRAM INDICATING THE CLOSED LOOP FEEDBACK PROCESS. [3] .................................. 20

FIGURE 8: DIFFERENT CONTROLLER ACTION RESPONSES [3] .................................................................................... 21

FIGURE 9: SCHEMATIC DIAGRAM OF A CONTINUOUS BIOREACTOR [4]. .................................................................... 23

FIGURE 10: DEPENDENCE OF EFFLUENT CELL CONCENTRATION X,SUBSTRATE CONCENTRATION S,PRODUCT

CONCENTRATION P ON CONTINUOUS CULTURE DILLUTION RATE D AS COMPUTED FROM THE MONOD

MODEL [4]. .................................................................................................................................................... 24

FIGURE 11: TRADITIONAL FEEDFORWARD-FEEDBACK STRUCTURE ........................................................................... 27

FIGURE 12: BLOCK DIAGRAM OF FEEDING STRATEGY UTILIZING ESTIMATED VARIABLES. [5] ................................... 28

FIGURE 14: ILLUSTRATION OF MULTIPLE PROCESS VARIABLES [6] ............................................................................ 30

FIGURE 15: SYSTEM STABILITY IS DEEMED OK IF A2/A1 ≈ 1/4 ACCORDING TO ZIEGLER AND NICHOLS. [7] ........... 33

FIGURE 16: STEP RESPONSE OF THE ZIEGLER-NICHOLS’ OPEN LOOP METHOD. ....................................................... 33

FIGURE 17: ZIEGLER-NICHOLS’ OPEN LOOP METHOD: THE EQUIVALENT DEAD-TIME L AND RATE R READ Off FROM

THE PROCESS STEP RESPONSE. [7] ................................................................................................................... 34

FIGURE 18: LINEARIZED PLOT OF CELL MASS AS A FUNCTION OF TIME [8] ............................................................... 38

FIGURE 19: PROFILES FOR X,S,V,F AND MU GENERATED BY A MODEL CREATED BY ENFORS AND CO-WORKERS [9] ....................................................................................................................................................................... 39

FIGURE 20: SCHEMATIC REPRESENTATION OF DEFINITION OF KS FOLLOWING MONOD KINETICS . .......................... 41

FIGURE 21: SCHEMATIC DIAGRAM OF NUMERICAL INTEGRATION BY SIMPSON ’ S RULE. .......................................... 48

FIGURE 22: FLOW CHART DESCRIBING MODEL SIMULATION STEPS. ITS INCLUSION HERE AS PART OF AN ONLINE ... 50

FIGURE 23: STRUCTURE OF A BIOLOGICAL NEURON. [1] ........................................................................................... 52

FIGURE 24: MULTIPLE INPUT NEURON (LEFT) AND TYPICAL DIAGRAM OF AN ANN WITH 2 HIDDEN LAYERS (RIGHT)

[10] ................................................................................................................................................................ 54

FIGURE 25: INITIAL CONDITIONS MODEL .................................................................................................................. 59

FIGURE 26: : FEED RATE ESTIMATION PROFILES GENERATED BY A POLYNOMIAL EQUATION FITTED TO THE MEAN OF

THE PROFILES ................................................................................................................................................. 61

FIGURE 27: F05 SUBSTRATE PREDICTIONS ................................................................................................................ 63

FIGURE 28: F06 SUBSTRATE PREDICTIONS ................................................................................................................ 64

FIGURE 29: F07 SUBSTRATE PREDICTIONS ................................................................................................................ 64

FIGURE 30: F08 SUBSTRATE PREDICTIONS ................................................................................................................ 65

FIGURE 31: OFFLINE BIOMASS FOR BATCH F04 ........................................................................................................ 66

FIGURE 32: OFFLINE GLUCOSE CONCENTRATION FOR F04 ....................................................................................... 66

FIGURE 33: NEURAL NETWORK PREDICTION OF BIOMASS FOR THE BIO-ENG REACTOR ............................................ 69

FIGURE 34:NEURAL NETWORK PREDICTION OF GLUCOSE CONCENTRATION FOR THE BIO-ENG REACTOR ................ 69

FIGURE 35: NEURAL NETWORK PREDICTION OF SPECIFIC GROWTH RATE FOR THE BIO-ENG REACTOR ..................... 70

FIGURE 36: ANN FOR BIOMASS PREDICTION IN THE RC1 ........................................................................................ 72

FIGURE 37: ANN FOR PREDICTION OF SPECIFIC GROWTH RATE FOR THE RC1 ......................................................... 73

Page 7: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 1

1 Introduction

Bioreactor monitoring and control is an essential research area in the

Bioprocessing industry. As is evident in most industries, the ability to

implement procedures by which a product can be processed, in a fashion that

is repeatable and controllable, which yields a high level of quality at a low

production cost is an absolute necessity. In an initiative set out by the FDA in

2004 titled: ‚PAT — A Framework for Innovative Pharmaceutical

Development, Manufacturing, and Quality Assurance‛ [11], a heavy

emphasis is placed on acquiring as much knowledge as is possible on the

system being used. Due to this, the development of methods which can be

applied globally for on-line process monitoring has seen much attention. It

has been spurred from this, that biopharmaceutical companies are motivated

to upgrade their monitoring tools to guarantee a pre-defined final product

quality. [12]

As the majority of advances in the area of bioprocesses control are known to

occur at an academic level, this PAT initiative lends itself well to smaller scale

lab’s in universities worldwide.

Currently in The laboratory of integrated Bioprocessing in DCU, one of the

notable areas of which there is research being conducted is the growth of yeast

cells using fed-batch Bioreactors. With these there are numerous

measurement techniques being employed with the use of various different

sensors to fully monitor and control the processes. The incorporation of

‚Software sensors‛ in the bioprocess as another tool for control has shown

promising results so far. Software sensors are mathematical models which use

the various different process measurements from other sensors to predict

other state variables inherent to the system. Presently there has been great

Page 8: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 2

developments implementing these ‚soft sensors‛ with the use of data

reconciliation, An example of which can be found in a work by Dabros et. al.,

[13]. However, classical control theory has not yet been implemented by

means of feedback and feed forward control loops .

The main aim of this project is the development and subsequent

implementation of these controllers using experimental data sets which have

been obtained from different Batches of experiments. It is hoped that

simulation models can be developed which can be used for online simulation

of process parameters such as the substrates glucose concentration levels and

the specific growth rate of biomass in the reactor. Both of which are important

process parameters in fed-batch production of yeast.

As stated previously, knowledge of the processes in question is fundamental

to any work carried out in this area. This includes the methods by which

measurement of important process parameters are carried out. In the context

of the LiB in DCU, techniques being employed include Dielectric

Spectroscopy, and Bio-calorimetry for measurement of Biomass concentration.

An off-gas analyser to produce readings for CO2 and O2 levels in the culture

and a Fourier-transform mid-infrared (FTIR) spectrometer for determination

of concentrations of glucose, ethanol and ammonium. A concise explanation

of these shall be given and the experimental setup for the two Bioreactor’s

given.

Prior to the development of any simulation models, a review of classical

control literature shall be presented. The understanding of the various modes

of operation of control systems is a requisite to understanding how such

models can be implemented. Having done this the standard operating

procedures for setting up a control system shall be discussed.

Page 9: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 3

Having completed all these tasks, the final aim of this work is the

development of simulation models which can ultimately be used as soft

sensors. Two approaches shall be taken with these. The first being a

mechanistic model which makes use of ordinary differential equations base on

the Monod equation to model the system in a Matlab coding platform and the

second being the use of artificial neural networks as a means of non-linear

modelling of various process parameters.

1.1 Process analytical technology (PAT)

What is PAT? [14]

PAT is an initiative set out by the FDA [11] in 2004 which recommends a

system for:

the design of, analysis of and control of Bioprocesses in industry.

the incorporation of more frequent processing measurements

creating critical quality and characteristics of high performance

raw and in-process materials

So in essence its focus is on gaining a full understanding of the manufacturing

process and its control.

There is laid out in it, two components; the first is the underlying scientific

principles and tools which aid in supporting innovative research and the

second is a regulatory strategy which accommodates this innovation by

means of inspections and reviews of processes as a team and also of training

and certification of staff [14]

Page 10: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 4

In the PAT framework it is made abundantly clear that quality of products

cannot be guaranteed by tight inspection, rather it should be designed into the

process.

In a review of the guidelines, Watts [14], defines process understanding as:

being able to identify all sources of variability and explain their

occurrence

management of variability through the process

all levels of quality of products can be readily predicted with good

accuracy.

It is apparent that validation tasks which need to be carried out can be more

easily accomplished when the process is well defined and understood.

Suggesting that the PAT initiative is beneficial for both economic growth of

the company as well as the increased quality of produced products.

The 4 key tools used in Process analytical technology are:

1. the use of Tools for Design, Data Acquisition and Analysis:

as with most Bioprocessing routes there are few which possess simple

linear relationships with only 2 input parameters.

Usually the products and processes are complex multi-factorial

systems containing physical, chemical, biological relationships which

need to be analysed using statistical techniques like design of

experiments

Mathematical relationships can be employed to provide accurate model

predictions and can be assessed by statistical evaluation. (The method

developed further in this work)

Page 11: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 5

2. Process Analysers which determine system parameters

These can be carried out Online, Inline or at-line

They need not be absolute values of attributes but fall within a

predefined accuracy range.

3. Process Control Tools

These are highly reliant on the capability and reliability of the above

mentioned process analysers to measure critical attributes.

They Monitor the state of a process and in real time manipulate it to a

desired level or set point.

Multivariate statistical process control is now becoming a tool which is

feasible and valuable for implementing real time measurements.

4. Continuous Improvement and Knowledge management tools

By learning from continuous data collection and analysing of statistics

over the life cycle of a product can yield process improvements.

Changes which can be incorporated can be justified with an assortment

of data to back up the proposals.

Continuous improvement should be carried out within products and

processes

Having gained an insight into PAT, it is intended that at all times throughout

this work that its motives shall be put into practice where possible.

Page 12: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 6

2 Bioprocess Monitoring

For the simulation modelling carried out within this work; all experimental

data has been provided by the Laboratory of integrated Bioprocessing in

DCU, this data has been acquired from two fed-batch Bioreactors. These are

termed the

1. Bio-Engineering Reactor and

2. Rc1 Bio-Calorimeter reactor.

Each lends itself to a different approach of providing online Biomass

concentration readings.

2.1 Bio-Engineering Reactor

Figure 1 and Figure 2 below gives an indication of the bioprocess monitoring

system used with the Bio-Engineering Reactor.

Values for the substrate components such as glucose, ethanol and ammonium

were acquired from a Fourier-transform mid-infrared (FTIR) spectrometer (2)

(ReactIRTM 4000, Mettler-Toledo, Greifensee, Switzerland), [13] which is

connected to the reactor and equipped with a thermostat (3) for temperature

control of the flow cell and a membrane pump (4) from ProMinent to allow

the circulation of the culture broth.

Biomass concentration readings were obtained by a technique known as

Dielectric spectroscopy which was carried out with a Biomass Monitor 210 (5)

from Aber Instruments (Aberystwyth, UK),[13]. The next section will discuss

Dielectric spectroscopy in greater depth.

The composition of CO2 and O2 in the culture has been obtained separately to

the Biomass by use of a lab scale off-gas analyser (6) (Duet,

Page 13: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 7

AdvancedBioSystems Ltd, UK), [13] in which the exhaust air flows though

after a passage through a Wolff bottle (7).

The amount of base consumed to control the cultures PH is monitored by a

balance (9) from Mettler Toledo connected to LabVIEW through an acquisition

card. The PH level is monitored by a pH probe (8) from Bioengineering.

Temperature is monitored and controlled through a temperature probe (10)

Pt1000 from Bioengineering. Stirring speed of the two blade Rushton turbine

stirrer is controlled through a stirrer speed controller (12) from

Bioengineering. A laboratory scales (PG5001-S, Mettler-Toledo, Greifensee,

Switzerland) connected to LabVIEW through a data acquisition card was

used to determine the feed-rate of medium into the reactor (13) which is

pumped through a peristaltic pump into the reactor.

The air flow entering the reactor is kept constant by an air flow meter (14). The

circulation of the cooling liquid (water) for the reactor as well as of its

condenser is assured by a cryostat from IG and a peristaltic pump (15). The

data emanating from the different devices are saved through a data

acquisition system piloted by LabVIEW on a PC (16).

All banks of data are stored in excel files.

The Batches used were Batches F05-F08 from the Bio-engineering

reactor and

Batches March 2nd, April 12th, April 29th, May 14th and May 19th for the

Rc1 reactor.

There was no bias given to which data was chosen.

Page 14: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 8

Figure 1: Bioengineering reactor schematic setup [2]

Figure 2: Experimental set-up with a 3.6 litres bioreactor from Bioengineering.

Page 15: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 9

2.1.1 Dielectric Spectroscopy

In recent years, the use of Dielectric spectroscopy has seen a lot of growth due

to its incorporation into the fermentation process. Its use as an in situ method

of determining viable cell density in a bioreactor lends its self effectively as a

tool for online Biomass monitoring. [12]

Dabros et. al., have demonstrated in recently published work that its use

yields a simple methodical approach for determination and control of the

specific growth rate of biomass in real time. [13]. The work which has been

carried out for said paper has provided the experimental background and

subsequent data that has led to the simulation modelling of a bioreactor in

this work found in section 4 later.

Figure 3: Dielectric capacitance probe

A paper by Teixeira explains that the technique employs the electrical

properties associated with cells when they are exposed to an electrical field.

When this radio frequency electrical field is applied through the culture, a

charge separation or a polarisation occurs through the plasma membrane.

Each cell then acts as a capacitor as the plasma membrane has the property of

being non-conductive. The capacitance signal generated then is dependent on

the volume, concentration and type of cells. As the technique requires intact

plasma membranes, only viable cells are measured. [12] A slight disadvantage

Page 16: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 10

to using Dielectric spectroscopy is that the combination of a noisy signal and a

small vessel, results in interference from components like the agitator and

baffles in the bioreactor leading to further dielectric filtering techniques being

required.

2.1.2 Rc1 Bio-calorimeter

A detailed schematic diagram of the Rc1 Bio-calorimeter and the control

system which is in place in the DCU Laboratory of integrated Bioprocessing is

given in Figure X Biomass concentration readings were obtained from a

technique known as calorimetry. It has been shown in a famous work by Von

Stockar that the heat generated in the production of microbial cultures can be

used as a consistent tool for Biomass estimation. [15]

This reactor configuration is set-up with a 2 liters RC1 Biocalorimeter from

Mettler Toledo equipped with standard probes such as a pH probe (2) from

Bioengineering and a probe for dissolved oxygen (3) from Bioengineering.

The air flow entering the reactor is kept constant by an air flow meter (4).

The Biomass Monitor BM 210 used with the Bioengineering reactor is also

used in this case (5) and is connected to the RC1 Biocalorimeter.

A peristaltic pump (6) controlled by LabVIEW (8) is used to add the substrate

feed in a controlled manner into the bioreactor, the added amount of feed is

monitored through a balance from Mettler Toledo. Another balance (7) as well

as a peristaltic pump (not shown on picture) are used to add base to the

bioreactor to keep the pH constant. This system was set up by Dr.

Senthilkumar Sivaprakasam and Brian Freeland and the process steps kindly

explained by Moira Schuler.

Page 17: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 11

Figure 4: Rc1 experimental setup

Figure 5: Rc1 Bio-Calorimeter with control implementation.

Page 18: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 12

3 Bioreactor Control

3.1 Motivation for Control

The use of Bioprocesses to produce pharmaceutical products can be classified

by the process route taken. The three basic modes of bioreactor operation are

batch, fed-batch or continuous. Batch type processes can be characterized by

numerous different traits [16]; they can be broadly defined as having;

Time variability, which leads to much ‘Ill-defined’ processes. This in

turn yields the problem of precise repeatability from batch to batch.

Non-linearity as an intrinsic attribute with most batch chemical

reactors.

The problems faced with accurate analytical modelling.

In the context of this work, fed-batch cell production is the process route

which shall be referred to and is the method by which all experimental data

used for simulation modelling was obtained.

The use of Batch bioreactors necessitates the implementation of control

algorithms, to recompense the huge complexities inherent in the system. As

stated above, this is due to the nonlinear, time-varying nature of real life

dynamic processes. [17]

In the case of a fed-batch fermentation process, microbial growth (biomass

concentration) in the bioreactor occurs in an exponential type profile over the

course of the batch. With this, the associated amount of heat and carbon

dioxide produced increases, as does the demand for oxygen. Unlike linear

processes, as these variables fluctuate and grow, no steady state is reached.

Hence, the problem for controller development is presented. [18]

It is clear that to obtain an efficiently working system, performing in its

optimal range and operating as precisely as possible, the ability to be able to

Page 19: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 13

dynamically control it is vital. It is at this point that more advanced control

methods come into play as more fundamental, robust techniques don’t have

the same chance of success[16]. Prior to attempting to develop a controller for

a bioreactor, one should be able to implement a mathematical model of the

system. Without this, the further development of any controls will be severely

hindered.

The following section is intended to give an insight to the requirements for

model development

3.2 Modelling a physicochemical system

The steps for modelling a physicochemical system are set out below [3].

Although these are straightforward, the resulting models can grow to great

complexities due to the large number of interactions in a system.

3.2.1 Identification of variables and parameters

The definition of a system is ‚A group of interacting, interrelated, or

interdependent elements forming a complex whole.‛ [19]

In essence, these elements are either inputs or outputs, and although there is a

huge level of interaction, from an control perspective we do not care as much

as to what occurs internally in the system, but rather, we require to be able to

determine what outputs will be generated from known inputs. This can be

deemed a black box model of sorts.

For the case of a fed-batch bioreactor and the data provided for the use of this

work, some typical variables can be identified as: Biomass concentration (x),

Substrate (glucose) concentration (s), Reactor Volume (V), Oxygen uptake rate

(OUR), Carbon dioxide evolution rate (CER) and temperature (T), specific

Page 20: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 14

growth rate of the biomass is () and the feeding rate is given by F(t) [20],

Many other parameters can be further specified if required.

3.2.2 Application of natural laws relating these variables

The use of conservation laws gives rise to governing equations which can

successfully model the bioreactor. For instance; The principle of the

conservation of mass when applied to a dynamic system says: [21]

From these laws, complex interactions in the Bioreactor can be simplified to a

desired level, adequate for simulation modelling of the process. In this

instance the governing laws are given in a paper by Enfors [9]. Their inclusion

below is merely for the purpose of clarity and to convey the form that they

hold. They shall be dealt with in more detail in further chapters.

(1)

(2)

(3)

(4)

(5)

Page 21: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 15

3.2.3 Mathematical solution of the resulting equations

The equations that have been constructed can now be solved by restating

them in terms of a deviation variable, relative to a set point, preceding any

changes in the system and solved as ordinary differential equations. [3] Or

rather, in terms of a dynamic nonlinear system; it is required that the state

variables determine what the current position of the system is over the course

of a feeding profile trajectory, through the operational cycle, and making

dynamic comparisons against this instantaneous set point . [18]

3.2.4 Interpretation of the results

Having achieved the desired goal of modelling the system, the results can be

laid out in a meaningful manner and implemented in the design of a control

algorithm for the system process. All this is done with a view towards

successful and robust automated control of the bioreactor fermentation

process.

3.3 Steps towards controller design

1. The empirical approach for controller design: This approach is a

common method for achieving a simple controller design. By means of trial

and error, the dynamic behaviour of the bioreactor outputs are determined by

making small step changes to the inputs. [18] The classic example of this,

which conveys the simplistic nature of it, is the use of a manually controlled

shower. In it a person adjusts the flow of hot water to be mixed with cold, so

Page 22: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 16

as to achieve a comfortable temperature or process set point. If the output

flow is too cold, they step up the flow of hot water. If the output is too hot

they step down the flow of hot water. This approach is employed during

controller tuning, it shall be dealt with in more detail in section 3.4.2

2. The model based strategy for controller design: This more

fundamental step towards controller design is also an important aspect of the

system model development given in section 4. This is a more scientific,

methodical approach, required for complex systems. It requires the

formulation of mass and energy balances to be carried out on different aspects

of the bioreactor. From these, ordinary differential equations can be

constructed. These will be nonlinear in nature for the scope of a fed-batch

bioreactor. [22] As a direct result of this, traditional methods of transfer

function based control theory fail to provide an adequate means of estimating

the systems behaviour over the course of the batch; this is because a single

transfer function is unable to account for the performance of the system over

the path of the growth cycle. [23] The lack of a steady state for comparison

leads to greater errors over the trajectory of the growth path. In his work,

Berber discusses the limitations that conventional control techniques have due

to this fact and therefore, the likelihood that they can be successfully

implemented with precise accuracy is not great [16] [23]. Luckily with

developments in the field of process control there have now become available,

methods, which can be applied to the area of fed-batch Bioreactors.

For the design of controllers, there are two broad classifications which can be

given to the type of strategy used for control design. These are; open loop or

closed loop control. These need to be understood prior to any algorithm

design and shall be made clear in the next two sections.

Page 23: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 17

3.3.1 Open loop control

The first step in implementing a controller is to understand the use of an open

loop. Open loop control, in the context of fed-batch bioreactors, involves

using a process model to generate a feeding profile or feed rate data from

previous batches. This yields an optimal state towards which the biomass

growth can be controlled. [23] Measurement of the output is recorded for

analysis of the system but this measurement is not used directly to feedback to

the controller to alter the inputs during the operation, thereby leaving the

connection between the output and inputs open. Hence the term open loop

control.

Traditionally, in industrial situations, fed-batch production is carried out in

this open loop manner using growth rate feeding profiles which have been

developed prior to production. [22]. Usually this is carried out by operators

trained to monitor and control the system. Process knowledge gained from

experience can alert operators to problems with the help of Data acquisition

and supervisory control systems [24].

In Figure 6 below [3], the open loop concept is simply displayed using an

example of a primitive heat exchanger, in which a valve is opened or closed to

control the temperature according to a set input profile which has been pre-

determined. As is clear from the diagram there is no connection between the

heat exchanger output and its input.

Page 24: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 18

Figure 6: Simple diagram illustrating open loop control. [3]

If at any point an operator uses the temperature sensor as an indication that

the process is deviating from its desired operating point and then alters the

flow of steam, the process loop is then said to be closed and feedback is being

used as a method of control.

3.3.2 Closed loop/feedback control

Over the last decade or so, great developments have been made in the area of

fed-batch control. These follow trends set in the area of chemical engineering

but have been slower to be successfully implemented due to the complexities

arising in the fed-batch production route.

A number of reasons, discussed in work by Mkondweni, and also in works by

Chen have led to the incorporation of on-line feedback loops, which have thus

led to advanced control strategies in the yeast growing process. [22]. [25]

These are:

1. The playoff which arises between productivity/efficiency and yield.

2. The ability to have reproducible and uniform yeast cultivations with

each batch, which can meet the requirements of the FDA and the PAT

Page 25: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 19

initiatives. This cannot be accomplished without well-developed

feedback control

3. The production of inhibiting substances in the batch can be enhanced

by the level of ethanol, and so, online control is necessary to limit this.

The premise of feedback control can be summarised in the following steps

given in [3] :

An output variable from the system is measured using a device called a

transducer or sensor. This variable can be termed Xm and usually varies

with time.

This value is then compared to a desired value or set point. Denoted

here as Xsp (making sure that Xm and Xsp both have the same units). The

deviation between the two values is the measured error. It is denoted:

e(t) = Xsp - Xm(t). The summing junction that calculates this is termed the

comparator.

The controller for the system is fed this deviation value and then acts

on the process and manipulates the variable X according to size of the

error e(t).

These three steps can be visualised in Figure 7 below using the simple

example again of a basic heat exchanger in which the controller alters the flow

of steam through the valve by means of an actuator ( not indicated here),

which is either electrically or pneumatically driven, thereby closing the loop

on the process.

Page 26: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 20

Figure 7: Simple block diagram indicating the closed loop feedback process. [3]

The next section intends to give a basic understanding of the types of

controllers available and the traits that each particular one has.

3.3.2.1 PID Control

There are three types of operating characteristics or actions available when

selecting a controller for a process, with different types more suited to

different situations.

Proportional action control: In this case the control acts at a given

instance of time. The output which the controller produces that acts on the

process is proportional to the error signal at a given time.

It is denoted P and its output takes the form: u(t) = KP e(t)

Integral action control: This controller acts over an accumulative

length of time, the output which the controller produces is proportional to an

integral of the error signal from an earlier time to the present

It is denoted I and its output takes the form: u

Derivative action control: In this case the output from the controller is

proportional to the slope of the signal at a given time, due to this; the

derivative controller is directing itself to where the error signal is going. Or in

essence it is predicting the error.

Page 27: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 21

It is denoted D and its output takes the form:

Figure 8: Different controller action responses [3]

These controller actions may also be combined into a single controller, termed

a PID, (proportional, Integral and derivative control). This is the most widely

used control algorithm and its equation (6) is given below [26]

Where:

u(t) is the controller output. e(t) = controllers variable error

Kp = Proportional gain Ki = Integral gain

Kd =Derivative gain

= Reset time = KC / Ki = Rate time or derivative time = KC * Kd

Although the discussed PID configuration of; P, I, & D controllers is the most

widely used, they can also be implemented in various different configurations

depending on the use required or the exhibited system behaviour. One such

example is a recently published work by Dabros and Schuler et. al. in which a

simple PI controller was successfully implemented as a means to maintain the

Page 28: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 22

specific growth rate µ of Biomass about a desired set-point in a fed-batch

bioreactor [13]. Its inclusion here is noted as the research led to successful

model developments in this work. A vast assortment of other literature exists

on controller configuration so it shall not be dealt with here.

Having now come to a point where the fundamental approaches to control of

a simple process can be understood, the difficulties that encompass the area of

fed-batch bioreactor control can be investigated, so as to adapt the right

strategy during controller design and optimisation.

Automated control of most chemical processes is done using a fixed gain PID

control loop. However, as mentioned previously, the inherent nonlinear

behaviour of the batch bioreactor leads to the tuning of a PID controller in a

simple feedback loop to become a demanding task at best. In their work

Cardello and San [20] demonstrate the difficulties that arise due to

nonlinearities by examining the marginal stability (the slight changes needed

to move from a stable to unstable region) of a feedback loop system for the

OUR rate in a fed-batch bioreactor. They show how the use of a set gain PID

controller, which is purposely tuned to a low OUR for system stability, can

become increasing more sluggish as time progresses. Also it is demonstrated

that for the same system, a controller tuned for a high OUR, which can deliver

a small offset and a quick response time can begin the process in a very

unstable state causing later problems in the batch.

The following case study gives an indication of the challenges that face

traditional control in a continuous Bioreactor. The objective of the work was

to implement a conventional PI controller for bioreactor with Monod kinetics,

much like the Fed-batch bioreactor modelled later sections in this work [4]. It

is intended to familiarise the reader with the broader details of controller

Page 29: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 23

design for a bioreactor. The standard operating procedures for controller

design will be set out in section 3.4

3.3.2.2 Case study 1: Design of PI controller for a Bioreactor [4].

In their work, Srinivasan and Karunanithi present a dynamic model of a

continuous stirred tank reactor in which a single population of microorganism

is cultivated on a single limiting substrate.

The fermentation process is modelled by ordinary differential equations much

like those presented in equations 1-5 previously. A simple schematic diagram

of the bioreactor with biomass concentration as the measured output is shown

in Figure 9

Figure 9: Schematic diagram of a continuous bioreactor [4].

Where x, S, P and µ are the biomass concentration, substrate concentration,

product concentration and the specific growth rate, respectively

Page 30: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 24

, is the substrate feed concentration, is the yield coefficient for cell mass

and is the yield co-efficient for product.

The Monod model, which is the most widely, used classical function for

microbial growth is presented for the function µ(s):

(7)

Where is the maximum growth rate and Ks is the saturation constant.

These equations are then solved for steady state conditions and the results

presented below in Figure 10. A dilution rate of 0.45 is deemed the most

adequate operating region and so the process controller is to be tuned to reach

this operating point.

Figure 10: Dependence of effluent cell concentration x,substrate concentration S,product

concentration P on continuous culture dillution rate D as computed from the Monod model [4].

The physical parameters used for the Monod model are: = 0.53 h-1, Ks =

0.12 g/l, Yx/s= 0.4, Yp/x = 0.5, Sf = 4.0 g/l,

Biomass concentration x = 1.3936 g/l

Substrate concentration s = 0.5160 g/l

Page 31: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 25

Product concentration p = 0.6968 g/l

Controller Design

The nonlinear equations obtained around the steady state operating point are

then linearized with a state space formulation set out in a work by Dochain,

[27]. From this the transfer function relating Dilution to the concentration of

Biomass is found as:

Using an approximation, the above transfer function is modelled as a first

order system with a step response applied to it. Finally, from the first order

response curve the process gain Kp and time constant τp were determined.

These being Kp = -2.544 and τp = 1.8538. The process gain is an indication of the

ratio of the steady state step response to the magnitude of a step input and the

time constant represents the time at which the response is 63.2% of its final

value.

From this work, the results obtained for a servo and regulatory response of

the bioreactor show adequate performance, however, the main conclusion to

be drawn from this case study is that if this idealised model, from which a

steady state can be easily achieved can only attain adequate results, it goes

without saying that it would be far from adequate given the inclusion of

unforeseen process disturbances which occur frequently in practice.

Furthermore, the process differences between this continuous reactor and the

Fed-batch reactor being investigated in this work are great. The nonlinear

nature of the fed-batch bioreactor which fails to reach a steady state only

further hampers the traditional PI control scheme used in this case.

Page 32: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 26

Having noted these pitfalls for P,I, & D control use, steps need to be taken to

optimise the controller so it can address these issues.

3.3.3 Feedforward control

The first type of controller design which can be implemented to address the

above problems is the addition of a feedforward controller to the existing

feedback system. The main task of the feedforward controller is to determine

if there is any change of load and if so, to take a corrective action on the input

to the process from the PID Controller.

In his review of Bioreactor control, Berber explains that to implement control

strategies and optimise them, for systems in which the process is not well

understood, like fed-batch reactors, there are two strategies which need to be

followed:

I) make us of procedures which give adequate or as optimal performance

as can be obtained, and

II) Acquire further knowledge of the system and then adapt the

procedures accordingly. [16]

In the context of the current work, this methodological approach has been

employed for model development with each having increasing complexity

and improving on the previous models process estimation and prediction

Page 33: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 27

Figure 11: Traditional feedforward-feedback structure

3.3.4 Control Relevant Modeling

As has been discussed previously, the development and use of on-line sensors

has increased dramatically in the last decade. However, their use has been

hindered by several problems such as inaccuracies due to noise, the

measurement time delay and the general instability of on-line sensors which

is evident in the glucose analysis systems used by Konstantinov et. Al. in [28].

One such solution to this is the use of system models which can provide

adequate models for system parameter estimation.

Konstantinov et al. [29] have presented the balanced DO-stat method. Using

this the exit gas composition from the fermenter was measured in real time,

and from a system model they estimated the glucose uptake rate (GUR), along

with this the feed rate of glucose was also determined. A similar approach to

system modeling is to be used in this work, in that the intended simulation

work shall be used as a tool for online estimation of glucose concentration by

means. This is to be achieved by means of a Matlab simulation which makes

Page 34: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 28

us of ordinary differential equations to extrapolate the data fed into the model

and make predictions on the specific growth rate of biomass.

Another approach which has shown success in the area of process modeling

with the intention of control is through the use of artificial neural networks.

In a work by Massimo et al. it has been shown that the specific growth rate of

penicillin has been estimated using neural networks which uses the

constituent concentrations of the off gas from the fermenter as inputs to the

model. They utilised the model to control the specific growth rate a low value

with the intention of optimising penicillin production. [30]. it was shown

however that the determination of an optimal network was difficult. It is

intended to take an approach similar to this later in this work in the neural

network section.

Figure 12 below shows the schematic of this modelling approach. Following

this work on model development its incorporation as an online estimator will

hopefully take place.

Figure 12: Block diagram of feeding strategy utilizing estimated variables. [5]

A great benefit to this type of control system is that the system estimator can

be programmed to vary its parameters dynamically depending on the state of

the system. This is termed adaptive control as the system can automatically

adapt to the non-linear state of the system.

Page 35: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 29

3.4 Standard Operating Procedures for Bioreactor control

For the successful and repeatable, implementation of a control system for the

manipulation of a fed-batch Bioreactor, the use of SOP’s in the lab is of great

importance. The following overview section draws heavily from work by

Edgars et al, this reference at this point serves for the rest of this section and

all other works cited will be made apparent. [6]

3.4.1 Overview of Control System Design

General Requirements

1. Safety. Plant safety is the most vital control objective. Its necessity abounds

out of physical safety for operators and people in the surrounding area and

also for the equipment and the content of the bioreactor.

2. Environmental Regulations. Solid, liquid or gaseous waste which remains

after a batch must be disposed of in a way that complies with environmental

regulations

3. Product Specifications and Production Rate. Control of the system must be

carried out in such a manner that the plant is continually able to meet

demands put on it by a specified production rate in order to be profitable.

4. Economic Plant Operation. Consistency needs to be maintained in order to

reach economic objectives over long periods of time

5. Stable Plant Operation. It is a desired to have a control system which

operates with a smooth plant operation, where the presence of large

Page 36: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 30

oscillations within controlled variables is minimised and the ability to input a

change in set point to the system and have the process recover after it rapidly.

3.4.2 Steps in Control System Design

Having set out clearly defined controller objectives the process control system

can be designed. There are 3 key steps in the procedure:

3.4.2.1 Choose the control strategy:

Multi-loop control:

Each output variable is controlled using a single input

variable.

Multivariable control

Each output variable is controlled using more than one

input variable

Having made a decision on these, the control structure can be chosen.

e.g. Pairing of controlled and manipulated variables.

Figure 13: Illustration of multiple process variables [6]

Page 37: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 31

3.4.2.2 Selection of the process variables which are to be measured

controlled and manipulated.

Controlled Variables selection guidelines:

Any variable which cannot self-regulate in the system must be

controlled.

Output variables must be chosen so that they keep within

equipment operating limitations, i.e., pressure, temperature, acidity.

Product quality, if possible should be directly correlated from the

output variable. e.g., Biomass concentration or temperature.

Output variables should have a high level of interaction with other

controlled variables

Output variables which possess favourable dynamic and static

characteristics

Selection of Manipulated Variables

Variables which are an input to the system need to have a large

effect on the controlled variables.

Inputs which have a rapid effect on controlled variables should be

chosen

If possible, variables which are to manipulated variables should

directly affect the controlled variable rather than indirectly.

Disturbances should not be recycled into the system.

Selection of Measured Variables

Good control is hampered by inaccurate and unreliable

measurements, so variables which can provide good accuracy are

desirable.

Page 38: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 32

Points at which measurements are taken should have adequate

sensitivity.

These points should be selected so as to also minimize time delays

and time constant

3.4.2.3 Determine controller settings from a suitable tuning method.

Having selected the control strategy which is to be implemented and the

process variables which are to be controlled, manipulated and measured, the

process of controller tuning can be carried out.

Proposed in their classic paper in 1942, Zeigler and Nichols [31] published a

simple to implement, on-line tuning technique for tuning of parameters for P-,

PI- and PID control systems. The techniques procedure set out in this section

is called the Ziegler-Nichols’ open loop method Or the Process reaction curve method.

In a work by Haugen [7] the approach has been summarised in a methodical

fashion for ease of use. It is this procedural methodology which shall be set

out. It is stated by Zeigler and Nichols that an acceptable level of stability is

achieved when the ratio of the amplitude in consecutive peaks on the

response curve is approximately ¼.

This is illustrated in Figure 14 below.

It should be noted that the figure of ¼ is an ideal measurement; it cannot be

guaranteed that this value can be obtained, however the results should not

deviate too far from this figure.

The response curve of the system is due to a step change of the disturbance or

a step change of the set point in the control loop.

Page 39: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 33

Figure 14: System stability is deemed ok If A2/A1 ≈ 1/4 according to Ziegler and Nichols. [7]

The Ziegler-Nichols’ PID tuning procedure

From the process step response graph, the PID parameters of the controller

are calculated. This is achieved via a process measurement ym following a step

with height U in the control variable u, the figure below clarifies this. The

word process here is a lumped term for all the blocks or components in the

control system excluding the controller itself.

Figure 15: Step response of the Ziegler-Nichols’ open loop method.

Tuning Steps:

Page 40: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 34

1. The controller is first set to manual mode; this opens the control loop if

it is closed. I.e. feedback.

2. The control variable is now adjusted manually until the desired

operating point is reached. In Figure 15 above this is achieved by

adjusting u0.

3. A ‚Small‛ step is applied to the system to excite it via a step of

amplitude U on the control variable u. ‚Small‛ is used here as the

process is not to deviate too far from the operating point, but the step

cannot be too small or an unobservable response ym will result. A

reasonable value of U=10% is recommended but this amplitude needs

to be chosen individually in each case.

4. From the response graph the following parameters are to be read off.

• Equivalent dead-time or lag L

• Rate or slope R

Figure 16: Ziegler-Nichols’ open loop method: The equivalent dead-time L and rate R read off from

the process step response. [7]

Page 41: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 35

The above figure displays the relevant part of the response graph from the

step input. It is seen that the time (X) axis starts at the step time and along the

Y axis, the value 0.0 represents the ym0 in Figure 16 above. The value for dead-

time L is the time it takes from the step time to the point of intersection

between 0.0 and the slope of the steepest tangent R.

5. The controller parameters can now be calculated according to the

values contained in the below table 1.

Table 1: Ziegler-Nichols’ open loop method: Formulas for the controller parameters.

Kp Ti Td

P controller ∞ 0

PI controller 3.3L 0

PID controller 2L

6. Having successfully determining the control parameters and entering

them into the controller the control loop can now be closed by setting it

back to automatic mode.

Page 42: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 36

4 Simulation modelling

4.1 Mechanistic model of fed-batch fermentation

As has been previously discussed in section 4, in order to successfully control

nonlinear process variables in a Bioreactor, in which direct measurements

cannot be taken on-line,

requires that numerical algorithms are implemented in computer simulations

as a means of real time estimation. These can be termed ‚software sensors‛ or

as ‚soft-sensors‛.

In the majority of industrial fermentation processes, the fed-batch approach is

the one which is utilised most often. This batch process is fed with a substrate

solution composed of one substrate component which is growth rate limiting.

This feed has commonly a concentration as high as possible, so as to reduce

the volume increase over the course of the batch. [9]

The process under investigation in this work was a fed-batch bioreactor

cultivating the wild-type strain of the yeast Kluyveromyces marxianus DSM

5422. The Fed-batch fermentation runs which have been carried out in the

DCU Laboratory of Integrated Bioprocessing have provided banks of data

which has been used for the estimation of Specific growth rate of Biomass

from both dielectric and Bio-calorimetry readings and prediction of Glucose

concentration within the feed substrate.

The specific growth rate µ (hr-1) of the biomass is a method by which the cell

concentration is described over a certain period of time and related to the

actual cell concentration in the reactor. Due to the importance it holds in

determining the quality of the final product, its control is a key step in

successful bioprocessing. [32]

Page 43: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 37

4.2 Model equations

A work by Mosier and Ladisch [8] demonstrates how the expression which is

used for cell growth rate in this work is based on the doubling time of cell

mass given by:

(7)

Over a period of time td the growth rate is given by μd = n / t, or wrote in the

form

(8)

Xd is the cell mass at time td and n = μdtd. rearranging and taking a log yields:

(9)

Again rearranging provides us with an expression for growth rate μd in terms

of doubling time td:

(10)

From this expression, the specific growth rate of cell mas can be plot on a

semilog plot as a function of time, in a linear manner. This can be seen in

Figure 17 below

Page 44: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 38

Figure 17: Linearized plot of cell mass as a function of time [8]

Over a short time interval in the exponential growth phase we are presented

with the following equation.:

(11)

From this, the estimated specific growth rate of biomass is calculated in our

simulation models using the below equation. This method has been trialled

and employed successfully in a work by Dabros et. al, [13] in the LiB in DCU.

(12)

The process model developed during the course of this research is loosely

based on Fed-Batch fermentation models developed by Enfors and co-workers

which take initial values for process variables such as; biomass (X), glucose (S)

and Volume (V) . [9] The model makes us of ordinary differential equations

Page 45: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 39

listed in section 4.2 and described in this section to produce optimal profiles

for an exponential/constant feeding profile over a timespan set by the user.

See Figure 18: Profiles for X,S,V,F and Mu generated by a model created by

Enfors and Co-workers below. From this model, the code was implemented

in a validation experiment to determine the possibility of model adaption for

online estimation of process parameters as what is termed, a ‚Soft sensor‛.

0 5 10 15 20 25 30 35 40 45 500

10

20

30

40

50

60

70

80

90

100

time (hrs)

Fed-batch with eponential/constant feed

X: 0-100 g/L

S: 0-1 g/L

V: 0-100 L

F:0-1 L/h

My: 0-1 /h

Figure 18: Profiles for X,S,V,F and Mu generated by a model created by Enfors and Co-workers [9]

This validation experiment was successful in that incremental values for Time,

X, S, and V were wrote to a storage location and then iteratively read back into

the model. As was expected, these generated the exact profiles that had been

seen before.

Prior to further development of the models it was envisaged that the initial

conditions model would be able to generate optimised profiles for the Lab

Bioreactors. However, the fine tuning of variables selected by Enfors made

redundant this notion when variables matching the Bio-engineering reactor

and Rc1 Bio-calorimeter were used.

Page 46: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 40

This has led to further, more accurate, modelling of the microbial growth

being carried out.

Before the workings of the simulation models can be discussed; there needs to

be an understanding of the fundamental process in which cell growth kinetics

are to be modelled. In this case, the equations outlined by Enfors [9] are

discussed by Mosier [8] in a basic but competent fashion which provides more

clarity on the issue of cell growth.

The equations used are based on microbial growth which is balanced. This

means that the growth is assumed to be independent of the cells age and only

the number of cells changes, with all cells retaining the same inherent

characteristics. [8]

The second equation to be implemented is the specific glucose consumption

rate (qS), which is assumed to follow Monod kinetics

(13)

Where:

qSmax = the maximum specific glucose consumption rate (hr-1 )

S = Glucose concentration (g/L)

Ks = Substrate Concentration at Which the Specific Growth Rate Is Half of Its

Maximum

This value is obtained from experimental data set out in a Monod plot as seen

in Figure 19. Monod Kinetics have also been mentioned in section 4.3.2

Page 47: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 41

Figure 19: Schematic representation of definition of Ks following Monod kinetics .

Next the equations for biomass concentration and substrate (glucose)

concentration are discussed below. They both consist of an accumulation term

and a dilution term.

The rate of change of Biomass concentration is given by:

(14)

Where:

F= substrate feed rate (L/hr)

V = Reactor volume (L)

µ= Specific growth rate of Biomass

X = Biomass concentration (g/L)

The rate of change of substrate concentration is given by:

Page 48: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 42

(15)

F= substrate feed rate (L/hr)

V = Reactor volume (L)

X = Biomass concentration (g/L)

S = Substrate (glucose) concentration (g/L)

Si = Initial glucose concentration in the feed (g/L)

There are two distinct phases to the experiments. Batch and Fed batch.

In the Batch phase, microbial growth takes place in an exponential fashion till

the feed has been depleted, at this point, the operator sets the feed rate to be

added to the Bioreactor in an open loop fashion, or to meet a pre-determined

profile.

In the batch phase there is no feed addition, so the diluting term is dropped

and the equation is represented by the positive accumulative growth:

(16)

This is similar to the substrate equation in that the diluting term is dropped

and we are left with the negative exponential decline of the substrate:

(17)

Page 49: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 43

Finally the volumetric growth rate is a simple mass balance equation

directly related to the feed rate. This is because with the nature of fed-

batch bioreactors there is no mass being lost from the system at any

point.

(18)

4.3 Matlab Code walk through

Three Matlab based models have been developed for the estimation of Specific

growth rate from Both Rc1 and Dielectric Biomass readings, and the

prediction of Substrate (glucose) concentration. These models are:

1. Matlab Simulation model with Feed-rate estimation

2. Matlab Simulation model with Feed-rate as a model input

3. Matlab Simulation model with PI-Feedback control

In Appendix A, the code for the 3 of these models is presented. Here full

annotations and explanations can be found for every step through the models.

Below follows a surmised walkthrough of the models so a prior knowledge of

their workings can be had.

Upon completion of this work the models are at a stage where they

successfully predict substrate concentration and estimate the specific growth

rate from previously obtained banks of data. If a further requirement presents

itself then these can be easily adapted to work online and take real data from

the data acquisition system in place and make online predictions and

estimations.

Page 50: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 44

The process data Time, X (Biomass), S( glucose concentration), V (Volume),

and F (Feed rate) used in these models are stored respectively in columns in

excel files.

I. Matlab Simulation model with Feed-rate estimation

a. First the excel storage file is read in with the command :

Z=xlsread('Reactor_data.xls'); This creates an array called Z

which contains all the reactor data

b. Next the simulation counter i is initiated at a value of i=2; This is

so there is room for column headings in the excel file

c. Empty storage arrays are next declared. These are declared

empty so that after every incremental step through the

simulation the result can be dynamically appended to the end of

the array.

d. An initial value of S is then set from the real data stored in the

excel file. This is either the direct readings stored from

experiment, or set manually as the initial glucose concentration

in the substrate.

e. A time span size is next defined. This sets the number of data

points over which estimations will be made for the course of the

simulation. A timespan of two consecutive data points is not

recommended as data becomes very noisy. Ten points were used

here.

f. A while loop is next defined. This is set to iterate through every

data point stored in Z. This is incremented by i=i+1 at the end of

the loop while the current value of i is <= the length of array Z

g. A function is called then to determine the values of specific

growth rate and feed rate. The functions inputs are the time

span, the span of X values and the current glucose concentration.

Page 51: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 45

The specific growth rate is determined and is smoothed using a

convolution function prior to it being returned. Checks are made

in the function to determine if the process is currently in batch or

fed batch mode. If it is still in batch mode the initial feed rate is

returned. If it is in fed-batch mode a polynomial equation is used

as an estimation of feed rate data and then the two variables are

again returned.

h. In the main model again a column vector Y is set to contain

current values of X, S, V, F and µ. This, along with the timespan

are used as the inputs to an ordinary differential equation solver

called ODE23s. The ODE’s numbered 13-18 given in Section 4.1

are the equations which are being solved. These are to be

integrated over the time span defined. As with step VII checks

for batch or fed batch are carried out and the correct ODE is then

selected. This returns the prediction of glucose concentration at a

certain time interval. The Ode23s function is discussed following

the code brief.

i. At this point the counter iterates ahead and the loop starts over

till completion

j. After each iteration, all values are stored in the arrays mentioned

in III. When the loop completes the values are scaled, wrote back

to excel alongside the original data for comparison and then

plotted in Matlab.

k. This completes the code overview.

Page 52: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 46

II. Matlab Simulation model with Feed-rate as a model input

a. To all intents and purposes, this code is identical to the previous

model. However, this small change included here has a large

effect on the model output

b. Simply a term is included which reads in the current value of

feed rate for the process during each iteration of the simulation

loop.

c. This provides correct feed rate data to the ODE’s

III. Matlab Simulation model with PI-Feedback control

a. As with model II above, the main workings of model III remain

quite similar.

b. In place of estimated or actual feed rate data being used, a PI

feedback control term is evaluated. And is used to define the

rate of feed addition to the process.

c. After the declaration of empty arrays the constants for

proportional and integral gain are declared.

d. The code remains the same till after step g. in model I. After this

point the set point for specific growth rate is set depending on

the process time.

e. The error term is then calculated for this iteration . This produces

a vector containing the error points at each time interval.

f. The linespace function calculates a vector with times spaced

evenly out depending on the number of accumulative error

terms stored

Page 53: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 47

g. This is then used as the times over which the accumulated error

is integrated. This returned value is multiplied by the integral

gain to provide the integral feedback term

h. The proportion feedback term is calculated by multiplying the

proportional gain by the error present at that instant.

i. These terms are combined with an exponential term to serve as

the feed rate feedback term.

j. From this point the code is nearly identical again. It is suggested

that the annotated code be consulted from a full understanding

of the model.

4.3.1 Solving Ordinary Differential Equations

The function ode23s is an implementation of the Runge-kutta method for

numerical integration. Its explanation here is found in a work by Mosier [8].

For first order differential equations like those contained in this work, it is

approximated by Simpsons rule. The equations must take the form:

Having initial conditions x=x0 at t=0

The solution for which is:

The value of the first step is calculated from the equation:

Here h is the step size defined, it can be seen in Figure 20 below.

Page 54: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 48

This process is repeated to calculate consequent values of x at every time

increment until n iterations have been carried out.

Figure 20: Schematic diagram of numerical integration by Simpson ’ s rule.

4.3.2 PI-Feedback control

The PI feedback term used in the model III has been implemented successfully

in a work by Dabros et, al. mentioned previously. [13]

As has been discussed already, the inclusion of classical PID controllers for the

successful automation of bioprocessing poses a challenging situation. In this

case the PI control feedback term has been included as a component in the

exponential term of the feed rate given in equation 18 below.

Page 55: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 49

(18)

As with most engineering applications, when a solution can be proposed with

simplicity, it’s robustness is usually quite good. This seems to be apparent in

this case as adequate results were obtained from its inclusion.

The controller gains were determined with a trial and error approach till the

errors achieved were minimised. As the data was not being directly

controlled, controller tuning could not be carried out to determine the gains

directly.

The controller gains were set at Kp=.5 and Ki = .005

Figure 21 below contains a flow chart indicating the key steps in the Matlab

based simulation model. It can be seen that it is included here as a soft sensor

and directly returning calculated controller parameters, whilst making online

predictions for glucose concentration. It is hoped that future work can

implement this.

Page 56: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 50

Figure 21: Flow chart describing model simulation steps. Its inclusion here as part of an online

Page 57: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 51

4.1 Artificial Neural Network Modelling

Estimation of variables relating to a specific Bio-process, by use of methods

other than mechanistic, mathematical, models mentioned previously, is a

rapidly growing area of research. The main motivation for this is the

requirement of models with which an adequate level of precision can be

ensured and derived from incomplete information; all for the purpose of

bioprocess control. [33].

Neural networks have gained popularity due to the nature and success of

their implementation. This is because the network does not require any prior

knowledge of the relationships between the variables and states of the system

before network training is carried out.

The possibility of vastly different configurations of Neural networks for Bio

process modelling and control has led to a surge in recent years in their use.

Much research has shown that due to their nature they can model the non-

linear relationships between process variables with a much greater accuracy

than is possible through mechanistic or statistical based modelling if only a

limited supply of real data is available. [34-37]. In their work, Thibault et al

[37] introduced the use of artificial neural networks for the dynamic

modelling of bioprocesses. Their work has led the way in development of

neural network for modelling of batch type fermentation processes and so it is

felt that an ANN approach to system modelling in this work would be of great

benefit.

Page 58: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 52

4.1.1 What is a Neural Network?[1]

An Artificial Neural network (ANN) is a biologically based system by

which data is processed. Its development has occurred from the

mimicry or simulation of biological neurons and their configuration

and workings.

ANN’s learn by connecting a large number of nerve cells called

neurons. In the neuron the soma processes the input, the axon splits up

the processed input and then converts it to the output. This is further

connected to the inputs of other neuron through a junction called a

synapse. The dendrites of the next neuron accepts this input and the

process repeats [1]

ANN’s consist of a processing element which is said to be equivalent to

biological neurons. Each neuron has many inputs and outputs, each

works only with the local data fed to them and the weighting which

has been allocated to the connection. This weighting is analogous to the

strength of the synapse in a cell. [33].

As a whole the neural networks has several different layers. The input,

output and the hidden layers, of which there can be one or more.

Data is fed into the network through the input layers and its final

response produced though the output having iterated though the layers

with each neurons associated connect weightings being applied.

Figure 22: Structure of a biological neuron. [1]

Page 59: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 53

4.1.2 Principles of ANN

There are 3 components in the construction of neural networks: [38]

Training

Verification

Testing

1. Training:

In the training phase the weights for connections wij are searched out so

that the resulting outputs agree as close as they can to the experimental

input data. Many methods can be used to optimize this process, but the

one used in this work is the method of back propagation.

Problem complexity dictates how many training iterations need to be

carried out and Ideally, this should be done until there is no

improvement in the root mean square error term

2. Verification:

Having completed training and a suitable network architecture is

obtained the model should be verified on independent data sets which

have not been included in the training set.

3. Testing:

Pending good results from the verification process, the Neural network

can now be used as a tool for estimation of estimation or prediction for

unknown data

Page 60: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 54

b

Wi

W1

W3

W2

Y

X2

X1

()FX3

Xi

Inputs Weights Response

Bias

Figure 23: Multiple input neuron (left) and typical diagram of an ANN with 2 hidden layers (right)

[10]

4.1.3 Neural Network Architecture

The network structure presented in Figure 23 above is representative of the

type of architecture employed during this work. It can be seen that the neuron

has multiple inputs each of which is multiplied by their associated weighting.

The response or output of the neuron is a function of the sum of the inputs

with the inclusion of a bias term .

The function by which the output is determined, is in this case termed the

sigmoidal transfer function. This is the most commonly used function. Its

purpose is to provide a continuous output which is said to be normalised

between zero and one [10]. Its use for the prediction of Biomass and specific

growth rate has been demonstrated successfully in a work by Bachinger [39]

so it is felt that its use here is more than adequate.

Page 61: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 55

The output of the neurons with the transfer function included now becomes:

(19)

where yi is the output signal, xi is an input signal, wij is a weight associated

with the input signal xi, and is a threshold value of neuron j. [39]

4.1.4 Neural Network Models

Unlike the mechanistic modelling carried out in section 4.1. The neural

network based models developed in this section are only applicable to their

respective reactor. So two neural networks have been created:

ANN for Bio-Engineering Reactor and

ANN Rc1 Bio-Calorimeter reactor.

By using the same methodology which has been given in section 4.5.2.2; the

selection of the process parameters which are to be predicted using the

neural network approach and the variables which were to be used for training

of the network was carried out.

For a more complete approach to parameter selection the author recommends

a work by Freeland [10] in which a Design of Experiment approach was taken.

Time constraints imposing on this project led to the selection of parameters

through the use of empirical knowledge gained by LiB staff. Ideally the DOE

approach mentioned should be carried out for thoroughness.

Page 62: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 56

Model 1:

ANN for Bio-Engineering Reactor

The process inputs, or Independent variables’ were selected as:

Volume (V), Base , Feed, Carbon evolution Rate (CER) and Oxygen

uptake rate (OUR)

The process outputs, or dependent variables’ were selected as:

Biomass concentration (X), Glucose concentration (S) and Specific

growth rate of Biomass (µ)

Model 2:

ANN Rc1 Bio-Calorimeter reactor.

The process inputs, or Independent variables’ were selected as:

Accumulative heat flow, Volume (v), Base (B), Feed rate (f(t)) and

Carbon evolution Rate (CER)

The process outputs, or dependent variables’ were selected as:

Biomass concentration (X), and Specific growth rate of Biomass (µ)

All process parameters which have been selected above are ones which can be

directly measured with high accuracy in their respective mode of batch

fermentation.

Page 63: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 57

4.1.4.1 Learning Model

The software which has been used for prediction is Trajan Neural Network

simulator (release 3). The sigmoid function as mentioned previously was used

along with the Multi-layer perceptron with the Back propagation learning

algorithm. Out of 5 batches in both RC1 and Bio-eng data, 3 sets of each were

stored together to be used for network training verification and testing.

Having completed this, the remaining two batches can be used for extra

testing after. The training data was divied up into trainging 73%, verification

9% and testing 18%.

Back Propagation

There are many different learning methods available to train Neural

Networks, but this is by far the most popular.

In this approach the network ‚learns‛ by a means of adjusting the weights

between neuron connections according to the error. Equation 20 below:

(20)

Where: t is the actual output and y is the predicted value. P is the pattern

number and j is the number of output nodes. The objective of the training is to

minimise the error by adjusting the weights in what is termed the steepest

descent method.

Page 64: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 58

Evaluation of Model performance:

The performance of both neural networks have been evaluated in terms of the

following statistical error tests: Mean Relative Error (MRE), Max Relative

Error and the Standard Deviation Ratio (SDR). These error terms are

calculated using the following equations:

(21)

(22)

(23)

(24)

(25)

The mean relative error test gives long term performance of the predicted

results. A lower value of MRE is desirable.

The standard deviation ratio is the ratio of the standard deviation of the error

to the standard deviation of the actual data. It is a measure of scatter in the

prediction mode. Values of less than 0.1 indicate a very good network.

Page 65: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 59

5 Results & Discussion

Mechanistic Models

5.1 Initial Conditions Model

As has been discussed previously, the initial condition model proposed by

Enfors cannot be directly applied here. After much model adaption and

parameter switching, It is felt that its use is more a proof of concept than to be

directly applicable to any fed-batch reactor with an exponential feed rate.

It can be seen in Figure 24 that the profiles for all variables are the optimal for

the process and so as a tool for creation of a set point for control is an ideal

application of this model.

0 5 10 15 20 25 30 35 40 45 500

10

20

30

40

50

60

70

80

90

100

time (hrs)

Fed-batch with eponential/constant feed

X: 0-100 g/L

S: 0-1 g/L

V: 0-100 L

F:0-1 L/h

My: 0-1 /h

Figure 24: Initial conditions model

Page 66: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 60

5.2 Bio-Engineering Reactor

The graphs containing all comparisons for Bio-engineering reactor data are

contained in Appendix B. Direct comparisons of the 3 models are made in this

section with each batch of data to illustrate the results which have been

obtained.

The equations Numbered 21 – 25 in section 5 previously have been

implemented for the comparison of predictions in this section also.

On inspection of Figure 26-Figure 29 the first major point to be noted is the

approximated glucose depletion in the Batch phase of the run. With all four

batches, the model with the PI feedback term achieves greater accuracy in all

cases.

As is expected next, the Model containing real feed rate input is, in three out

of the four batches closer to predicting the substrate concentration. The reason

for it having a better approximation to the curve is due to the placement

which the feed rate estimation holds in batch F05 seen in Figure 25. It is only

by chance that this feed rate results in a profile closer to the actual feed rate

profile.

Again on first inspection of Figure 26-Figure 29, during the fed-batch phase of

fermentation, it is apparent that the model with the PI feedback term once

again seems to approximate the glucose concentration profile with greater

accuracy except in the instance of Batch F05 (Figure 26).

The reason this occurs, is due to the component of code which determines if

the model is in batch or fed batch mode. The check is made by determining if

the glucose concentration is above 2g/L and the time being less than 10 hrs. If

so, the model operates in batch mode. Prior knowledge of this can easily fix

the occurrence of this error and give a better result. however, it is felt that as it

Page 67: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 61

stands the model is operating at its best. To make changes to account for this

discrepancy would only lead to an offset in predicted results.

Figure 25: : Feed rate estimation profiles generated by a polynomial equation fitted to the mean of the

profiles

Table 3 below contains values of both Mean Relative Error and Standard

deviation ratios for each model in each batch.

Values of mean Relative error which approach zero are the ideal. i.e., there is

no error present. Obviously this cannot not be the case with stochastic noise

present in any real process. In this case the value of MRE which lies closest to

zero for the batch represents the model which has best estimated the process.

It should be noted here that the reason the values of MRE are found to be very

high is the relative nature of the comparisons over points in the batch where

the real experimental value lies so close to zero. As the error is divided by the

actual value, The relative error terms increase hugely in size because of this.

Nevertheless the theory still holds in that the closer the value to zero, the

Page 68: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 62

better accuracy is for the prediction. By also determining the mean absolute

error of every simulation the above statement has been verified.

Batches F06 and F07 are best predicted again by the PI feedback control model

as is hoped. However, this is not the case in the other 2 models. Batch F05 has

shown that it has been limited by the mode selection component of the model

previously but batch F08 does not show any signs of this. On inspection of the

graph it is apparent that there is a large spike in glucose concentration. It can

be debated whether or not this spike is due to a sensor error or some other

process problem, but this will not be concerned with here. Rather, because in

this case the MRE error term has achieved a much lower value it is felt

because of the much larger absolute error at these points over which the spike

occurs. This leads to the relative error term approach reaching unity as the

error increases. The other two model estimations both rise with this spike and

it can be seen on inspection of the graph that this drastically affects the

performance of both towards the end of the batch. Whereas the PI feedback

model approximates much better here and recovers well from such a

disturbance. This notion is confirmed further upon inspection of the standard

deviation ratios. The SDR is a measure of scatter, and as with the MRE term, a

lower value indicates better accuracy. This PI feedback model has an SDR

value much smaller than the other two which indicates its higher accuracy.

This is the case in batches F06 and F07 where the SDR is much smaller than

the two other models. In Batch F05 due to reasons mentioned previously the

model with feed rate estimation is the most successful.

Page 69: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 63

Table 2: Mean Relative error and Standard deviation ratio for glucose prediction for each batch

F05 S with Fest S with F real S with F PI

MRE -17.35%

-28.10 % -43.27 %

SDR 0.31 0.33 0.32

F06

MRE 12601.06 % 6948.52 % 2534.15 %

SDR 0.54 0.39 0.29

F07

MRE 11605.85 % 14113.59 % 6155.44%

SDR 0.31 0.37 0.15

F08

MRE -1003.04 % -740.35 % -3147.10 %

SDR 0.40 0.42 0.30

Figure 26: F05 Substrate predictions

Page 70: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 64

Figure 27: F06 Substrate predictions

Figure 28: F07 Substrate predictions

Page 71: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 65

Figure 29: F08 Substrate predictions

5.3 RC1 Bio-Calorimeter Reactor

For the batch cultivation of Biomass with the RC1 Bio-Calorimeter there has

been no glucose concentration profiles recorded like those for the Bio-

engineering reactor. Due to this, no direct comparisons can be made.

However, consulting Figure 30 and Figure 31 shows the offline calculations of

both Biomass and Glucose for the batch phase of batch F04. The data for

which has also been used as an input to the Pi feedback model. From this one

run it can be reasonable to assume that the simulations modelled hold up fine

and adequate results have been obtained for the Rc1.

It is felt that using this batch alone leads to far too large an assumption that

the model holds., however, on examining the figures for specific growth rate

estimation in the Appendix B for both Rc1 and Bio-eng data and also the fit of

dry cell weight biomass to the online values for both reactors leads the author

Page 72: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 66

to believe that if these values all correlate with reasonable agreement, then so

should the Glucose prediction model. This assumption is justified, but the

side of caution should be erred on pending more exhaustive experimentation.

Figure 30: Offline Biomass for batch F04

Figure 31: Offline glucose concentration for F04

Page 73: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 67

Artificial Neural Networks

5.4 ANN for Bio-Engineering Reactor

During development of the neural network for the bio-engineering reactor it

was known, and has been demonstrated here that a single network which can

successfully predict Biomass concentration, glucose concentration and specific

growth rate would be difficult as the characteristics of the different

parameters vary greatly. Ideally, a separate model of each would give much

more accurate predictions. However, it was decided to only use one in an

effort to build a level of robustness into the overall finished hybrid system.

This avoids confusion, and helps prevent the occurrence of oversights and

mistakes.

The network has been trained with data sets F05, F06 & F07 and testing

carried out using F08. The training data set had 3 batches joined together and

sorted by time.

The 5 final networks which give the best performance during training and

testing were:

Model 1: 5-10-10-3

Model 2: 5-10-3

Model 3: 5-11-3

Model 4: 5-8-7-3

Model 5: 5-10-11-3

Page 74: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 68

The network that displayed best performance was model 1 which contains

two hidden layers with a 5-10-10-3 architecture. Its inputs Volume (V), Base ,

Feed, Carbon evolution Rate (CER) and Oxygen uptake rate (OUR).

The results are contained in table 3. This table contains both values for mean

relative error and standard deviation ratio. It can be seen that the best selected

model does not reflect the best approximation to a specific parameter in every

case, but it is more an all-rounder. By comparing the error results for model 1

and 5 for biomass we get -10.4% and 3.9 respectively, but further inspection

of the values for specific growth rate yields -8% and 18.4%. the lower value of

standard deviation ratio in each case helped in making a decision.

At this point the author is of the opinion that more rigorous training could be

of benefit to the results for the network. With predictions of biomass yielding

a relative error of -10.4% it is felt by the author that this is perhaps too large a

value. The standard deviation ratio has displayed however that the variance

in the network is good and a value of .11 is close to the ideal value of .1 or less.

It was known from literature before carrying out any network training that

the estimation of specific growth rate to a high level of accuracy would be

difficult, and that has been apparent when looking at the results. An error of

less than 10% is positive, but it has a large standard deviation ratio of .589

which is not desirable. It is felt though that considering the large oscillations

in the type of curve generated for the specific growth rate that the predictions

which are given here are adequate.

Page 75: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 69

Figure 32: Neural network prediction of Biomass for the bio-eng reactor

Figure 33:Neural network prediction of glucose concentration for the bio-eng reactor

Page 76: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 70

Figure 34: Neural network prediction of specific growth rate for the bio-eng reactor

Table 3: Table of mean relative error and Standard deviation ratio for the 3 process outputs.

Model 1 Model 2 Model 3 Model 4 Model 5

Biomass

MRE -10.43065667 -6.225047126 -14.08271919 31.88276825 3.901314865

SDR 0.11497682 0.130035081 0.104248069 0.117238919 0.221576281

Glucose

MRE 542.9076736 3293.042551 1986.741636 533.9579251 1286.828158

SDR 0.216903324 0.290920242 0.199935975 0.203154184 0.166970299

Mu

MRE -8.028698242 12.69736713 28.76862326 37.31703049 18.94249919

SDR 0.58980005 0.583233171 0.618321087 0.716934975 0.639735173

Page 77: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 71

5.5 Rc1 Biocalorimeter

The network has been trained with data sets from march 2nd, April 12th and

April 29th and then testing carried out using May 14th. The training data set

had 3 batches joined together and sorted by time.

The 5 final networks which give the best performance during training and

testing were:

Model 1: 4-8-11-2

Model 2: 5-9-2

Model 3: 5-10-3

Model 4: 5-11-11-2

Model 5: 5-11-10-2

The network that displayed best performance was model 2 which contains

one hidden layer with a 5-9-2 architecture.

The inputs to the network were: Accumulative heat flow, Volume (v), Base

(B), Feed rate (f(t)) and Carbon evolution Rate (CER)

The results are contained in table 4.

As with the bio engineering reactor it can be seen that the best selected model

does not provide the best results for both outputs. We can see that model 5

provides a much more accurate prediction for biomass than model 2. Model 2

has been chosen none the less as the specific growth rate would be the

parameter more important to successful control of the reactor. Biomass

prediction has yielded a mean relative error of 13.6% and with a relatively

good value for standard deviation ratio of .14

Page 78: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 72

Under prediction of specific growth rate was found to be -12.4%. The variance

in this network is not great though with a large value of 1.28 being given. It is

again advised that more intensive training be carried out prior to

implementation in an online system.

Table 4: Table containing mean relative error and standard deviation results for the Rc1 neural

network

Figure 35: ANN for biomass prediction in the RC1

Model 1 Model 2 Model 3 Model 4 Model 5

Biomass

MRE -14.5680876 13.60795743 -1.858661161 -15.42529549 -2.221702948

SDR 0.114902333 0.140220665 0.09186294 0.086787584 0.094961317

Mu

MRE 139.7359615 -12.42650021 107.5608925 260.5919583 66.54503917

SDR 0.931268315 1.28730528 1.342094144 0.961964526 0.987032022

Page 79: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 73

Figure 36: ANN for prediction of specific growth rate for the Rc1

Page 80: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 74

6 Ethics & Responsibility

Simulation modelling of a fed-batch fermentation process using both model

approaches has shown to have limitations. As with any other type of

simulation there has to be limitations as the dynamic non ideal occurrence of

any process cannot be fully captured using computer software. Because of

this, It can be frustrating to see inaccuracies in the generated data after having

devoted so much time to the model. The opportunity to perhaps modify

results slightly to represent the real process can be tempting but the

formulation of a model must be done with care and attention to detail. When

building the model care should be used in making sure to include accurate

information, and complete data sets where necessary. The end user of the

model needs to be informed on the limitations and results clearly

Care needs to be taken so as to not make the easy mistake of including human

emotion or perhaps any ethical values which may influence how the model is

constructed.

Further to the simulation side of this work, the use of other peoples research

needs to be properly referenced and citations used correctly. Due care needs

to be given here as presenting someone else’s work as your own is a serious

offence, in both academia and the workplace.

Having concluded this work, it is felt that these points above have been

followed and that this research can be viewed and referenced in the future

with full knowledge that it provides accurate information which is intended

to broaden the collective knowledge in this field.

Page 81: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 75

7 Conclusion

On completion of this investigation into the use of simulation models for the

prediction and estimation of system variables in a fed-batch fermentation

process a number of interesting findings have been reported.

Initial research has led to the development of 3 types of Matlab based

mechanistic models in which experimental data has been used to successfully

model the profile of glucose consumption and estimate the specific growth

rate of Biomass in a fed-batch bioreactor. This has been carried out by solving

ordinary differential equations that have been demonstrated in other research

to provide adequate models.

Feed rate profile was the means by which the models differed from each

other. In model 1, a feed rate profile was inferred from a polynomial equation

generated from the mean of 5 different feed profiles. Model 2 used actual feed

consumption levels from which the feed rate was determined and then used

as an input to the model. Finally the 3rd model used a Proportional-Integral

feedback term as a component in an exponential feed rate input. The PI term

was calculated from the error in specific growth rate against a set point and

was fed back into the system to take corrective action.

It has been shown that the third model was the most accurate out of the 3

models as was expected. Although the results were pleasing it can be

concluded that these models have limitations and the requirement of further

techniques, like the inclusion of a more sophisticated filtering technique for

noisy data or the inclusion of more parameters is needed to decrease the error

between the actual values and those which have been predicted.

Page 82: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 76

The second modelling approach which has been taken was through the use of

artificial neural networks. There use was decided upon as they have been

shown in literature to be able to cope with the non-linear dynamic nature of

fed-batch bioreactors.

System outputs which can be recorded online with a good accuracy such as

Accumulative heat flow, Volume (v), Base (B), Feed rate (f(t)) and Carbon

evolution Rate (CER) were used as inputs to the neural networks. This was

done so that a robust control system can be developed following this research

which makes use of the minimum system variables to control the growth of

Biomass.

Again, the results which have been achieved through the use of neural

networks are promising, but because of the complexity of the 3 different

outputs the accuracy was hindered. This was due to the fact that although the

optimal network architecture for one parameter was good, it was found to be

worse for the corresponding accuracy of the other parameters being predicted.

A playoff between accuracy and robustness in the simulation model had to

take place.

Finally, having laid out the steps towards controller in previous chapters it is

hoped that this work can serve as a step further towards the complete

implementation of a control system based on the simulation models

developed.

Page 83: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 77

8 Appendix A

8.1 Matlab Model with feed-rate estimation for S and µ

prediction

8.1.1 Start model % To be named Model_start.m and saved in working directory with Reactor_data.xls

% (excel file containing columns T,X,S,V,F) and function files Getvalues_Mu_F.m and

% Getvalues_X_S_V.m

clear all;

clc;

tic % tic toc function which times simulations run

% An excel read in function is first employed which opens an excel file in the working

% directory and stores its contents in array Z[]

Z=xlsread('Reactor_data.xls');

% The counter for the program is started at value of 2, i=1 is the column headings in

% the excel file eg; Time, X, V etc

i=2;

% Empty storage arrays are declared for storage of variables which accumulate over

% the simulation run

y_total=[]; % for storage of differential variables X, S, V.

total_sim_Mu=[];% for storage of non-differential variable Mu, specific growth rate.

total_sim_F=[]; % for storage of non-differential variable F, feed rate.

t_total=[]; % for storage of non-differential variable time

% The initial value of S (substrate concentration)is determined from the excel file.

% This can be taken from either a real data point or specified if no data is

% available.

% The first entry to the array is zero to let the simulation run coincide with i=2 for

% column headings

total_sim_S=[0;Z(2,3)];

global time_step_size; %Declaration of a global variable which can be accessed by all

% functions.

time_step_size=10; % Time step size which is set only once at this point and made %

% global to all functions

% The initial feedrate for the simulation is set here as .001L/hr however this

% parameter can also be calculated from equation

F0=.001;

Page 84: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 78

% A While loop is initialised which iterates through every data point in the Z data

% storage matrix. Values of X S and Mu are calculated repetetivly for every time step

% in the loop.

while i<=(length(Z)-time_step_size)

% Below The Timespan vector which is a required input to the ode23s function

% and the Time range for error estimation are defined. The latter is the same

% length as tspan but contains a range rather than final and intial value

tspan=[Z(i,1) Z((i+time_step_size-1),1)];

timestep=Z(i:(i+time_step_size-1),1);

% The below values are initial values which are used for variable prediciton.

% They are incremented at every loop iteration

% Declare value of X at iteration step i from Z storage matrix

X=Z(i,2);

% Declares Storage array of X values at each iteration for the current time

% step from time i to current time.

X_Mu=Z(i:(i+time_step_size-1),2);

% Declares value of V for the start time of this time step.

V=Z(i,4);

% Call to a function Getvalues whis calculates (returns) values for F and the

% average Specific growth rate Mu_avg over this time step. It reads in values

% of the time step range, range of X over the time for specifi growth rate

% calculation and the initial value of predicted substrate concentration for

% this time step.

[Mu_avg,F] = Getvalues_X_F(timestep,X_Mu, total_sim_S(i));

% An else if loop is declared to set specic growth rate at reasonable values

% until a steadier state is reached at time of ten hrs in his particular case

if Z(i,1)<=5

Mu=0.3;

else if (Z(i,1)>5)&&(Z(i,1)<10)

Mu=.2;

else

Mu=mean(Mu_avg);

end

end

% The variables X Si V F and Mu for this time step are located in a column

% vector y this % vector. This Vector is used as an input to the ode23s

% function for determination of predicted values X V and S.

y=[X;total_sim_S(i);V; F; Mu;];

% The ODE solver function is called which reads in vector y and solves

% (integrates the differential equations) for time step defined in tsep above.

Page 85: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 79

% It Returns an array y, with values for X, S, V integrated at numerous

% iterations over the time span and also returns the time iterations used over

% the time span.

[t y]=ode23s('Getvalues_X_S_V',tspan,y);

% Storage array y_total for X S V values, takes the last value (length(y)) of

% each from % this iteration set and accumulates till while loop completion

y_total=[y_total; y(length(y),1:3)];

t_total=[t_total; t(length(t),:)]; % as above but stores total time

total_sim_Mu=[total_sim_Mu; Mu]; % as above but stores total Mu where

calculated above,

total_sim_F=[total_sim_F; F]; % as above but stores total F where calculated

% above,

S_out=y(length(y),2); % S value modelled from ode23s taken as last value of

% iteration set

% storage array for S values, takes last value of S from S_out till while loop

% completion

total_sim_S=[total_sim_S; S_out];

i=i+1; % increment i value

% The loop ending which finally completes once all data has been worked though over N

% interations through the simulation

end

y2=[total_sim_F,total_sim_Mu]; % storage array for holding total F & My values

y=[y_total,y2]; % storage array for holding y_total=[X,S,V] and F & Mu

% The following section is used to scale max the values for graphing within matlab.

% X,S,V,F, Mu are set depending on the max value required in the graph

ymax=[50,10,5,50,1];

% These are scaled to a 0-100 scale using a for loop which generates a new vector

% yscaled

for i=1:length(ymax)

yscaled(:,i)=y(:,i)/ymax(i)*100;

end

% storage array which contains all variables generated over the course of the

% simulation

Final_values=[t_total,y];

% The headings which are to be wrote to an excel file are declared

Headers={'Time', 'X','S','V','F','Mu','','','Time', 'X','S','V','F'};

% An excel write function which writes the headings to an excel file.

xlswrite('Final_values.xls', Headers,1,'A2');

% An excel write function which writes out accumulated final X S V F Mu values to

% excel file

Page 86: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 80

xlswrite('Final_values.xls', Final_values,1, 'A3');

% An excel write function which writes out the original data in matrix Z so

% comparisons can be easily made.

xlswrite('Final_values.xls', Z,1, 'I3');

% plot and label

toc % end of tic toc function for time

% Matlab graphing function which plots all variables against the total time

yplot=plot(t_total,yscaled);

% sets maximum Y axis at 100

set(gca,'YLim',[0 100])

% legend for graph

legend('X: 0-50 g/L','S: 0-10 g/L','V: 0-5 L','F:0-50 ML/h','Mu: 0-1 /h')

% Xaxis label and title

xlabel('time (hrs)')

title('Fed-batch Simulation model')

figure(gcf)

% Code completion.

8.1.2 F and µ estimation function

% Function to be named Getvalues_X_F.m and stored in the same directory as

% model_start.m

% This Function getvalues reads in variables timestep, X_Mu and total_sim_S(i)and sets

% as vector t, Xmu and S respectively

function [Mu_avg, F] = Getvalues_X_F(t, X_Mu, S)

%calling global variable to access time step size initialised in main model.

global time_step_size

i=1; % initiates i at 1.

Muspan=[]; % Declaration of storage array to hold values of Mu for the time step

F0=.001; % Initialises F0 at a defined value or can be changed to calculate depending

% on model.

%%% Specific growth rate estimation %%%

% This for loop which iterates N times calculates the specific growth rate at

% different instances over length of the time step. (usually 3 points)

while i<=((time_step_size/2)+1)

Page 87: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 81

% Declares value of X at timestep/2 to for Mu calculation

X_Mu_now=X_Mu(i+(time_step_size/2)-1);

% Declares initial value of X for Mu calculation

X_Mu_prev=X_Mu(i);

% Declares value of t at timestep/2 to for Mu calculation

tnow=t(i+(time_step_size/2)-1);

% Declares initial value of t for Mu calculation

tprev=t(i);

% Specific growth rate estimation for each time step

Mu=(log(X_Mu_now/X_Mu_prev))/(tnow-tprev);

% Total SGR containing numerous values for SGR over this functions time step.

% (usually 3 % points)

Muspan=[Muspan;Mu];

i=i+1; % increments for loop.

end

% Convolution function which calcuates a smoothed response of specific growth rates

% noisy data

span=5; % Size of the averaging window

window = ones(span,1)/span;

Mu_avg = convn(Muspan,window,'same');

% If else loop for Feedrate estimation, if the current value for S is over a certain

% value and less than a certain time (Batch phase) then set the feed rate at its

% intial value, else set it as a polynomial equation which determine the average

% feerate depending on the current time

if (S>.5)&&(max(t)<8)

F=F0;

else

F=-.000001*max(t)^3+.0001*max(t)^2-.0008*max(t)+.0011;

end

end % end of function for calculating specific growth rate and feed rate.

8.1.3 Substrate prediction function % To be named Getvalues_X_S_V.m and stored in same working directory as Start_model.m

% An ordinary differential equation solver function which reads in values for t (time

% span) and y (X S V F MU) and returns an Ode containing dXdt dSdy and dVdt. This is

% then integrated over the time span defined.

function dydt=Getvalues_X_S_V(t,y)

Page 88: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 82

% The variables X,S,V,F and My are extracted from read in y-vector

X=y(1);

S=y(2);

V=y(3);

F=y(4);

Mu=y(5);

% Declaration of process constants

qSmax=.35; % maximum specific glucose consumption rate

Ks=3.5;

Si=300; % Initial feed glucose concentration

F0=.001;

qS=qSmax*S/(S+Ks); % specific glucose consumption rate

% if loop to specify the rate of Biomass and substrate concentraion change depending

% whether the system is in Batch or Fed batch mode

if (S>=2)&&(t<10)

dXdt=Mu*X;

dSdt=(-qS*X);

else

dXdt=(-F/V)*X+Mu*X;

dSdt=(F/V)*(Si-S)-qS*X;

end

dVdt=F;

% make a dydt column vector and return

dydt=[dXdt; dSdt; dVdt; F; Mu];

8.2 Matlab Model with feed-rate input for S and µ

prediction

8.2.1 Start model

As 5.1.1 but with inclusion of

F=Z(i,5);

After the Getvalues function call.

Page 89: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 83

8.2.2 F and µ estimation function

Identical to 5.1.2

8.2.3 Substrate prediction function

Identical to 5.1.3

8.3 Matlab Model with feedback control for S and µ

prediction

8.3.1 Start model % To be named Model_start.m and saved in working directory with Reactor_data.xls

% (excel file containing columns T,X,S,V,F) and function files Getvalues_Mu_F.m and

% Getvalues_X_S_V.m

clear all;

clc;

tic % tic toc function which times simulations run

% An excel read in function is first employed which opens an excel file in the working

% directory and stores its contents in array Z[]

Z=xlsread('Reactor_data.xls');

% The counter for the program is started at value of 2, i=1 is the column headings in

% the excel file eg; Time, X, V etc

i=2;

% Empty st storage arrays are declared for storage of variables which accumulate over

% the simulatioin run

y_total=[]; % for storage of differential variables X, S, V.

total_sim_Mu=[];% for storage of non-differential variable Mu, specific growth rate.

total_sim_F=[]; % for storage of non-differential variable F, feed rate.

t_total=[]; % for storage of non-differential variable time

SUMet=[]; % for storage of accumulative error et

sum_Integral_error=0; % initialise the integral error at zero.

% The initial value of S (substrate concentration)is determined from the excel file.

% This can be taken from either a real data point or specified if no data is

% available.

% The first entry to the array is zero to let the simulation run coincide with i=2 for

% column headings

total_sim_S=[0;Z(2,3)];

global time_step_size; %Declaration of a global variable which can be accessed by all

% functions.

Page 90: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 84

time_step_size=10; % Time step size which is set only once at this point and made %

% global to all functions

% Declaration of values for proportional and integral gain.

Kp=.5;

Ki=0.001;

% A While loop is initialised which iterates through every data point in the Z data

% storage matrix. Values of X S and Mu are calculated repetetivly for every time step

% in the loop.

while i<=(length(Z)-time_step_size)

% Below The Timespan vector which is a required input to the ode23s function

% and the Time range for error estimation are defined. The latter is the same

% length as tspan but contains a range rather than final and intial value

tspan=[Z(i,1) Z((i+time_step_size-1),1)];

timestep=Z(i:(i+time_step_size-1),1);

% The below values are initial values which are used for variable prediciton.

% They are incremented at every loop iteration

% Declare value of X at iteration step i from Z storage matrix

X=Z(i,2);

% Declares Storage array of X values at each iteration for the current time

% step from time i to current time.

X_Mu=Z(i:(i+time_step_size-1),2);

% Declares value of V for the start time of this time step.

V=Z(i,4);

% Call to a function Getvalues which calculates (returns) values for F and the

% average Specific growth rate Mu_avg over this time step. It reads in values

% of the time step range, range of X over the time for specific growth rate

% calculation and the initial value of predicted substrate concentration for

% this time step.

[Mu_avg,F] = Getvalues_Mu_F(timestep,X_Mu, total_sim_S(i));

% Declares Mu set points for the run at different time points

if Z(i,1)<=5

MuSp=.2;

else if ((Z(i,1)>5)&&(Z(i,1)<=7.5))

MuSp=.15;

else

MuSp=.1;

end

end

et=(MuSp-Mu_avg); % Error for each interval during each iteration loop.

ET=mean(et); % Mean error value for the 3 values returned from Mu_avg

% for theloop setting the value for specific growth rate. At a time less than

%5,it is set at a constant value due to large oscillations and otherwise set as

% the mean value of Mu_avg

if max(timestep)<5

Mu=.15;

else

Mu=mean(Mu_avg);

Page 91: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 85

end

% low and high band pass cutting off extreme osicaltions in Mu

if Mu>.4 || Mu<.05

Mu=MuSp;

end

% The linspace function generates linearly spaced vectors. It is similar to the

% colon operator ":",but gives direct control over the number of points. Here

% it calculates a vector with times spaced evenly out depending on the number

% of error terms stored

int_time= LINSPACE(min(timestep), max(timestep), length(et));

% Trapezoidal numerical integration of the accumulative error over the total

% time

Integral_error=trapz(int_time,et);

% Accumulative error summation for integral part of PI controller

sum_Integral_error=sum_Integral_error+Integral_error;

prop=Kp*ET; % Proportional component calculation for PI contorller

int=Ki*sum_Integral_error; % integral component calculation for PI contorller

FB=(MuSp+prop+int)*min(timestep); % Feedback term calculation

F0=.001; % Declaration of initial feed rate, can be calculated from equation if

% neccessary

% Feedback feedrate calculation to be fed into ODE solver

if min(timestep)<6

F=F0;

else

F=F0*exp(FB);

end

% Declares Mu set points for the run at different time points

if Z(i,1)<=5

MuSp=.2;

else if ((Z(i,1)>5)&&(Z(i,1)<=7.5))

MuSp=.15;

else

MuSp=.1;

end

end

% The variables X Si V F and Mu for this time step are located in a column

% vector y this % vector. This Vector is used as an input to the ode23s

% function for determination of predicted values X V and S.

y=[X;total_sim_S(i);V; F; Mu;];

% The ODE solver function is called which reads in vector y and solves

% (integrates the differential equations) for time step defined in tsep above.

% It Returns an array y, with values for X, S, V integrated at numerous

% iterations over the time span and also returns the time iterations used over

% the time span.

[t y]=ode23s('Getvalues_X_S_V',tspan,y);

% Storage array y_total for X S V values, takes the last value (length(y)) of

% each from % this iteration set and accumulates till while loop completion

Page 92: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 86

y_total=[y_total; y(length(y),1:3)];

t_total=[t_total; t(length(t),:)]; % as above but stores total time

total_sim_Mu=[total_sim_Mu; Mu]; % as above but stores total Mu where

calculated above,

total_sim_F=[total_sim_F; F]; % as above but stores total F where calculated

% above,

S_out=y(length(y),2); % S value modelled from ode23s taken as last value of

% iteration set

% storage array for S values, takes last value of S from S_out till while loop

% completion

total_sim_S=[total_sim_S; S_out];

i=i+1; % increment i value

% The loop ending which finally completes once all data has been worked though over N

% interations through the simulation

end

y2=[total_sim_F,total_sim_Mu]; % storage array for holding total F & My values

y=[y_total,y2]; % storage array for holding y_total=[X,S,V] and F & Mu

% The following section is used to scale max the values for graphing within matlab.

% X,S,V,F, Mu are set depending on the max value required in the graph

ymax=[50,10,5,50,1];

% These are scaled to a 0-100 scale using a for loop which generates a new vector

% yscaled

for i=1:length(ymax)

yscaled(:,i)=y(:,i)/ymax(i)*100;

end

% storage array which contains all variables generated over the course of the

% simulation

Final_values=[t_total,y];

% The headings which are to be wrote to an excel file are declared

Headers={'Time', 'X','S','V','F','Mu','','','Time', 'X','S','V','F'};

% An excel write function which writes the headings to an excel file.

xlswrite('Final_values.xls', Headers,1,'A2');

% An excel write function which writes out accumulated final X S V F Mu values to

% excel file

xlswrite('Final_values.xls', Final_values,1, 'A3');

% An excel write function which writes out the original data in matrix Z so

% comparisons can be easily made.

xlswrite('Final_values.xls', Z,1, 'I3');

Page 93: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 87

% plot and label

toc % end of tic toc function for time

% Matlab graphing function which plots all variables against the total time

yplot=plot(t_total,yscaled);

% sets maximum Y axis at 100

set(gca,'YLim',[0 100])

% legend for graph

legend('X: 0-50 g/L','S: 0-10 g/L','V: 0-5 L','F:0-50 ML/h','Mu: 0-1 /h')

% Xaxis label and title

xlabel('time (hrs)')

title('Fed-batch Simulation model')

figure(gcf)

% Code completion.

8.3.2 F and µ estimation function

Identical to 5.1.2

8.3.3 Substrate prediction function

Identical to 5.1.3

With the inclusion of the if statement:

if t<6 F=F0; else F=F0*exp(FB); end

after the declaration of process constants

Page 94: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 88

9 Appendix B

9.1 Bio-Engineering Reactor

9.1.1 Reactor Data with Feed rate estimation

F05

Page 95: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 89

F06

Page 96: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 90

F07

Page 97: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 91

F08

Page 98: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 92

F09

No Substrate predictions

Page 99: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 93

9.1.2 Reactor Data with Feed rate input

F05

F06

Page 100: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 94

F07

F08

Page 101: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 95

F09

9.1.3 Reactor Data with Feedback control

F05

Page 102: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 96

F06

Page 103: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 97

F07

Page 104: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 98

F08

Page 105: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 99

F09

Page 106: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 100

Page 107: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 101

9.2 RC1 Bio-Calorimeter Reactor

9.2.1 Rc1 with Feed rate estimation

March 2

Page 108: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 102

April 12

Page 109: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 103

April 29

Page 110: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 104

May 14 Very different feed rate

Page 111: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 105

May 19

Page 112: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 106

Validation with KM04

Page 113: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 107

Page 114: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 108

10 References [1] Bhotmange, M., and Shastri, P., 2011, "Application of Artificial Neural Networks to Food

and Fermentation Technology," Artificial Neural Networks - Industrial and Control

Engineering Applications, .

[2] Dabros, M., Amrhein, M., Bonvin, D., 2009, "Data Reconciliation of Concentration

Estimates from Mid-Infrared and Dielectric Spectral Measurements for Improved on-Line

Monitoring of Bioprocesses," Biotechnology Progress, 25(2) pp. 578-588.

[3] English, N., 2005, "Process Instumentation and control course notes," UCD, School of

Chemical and Bioprocess engineering.

[4] Srinivasan, S., and Karunanithi, T., 2010, "Design of PI Controller for Bioreactors for

MaximumProduction Rate," International Journal of ChemTech Research, Vol.2,(No.3,) pp.

1679-1685.

[5] Lee, J., Lee, S. Y., Park, S., 1999, "Control of Fed-Batch Fermentations," Biotechnology

Advances, 17(1) pp. 29-48.

[6] Seborg, D., Edgar, F., and Mellichamp, D., 2003, "Process Dynamics and Control," John

Wiley & Sons, pp. 736.

[7] Haugen, F., 2010, "Basic DYNAMICS and CONTROL," ISBN 978-82-91748-13-9, Tapir

Academic Press, pp. 191.

[8] Mosier, N., and Ladisch, M., 2009, "Modern Biotechnology : Connecting Innovations in

Microbiology and Biochemistry to Engineering Fundamentals," Wiley, United Kingdom, pp.

464.

[9] Enfors, S. -., 2002, "Continuous and Fed-Batch Fermentation," Comprehensive Bio-Process

Engineering, pp. 67-92.

[10] Freeland, B., 2008, "Development of a Heat Transfer Teaching Rig and an Investigation

into the use of Artificial Neural Networks for Heat Transfer Modelling in Stirred Tank

Reactors," MSc Dissertation Dublin City University, .

[11] U.S. Department of Health and Human Services Food and Drug Administration, 2004,

"Guidance for IndustryPAT — A Framework for Innovative Pharmaceutical Development,

Manufacturing, and Quality Assurance," Pharmaceutical CGMP, .

[12] Teixeira, A. P., Oliveira, R., Alves, P. M., 2009, "Advances in on-Line Monitoring and

Control of Mammalian Cell Cultures: Supporting the PAT Initiative," Biotechnology

Advances, 27(6) pp. 726-732.

[13] Dabros, ,Michal, Schuler, ,Moira, and Marison, ,Ian, 2010, "Simple Control of Specific

Growth Rate in Biotechnological Fed-Batch Processes Based on Enhanced Online

Measurements of Biomass," Bioprocess and Biosystems Engineering, (9) pp. 1109-1118.

Page 115: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 109

[14] Watts, C., 2005,

Http://www.Fda.gov/downloads/AboutFDA/CentersOffices/CDER/UCM174306.Pdf," PAT —

A Framework for Innovative Pharmaceutical Development, Manufacturing, and Quality

Assurance, 2010(26/8) .

[15] von Stockar, U., Duboc, P., Menoud, L., 1997, "On-Line Calorimetry as a Technique for

Process Monitoring and Control in Biotechnology," Thermochimica Acta, 300(1-2) pp. 225-236.

[16] Berber, R., 1996, "Control of Batch Reactors : A Review : Process Operations and

Control," 74(1) pp. 3-20.

[17] Boskovic, J. D., and Narendra, K. S., 1995, "Comparison of Linear, Nonlinear and Neural-

Network-Based Adaptive Controllers for a Class of Fed-Batch Fermentation Processes,"

Automatica, 31(6) pp. 817-840.

[18] Ahuja, S., 1998, "Control Strategies for Bioprocesses," .

[19] Collins English Dictionary – Complete and Unabridged., 2011, "System. (n.d.)," (1991,

1994, 1998, 2000, 2003), 2011(August 20) .

[20] Cardello, R. J., 1988, "The Design of Controllers for Batch Bioreactors," Biotechnology and

Bioengineering, 32pp. 519-526.

[21] Luyben, W.L., 1989, "Process Modeling,Simulation and Control for Chemical Engineers,"

McGraw-Hill Higher Education, .

[22] Mkondweni, N. S., 2002, "Modelling and Optimal Control of Fed-Batch Fermentation

Process for the Production of Yeast," Peninsula Technikon Theses & Dissertations, (paper 5)

pp. 1-191.

[23] Soni, A., 2002, "A MULTI-SCALE APPROACH TO FED-BATCH BIOREACTOR

CONTROL," Graduate Faculty of the School of Engineering University of Pittsburgh, .

[24] Saarela, U., Leiviskä, K., and Juuso, E., 2003, "Modelling of a Fed-Batch Fermentation

Process," .

[25] Chen, L., Bastin, G., and Van Breusegem, V., 1995, "A Case Study of Adaptive Nonlinear

Regulation of Fed-Batch Biological Reactors," Automatica, 31(1) pp. 55-65.

[26] Astrom, K., and Murray, R., "Feedback Systems: An Introduction for Scientists and

Engineers," .

[27] Dochain, D., 1999, "Process Dynamics Modeling, Analysis, and Simulation by B. Wayne

Bequette 1st Edition, 1998; Prentice-Hall PTR, Upper Saddle River, New Jersey 07458, Xviii +

621 Pages; Price $85,00 US. ISBN 0-13-206889-3," The Canadian Journal of Chemical

Engineering, 77(1) pp. 191-191.

[28] Konstantinov, B., Chuppa, S., Sajan, E., 1994, "Real-Time Biomass-Concentration

Monitoring in Animal-Cell Cultures," Trends Biotechnol, pp. 324-12.

Page 116: Simulation modelling of a Fed-batch Bioreactor for controller development

Neville Lawless Page 110

[29] Konstantinov, K. B., (Osaka Univ., Suita (Japan). Faculty of Engineering), Nishio, N.,

1990, "Glucose Feeding Strategy Accounting for the Decreasing Oxidative Capacity of

Recombinant Escherichia Coli in Fed-Batch Cultivation for Phenylalanine Production,"

Journal of Fermentation and Bioengineering, 70(4) pp. 253-7.

[30] Massimo, C. D., Lant, P. A., Saunders, A., 1992, "Bioprocess Applications of Model-Based

Estimation Techniques," Journal of Chemical Technology & Biotechnology, 53(3) pp. 265-277.

[31] Ziegler, J.G and Nichols, N. B, 1942, "Optimum Settings for Automatic Controllers."

Transactions of the ASME, pp. 759-768.

[32] Schuler, M., Sivaprakasam, S., Freeland, B., "Investigation of the Potential of

Biocalorimetry as a Process Analytical Technology (PAT) Tool for Monitoring and Control of

Crabtree-Negative Yeast Cultures," Applied Microbiology and Biotechnology, pp. 1-10.

[33] Gadkar, K. G., Mehra, S., and Gomes, J., 2005, "On-Line Adaptation of Neural Networks

for Bioprocess Control," Computers & Chemical Engineering, 29(5) pp. 1047-1057.

[34] Havel, J., Peña, E. M., Rojas-Hernández, A., 1998, "Neural Networks for Optimization of

High-Performance Capillary Zone Electrophoresis Methods: A New Method using a

Combination of Experimental Design and Artificial Neural Networks," Journal of

Chromatography A, 793(2) pp. 317-329.

[35] Potocnik, P., and Grabec, I., 1999, "Empirical Modeling of Antibiotic Fermentation

Process using Neural Networks and Genetic Algorithms," Mathematics and Computers in

Simulation, 49(4-5) pp. 363-379.

[36] Saha, P. K., Shoib, M., and Kamruzzaman, J., 1998, "Development of a Neural Network

Based Integrated Control System of 120 ton/h Capacity Boiler," Computers & Electrical

Engineering, 24(6) pp. 423-440.

[37] Thibault, J., Van Breusegem, V., and Chéruy, A., 1990, "On-Line Prediction of

Fermentation Variables using Neural Networks," Biotechnology and Bioengineering, 36(10)

pp. 1041-1048.

[38] Havel, J., 2008, "Applications Orientated use of Artificial Nueral Networks Ins Science

Workshop Manual." National Centre for Sensor Research, .

[39] Bachinger, T., Mårtensson, P., and Mandenius, C. -., 1998, "Estimation of Biomass and

Specific Growth Rate in a Recombinant Escherichia Coli Batch Cultivation Process using a

Chemical Multisensor Array," Journal of Biotechnology, 60(1-2) pp. 55-66.