Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time...

24
Parameter Optimisation using POD: Application in Groundwater Flow J. N. Wise Supervisors: Prof. M. Batton-Hubert, Prof. G. Venter Collaboration between EMSE and SU December 7, 2012 J. N. Wise (SUN) 1 / 24

Transcript of Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time...

Page 1: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Parameter Optimisation using POD:Application in Groundwater Flow

J. N. Wise

Supervisors: Prof. M. Batton-Hubert, Prof. G. Venter

Collaboration between EMSE and SU

December 7, 2012

J. N. Wise (SUN) 1 / 24

Page 2: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Outline

1 Context

2 Richard’s equation FE discretization

3 Proper orthogonal decomposition

4 Further linearization using POD

5 Optimisation

J. N. Wise (SUN) 2 / 24

Page 3: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Context

Groundwater

J. N. Wise (SUN) 3 / 24

Page 4: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Richards equation

Finite element equation and discretizationRichard’s equation: Describes head pressure h (in meters)

C(h)∂h∂t

= ∇ · K (h)∇(h + z)

Backward finite difference for time step

dhdt

=h − hold

δt

Variational formulation - multiply by test functionv(x , z) = v1ϕ1(x , z), ..., vnϕn(x , z)∫

ΩvC

hδt

+

∫Ω∇v · K∇h︸ ︷︷ ︸

Mh

=

∫Ω

vChold

δt−∫

ΩK∂v∂z

+

∫Γ

vf︸ ︷︷ ︸V

J. N. Wise (SUN) 4 / 24

Page 5: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Discretization

Richard equation: FE and equations

Discretization

h(x , z, t) ≈n∑

i=1

hi(t)ϕi(x , z)

Non-linear parameters

C(h) =

d(θs − θr )(1 + (hhg

)n)−m

dh

K (h) = Ks

(θ(h)− θr

θs − θr

)n

φ1 φ2 φ3 φ4

φ5φ0

BV1 BV2h2 h3h(x)

x

0.000

0.005

0.010

0.015

0.020

0.025

0.030

0.035

0.040

C(h

)

0.0012

0.0014

0.0016

0.0018

0.0020

0.0022

0.0024

0.0026

0.0028

0.0030

K(h

)

−6 −5 −4 −3 −2 −1 0Head [m]

K(h)C(h)

J. N. Wise (SUN) 5 / 24

Page 6: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Matrix notation

Matrix form

(M1 + M2) h = V1 + V2 + V3 [n × n]

M1(C) =1δt

∫Ω

vCv

M2(K ) =

∫Ω∇v · K∇v

[n × n]

V1(C) =1δt

∫Ω

Cv

V2(K ) = −∫

ΩK∂v∂z

V3 =

∫Γ

vf (x , y , t)

[n × 1]

POD

J. N. Wise (SUN) 6 / 24

Page 7: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Code

//----------//// Matrices ////----------//varf m1(h, v) = int2d(Th)( Ch/dt * h * v);varf m2(h, v) = int2d(Th)(Kh*dx(h)*dx(v)+Kh*dy(h)*dy(v))

+on(7,h=(ymax -y+2*ampl));matrix M1, M2;

//---------//// Vectors ////---------//varf v1(h, v) = int2d(Th)( Ch/dt* hn*v);varf v2(h, v) = int2d(Th)(- Kh*dy(v));varf vd(h, v) = on(7,h=(ymax -y+2*ampl)); // River - Dirichletvarf vnw(h, v) = int1d(Th,5)(-v*0.015); // Pumping well - Neumannvarf vnr(h, v) = int1d(Th,3)(v*BV*N.y*(x<200)); // Rainfall input - Neumann

Vh V1, V2, Vd, Vnw, Vnr;

J. N. Wise (SUN) 7 / 24

Page 8: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Test problem

Boundary conditions

C(h)∂h∂t

= ∇ · K (h)∇(h + z)

h(x , z, t) = (y − 80)m on Γd

K∇(h + z) = −0.015m/s on Γnw

K∇(h + z) = Frain(t)m/s on Γnr

δt = 24hr 0 ≤ t ≤ 100days

0 50 100 150 200 250 300

x [cm]0

50

100

150

200

z[c

m]

Dirichlet Γd

Neuman Γnr

Neumann Γnw

Initial condition and Frain

0 50 100 150 200 250 300

x [cm]0

