adjoint based gradient calculation - advantantages and challenges
DESCRIPTION
Adjoint based gradient calculation - advantantages and challenges. Bjarne Foss, Ruben Ringset The Norwegian University of Science & Technology – NTNU IO center. Outline Motivation A simple example to illustrate the potential of adjoints Where are the hurdles? Conclusions. Motivation. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/1.jpg)
1
Adjoint based gradient calculation - advantantages and challenges
Bjarne Foss, Ruben RingsetThe Norwegian University of Science & Technology – NTNUIO center
Outline1. Motivation
2. A simple example to illustrate the potential of adjoints
3. Where are the hurdles?
4. Conclusions
![Page 2: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/2.jpg)
2
Motivation
Norne fieldStatoilHydroEni, Petoro
Model
Data
![Page 3: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/3.jpg)
3
for k=1 to N ...simulate(k) end
model well schedule
+
simulator forecast
timenow
Optimize
now
history
Parameter estimation
Uncertainty
Motivation
![Page 4: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/4.jpg)
4
Reservoir Wells Pipelines Process Utilities Pipelines/tankers
Market
Inletseparator
Reservoir and well models
(Eclipse)
Network model(GAP, MaxPro,
OLGA)
Process model(HYSIS)
X 1
N G
L N G
C W 1
C 2
C W2 A / B
E 1 A
E 1 B
E 2
E 3
P r e - c o o l i n gP r e - c o o l i n gS e c t i o nS e c t i o n
L i q u e f a c t i o nL i q u e f a c t i o n S e c t i o nS e c t i o n
S u b - c o o l i n gS u b - c o o l i n gS e c t i o nS e c t i o n
C W3 A / B
C 1
C 3G
Application Value chain optimization
Application Value chain optimization
Motivation
Optimization requires a large number of gradient calculations
Efficient gradient computations are important
![Page 5: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/5.jpg)
5
A simple example
kkkkk
kkkk
kkk
k
uuxxz
ukxkxx
uxk
xx
,2,1,2,1
,2,2,11,2
,12,2
,11,1
2.01.0
Output
)sin(
systemNonlinear
]2.01.0[ ],11[
10
01 ,
)sin(
21
Jacobians
,2
kk
kk
k
DC
Bkk
xkA
kk
kk
xku
xu
,1,2
2,2,1
law control leStabilizab
N
TNk
Tk
N
kk
Tk QxxRuuQzzJ
2
1][
2
1
function Objective1
0
![Page 6: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/6.jpg)
6
A simple example
![Page 7: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/7.jpg)
7
A simple example
![Page 8: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/8.jpg)
8
length simulation theis where
with increases Runtime 2
N
NNwith
linearly increases Runtime
A simple example
![Page 9: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/9.jpg)
9
Adjoint gradient computation
![Page 10: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/10.jpg)
10
Adjoint gradient computation
Forward simulation
![Page 11: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/11.jpg)
11
Adjoint gradient computation
One forward
simulation
One reverse
simulation
![Page 12: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/12.jpg)
12
Forward method
N forward
simulations
(nested loops)
![Page 13: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/13.jpg)
13
The output constraint challenge – possible remedies
Reducing the number of constraints• Enforcing them on parts of a prediction horizon• Lumping output constraints together
– One interesting application of this is found in the Standford GPRS reservoir simulator (Sarma et al, 2006)
0),0(min(),0(max(
,,,1,
,min1 1
max,,
maxmin
ik
N
k
N
iiik
Nkk
zzzzy
RzNkzzzz
z
![Page 14: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/14.jpg)
14
The output constraint challenge
![Page 15: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/15.jpg)
15
The output constraint challenge – possible remedies
Reducing the number of constraints• Enforcing them on parts of a prediction horizon• Lumping output constraints together
– One interesting application of this is found in the Standford GPRS reservoir simulator (Sarma et al, 2006)
0),0(min(),0(max(
,,,1,
,min1 1
max,,
maxmin
ik
N
k
N
iiik
Nkk
zzzzy
RzNkzzzz
z
Taking advantage of barrier or interior point optimization methods• Removing output constraints without introducing slack
variables• Model constraints (i.e. equality constraints) can be removed by
a single shooting method (in eg. MPC)
![Page 16: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/16.jpg)
16
Adjoint based gradient calculation - advantantages and challenges
Conclusions• Adjoint based gradient
calculation may give huge improvements in run-time
• Output constraints is a challenge
![Page 17: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/17.jpg)
17
![Page 18: Adjoint based gradient calculation - advantantages and challenges](https://reader035.vdocuments.net/reader035/viewer/2022081501/56813a0d550346895da1df22/html5/thumbnails/18.jpg)
18
Once again - A very simple example
ufuxf u )(2
1 22
u
Let
and assume that is the independent variable, i.e. Compute the gradient wrt
01),( uxuxg
)(),( uux
)1()(2
1 22 uxuxL Lagrangian function
du
dL
du
dx
x
L
u
LLu
du
duxxuLu
)1()1)(()(
u
Choose x
12))1(( uuuLu 0),( when 12 uxgufu
(”reverse simulation”)