Download - PREHRAMBENO -BIOTEHNOLOŠKI FAKULTET
1PREHRAMBENO -BIOTEHNOLOŠKI FAKULTET
Poslijediplomski studij: PREHRAMBENE TEHNOLOGIJE
MODELIRANJE, OPTIMIRANJE I PROJEKTIRANJE PROCESA
Prof.dr.sc. Želimir Kurtanjek
PBF
tel: 4605 294 fax: 4836 083
E-mail: [email protected]
URL: http:/mapbf.pbf.hr/~zkurt
3MULTIDISCIPLINARNOST MATEMATIČKOG MODELIRANJA PROCESA
BIOTEHNIČKE
ZNANOSTI
MATEMATIČKE
ZNANOSTI
RAČUNARSKE
ZNANOSTI
4 TEORIJA SUSTAVA I MATEMATIČKO MODELIRANJE
Osnovni pojmovi o sustavu:
SUSTAV
OKOLINAGRANICASUSTAVA
{masa
energija
informacija}
masa
energija
informacija
Prikaz odnosa sustava i okoline
5
POČETAK
SISTEMSKI PRISTUP MODELIRANJU
SVRHA MODELA
DEFINIRANJE ULAZNIH VELIČINA X
DEFINIRANJE IZLAZNIH VELIČINA Y
IZVODI BILANCI MASE, ENERGIJE, KOLIČINE GIBANJA
IZBOR NUMERIČKE METODE
IZBOR RAČUNALNOGJEZIKA
RJEŠENJE JEDNADŽBI MODELA
ODREĐIVANJE PARAMETARA
PROVJERA MODELA
2M < NE
PRIMJENA
DA
6Značajke sustava
Sustav je apstraktna tvorevina, najčešće definira matematičkim relacijama ( npr. skupom diferencijalnih jednadžbi, diskretnih jednadžbi, neuralnim mrežama, neizraženom “fuzzy “ logikom, ekspertnim sustavom itd.).
1) za analizu nekog procesa, 2) upravljanje,3) projektiranje,4) nadzor ( monitoring )5) osiguranje kakvoće proizvoda6) optimiranje7) razvoj novih proizvoda8) zaštitu okoliša
Sustav se definira s obzirom na određenu svrhu, na primjer:
7NAČELO IZVOĐENJA BILANCI
V
dio volumena
ulazni tokovi:
tvari, energije,
količine gibanja
izlazni tokovi:
tvari, energije,
količine gibanja
8U procesnom inženjerstvu ( kemijskom, biokemijskom, prehrambenom, farmaceutskom .. ) matematičke modele izvodimo na osnovi slijedećih bilanci: mase (tvari), energije i količine
gibanja.
Osnovni oblik bilance je:
reakcijeebiokemijsk
iliikemijskezbogVvolumenu
uSpromjena
Vvolumenaiz
Stokovaizlaznih
zbroj
Vvolumenu
Stokovaulaznih
zbroj
Vvolumenuu
Saakumulacij
t /
gdje S označava masu ( količinu tvari), energiju i količinu gibanja.
9Modeli se razlikuju zavisno od izbora volumena za koji se postavlja bilanca.
Kada volumen obuhvaća ukupan volumen u kojem se zbiva proces ( na primjer biokemijski reaktor ) onda su to modeli s usredotočenim ili koncentriranim veličinama stanja.
Ako se kao volumen za koji se postavljaju bilance odabere samo dio cijelog volumena onda se radi o modelu s raspodjeljenim ili distribuiranim veličinama stanja.
Modeli s usredotočenim parametrima postaju sistemi običnih diferencijalnih jednadžbi, a modeli s distrubuiranim stanjima određeni su sistemom parcijalnih diferencijalnih jednadžbi.
10Razliku u načinu izvođenja bilanci možemo prikazati pomoću slijedećeg grafičkog prikaza:
V
U
U
U
I
I
1
2
3
1
2
V
U
U
U
I
I
1
2
3
1
2
u
u
i
i
1
2
1
2
S
U
U
U
1
2
3
ukupanvolumen V
diferencijalvolumena
dV
I
I
1
2
u
u1
2
i
i12
U,I su ulazni i izlazni tokovi za ukupanvolumen
u , i su ulazni i izlazni tokoviza diferencijal volumena
S
11U bilanci mase sastojka predznak ( + ) dolazi u slučaju kada je tvar
produkt reakcije, a predznak ( - ) kada je tvar reaktant u reakciji. Kod bilance energije predznak ( + ) dolazi kada je reakcija
egzotermna, a predznak ( - ) kada je reakcija endotermna.
Oznaka označava malu ali konačnu promjenu određene veličine,t je oznaka za vrijeme, je oznaka za malu konačnu promjenut je mala konačna promjena vremena(akumulacija S) je mala konačna promjena akumulacije ( sadržaja S)
dt
dF
t
Ft
0lim
Bilance postaju diferencijalne jednadžbe kada se provede granični postupak u kojem konačne diferencije, , postaju infinitezimalne veličine ( odnosno diferencijali, d ).
12Na primjer, za model s usredotočnim veličinama bilance mase za pojedine supstrate ima ima oblik:
Ni
Ni
NijsV
dt
d
,1 j
j,1 i
j,1 i
V u volumenus eproizvodnj
ili potrosnje brzina
reaktoru u ssupstrata
ijakoncentrac
Vizqprotok
volumniizlazni
pritoku u ssupstrata
ijakoncentrac
Vuqprotok
volumniulazni
13Opći oblik modela s raspodjeljenim veličinama stanja je:
txyfr
rtyt
,,,
gdje je vektor položaja. r
uz zadano početno stanje: ryrty o
,0
rubne uvjete: tyrty SSr
, i/ili ygrtyr Sr
,
txi ulazne veličine:
14Klasifikacija modela
Analitički modeli Neanalitički modeli
Regresijski
Neuralne mreže
“Fuzzy logic”
neizražena logika
Ekspertni sustavi
oooo
izvedeni iz
fundamentalnih
zakona fizike, kemije
i biologije
15Klasifikacija analitičkih modela
Deterministički Stohastički
Distribuirani UsredotočeniPopulacijski
Usredotočeni
DistribuiraniLinearni
Nelinearni
Diskretni
Kontinuirani
Nelinearni Linearni
Dif. jednadžbe
Prijenosne
funkcije
16Kontinuirani - diskretni modeli
Kontinuirani model sustava 1 reda
txktytydt
d
x(t) y(t)Sustav 1. reda
Zadane veličine:
1) parametri , k
2) početno stanje y(t = 0) = y0
3) ulazna veličina x(t), t [ 0, tf ]
17
x@t_D:= If@2< t< 8, 1, 0DPlot@x@tD,8t, 0, 10<D
2 4 6 8 10
0.2
0.4
0.6
0.8
1
Model u programskom jeziku:
Wolfram Research “Mathematica”
18k= 1.0; t =1.2;
NDSolve@8t * y'@tD+y@tD==k * x@tD, y@0D== 0.01<, y,8t, 0, 10<DPlot@Evaluate@y@tD. %D,8t, 0, 10<D
2 4 6 8 10
0.2
0.4
0.6
0.8
1
kontinuirandiskretan
korak
19Matematički modeli procesa u biotehnologiji
Matematički modeli procesa u biotehnologiji imaju vrlo istaknuti značaj. Na osnovu matematičkih modela analiziraju se:
odzivi mjernih sustava u biotehnološkim procesima,
procjenjuju se parametri i direktno nemjerljiva stanja procesa,
prijenos rezultata iz modela za laboratorijsko mjerilo u poluindustrijsko i industrijsko mjerilo
optimiranje procesa
nadzor ( “ monitoring” ) procesa
očuvanje kakvoće proizvoda
upravljanje ( automatizacija ) procesa
projektiranje novih procesa
20CONTENTS
1. Systems approach
2. Knowledge and system models
3. Fuzzy logic models
4. Example: Fuzzy logic control of flow rate
5. Neural networks
6. Control structures
7. Neural network control of a chemostat
8. Adaptive neural network fuzzy inference system
9. Computer demo exercises
10. Conclusions
21
Surroundings
System
xP
xI
y
Process subsystemSP
Control subsystemSC
Systems view of an industrial bioprocess
23Graphical representation of "transparency" of mathematical models in relation to knowledge and perception of
complexity of a system.
Neural networks
Fuzzy models
Analytical models
System complexity
Knowledge
X Y
24Objectives in modeling
Analytical models
Process analysis: studies of reaction mechanisms, kinetics, parameter estimation
Process design
Process optimization
Process control
Process on-line monitoring
Input - output models
Process on-line monitoring
Process control
25Fuzzy logic models
In fuzzy logic models input and output spaces are covered or appro-ximated with discourses of fuzzy sets labeled as linguistic variables
For example, if Ai X is an i-th fuzzy set it is defined as an ordered pair:
fAi ttXtxtxtxA ,0,,
where x(t) is a scalar value of an input variable at time t, and A is called a membership function which is a measure of degree of mem-bership of x(t) to Ai expressed as a scalar value between 0 and 1.
Typical membership functions have a form of a bellshaped or Gaussian, triangular, square, truncated ramp and other forms
27
X
Input space of physical variables
Input space of linguistic variables
AX
Output space of linguistic variables
AY
Output space of physical variables
Y
Logical rules with linguistic variables
Fuzzy Logic Inference Systems
( Mamdani Model )
28Input output relationships are modeled by fuzzy inference system, FIS.It is based on fuzzy logic reasoning which is a superset of classical Boolean logic rules for crisp sets. Elementary logic operations with fuzzy sets are:
fuzzy intersection or conjunction ( Boolean AND )
xxTxAxA AjAiji ,A typical choice of T-norm operator is a minimum function corresponding to Boolean AND, i.e.:
xAxAxAANDxA jiji ,minand standard choice to Boolean OR and NOT:
xAxAxAORxA jiji ,max
xAxANOT 1
29Process of mapping scalar between input and output sets by Fuzzy Inference System.
Fuzzification Fuzzy inference Defuzzification
x(t)y(t)
30Sugeno (1988) Fuzzy Inference System
X
Space of input variables (numbers)
AX
Space of input logic variables
Z
Space of singelton MF (numbers)
Y
Space of output variables (numbers)
Developed for process modeling and identification.
Application in adaptive neural fuzzy logic systems ANFIS
Logic relations
31
In Sugeno FIS for fuzzy inference polynomial Pn approximation is applied
Y = Pn ( Z ), usually a linear model is used
Y = C1 Z + Co , C1 and Co are constants
Mapping to scalar variables is obtained by averaging
y = WT Y
32Example: Fuzzy logic control of flow rate
For example, consider a fuzzy logic model of control of a flow rate ( position of a valve piston) based on input values of temperature T and pH
flow ratevalve position
T
pH Q
BIOPROCESS
FUZZY LOGIC MODEL
33FIS model Q=f(T,pH)
FUZZYRULES
INPUTSPACE OFLINGUISTICVARIABLES
FUZZIFICATION
OUTPUTSPACE OFLINGUISTICVARIABLES
DEFUZZIFI-CATION
FUZZY INFERENCE SYSTEM
INPUT DATA T(t) pH(t)
OUTPUT DATA Q(t)
AGGREGATION
35List of the fuzzy rules for control of valve position
IF T is low AND pH is low OR good THEN valve is half open IF T is low AND pH is low THEN valve is open IF T is high AND pH is high THEN valve is closed IF T is high AND pH is low THEN valve half open IF T is good AND pH is good THEN valve half open
36Membership function of the fuzzy sets in the output space
CLOSED HALF CLOSED
VALVE
VALVE
VALVE
OPEN
37Aggregation of fuzzy consequents from fuzzy inference system FIS into a single fuzzy variable output
(t)
VALVE
y(t) = valve position
FIS rules
Aggregation to output
dxx
dxxxty
~
~)(
centroid
38Schematic representation of a neurone with a sigmoid activation function
O
x1
x3
x2
xi
xN
ACTIVATION
0
0,2
0,4
0,6
0,8
1
1,2
-6 -4 -2 0 2 4 6
INPUTOUTPUT
)exp(1
1)(
ssf
40Model equations
k
TtytyE
2
1
)1(
1
)1()1(
1
)1(lN
i
lj
li
lijl
lN
i
lj
li
lij
lj koWnetkoWfko
jiji W
EW
,,
Methods of adaptation:
On-line back propagation of error with use of momentum term
Batch wise use of conjugate gradients ( Ribiere-Pollack, Leveberg-Marquard)
41NN models for process control
NNARX: Regressor vector:
Tkbka nntuntuntytyt 11
Predictor: ,,1 tNNttyty
NNOE: Regressor vector:
Tkbka nntuntuntytyt 11
Predictor:
,tNNty
42Inverse neural network control
PROCESSNN-1
XI Y
n
Input information on referencetransients of output variables
Compensation of process noise ?
45Chemostat as a single input single output SISO system
CHEMOSTAT
NN
D S
XSM
SMSXSS
S ccK
cYccD
dt
dc
0
XSM
SMX
X ccK
ccD
dt
dc
XXSM
SMPX
P cDccK
cY
dt
dc
47Responses of concentration of substrate chemostat to a sine perturbation of reference concentration obtained with direct inverse control. Reference signal is plotted as a solid curve and response is dotted. Frequency of perturbations are A: 0,0125 min-1; B: 0,025 min-1; C: 0,2 min-1; D: 0,1 min-1
0 20 40 60 80 100 120 140 160 180 2000
2
4
6
8
10
12
0 20 40 60 80 100 120 140 160 180 200 0
1
2
3
4
5
6
7
8
9
10
0 20 40 60 80 100 120 140 160 180 200 0
1
2
3
4
5
6
7
8
9
10
A B
C D
48Responses of substrate (s), dilution rate (D), product (p), and biomass (x) under direct inverse neural network control. Reference signal is a series of square impulses of substrate. The chemostat responses are dotted lines and the reference is a solid line.
0 20 40 60 80 100 120 140 160 180 200 3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
4
s D
p x
49Responses of substrate under direct inverse neural (….)
network control and internal model (….) control .
0 20 40 60 80 100 120 140 160 180 200 0
2
4
6
8
10
12
50Comparison of direct inverse neural network control and internal model neural network control with 7,5% relative standard noise in substrate measurement
S
Time (min)
0 200100
51NN from B. yeast production in deep jet bioreactor (Podravka)
1-run2-run3-run
15 h15 h15 h
Measured NN model
EtOH
52Adaptive neuro fuzzy inference system ANFIS
Integration of neural networks with fuzzy logic modeling.
ANFIS does not require prior selection of fuzzy logic variables
ANFIS does not require prior logic inference rules
ANFIS requires only sets of input and output training data ( like for NN modeling )
ANFIS has Sugeno structure of fuzzy logic systems
53ANFIS provides fuzzy logic clustering of data to artificial linguistic variables.
ANFIS provides adaptive membership functions for definition of association of data to linguistic variables (fuzzy variables).
ANFIS provides combinatorial generation of logical relations for mapping between input and output fuzzy sets.
ANFIS provides adaptation of parameters in Sugeno mapping.
ANFIS provides back propagation method for adaptation of model to training data.
54ANFIS model of chemostat D(k)=f [ Sref,S(k),S(k-1)]
and
or
not
input
Input MF
rules
output MF
Sugeno i/o mapping
output
Sref
S(k)
S(k-1)D(k)
56ConclusionsNeural networks NN and Fuzzy logic inference (FIS) systems are very practical methods for modelling and control of bioprocesses.
Advanced computer supported instrumentation for physical, chemical and biological variables provide large data banks applicable for training NN and FIS models.
NN and FIS are best suited for on-line monitoring, soft identification and nonlinear multivariable adaptive control.
Unlike analytical models, NN and FIS can be developed without “a priori” fundamental knowledge of a process.
Analytical models are “very expensive” to develop, but they are the most valuable engineering tool.
57NN and FIS can integrate knowledge in a very general form. Information from on-line instruments, image analysis and human experience can be easily incorporated.
Analytical models are excellent for extrapolation in the entire process space, while NN and FIS are the best at interpolation in the training set and need to be tested for extrapolation outside training.
Integration of NN and FIS into Adaptive Neural Fuzzy Inference Systems ANFIS leads to models which combine the best properties of NN and FIS.
ANFIS are highly adaptive like NN, they are transparent for logical rules like FIS, automatically generate linguistic variables and logical rules, and are trained to extensive process data.