50

100

150

200

z[c

m]

-15.000

0.000

15.000

30.000

45.000

60.000 60.000

75.000

0 20 40 60 80 100

Time in days0

5

10

15

20

Rai

nin

mm

J. N. Wise (SUN) 8 / 24

Page 9: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Reduced modelling

Parameter optimisation problemOptimisation problem requires ≈ 100’s simulationsNeed to reduce individual simulation times

SolutionReduce matrix size => number shape functionsRun a number of full simulations (based on DOE)Capture the behaviour with global shape functionsGlobal functions must optimally represent original response

J. N. Wise (SUN) 9 / 24

Page 10: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Principal component analysis

PCA outlineCollect snapshot set X = [h1(x), h2(x), ..., hd (x)]

Optimisation problem: Find optimal global shape functions.

Min‖X − projΨi X‖,⟨Ψi ,Ψj

⟩= δij ,

Set up covariance matrix

A =1n

XX T

Turns out eigenvectors of A are optimal shape functionsU = Ψ1, Ψ2, ..., Ψm

J. N. Wise (SUN) 10 / 24

Page 11: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

First four eigenvectors

0 50 100 150 200 250 300

x [cm]0

50

100

150

200

z[c

m]

0.0030.006

0.009

0.009

0.012

0.015

0.01

8

0.021

0 50 100 150 200 250 300

x [cm]0

50

100

150

200

z[c

m] -0.016

-0.0080.000

0.000

0.0080.016

0.024

0.032

0.040

0 50 100 150 200 250 300

x [cm]0

50

100

150

200

z[c

m]

-0.075-0.060

-0.045-0.030-0.015

0.000

0.000

0.015

0 50 100 150 200 250 300

x [cm]0

50

100

150

200

z[c

m]

-0.045-0.030

-0.030

-0.015 -0.015

0.000

0.000

0.015

0.030

J. N. Wise (SUN) 11 / 24

Page 12: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Approach 1: Galerkin intrusive approach

Reduced modelling with global shape functionsGlobal shape function approximation

h(x , z, t) =m∑

j=1

αj(t)Ψj(x , z)

Test function:

w(x , z) = w1Ψ1(x , z) + ...+ wmΨm(x , z)

Relation between w(x , z) and v(x , z):

Ψi(x , z) =n∑

j=1

Ψijϕj(x , z)

U = Ψ1, Ψ2, ..., Ψm

J. N. Wise (SUN) 12 / 24

Page 13: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Matrix notation

Matrix form (M1 + M2

)h = V1 + V2 + V3 [m ×m]

M1(C) =1δt

∫Ω

wCw

M2(K ) =

∫Ω∇w · K∇w

[m ×m]

V1(C) =1δt

∫Ω

Cw

V2(K ) = −∫

ΩK∂w∂z

V3(f ) =

∫Γ

wf (x , z, t)

[m × 1]

J. N. Wise (SUN) 13 / 24

Page 14: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Matrix notation in ‘reduced’ model

Projection onto reduced basis(M1 + M2

)h = V1 + V2 + V3 [m ×m]

M1(C) = UTM1(C)U

M2(K ) = UTM2(K )U

V1(C) = UTV1(C)

V2(K ) = UTV2(K )

V3(f ) = UTV2(K )

To solve:

[m×m]︷ ︸︸ ︷UT(M1 + M2)Uα = UT(V1 + V2 + V3)

Mα = V

h = Uα

J. N. Wise (SUN) 14 / 24

Page 15: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Approach 2: Linearized Galerkin Method

Linearize non-linear termsLinearize non-linear functions with PCA:

C ≈ C =mC∑j=1

αCj ΨC

j (x , z), K ≈ K =mK∑j=1

αKj ΨK

j (x , z)

Find αC and αK with least squares projection: Matrices

Mh => Mα = UT(

M1(C) + M2(K ))

Uα [m ×m ×m]

V => V = UT(

V1(C) + V2(K ) + V3

)[m × 1×m]

Evaluate responseMα = V

h = UαJ. N. Wise (SUN) 15 / 24

Page 16: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Error evaluation‘True’ response H(P∗) = h∗

1, ...,h∗100

Error function (Vermeulen, 2004):

RRMS = 100 · 1nts

nts∑i=1

√||hi(P∗)− hi(P∗)||2||hi(P∗)−Gh||2

