No Slide Title

Download Report

Transcript No Slide Title

PREHRAMBENO -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
1
2
MODELIRANJE
MULTIDISCIPLINARNOST MATEMATIČKOG
MODELIRANJA PROCESA
BIOTEHNIČKE
MATEMATIČKE
ZNANOSTI
ZNANOSTI
RAČUNARSKE
ZNANOSTI
3
TEORIJA SUSTAVA I MATEMATIČKO
MODELIRANJE
Osnovni pojmovi o sustavu:
masa
energija
informacija
OKOLINA
{
GRANICA
SUSTAVA
SUSTAV
Prikaz odnosa sustava i okoline
masa
energija
informacija
}
4
SISTEMSKI PRISTUP MODELIRANJU
SVRHA
POČETAK
MODELA
DEFINIRANJE
ULAZNIH
VELIČINA X
DEFINIRANJE
IZLAZNIH
VELIČINA Y
ODREĐIVANJE
PARAMETARA
IZBOR
NUMERIČKE
METODE
RJEŠENJE
JEDNADŽBI
MODELA
PROVJERA
MODELA
2 M < 
IZVODI BILANCI
MASE, ENERGIJE,
KOLIČINE GIBANJA
IZBOR
RAČUNALNOG
JEZIKA
NE
DA
PRIMJENA
5
Značajke sustava
6
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.).
Sustav se definira s obzirom na određenu svrhu,
na primjer:
1) za analizu nekog procesa,
2) upravljanje,
3) projektiranje,
4) nadzor ( monitoring )
5) osiguranje kakvoće proizvoda
6) optimiranje
7) razvoj novih proizvoda
8) zaštitu okoliša
NAČELO IZVOĐENJA BILANCI
dio
volumena
V
ulazni tokovi:
tvari, energije,
količine gibanja
izlazni tokovi:
tvari, energije,
količine gibanja
7
8
U 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:
zbroj
zbroj

 
  prom jena S u







 akum ulacija 

  ulaznih tokova  izlaznih tokova  volum enu V zbog 
S









 kem ijske i / ili

S
S
t 

 
 

 u volum enuV  
u
volum
en
V
iz
volum
ena
V
biokem
ijsk
e
reakcije

 
 

gdje S označava
masu ( količinu tvari), energiju i količinu gibanja.
Modeli 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.
9
10
Razliku u načinu izvođenja bilanci možemo prikazati pomoću slijedećeg
grafičkog prikaza:
U1
U1
I1
I1
u1
U2
V
U2
u2
V
i2
i1
S
I2
U3
U3
I2
U3
U1
U2
S
ukupan
volumen V
I1
u1
I2
u2
U,I su ulazni i izlazni tokovi za ukupan
volumen
diferencijal
volumena
dV
i1
i2
u , i su ulazni i izlazni tokovi
za diferencijal volumena
11
U 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 promjenu
t je mala konačna promjena vremena
(akumulacija S) je mala konačna promjena akumulacije
( sadržaja S)
  F  dF
 
lim 
 t 0  t

 dt
Bilance postaju diferencijalne jednadžbe kada se provede
granični postupak u kojem konačne diferencije,  , postaju
infinitezimalne veličine ( odnosno diferencijali, d ).
Na primjer, za model s usredotočnim veličinama bilance mase
12
za pojedine supstrate ima ima oblik:
ija

 ulaznivolumni  koncentrac
d
V  s j     protok q u V    supstrata s u prit oku 
dt
j
i 1, N
i
 

koncentrac
ija

 izlazni volumni 



  


i 1, N protok q i iz V   supstrata s j u reaktoru
brzina potrosnje ili





 proizvodnje s u volumenuV 
j
i 1, N

Opći oblik modela s raspodjeljenim veličinama stanja je:
  
   
yt , r    f  y, x , t 
t
r
gdje je

r
vektor položaja.

  
uz zadano početno stanje: yt  0, r   yo r 
 

rubne uvjete: yt, r  rS  yS t 

