E. C. Biscaia Jr ., A. R. Secchi, L. S. Santos
description
Transcript of E. C. Biscaia Jr ., A. R. Secchi, L. S. Santos
E. C. Biscaia Jr., A. R. Secchi, L. S. Santos
Programa de Engenharia Química (PEQ) – COPPE – UFRJ
Rio de Janeiro - Brazil
Dynamic Optimisation Using Wavelets Bases
Aims of the Contribution
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[f)t(x
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
ff fe x t y t u t[ ( ), ( ), ( ), ] 0
00 x)t(x
Improve numerical methods for solving dynamic optimisation problems:
s.t
Sequential Method
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[fdt)t(dx
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
0]),(),(),([ fff tutytxe
00 x)t(x
)t(u)t(u),t(usn10
fn ttttts 210
Control variables are discretized and dynamic model is solved numerically at each iteration of the NLP
Sequential Method
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[fdt)t(dx
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
0]),(),(),([ fff tutytxe
00 x)t(x
)t(u)t(u),t(usn10
fn ttttts 210
Control variables are discretized and dynamic model is solved numerically at each iteration of the NLP
Sequential Method
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[fdt)t(dx
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
0]),(),(),([ fff tutytxe
00 x)t(x
)t(u)t(u),t(usn10
fn ttttts 210
discretization in time domain ns stages
Control variables are discretized and dynamic model is solved numerically at each iteration of the NLP
Sequential Method
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[fdt)t(dx
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
0]),(),(),([ fff tutytxe
00 x)t(x
)t(u)t(u),t(usn10
fns ttttt 210
1t
2t
1snt
sntcontrol profile
(parameterization)
Sequential Method
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[fdt)t(dx
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
0]),(),(),([ fff tutytxe
00 x)t(x
)t(u)t(u),t(usn10
fns ttttt 210
1t
2t
1snt
snt
decision variables
Sequential Method
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[fdt)t(dx
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
0]),(),(),([ fff tutytxe
00 x)t(x
)t(u)t(u),t(usn10
fns ttttt 210
1t
2t
1snt
snt
decision variables
Sequential Method
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[fdt)t(dx
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
0]),(),(),([ fff tutytxe
00 x)t(x
)t(u)t(u),t(usn10
fns ttttt 210
1t
2t
1snt
snt
decision variables
NLP solver
Calculates optimal
control profile
Sequential Method
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[fdt)t(dx
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
0]),(),(),([ fff tutytxe
00 x)t(x
)t(u)t(u),t(usn10
fns ttttt 210
1t
2t
1snt
snt
decision variables
NLP solver
Calculates optimal
control profile
Successive Refinement
Initial profile
NLP solver
Refinement
NLP solver
Wavelets Sequential Method
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[fdt)t(dx
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
0]),(),(),([ fff tutytxe
00 x)t(x
NLP solver
Wavelets Sequential Method
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[fdt)t(dx
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
0]),(),(),([ fff tutytxe
00 x)t(x
NLP solver
Wavelets
Improving Adaptation of discrete points at each
iteration
Wavelets Sequential Method
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[fdt)t(dx
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
0]),(),(),([ fff tutytxe
00 x)t(x )t(u)t(u),t(usn10
fns ttttt 210
NLP solver
Wavelets
Improving Adaptation of discrete points at each
iteration
Wavelets Sequential Method
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[fdt)t(dx
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
0]),(),(),([ fff tutytxe
00 x)t(x )t(u)t(u),t(usn10
fns ttttt 210
NLP solver
Wavelets
new mesh
1t
2t
1snt
snt
3t
Improving Adaptation of discrete points at each
iteration
Wavelets Sequential Method
]t,p),t(u),t(y),t(x),t(x[Jmin f
)]p,t),t(u),t(y),t(x[fdt)t(dx
0t,p),t(u),t(y),t(xg
0,),(),(),( ttutytxh
0]),(),(),([ fff tutytxe
00 x)t(x )t(u)t(u),t(usn10
fns ttttt 210
NLP solver
Wavelets
new mesh
1t
2t
1snt
snt
3t
Improving Adaptation of discrete points at each
iteration
Wavelets AnalysisConsidering a function , it can be transformed into wavelet domain as:
)(tu
)t(),t(ud m,nm,n details
Wavelets AnalysisConsidering a function , it can be transformed into wavelet domain as:
)(tu
)t(),t(ud m,nm,n details
k n
Tn m n m
n m
u t d t D t2 2 1
, ,
1 0
( ) ( )
control variable
Inner product
Wavelets AnalysisConsidering a function , it can be transformed into wavelet domain as:
)(tu
where is the maximum level resolution. k
],,,,[ 12,2,,0,212,2,,0,212,1,,1,10,1 nkknn
)t(),t(ud m,nm,n details
k n
Tn m n m
n m
u t d t D t2 2 1
, ,
1 0
( ) ( )
control variable
],,,,[ 12,2,,0,212,2,,0,212,1,,1,10,1 nkknn dddddddD
Vector of wavelets details
Inner product
Resolution Position
kns 2
Wavelets Analysis
Haar wavelet has been considered:
10,0121,1210,1
toutt
tt
Wavelets Analysis
Haar wavelet has been considered:
10,0121,1210,1
toutt
tt
mtnnmn 22 2/, )12(,,0 nm
Wavelets Analysis
Haar wavelet has been considered:
10,0121,1210,1
toutt
tt
jnkmkjmn ,,0, ,,
mtnnmn 22 2/, )12(,,0 nm
Orthogonal basis
)t(u)t(u),t(usn10
fns ttttt 210
Wavelets Analysis
)t(u)t(u),t(usn10
fns ttttt 210
Control profile
NLP solver
Wavelets Analysis
NLP solver
)t(u)t(u),t(usn10
fns ttttt 210
Control profile
NLP solver
How Wavelets Work
NLP solver
Wavelets
Wavelets
Iteration 1
Iteration 2
Wavelets Thresholding Analysis
],,,,[ 12,2,,0,212,2,,0,212,1,,1,10,1 nkknn dddddddD
)t(),t(ud m,nm,n details
Wavelets Thresholding Analysis
],,,,[ 12,2,,0,212,2,,0,212,1,,1,10,1 nkknn dddddddD
]dd,,dd,dd,d[D nkknn ,,,,,,,,,,,,,th
12202122021211101
Thresholding: some details are eliminated.
)t(),t(ud m,nm,n details
Wavelets Thresholding Analysis
],,,,[ 12,2,,0,212,2,,0,212,1,,1,10,1 nkknn dddddddD
]dd,,dd,dd,d[D nkknn ,,,,,,,,,,,,,th
12202122021211101
)t(DtuTThTh New thresholded
control profile
Thresholding: some details are eliminated.
)t(),t(ud m,nm,n details
Thresholding strategiesThresholding:
(i)decomposition of the data ; (ii)comparing detail coefficients with a given threshold value and shrinking coefficients close to zero, eliminating data noise effects (DONOHO and JOHNTONE, 1995):
Thresholding strategiesThresholding:
(i)decomposition of the data ; (ii)comparing detail coefficients with a given threshold value and shrinking coefficients close to zero, eliminating data noise effects (DONOHO and JOHNTONE, 1995):
Visushrink (DONOHO, 1992):
n m n md u tt, ,( ), ( )
, , ,ˆ , n m n m n md Thr d d
,,
,
0, if,
1, if
n mn m
n m
dThr d
d
)ln(2ˆ sn
11, : 0,1, , 2 1
ˆ0.6745
nn mmedian d m
standard deviation of a white noise
details coefficients
Thresholding strategiesThresholding:
(i)decomposition of the data ; (ii)comparing detail coefficients with a given threshold value and shrinking coefficients close to zero, eliminating data noise effects (DONOHO and JOHNTONE, 1995):
Visushrink (DONOHO, 1992):
Fixed user specified (SCHLEGEL and MARQUARDT,2004 and BINDER, 2000):
n m n md u tt, ,( ), ( )
, , ,ˆ , n m n m n md Thr d d
,,
,
0, if,
1, if
n mn m
n m
dThr d
d
)ln(2ˆ sn
e
11, : 0,1, , 2 1
ˆ0.6745
nn mmedian d m
standard deviation of a white noise
details coefficients
How Wavelets Work
)t(u)t(u),t(usn10
fns ttttt 210
Control profile
NLP solver
NLP solver
Wavelets
Wavelets
Sequential AlgorithmIncorporate the
Visushrink threshold procedure and
compare with other fixed threshold
parameters;
Observe if the CPU is affected by changes of
threshold rule.
Improve, at each iteration, the estimate
of control profile.
Algorithm and Parameters
1. Integrator: Runge Kutta fourth order (ode45 Matlab);
2. Optimisation: Interior Point (Matlab) was used as NLP solver;
3. Wavelets: Routines of Matlab 7.6;
4. Stop Criteria
1
i iobj obj
iobj
F F
F
Flowsheet of Wavelet Refinement Algorithm
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010
Initial control Profile
u
t
Example: Semi-batch Isothermal Reactor (SRINIVASAN et al. ,2003)
Constant by parts interpolation
Flowsheet of Wavelet Refinement Algorithm
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010 Optimal control profile 8 stages
u
t
Example: Semi-batch Isothermal Reactor (SRINIVASAN et al. ,2003)
Flowsheet of Wavelet Refinement Algorithm
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010Optimal control profile
16 stages
u
t
Example: Semi-batch Isothermal Reactor (SRINIVASAN et al. ,2003)
Flowsheet of Wavelet Refinement Algorithm
0 50 100 150 200 2500.0000
0.0005
0.0010
0.0015
0.0020
0.0025
n = 4
n (Resolution)
n = 1n = 2
n = 3
Adaptive Visushrink Threshold16 stages
wavele
t deta
ils
t
Visushrink Threshold Fixed Threshold
0 50 100 150 200 2500.0000
0.0005
0.0010
0.0015
0.0020
0.0025Fixed threshold
16 stagesw
avele
t deta
ils
t
Example: Semi-batch Isothermal Reactor (SRINIVASAN et al. ,2003)
Flowsheet of Wavelet Refinement Algorithm
0 50 100 150 200 2500.0000
0.0005
0.0010
0.0015
0.0020
0.0025Thresholded details
16 stages
wavele
t deta
ils
t
Visushrink Threshold Fixed Threshold
Example: Semi-batch Isothermal Reactor (SRINIVASAN et al. ,2003)
0 50 100 150 200 2500.0000
0.0005
0.0010
0.0015
0.0020
0.0025Thresholded details
16 stagesw
avele
t deta
ils
t
Flowsheet of Wavelet Refinement Algorithm
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010
Optimal control profile 20 stagesu
t
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010
Optimal control profile 18 stagesu
t
Visushrink Threshold Fixed Threshold
Example: Semi-batch Isothermal Reactor (SRINIVASAN et al. ,2003)
Flowsheet of Wavelet Refinement Algorithm
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010
Optimal control profile 20 stagesu
t
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010
Optimal control profile 18 stagesu
t
Visushrink Threshold Fixed Threshold
Locations of discontinuity points ~ large details coefficients
Example: Semi-batch Isothermal Reactor (SRINIVASAN et al. ,2003)
Flowsheet of Wavelet Refinement Algorithm
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010
Optimal control profile 16 stages
u
t
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010
Optimal control profile 16 stages
u
t
Visushrink Threshold Fixed Threshold
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010
Optimal control profile 20 stagesu
t
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010
Optimal control profile 26 stagesu
t
Example: Semi-batch Isothermal Reactor (SRINIVASAN et al. ,2003)
Case Studies
Semi-batch Isothermal Reactor (SRINIVASAN et al., 2003))
A B C B D2
Bu F tf C t( )max ( )
0 25 50 75 100 125 150 175 200 225 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010
u [L.m
in-1
]
t [min]
Bu F t( )Optimal Control Profile: 128 stages
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010 16 stages
u
t [min]
Control profile evolution
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010 20 stages
u
t [min]
Control profile evolution
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.001030 stages
u
t [min]
Control profile evolution
0 50 100 150 200 250
0.0000
0.0002
0.0004
0.0006
0.0008
0.0010 34 stages
u
t [min]
Control profile evolution
Results: Semi-batch Isothermal Reactor
Uniform mesh with 128 stages
Fixed Threshold 10-4
Fixed Threshold 10-5
Fixed Threshold 10-7
Visushirink
Iter.Total CPU
nsTotal CPU
nsTotal CPU
nsTotal CPU
nsTotal CPU
ns
1 8 8 8 82 16 16 16 163 22 22 24 164 26 30 32 205 28 36 36 306 32 42 40 347 36 46 428 42 58 549 461011
1 128 0.76 46 0.85 58 0.91 54 0.22 34
Reference CPU time: Uniform mesh
Bioreactor problem (CANTO et al. , 2001))
Sf
u F tJ M t
( )max ( )
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 150.0
0.2
0.4
0.6
0.8
1.0
1.2
1.4
1.6
1.8
2.0
u [L
.h-1
]
t [h]
Su F t( )Optimal Control Profile: 128 stages
M: monomerS: substrate
Control profile evolution
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 150.0
0.2
0.4
0.6
0.8
1.0
1.2
1.4
1.6
1.8
2.0 16 stages
u [L.h
-1]
t [h]
Control profile evolution
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 150.0
0.2
0.4
0.6
0.8
1.0
1.2
1.4
1.6
1.8
2.0 20 stages
u [L.h
-1]
t [h]
Control profile evolution
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 150.0
0.2
0.4
0.6
0.8
1.0
1.2
1.4
1.6
1.8
2.0 26 stages
u [L.h
-1]
t [h]
Control profile evolution
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 150.0
0.2
0.4
0.6
0.8
1.0
1.2
1.4
1.6
1.8
2.0 34 stages
u [L.h
-1]
t [h]
Control profile evolution
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 150.0
0.2
0.4
0.6
0.8
1.0
1.2
1.4
1.6
1.8
2.0 46 stages
u [L.h
-1]
t [h]
Control profile evolution
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 150.0
0.2
0.4
0.6
0.8
1.0
1.2
1.4
1.6
1.8
2.0 64 stages
u [L.h
-1]
t [h]
Results: Bioreactor problem)
Uniform mesh with 128 stages
Fixed Threshold 10-1
Fixed Threshold 10-4
Fixed Threshold 10-7
Visushirink
Iter.Total CPU
nsTotal CPU
nsTotal CPU
nsTotal CPU
nsTotal CPU
ns
1 8 8 8 82 16 16 16 163 26 24 32 204 30 32 38 265 38 42 46 346 44 48 58 467 48 56 66 648 56 74 729 70 84
1 128 0.82 70 1.32 74 1.58 84 0.37 64
Reference CPU time: Uniform mesh
Mixture of Catalysts (BELL and SARGENT, 2000)
fu t
C t( )
max[ ( )]
catu t
cat cat1
( )1 2
0.0 0.2 0.4 0.6 0.8 1.0
0.0
0.2
0.4
0.6
0.8
1.0
u
t
Optimal Control Profile: 64 stages
CBAcatcat 21
Control profile evolution
0.0 0.2 0.4 0.6 0.8 1.0
0.0
0.2
0.4
0.6
0.8
1.0 16 stages
u
t
Control profile evolution
0.0 0.2 0.4 0.6 0.8 1.0
0.0
0.2
0.4
0.6
0.8
1.0 20 stages
u
t
Control profile evolution
0.0 0.2 0.4 0.6 0.8 1.0
0.0
0.2
0.4
0.6
0.8
1.0 26 stages
u
t
Results: Bioreactor problem
Uniform mesh with 64 stages
Fixed Threshold 10-1
Fixed Threshold 10-4
Visushirink
Iter.Total CPU
nsTotal CPU
nsTotal CPU
nsTotal CPU
ns
1 8 8 82 16 16 163 20 20 204 22 22 265 28 30
1 64 0.43 28 0.56 30 0.14 26
Reference CPU time: Uniform mesh
Conclusions
1. Two threshold procedures were analyzed here: Fixed and Visuhrink (level dependent threshold). According to the results, Visushrink strategy is able to denoise the details in a more efficient way than Fixed strategy, that is more conservative. We have shown that the choice of a threshold procedure can improve the wavelet adaptation algorithm;
Conclusions
1. Two threshold procedures were analyzed here: Fixed and Visuhrink (level dependent threshold). According to the results, Visushrink strategy is able to denoise the details in a more efficient way than Fixed strategy, that is more conservative. We have shown that the choice of a threshold procedure can improve the wavelet adaptation algorithm;
2. Other examples from literature ( BINDER et al., 2000; SRINIVASAN et al. , 2003; SCHLEGEL, 2004) was solved and have been presented similar results: a considerable improvement of CPU time when Visushrink is used.
Conclusions
1. Two threshold procedures were analyzed here: Fixed and Visuhrink (level dependent threshold). According to the results, Visushrink strategy is able to denoise the details in a more efficient way than Fixed strategy, that is more conservative. We have shown that the choice of a threshold procedure can improve the wavelet adaptation algorithm;
2. Other examples from literature ( BINDER et al., 2000; SRINIVASAN et al. , 2003; SCHLEGEL, 2004) was solved and have been presented similar results: a considerable improvement of CPU time when Visushrink is used.
3. Other wavelets thresholding strategies (as Sureshrink and Minimaxi) has been investigated, however in some cased these strategies have undesirable results, with worse performance than Fixed strategy.
Future Works
1. This algorithm will be used to solve more complex problems with several control variables in order to improve the sequential adaptation of each control profile. Our expectation is to observe the intensification of threshold influence for these problems.
Future Works
1. This algorithm will be used to solve more complex problems with several control variables in order to improve the sequential adaptation of each control profile. Our expectation is to observe the intensification of threshold influence for these problems.
2. As observed here, wavelets are able to detect discontinuity points and therefore the location of different control arcs. A more sophisticated interpolation of control profile will be implemented in these regions with aims to reduce he number of stages and consequently decision variables.
Thank You