Test LPG for parameter set P∗:

Table: Parameter set

Ks1[cm/d ] Ks2[cm/d ] hg[cm] m θs θr I0.032 0.048 29.2 0.4 0.34 0.0002 0.4

Run full simulation, PCA, run reduced simulation

J. N. Wise (SUN) 16 / 24

Page 17: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Time and error for LPG

Error and time evaluations (FE simulation => 75 seconds )

6 7 8 9 10 11 12 13 14 15 16 17 18Number of shape functions

0.800.850.900.951.001.051.101.15

Tim

e[s

]

LPG

6 7 8 9 10 11 12 13 14 15 16 17 18Number of shape functions

0

1

2

3

4

5

RR

MS

LPG

J. N. Wise (SUN) 17 / 24

Page 18: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Hybrid method result at final time step

True response and error with m = 18 and RRMS = 0.45

0 50 100 150 200 250 300

x [cm]0

50

100

150

200

z[c

m]

-40.000

-20.000

0.000

20.000

40.000

60.000

80.000

-40.000

-20.000

0.000

20.000

40.000

60.000

80.0000 50 100 150 200 250 300

x [cm]0

50

100

150

200

z[c

m]

-0.030

-0.020 -0.020

-0.010

-0.010

0.000

0.000

0.010

0.010

0.010

0.020

J. N. Wise (SUN) 18 / 24

Page 19: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Optimisation problem: 2 parameters

Simple optimisation problem:

Minimize : F (P) = RRMS(H(P∗), H(P))

Subject to : P ≥ P l

P ≤ Pu

Design of experiments to capture different behaviour

0.001 0.002 0.003 0.004 0.005 0.006K

30

40

50

60

70

80

hg

DOE

0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008K

30

40

50

60

70

80

hg

Optimisation with 20 shape functions

DOEStarting pointTrue OptimumSearch pathDOT optimum

J. N. Wise (SUN) 19 / 24

Page 20: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

POD Trust region (Fahl:2000), (Alexandrov:1998)

0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008K

30

40

50

60

70

80

hg

Optimisation with 20 shape functions

DOEStarting pointTrue OptimumSearch pathDOT optimum

0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008K

30

40

50

60

70

80

hg

Optimisation with 20 shape functions

DOEStarting pointTrue OptimumSearch pathDOT optimum

0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008K

30

40

50

60

70

80

hg

Optimisation with 20 shape functions

DOEStarting pointTrue OptimumSearch pathDOT optimum

0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008K

30

40

50

60

70

80

hg

Optimisation with 20 shape functions

DOEStarting pointTrue OptimumSearch pathDOT optimum

Figure: Similar behaviour at different locationsJ. N. Wise (SUN) 20 / 24

Page 21: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Algorithm

Start

Define Pnew = Pinitial Pnew = Popt

Find k nearest DOE: Pnew

Create POD model: U ∈ Rnxm

RRMS < 1%? No

m = m + 1

||Popt − Pnew || < rtrust

Yes

Optimise: Find Popt

No

||Popt − Pnew || < 0.001

No

Fin

J. N. Wise (SUN) 21 / 24

Page 22: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Results from 7 variable optimisation with m = 15 and K = 3

P: Ks1 Ks2 hg m thetas thetar infilt

Init 0.04 0.056 12.133 0.43 0.36 0.0006 0.4666Fin 0.033 0.0486 29.508 0.4112 0.3626 0.0006 0.3879

True 0.032 0.048 29.2 0.4033 0.34 0.0002 0.4

Time considerations with scaled trust radius rtrust = 0.3Needs ≈ 100 iterations per trust regionRun’s four cycles before convergenceTotal function calls ≈ 400Each full FE function call ≈ 75sEach POD call ≈ 1sTherefore speedup of 75x

J. N. Wise (SUN) 22 / 24

Page 23: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Conclusion

ConclusionVery useful having FreeFem++ to create matricesPOD method show excellent potential in time reductionGood potential in extrapolationUseful for parameter optimisationYields information over whole domain unlike metamodellingtechniques

J. N. Wise (SUN) 23 / 24

Page 24: Parameter Optimisation using POD: Application in ...+/uploads/Main/John_Wise.pdf · Time considerations with scaled trust radius rtrust = 0:3 Needs ˇ100 iterations per trust region

Home

J. N. Wise (SUN) 24 / 24