i ulazne veličine: xt 
 
  
i/ili  r yt , r  rS  g  y 
13
14
Klasifikacija modela
Analitički modeli
Neanalitički modeli
Regresijski
izvedeni iz
fundamentalnih
oooo
zakona fizike, kemije
i biologije
Neuralne mreže
“Fuzzy logic”
neizražena logika
Ekspertni sustavi
Klasifikacija analitičkih modela
Deterministički
Distribuirani
15
Stohastički
Populacijski
Usredotočeni
Usredotočeni
Linearni
Diskretni
Nelinearni
Kontinuirani
Distribuirani
Dif. jednadžbe
Nelinearni
Linearni
Prijenosne
funkcije
Kontinuirani - diskretni modeli
Kontinuirani model sustava 1 reda
x(t)
Sustav 1. reda
d
  y t   y t   k  xt 
dt
Zadane veličine:
1) parametri  , k
2) početno stanje y(t = 0) = y0
3) ulazna veličina x(t), t  [ 0, tf ]
y(t)
16
Model u programskom jeziku:
17
Wolfram Research “Mathematica”
@
D
@
D
@
@
D8 <D
x t_ := If 2 < t < 8, 1, 0
Plot x t , t, 0, 10
1
0.8
0.6
0.4
0.2
2
4
6
8
10
@
8
@
D
@
D
@
D
@
D
<
8
<
D
@@
@
D
D8 <D
18
k = 1.0; t = 1.2;
NDSolve
t * y' t + y t
== k * x t , y 0 == 0.01 , y,
t, 0, 10
Plot Evaluate y t . % , t, 0, 10
1
0.8
kontinuiran
diskretan
0.6
korak
0.4
0.2
2
4
6
8
10
Matematički modeli procesa u biotehnologiji
19
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
projektiranje novih procesa
nadzor ( “ monitoring” ) procesa
očuvanje kakvoće proizvoda
upravljanje ( automatizacija ) procesa
optimiranje procesa
CONTENTS
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
20
21
Systems view of an industrial bioprocess
Surroundings
System
xP
Process subsystem
SP
xI
Control subsystem
SC
y
Schematic diagram of mathematical forward M and
inverse M-1 models
M
Y
X
M-1
22
Graphical representation of "transparency" of mathematical 23
models in relation to knowledge and perception of
complexity of a system.
Analytical models
X
Y
Fuzzy models
Neural networks
Knowledge
System
complexity
Objectives in modeling
Analytical models
Process analysis: studies of reaction mechanisms, kinetics,
parameter estimation
Process design
Process optimization
Process on-line monitoring
Process control
Input - output models
Process on-line monitoring
Process control
24
25
Fuzzy logic models
In fuzzy logic models input and output spaces are covered or approximated 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:

 
Ai  xt ,  A  xt  xt   X , t  0, t f
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 membership 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
Gaussian membership functions
26
Fuzzy Logic Inference Systems
27
( Mamdani Model )
Logical rules with
linguistic variables
X
AX
AY
Input
space of
physical
variables
Input
space of
linguistic
variables
Output
space of
linguistic
variables
Y
Output
space of
physical
variables
Input output relationships are modeled by fuzzy inference 28
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 )
 Ai x  Aj x  T  Ai x,  Aj x
A typical choice of T-norm operator is a minimum function
corresponding to Boolean AND, i.e.:
Ai x AND Aj x  minAi x, Aj x
and standard choice to Boolean OR and NOT:
Ai x OR Aj x  maxAi x, Aj x
NOT Ax  1  Ax 
Process of mapping scalar between input and output sets by29
Fuzzy Inference System.
Fuzzification
x(t)
Fuzzy inference
Defuzzification
y(t)
30
Sugeno (1988) Fuzzy Inference System
Logic
relations
X
Space of
input
variables
(numbers)
AX
Z
Space of
input
logic
variables
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
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
Example: Fuzzy logic control of flow rate
32
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 rate
valve position
T
pH
BIOPROCESS
FUZZY
LOGIC
MODEL
Q
FIS model Q=f(T,pH)
FUZZY INFERENCE SYSTEM
INPUT
SPACE OF
LINGUISTIC
VARIABLES
FUZZY
RULES
OUTPUT
SPACE OF
LINGUISTIC
VARIABLES
AGGREGATION
FUZZIFICATION
DEFUZZIFICATION
INPUT DATA
T(t) pH(t)
OUTPUT DATA
Q(t)
33
34
 LOW pH
 LOW T

GOOD T
 HIGH T
T
T

GOOD pH
 HIGH
