Modeling_Simulation_Lecture10
Modeling_Simulation_Lecture10
Ali M. Sahlodin
Department of Chemical Engineering
AmirKabir University of Technology
1397 S.H
1
11/17/2019
2
11/17/2019
dk
(C A ) 1 C A2 2k1C A (C A )
d
dk dk
(C B ) 1 C A2 2k1C A (C A ) 2 CB k2 (CB )
d d
dki b b
ai ( 2 ) exp( )
d R R
at t 0 (C A ) (CB ) 0
3
11/17/2019
Sensitivities of these
are finally needed.
State sensitivities are
intermediate results and
not required per se.
dJ dJ
(p) (p) p j (x(tf ), p) x (x(tf ), p)T x p j (tf )
dp j dp j
t
λ(t )T f p j (t , x(t ), p) f x (t , x(t ), p)x p j (t ) x p j (t ) dt
f
t0
4
11/17/2019
tf t tf
t λ(t )T x p j (t )dt λ(t )T x p j (t ) λ( t )T x (t )dt
f
0
t0 t0 pj
4. Substitute
dJ dJ
(p) (p) p j (x(tf ), p) λ(t0 )T h p j (p)
dp j dp j
T
x (x(tf ), p)-λ(t f ) x p j (tf )
t T
t ) x ) dt
(λ(t )T f p j (t , x(t ), p) f x (t , x(t ), p)T λ(t ) λ(
f
t0 pj
dJ dJ
(p) (p) p j (x(tf ), p) λ* (t0 )T h p j (p)
dp j dp j
tf
(λ* (t )T f p j (t , x(t ), p)) dt Influence of initial conditions
t0
Influence of system
dynamics
Copyright © Ali M. Sahlodin, Dept. of Chemical Engineering, AmirKabir Univ. of Tech. 10
5
11/17/2019
3. Compute gradients
dJ
(p) p j (x(tf ), p) λ* (t0 )T h p j (p) q j (t0 )
dp j
Maximize J ( ) CB2 a 2
6
11/17/2019
Adjoint equations
1* (t ) T
2k1C A 0 1 (t )
* 1* (t f ) 0
,
2* (t ) 2k1C A k2 2* (t ) 2C (
2 (t f ) B f
*
t )
T
dk1 2
d C A 1* (t )
q =- , q(t f )=0
dk1 C 2 dk2 C 2* (t )
d A d B
dJ
( ) 2a λ* (t0 )T h p j (p) q(t0 )
d
0
Adjoint Sensitivity
More efficient than forward sensitivity when there is a
large number of parameters and few functionals.
Requires more memory for storing state values in the
forward integration.
With variable step integrators, interpolation is needed to
evaluate state values for the adjoint system.
Does NOT provide state sensitivities.
Does NOT provide sensitivity at intermediate times.
7
11/17/2019