pH
pH
pH
T
T(t)
pH
pH(t)
List of the fuzzy rules for control of valve position
IF
IF
IF
IF
IF
T is low AND pH
T is low AND
T is high AND
T is high AND
T is good AND
is low OR good
pH is low
pH is high
pH is low
pH is good
35
THEN valve is half open
THEN valve is open
THEN valve is closed
THEN valve half open
THEN valve half open
Membership function of the fuzzy sets in the output space 36

CLOSED
VALVE

OPEN
VALVE
HALF CLOSED

VALVE
Aggregation of fuzzy consequents from fuzzy inference
system FIS into a single fuzzy variable output
(t)
FIS rules
Aggregation
to output
VALVE
centroid
~ x   dx y(t) = valve position
x



y (t ) 
~ x   dx


37
Schematic representation of a neurone with a sigmoid
activation function
ACTIVATION
x1
1,2
1
x2
OUTPUT
O
x3
0,8
0,6
0,4
xi
0,2
xN
0
-6
-4
-2
0
2
4
INPUT
1
f ( s) 
1  exp( s)
6
38
Schematic diagram of a feedforward multilayer
perceptron
X1
Y1
X2
Y2
X3
Y3
X4
I
H
O
39
Model equations
40
N ( l 1)
N ( l 1)


olj k   f  Wijl  oi(l 1) k    jl  netl  Wijl  oi(l 1) k    jl
i 1
 i 1

 T  
1
E    y  t   y  t 
2 k
E
Wi , j   
Wi , j
Methods of adaptation:
On-line back propagation of error with use of momentum term
Batch wise use of conjugate gradients ( Ribiere-Pollack, LevebergMarquard)
41
NN models for process control
NNARX: Regressor vector:
 t   yt 1 yt  na ut  nk ut  nb  nk 1
T
Predictor:


y t   y t t 1,  NN  t , 
NNOE: Regressor vector:


T
 t   yt 1 yt  na ut  nk ut  nb  nk 1
Predictor:

y t   NN  t , 
Inverse neural network control
Compensation of
process noise ?
n
Y
XI
NN-1
Input information on reference
transients of output variables
PROCESS
42
Inverse neural network control coupled with a
PID feedback loop
n
XI
NN-1
PROCESS
Y
PID
+
-
43
44
Internal model control structure
n1
NN -1
xI
n2
n3
PROCESS
Y
-
NN
+
Chemostat as a single input single output SISO system
D
S
CHEMOSTAT
NN
cS
dcX
 D  cX  M 
 cX
dt
K M  cS
dcS
cS
 D  cS 0  cS   YSX   M 
 cX
dt
K M  cS
cS
dcP
 YPX   M 
 cX  D  cX
dt
K M  cS
45
CHEMOSTAT SISO MODELS
46
NN
cS k  1  NN cS k , cS k 1, D(k ), D(k 1)
NN-1
Dk 1  NN
1
cS k 1, cS k , cs (k 1), D(k )
Responses of concentration of substrate chemostat to a sine
47
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
10
9
A
B
8
7
6
5
4
3
2
1
0
12
0
20
40
60
80
100
120
140
120
140
160
180
200
10
D
9
C
10
8
7
8
6
5
6
4
4
3
2
2
1
0
0
20
40
60
80
100
120
140
160
180
200
0
0
20
40
60
80
100
160
180
200
Responses of substrate (s), dilution rate (D), product (p), and
48
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.
s
D
4
3.9
3.8
3.7
3.6
x
p
3.5
3.4
3.3
3.2
3.1
0
20
40
60
80
100
120
140
160
180
200
Responses of substrate under direct inverse neural (
network control and internal model (
….)
….) control .
12
10
8
6
4
2
0
0
20
40
60
80
100
120
140
160
180
200
49
Comparison of direct inverse neural network control and
internal model neural network control with 7,5% relative
standard noise in substrate measurement
S
0
100
Time (min)
200
50
NN from B. yeast production in deep jet bioreactor
(Podravka)
EtOH
3-run
2-run
1-run
15 h
15 h
15 h
Measured
NN model
51
Adaptive 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
52
53
ANFIS 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.
ANFIS model of chemostat D(k)=f [ Sref,S(k),S(k-1)]
Input MF
Sref
output MF
not
or
and
S(k)
D(k)
output
S(k-1)
input
rules
Sugeno i/o mapping
54
DEMODemo
PROGRAMS
55
Conclusions
56
Neural 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.
NN 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.
57
58
Model verification of NN, FIS and ANFIS is
the most important step before their
application in laboratory and industrial
practice.