0% found this document useful (0 votes)
44 views124 pages

SLL 12

This document summarizes a presentation on optimization tools in the FreeFem++ finite element software. It introduces FreeFem++ and its features such as automatic mesh generation and finite element solvers. It then discusses interior point methods for optimization and the IPOPT software. Finally, it defines a "Signorini-like" Laplacian problem and presents numerical results for this problem.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views124 pages

SLL 12

This document summarizes a presentation on optimization tools in the FreeFem++ finite element software. It introduces FreeFem++ and its features such as automatic mesh generation and finite element solvers. It then discusses interior point methods for optimization and the IPOPT software. Finally, it defines a "Signorini-like" Laplacian problem and presents numerical results for this problem.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 124

A Fast Interior Point Method

for FreeFem++
Application to a laplacian problem with Signorini type
boundary conditions (Z. Belhachmi, F. Ben Belgacem & F. Hecht)

Sylvain Auliac - Laboratoire Jacques-Louis Lions

mardi 3 juillet 12
Outline

mardi 3 juillet 12
Outline

Introduction
• FreeFem++ : a short presentation
• Optimization tools in FreeFem++

mardi 3 juillet 12
Outline

Introduction
• FreeFem++ : a short presentation
• Optimization tools in FreeFem++

Interior-Point Methods
• A short overview
• The IPOPT software
• Using IPOPT through FreeFem++

mardi 3 juillet 12
Outline

Introduction
• FreeFem++ : a short presentation
• Optimization tools in FreeFem++

Interior-Point Methods
• A short overview
• The IPOPT software
• Using IPOPT through FreeFem++

«Signorini-like» Laplacian Problem


• Definition of the problem
• Numerical results

Closing...

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software (F. Hecht)


An open-source finite element PDE
solver with :

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software (F. Hecht)


An open-source finite element PDE
solver with :
•An automatic mesh generator

⌦ ⇢ R2 s.t.
@⌦ = = {(cos(t), sin(t)) , t 2 [0, 2⇡]}

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software


An open-source finite element PDE
solver with :
•An automatic mesh generator

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software


An open-source finite element PDE
solver with :
•An automatic mesh generator
•A FEM/PDE/Variational Forms specific user language

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software


An open-source finite element PDE
solver with :
•An automatic mesh generator
•A FEM/PDE/Variational Forms specific user language

Z Z
find u 2 H01 (⌦) s.t. 8v 2 H01 (⌦) rurv fv = 0
⌦ ⌦

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software


An open-source finite element PDE
solver with :
•An automatic mesh generator
•A FEM/PDE/Variational Forms specific user language

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software


An open-source finite element PDE
solver with :
•An automatic mesh generator
•A FEM/PDE/Variational Forms specific user language

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software


An open-source finite element PDE
solver with :
•An automatic mesh generator
•A FEM/PDE/Variational Forms specific user language
•Automatic interpolation from a mesh to another one

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software


An open-source finite element PDE
solver with :
•An automatic mesh generator
•A FEM/PDE/Variational Forms specific user language
•Automatic interpolation from a mesh to another one
•Some sparse sequential linear solvers (LU, Cholesky,
UMFPack, etc...), and some parallel ones (MUMPS, HYPRE,
SUPERLU, PASTIX, etc...), eigenvalues and vectors (ARPACK)

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software


An open-source finite element PDE
solver with :
•An automatic mesh generator
•A FEM/PDE/Variational Forms specific user language
•Automatic interpolation from a mesh to another one
•Some sparse sequential linear solvers (LU, Cholesky,
UMFPack, etc...), and some parallel ones (MUMPS, HYPRE,
SUPERLU, PASTIX, etc...), eigenvalues and vectors (ARPACK)
•An MPI interface

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software


An open-source finite element PDE
solver with :
•An automatic mesh generator
•A FEM/PDE/Variational Forms specific user language
•Automatic interpolation from a mesh to another one
•Some sparse sequential linear solvers (LU, Cholesky,
UMFPack, etc...), and some parallel ones (MUMPS, HYPRE,
SUPERLU, PASTIX, etc...), eigenvalues and vectors (ARPACK)
•An MPI interface
•An IDE interface (by A. Le Hyaric)

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software


An open-source finite element PDE
solver with :
•An automatic mesh generator
•A FEM/PDE/Variational Forms specific user language
•Automatic interpolation from a mesh to another one
•Some sparse sequential linear solvers (LU, Cholesky,
UMFPack, etc...), and some parallel ones (MUMPS, HYPRE,
SUPERLU, PASTIX, etc...), eigenvalues and vectors (ARPACK)
•An MPI interface
•An IDE interface (by A. Le Hyaric)
•Some non-linear optimization tools

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software


An open-source finite element PDE
solver with :
•An automatic mesh generator
•A FEM/PDE/Variational Forms specific user language
•Automatic interpolation from a mesh to another one
•Some sparse sequential linear solvers (LU, Cholesky,
UMFPack, etc...), and some parallel ones (MUMPS, HYPRE,
SUPERLU, PASTIX, etc...), eigenvalues and vectors (ARPACK)
•An MPI interface
•An IDE interface (by A. Le Hyaric)
•Some non-linear optimization tools
•An active community of users
mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

The FreeFem++ Software


An open-source finite element PDE
solver with :
•An automatic mesh generator
•A FEM/PDE/Variational Forms specific user language
•Automatic interpolation from a mesh to another one
•Some sparse sequential linear solvers (LU, Cholesky,
UMFPack, etc...), and some parallel ones (MUMPS, HYPRE,
SUPERLU, PASTIX, etc...), eigenvalues and vectors (ARPACK)
•An MPI interface
•An IDE interface (by A. Le Hyaric)
•Some non-linear optimization tools
•An active community of users
➡ http://www.freefem.org/ff++/
mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

Optimization Tools of FreeFem++ :

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

Optimization Tools of FreeFem++ :


Unconstrained Optimization :
Quadratic problems solvers: LinearCG, LinearGMRES
General non-linear optimizers:
•NLCG, BFGS
•CMAES (derivative free evolution strategy, MPI version available)
•NEWUOA (derivative free)

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

Optimization Tools of FreeFem++ :


Unconstrained Optimization :
Quadratic problems solvers: LinearCG, LinearGMRES
General non-linear optimizers:
•NLCG, BFGS
•CMAES (derivative free evolution strategy, MPI version available)
•NEWUOA (derivative free)

NLopt - Constrained non-linear optimizers :


•Derivative free / stochastic algorithms : DIRECT, CRS, ISRES, NEWUOA,
BOBYQA, COBYLA, SBPLX, etc...
•Gradient-based algorithms : LBFGS, MMA, SLSQP,T-Newton, etc...
•Augmented Lagrangian Method
Whole list available on the NLopt web page

mardi 3 juillet 12
Introduction FreeFem++ : a short presentation
Optimization tools with FreeFem++

Optimization Tools of FreeFem++ :


Unconstrained Optimization :
Quadratic problems solvers: LinearCG, LinearGMRES
General non-linear optimizers:
•NLCG, BFGS
•CMAES (derivative free evolution strategy, MPI version available)
•NEWUOA (derivative free)

NLopt - Constrained non-linear optimizers :


•Derivative free / stochastic algorithms : DIRECT, CRS, ISRES, NEWUOA,
BOBYQA, COBYLA, SBPLX, etc...
•Gradient-based algorithms : LBFGS, MMA, SLSQP,T-Newton, etc...
•Augmented Lagrangian Method
Whole list available on the NLopt web page

IPOPT :
Constrained non-linear optimization using sparse matrices
mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

Interior Point Methods : a short overview

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

Classical minimization under constraints problem :


Objective function : Constraints :
f :R !R
n
c = (c1 , . . . , c m ) : R n
! R m

Find : x0 = argmin f (x)


8i, ci (x) 0

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

Classical minimization under constraints problem :


Objective function : Constraints :
f :R !R
n
c = (c1 , . . . , c m ) : R n
! R m

Find : x0 = argmin f (x)


8i, ci (x) 0

Barrier Function :
For a given µ > 0, solve the unconstrained problem of finding
Xm
xµ = argmin f (x) µ ln ci (x)
x2Rn i=1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

Classical minimization under constraints problem :


Objective function : Constraints :
f :R !R
n
c = (c1 , . . . , c m ) : R n
! R m

Find : x0 = argmin f (x)


8i, ci (x) 0

Barrier Function :
For a given µ > 0, solve the unconstrained problem of finding
Xm
xµ = argmin f (x) µ ln ci (x)
x2Rn i=1
IP Methods : given a decreasing sequence (µk ) with µk
k!+1
! 0
find a a sequence (xµk ) of associated minimizers.

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

Barrier Function :
For a given µ > 0, solve the unconstrained problem of finding
Xm
xµ = argmin f (x) µ ln ci (x)
x2Rn i=1
IP Methods : given a decreasing sequence (µk ) with µk
k!+1
! 0
find a a sequence (xµk ) of associated minimizers.

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

Barrier Function :
For a given µ > 0, solve the unconstrained problem of finding
Xm
xµ = argmin f (x) µ ln ci (x)
x2Rn i=1
IP Methods : given a decreasing sequence (µk ) with µk ! 0
k!+1
find a a sequence (xµk ) of associated minimizers.

Illustration : minimize f (x, y) = (x + 0.1)2


+ (y 0.5)2 on a triangle

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

Barrier Function :
For a given µ > 0, solve the unconstrained problem of finding
Xm
xµ = argmin f (x) µ ln ci (x)
x2Rn i=1
IP Methods : given a decreasing sequence (µk ) with µk ! 0
k!+1
find a a sequence (xµk ) of associated minimizers.

Illustration : minimize f (x, y) = (x + 0.1)2


+ (y 0.5)2 on a triangle

Isovalues of f

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

Barrier Function :
For a given µ > 0, solve the unconstrained problem of finding
Xm
xµ = argmin f (x) µ ln ci (x)
x2Rn i=1
IP Methods : given a decreasing sequence (µk ) with µk ! 0
k!+1
find a a sequence (xµk ) of associated minimizers.

Illustration : minimize f (x, y) = (x + 0.1)2


+ (y 0.5)2 on a triangle

Isovalues of f log(µ) = 2

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

Barrier Function :
For a given µ > 0, solve the unconstrained problem of finding
Xm
xµ = argmin f (x) µ ln ci (x)
x2Rn i=1
IP Methods : given a decreasing sequence (µk ) with µk ! 0
k!+1
find a a sequence (xµk ) of associated minimizers.

Illustration : minimize f (x, y) = (x + 0.1)2


+ (y 0.5)2 on a triangle

Isovalues of f log(µ) = 1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

Barrier Function :
For a given µ > 0, solve the unconstrained problem of finding
Xm
xµ = argmin f (x) µ ln ci (x)
x2Rn i=1
IP Methods : given a decreasing sequence (µk ) with µk ! 0
k!+1
find a a sequence (xµk ) of associated minimizers.

Illustration : minimize f (x, y) = (x + 0.1)2


+ (y 0.5)2 on a triangle

Isovalues of f log(µ) = 0

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

Barrier Function :
For a given µ > 0, solve the unconstrained problem of finding
Xm
xµ = argmin f (x) µ ln ci (x)
x2Rn i=1
IP Methods : given a decreasing sequence (µk ) with µk ! 0
k!+1
find a a sequence (xµk ) of associated minimizers.

Illustration : minimize f (x, y) = (x + 0.1)2


+ (y 0.5)2 on a triangle

Isovalues of f log(µ) = 1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

Barrier Function :
For a given µ > 0, solve the unconstrained problem of finding
Xm
xµ = argmin f (x) µ ln ci (x)
x2Rn i=1
IP Methods : given a decreasing sequence (µk ) with µk ! 0
k!+1
find a a sequence (xµk ) of associated minimizers.

Illustration : minimize f (x, y) = (x + 0.1)2


+ (y 0.5)2 on a triangle

Isovalues of f log(µ) = 2

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

Barrier Function :
For a given µ > 0, solve the unconstrained problem of finding
Xm
xµ = argmin f (x) µ ln ci (x)
x2Rn i=1
IP Methods : given a decreasing sequence (µk ) with µk ! 0
k!+1
find a a sequence (xµk ) of associated minimizers.

Illustration : minimize f (x, y) = (x + 0.1)2


+ (y 0.5)2 on a triangle

Isovalues of f log(µ) = 5

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP Methods : given a decreasing sequence (µk ) with µk k!+1


! 0
find a sequence (xk )such that :
m
X
8k, xk = argmin f (x) µk ln ci (x)
x2Rn i=1

Links with the original problem :

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP Methods : given a decreasing sequence (µk ) with µk k!+1


! 0
find a sequence (xk )such that :
m
X
8k, xk = argmin f (x) µk ln ci (x)
x2Rn i=1

Links with the original problem :


Xm
µk
Extremum point : rf (xk ) rci (xk ) = 0
i=1
ci (xk )

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP Methods : given a decreasing sequence (µk ) with µk k!+1


! 0
find a sequence (xk )such that :
m
X
8k, xk = argmin f (x) µk ln ci (x)
x2Rn i=1

Links with the original problem : «Dual variables»


Extremum point :
rf (xk ) Jc (xk ) k = 0 , where
T
k = µk /c(xk )

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP Methods : given a decreasing sequence (µk ) with µk k!+1


! 0
find a sequence (xk )such that :

8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm

Links with the original problem :


Extremum point : rf (xk ) Jc (xk ) k = 0
T
ci (xk ) k,i = µk

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP Methods : given a decreasing sequence (µk ) with µk k!+1


! 0
find a sequence (xk )such that :

8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm

Links with the original problem :


Extremum point : rf (xk ) Jc (xk ) k = 0
T
ci (xk ) k,i = µk
KKT Conditions : rf (x⇤ ) Jc (x⇤ )T ⇤ = 0
c(x⇤ ) 0
8i, ⇤i 0
8i, ci (x ) i = 0
⇤ ⇤

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP Methods : given a decreasing sequence (µk ) with µk k!+1


! 0
find a sequence (xk )such that :

8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm

Links with the original problem :


Extremum point : rf (xk ) Jc (xk ) k = 0
T
ci (xk ) k,i = µk
KKT Conditions : rf (x⇤ ) Jc (x⇤ )T ⇤ = 0 µk ! 0
c(x⇤ ) 0
8i, ⇤i 0
8i, ci (x ) i = 0
⇤ ⇤

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP Methods : given a decreasing sequence (µk ) with µk k!+1


! 0
find a sequence (xk )such that :

8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm

Links with the original problem :


Extremum point : rf (xk ) Jc (xk ) k = 0
T
ci (xk ) k,i = µk
9(x , ) KKT point and multipliers such that,
⇤ ⇤


Under some favorable assumptions : xk ! x
k!+1

With even more assumptions : k !
k!+1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP main step: given a decreasing sequence (µk ) with µk k!+1


! 0
find a sequence (xk )such that :

8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm

Links with the original problem :


Extremum point : rf (xk ) Jc (xk ) k = 0
T
k = µk /c(xk )
9(x , ) KKT point and multipliers such that,
⇤ ⇤


Under some favorable assumptions : xk ! x
k!+1

With even more assumptions : k !
k!+1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP main step: given a decreasing sequence (µk ) with µk k!+1


! 0
find a sequence (xk )such that :

8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm

Links with the original problem :


Extremum point : rf (xk ) Jc (xk ) k = 0
T
k = µk /c(xk )
9(x , ) KKT point and multipliers such that,
⇤ ⇤


Under some favorable assumptions : xk ! x
k!+1

With even more assumptions : k !
k!+1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP main step: given a decreasing sequence (µk ) with µk k!+1


! 0
find a sequence (xk )such that :

8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm

Links with the original problem :


9(x⇤ , ⇤ ) KKT point and corresponding multipiers of the
original problem, such that, under some assumptions :
⇤ ⇤
xk ! x k !
k!+1 k!+1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP main step: given a decreasing sequence (µk ) with µk k!+1


! 0
find a sequence (xk )such that :

8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm

Links with the original problem :


9(x , ) KKT point and corresponding multipiers of the
⇤ ⇤

original problem, such that, under some assumptions :


⇤ ⇤
xk ! x k !
k!+1 k!+1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP main step: given a decreasing sequence (µk ) with µk k!+1


! 0 Links with the original problem : 9(x⇤ , ⇤
) KKT point
find a sequence (xk )such that : and corresponding multipliers of the original problem, such
that, under some assumptions :
8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm xk ! x⇤ k ! ⇤
k!+1 k!+1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP main step: given a decreasing sequence (µk ) with µk k!+1


! 0 Links with the original problem : 9(x⇤ , ⇤
) KKT point
find a sequence (xk )such that : and corresponding multipliers of the original problem, such
that, under some assumptions :
8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm xk ! x⇤ k ! ⇤
k!+1 k!+1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP main step: given a decreasing sequence (µk ) with µk k!+1


! 0 Links with the original problem : 9(x⇤ , ⇤
) KKT point
find a sequence (xk )such that : and corresponding multipliers of the original problem, such
that, under some assumptions :
8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm xk ! x⇤ k ! ⇤
k!+1 k!+1

Primal-dual IP method - Newton’s method is applied to


the non-linear system
⇢ :
rf (x) Jc (x)T = 0
ci (x) i = µ , 8i  m

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP main step: given a decreasing sequence (µk ) with µk k!+1


! 0 Links with the original problem : 9(x⇤ , ⇤
) KKT point
find a sequence (xk )such that : and corresponding multipliers of the original problem, such
that, under some assumptions :
8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm xk ! x⇤ k ! ⇤
k!+1 k!+1

Primal-dual IP method - Newton’s method is applied to



the non-linear system : rf (x) Jc (x) = 0
T

ci (x) i = µ , 8i  m
Newton update ( x, ):
✓ ◆✓ ◆ ✓ ◆
H JcT x rf JcT
=
⇤Jc C C µ1
m
X
Where H = r2 f i r 2
ci and C = ( ij ci )1i,jm (as for ⇤ ).
i=1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP main step: given a decreasing sequence (µk ) with µk k!+1


! 0 Links with the original problem : 9(x⇤ , ⇤
) KKT point
find a sequence (xk )such that : and corresponding multipliers of the original problem, such
that, under some assumptions :
8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm xk ! x⇤ k ! ⇤
k!+1 k!+1

Primal-dual IP method - Newton’s method is applied to



the non-linear system : rf (x) Jc (x) = 0
T

ci (x) i = µ , 8i  m
Newton update ( x, ):
✓ ◆✓ ◆ ✓ ◆
H JcT x rf JcT
=
⇤Jc C C µ1
m
X
Where H = r2 f i r 2
ci and C = ( ij ci )1i,jm (as for ⇤ ).
i=1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

IP main step: given a decreasing sequence (µk ) with µk k!+1


! 0 Links with the original problem : 9(x⇤ , ⇤
) KKT point
find a sequence (xk )such that : and corresponding multipliers of the original problem, such
that, under some assumptions :
8k, rf (xk ) Jc (xk )T k = 0, k = µk /c(xk ) 2 Rm xk ! x⇤ k ! ⇤
k!+1 k!+1

Primal-dual IP method - Newton’s method is applied to



the non-linear system : rf (x) Jc (x) = 0
T

ci (x) i = µ , 8i  m
Newton update ( x, ):
✓ ◆✓ ◆ ✓ ◆
H JcT x rf JcT
=
⇤Jc C C µ1
m
X
Where H = r2 f i r 2
ci and C = ( ij ci )1i,jm (as for ⇤ ).
i=1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The IPOPT software :


• C++ open source implementation of a primal-dual interior
point method for non-linear smooth optimization, from the
COIN-OR project
☞ https://projects.coin-or.org/Ipopt
☞ the mailing list
• Uses sparse matrices and sparse symetric linear solvers
(mumps, PARDISO, etc... ) for the Newton’s steps.
• Handles both inequality and/or equality constraints
• A fortran variant for variationnal inequalities...?
Bibliography :
•A. Wächter and L. T. Biegler, On the Implementation of a Primal-Dual Interior Point Filter Line Search
Algorithm for Large-Scale Nonlinear Programming, Mathematical Programming 106(1), pp. 25-57, 2006
•Some IPOPT related papers : https://projects.coin-or.org/Ipopt/wiki/IpoptPapers

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface :


8 ⇤
>
> x = argmin f (x)
>
< x2Rn

>
> lb ⇤
8i  n, xi  xi  xi ub
>
:
8i  m, ci  ci (x )  ci
lb ⇤ ub

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface :


8 ⇤
>
> x = argmin f (x)
>
< x2Rn

>
> lb ⇤
8i  n, xi  xi  xi ub
Simple bounds constraints
>
:
8i  m, ci  ci (x )  ci
lb ⇤ ub

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface :


8 ⇤
>
> x = argmin f (x)
>
< x2Rn

>
> lb ⇤
8i  n, xi  xi  xi ub
>
:
8i  m, ci  ci (x )  ci
lb ⇤ ub
«True» constraints

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
>
IPOPT needs f, rf, c, Jc , xlb , xub , < x2Rn

c , c and...
lb ub >
>
>
:
8i  n, xlb
i  x⇤
i  xub
i
8i  m, ci  ci (x )  cub
lb ⇤
i
H : Rn ⇥ Rm ! Mn (R)
m
X
(x , ) 7 ! r f (x)
2
ir
2
ci (x)
i=1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
>
IPOPT needs f, rf, c, Jc , xlb , xub , < x2Rn

c , c and...
lb ub >
>
>
:
8i  n, xlb
i  x⇤
i  xub
i
8i  m, ci  ci (x )  cub
lb ⇤
i
H : Rn ⇥ R ⇥ Rm ! Mn (R)
m
X
(x , , ) 7 ! r f (x) +
2
ir
2
ci (x)
i=1

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
>
IPOPT needs < x2Rn

f >
>
>
:
8i  n, xlb
i  x⇤
i  xub
i
8i  m, ci  ci (x )  cub
lb ⇤
i
rf, c
xlb , xub , clb , cub
Jc

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
>
IPOPT needs < x2Rn

f : func real f(real[int] &X) {...} >


>
>
:
8i  n, xlb
i  x⇤
i  xub
i
8i  m, ci  ci (x )  cub
lb ⇤
i
rf, c
xlb , xub , clb , cub
Jc

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
>
IPOPT needs < x2Rn

f : func real f(real[int] &X) {...} >


>
>
:
8i  n, xlb
i  x⇤
i  xub
i
8i  m, ci  ci (x )  cub
lb ⇤
i
rf, c : func real[int] df(real[int] &X) {...}
func real[int] c(real[int] &X) {...} (optional)
xlb , xub , clb , cub
Jc

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
>
IPOPT needs < x2Rn

f : func real f(real[int] &X) {...} >


>
>
:
8i  n, xlb
i  x⇤
i  xub
i
8i  m, ci  ci (x )  cub
lb ⇤
i
rf, c : func real[int] df(real[int] &X) {...}
func real[int] c(real[int] &X) {...} (optional)
xlb , xub , clb , cub
Jc : func matrix Jc(real[int] &X) {...}
Needed only if there are constraint functions

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
>
IPOPT needs < x2Rn

f : func real f(real[int] &X) {...} >


>
>
:
8i  n, xlb
i  x⇤
i  xub
i
8i  m, ci  ci (x )  cub
lb ⇤
i
rf, c : func real[int] df(real[int] &X) {...}
func real[int] c(real[int] &X) {...} (optional)
xlb , xub , clb , cub
Jc : func matrix Jc(real[int] &X) {...}
Needed only if there are constraint functions

H : func matrix H(real[int] &X, real s, real[int] &L)


In case of affine constraints, the prototype may be :
func matrix H(real[int] &X) {...}
If H is omitted Newton is replaced by a BFGS algorithm.

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
>
IPOPT needs < x2Rn

f : func real f(real[int] &X) {...} >


>
>
:
8i  n, xlb
i  x⇤
i  xub
i
8i  m, ci  ci (x )  cub
lb ⇤
i
rf, c : func real[int] df(real[int] &X) {...}
func real[int] c(real[int] &X) {...} (optional)
xlb , xub , clb , cub :
real[int] arrays
Jc : func matrix Jc(real[int] &X) {...} •size n for x bounds
Needed only if there are constraint functions
•size m for c bounds
•x bounds are optionnal
H : func matrix H(real[int] &X, real s, real[int] &L) •Set components to ±1e19
In case of affine constraints, the prototype may be : for unboundedness in
func matrix H(real[int] &X) {...} particular directions.
If H is omitted Newton is replaced by a BFGS algorithm.

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
>
IPOPT needs < x2Rn

f : func real f(real[int] &X) {...} >


>
>
:
8i  n, xlb
i  x⇤
i  xub
i
8i  m, ci  ci (x )  cub
lb ⇤
i
rf, c : func real[int] df(real[int] &X) {...}
func real[int] c(real[int] &X) {...} (optional)
xlb , xub , clb , cub :
real[int] arrays
Jc : func matrix Jc(real[int] &X) {...} •size n for x bounds
Needed only if there are constraint functions
•size m for c bounds
•x bounds are optionnal
H : func matrix H(real[int] &X, real s, real[int] &L) •Set components to ±1e19
In case of affine constraints, the prototype may be : for unboundedness in
func matrix H(real[int] &X) {...} particular directions.
If H is omitted Newton is replaced by a BFGS algorithm.

Call IPOPT : full featured


int status = IPOPT(f, dF, c, Jc, H, xstart, lb=xlb,ub=xub,clb=clb,cub=cub, ... ... );
Remark: requires load ″ff-Ipopt″; earlier in the script

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
>
IPOPT needs < x2Rn

f : func real f(real[int] &X) {...} >


>
>
:
8i  n, xlb
i  x⇤
i  xub
i
8i  m, ci  ci (x )  cub
lb ⇤
i
rf, c : func real[int] df(real[int] &X) {...}
func real[int] c(real[int] &X) {...} (optional)
xlb , xub , clb , cub :
real[int] arrays
Jc : func matrix Jc(real[int] &X) {...} •size n for x bounds
Needed only if there are constraint functions
•size m for c bounds
•x bounds are optionnal
H : func matrix H(real[int] &X, real s, real[int] &L) •Set components to ±1e19
In case of affine constraints, the prototype may be : for unboundedness in
func matrix H(real[int] &X) {...} particular directions.
If H is omitted Newton is replaced by a BFGS algorithm.

Call IPOPT : unconstrained


int status = IPOPT(f, dF, H, xstart, lb=xlb,ub=xub, ... ... );
Remark: requires load ″ff-Ipopt″; earlier in the script

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
>
IPOPT needs < x2Rn

f : func real f(real[int] &X) {...} >


>
>
:
8i  n, xlb
i  x⇤
i  xub
i
8i  m, ci  ci (x )  cub
lb ⇤
i
rf, c : func real[int] df(real[int] &X) {...}
func real[int] c(real[int] &X) {...} (optional)
xlb , xub , clb , cub :
real[int] arrays
Jc : func matrix Jc(real[int] &X) {...} •size n for x bounds
Needed only if there are constraint functions
•size m for c bounds
•x bounds are optionnal
H : func matrix H(real[int] &X, real s, real[int] &L) •Set components to ±1e19
In case of affine constraints, the prototype may be : for unboundedness in
func matrix H(real[int] &X) {...} particular directions.
If H is omitted Newton is replaced by a BFGS algorithm.

Call IPOPT : with BFGS


int status = IPOPT(f, dF, c, Jc, xstart, lb=xlb,ub=xub,clb=clb,cub=cub ... ... );
Remark: requires load ″ff-Ipopt″; earlier in the script

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
>
IPOPT needs < x2Rn

f : func real f(real[int] &X) {...} >


>
>
:
8i  n, xlb
i  x⇤
i  xub
i
8i  m, ci  ci (x )  cub
lb ⇤
i
rf, c : func real[int] df(real[int] &X) {...}
func real[int] c(real[int] &X) {...} (optional)
xlb , xub , clb , cub :
real[int] arrays
Jc : func matrix Jc(real[int] &X) {...} •size n for x bounds
Needed only if there are constraint functions
•size m for c bounds
•x bounds are optionnal
H : func matrix H(real[int] &X, real s, real[int] &L) •Set components to ±1e19
In case of affine constraints, the prototype may be : for unboundedness in
func matrix H(real[int] &X) {...} particular directions.
If H is omitted Newton is replaced by a BFGS algorithm.

Call IPOPT : unconstrained with BFGS


int status = IPOPT(f, dF, xstart, lb=xlb,ub=xub, ... ... );
Remark: requires load ″ff-Ipopt″; earlier in the script

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
case of quadratic objective and affine constraints >
< x2Rn

>
> 8i  n, xlb
 x⇤
 xub
>
: i i i
8i  m, ci  ci (x )  cub
lb ⇤
i

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
case of quadratic objective and affine constraints >
< x2Rn

> 8i  lb
 ⇤
 ub
8x 2 R , f (x) = hAx, xi + hb, xi
n 1
2
>
>
:
n, xi xi xi
8i  m, ci  ci (x )  cub
lb ⇤
i
c(x) = Cx + d
(A, b) 2 Mn,n (R) ⇥ R , (C, d) 2 Mn,m (R) ⇥ R
n m

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
case of quadratic objective and affine constraints >
< x2Rn

> 8i  lb
 ⇤
 ub
8x 2 R , f (x) = hAx, xi + hb, xi
n 1
2
>
>
:
n, xi xi xi
8i  m, ci  ci (x )  cub
lb ⇤
i
c(x) = Cx + d
(A, b) 2 Mn,n (R) ⇥ R , (C, d) 2 Mn,m (R) ⇥ R
n m

➡ Possibility to directly pass the matrices and vectors

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
case of quadratic objective and affine constraints >
< x2Rn

> 8i  lb
 ⇤
 ub
8x 2 R , f (x) = hAx, xi + hb, xi
n 1
2
>
>
:
n, xi xi xi
8i  m, ci  ci (x )  cub
lb ⇤
i
c(x) = Cx + d
(A, b) 2 Mn,n (R) ⇥ R , (C, d) 2 Mn,m (R) ⇥ R
n m

➡ Possibility to directly pass the matrices and vectors

Quadratic objective and affine constraints :


... //begining of the script
matrix A = ... ;
matrix C = ... ;
real[int] b = ... , d = ... ;
IPOPT([A,b] , [C,d] , xstart , /*named parameters*/ );

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
case of quadratic objective and affine constraints >
< x2Rn

> 8i  lb
 ⇤
 ub
8x 2 R , f (x) = hAx, xi + hb, xi
n 1
2
>
>
:
n, xi xi xi
8i  m, ci  ci (x )  cub
lb ⇤
i
c(x) = Cx + d
(A, b) 2 Mn,n (R) ⇥ R , (C, d) 2 Mn,m (R) ⇥ R
n m

➡ Possibility to directly pass the matrices and vectors

Homogeneous quadratic objective and affine constraints :


... //begining of the script
matrix A = ... ;
matrix C = ... ;
real[int] d = ... ;
IPOPT(A , [C,d] , xstart , /*named parameters*/ );

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
case of quadratic objective and affine constraints >
< x2Rn

> 8i  lb
 ⇤
 ub
8x 2 R , f (x) = hAx, xi + hb, xi
n 1
2
>
>
:
n, xi xi xi
8i  m, ci  ci (x )  cub
lb ⇤
i
c(x) = Cx + d
(A, b) 2 Mn,n (R) ⇥ R , (C, d) 2 Mn,m (R) ⇥ R
n m

➡ Possibility to directly pass the matrices and vectors

Standard objective and affine constraints :


... //begining of the script
func real f(real[int] &X) {...}
func real[int] df(real[int] &X) {...}
func matrix H(real[int] &X) {...} //no need for the full prototype
matrix C = ... ;
real[int] d = ... ;
IPOPT(f, df, H, [C,d] , xstart , /*named parameters*/ );

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
case of quadratic objective and affine constraints >
< x2Rn

> 8i  lb
 ⇤
 ub
8x 2 R , f (x) = hAx, xi + hb, xi
n 1
2
>
>
:
n, xi xi xi
8i  m, ci  ci (x )  cub
lb ⇤
i
c(x) = Cx + d
(A, b) 2 Mn,n (R) ⇥ R , (C, d) 2 Mn,m (R) ⇥ R
n m

➡ Possibility to directly pass the matrices and vectors

Quadratic objective and standard constraints : hazardous case


... //begining of the script
func real[int] c(real[int] &X) {...}
func matrix Jc(real[int] &X) {...}
matrix A = ... ;
real[int] b = ... ;

IPOPT([A,b] , c, Jc, xstart , /*named parameters*/ );

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : 8 ⇤


> x = argmin f (x)
>
case of quadratic objective and affine constraints >
< x2Rn

> 8i  lb
 ⇤
 ub
8x 2 R , f (x) = hAx, xi + hb, xi
n 1
2
>
>
:
n, xi xi xi
8i  m, ci  ci (x )  cub
lb ⇤
i
c(x) = Cx + d
(A, b) 2 Mn,n (R) ⇥ R , (C, d) 2 Mn,m (R) ⇥ R
n m

➡ Possibility to directly pass the matrices and vectors

Quadratic objective and standard constraints : hazardous case


... //begining of the script
func real[int] c(real[int] &X) {...}
func matrix Jc(real[int] &X) {...} Here, H(x, , ) is always equal to A
matrix A = ... ; ➡ erroneous hessian in some cases
real[int] b = ... ;

IPOPT([A,b] , c, Jc, xstart , /*named parameters*/ );

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : some hints and tips

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : some hints and tips


Matrix returning functions : must return a global object
func matrix H(real[int] &X)
{
matrix M;
... //compute M
return M;
}

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : some hints and tips


Matrix returning functions : must return a global object
func matrix H(real[int] &X)
{ M is cleaned after closing the
matrix M; function block, so the returned
... //compute M object does not exist anymore...
return M;
}

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : some hints and tips


Matrix returning
Sparse functions :functions
matrix returning must return a global
: must object
return a global object
matrix M; //just declare a global matrix
func matrix H(real[int] &X)
func matrix H(real[int] &X)
{
{
matrix M;
... //do something to fill M
... //compute M
return M; //M will not be deleted before H goes out of scope
return M;
}
}

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : some hints and tips

Sparse matrix returning functions : must return a global object


matrix M; //just declare a global matrix
func matrix H(real[int] &X)
{
... //do something to fill M
return M; //M will not be deleted before H goes out of scope
}

The structure of the matrices : has to be constant through the


optimization process...
• Use varf as much as possible to build matrices, matrices built with the same varf always have
the same structure even if some coefficients becomes null.
• Remember that zeros are discarded when building sparse matrices from arrays :
real[int] c=...; real[int,int] tmp=...;
int[int] I=..., J=...; matrix M = tmp;
matrix M = [I, J ,c]; //two dangerous methods

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : some hints and tips (2)

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : some hints and tips (2)


Named parameters : subset of the IPOPT parameters, plus a few
FreeFem++ specific ones, which can be used for :
• Stopping criteria (tol, maxiter, maxcputime, etc...)
• Getting final values (objvalue, lm, uz, lz, etc...)
• Perform a warm start
• Call a derivatives checker
• Force the BFGS mode (add bfgs=1)
• Specify an extern option file (see the IPOPT documentation)
• etc...
Check the documentation for more informations.

mardi 3 juillet 12
A short overview
Interior Point Method The IPOPT software
Using IPOPT through FreeFem++

The FreeFem++ Interface : some hints and tips (2)


Named parameters : subset of the IPOPT parameters, plus a few
FreeFem++ specific ones, which can be used for :
• Stopping criteria (tol, maxiter, maxcputime, etc...)
• Getting final values (objvalue, lm, uz, lz, etc...)
• Perform a warm start
• Call a derivatives checker
• Force the BFGS mode (add bfgs=1)
• Specify an extern option file (see the IPOPT documentation)
• etc...
Check the documentation for more informations.

Returned value : the IPOPT function returns an int revealing what


happens during the optimization. Positive values often means IPOPT
performed well and negative values are relevant of troubles.

mardi 3 juillet 12
Examples Quadratic problems
A non quadratic example

A Quadratic Example :

mardi 3 juillet 12
Examples Quadratic problems
A non quadratic example

A Quadratic Example :

mardi 3 juillet 12
Examples Quadratic problems
A non quadratic example

A Quadratic Example :

mardi 3 juillet 12
Examples Quadratic problems
A non quadratic example

Stokes Cavity Flow :


8
< u rp = f
in ⌦
r.u = 0
:
u=g on @⌦

mardi 3 juillet 12
Examples Quadratic problems
A non quadratic example

Stokes Cavity Flow :


8
< u rp = f
in ⌦
r.u = 0
:
u=g on @⌦

Z Z
1 2
Find : u = argmin
4
rv + rv
t
f.v
v2K ⌦ ⌦

Where : K = v 2 H 1 (⌦)2 , v g 2 H01 (⌦)2 , r.v = 0

mardi 3 juillet 12
Examples Quadratic problems
A non quadratic example

Stokes Cavity Flow :


Z Z
1 2
Find : u = argmin
4
rv + rv
t
f.v
v2K ⌦ ⌦

Where : K = v 2 H 1 (⌦)2 , v g 2 H01 (⌦)2 , r.v = 0

mardi 3 juillet 12
Examples Quadratic problems
A non quadratic example

Stokes Cavity Flow :


Z Z
1 2
Find : u = argmin
4
rv + rv
t
f.v
v2K ⌦ ⌦

Where : K = v 2 H 1 (⌦)2 , v g 2 H01 (⌦)2 , r.v = 0

mardi 3 juillet 12
Examples Quadratic problems
A non quadratic example

Stokes Cavity Flow :


Z Z
1 2
Find : u = argmin
4
rv + rv
t
f.v
v2K ⌦ ⌦

Where : K = v 2 H 1 (⌦)2 , v g 2 H01 (⌦)2 , r.v = 0

Discret Problem : find minimizer of


Jh (u) = (Au, u) (b, u) , u 2 Kh
Kh = v 2 P2 (Th )2 | Ch v = 0 + Dirichlet boundary conditions
Z
(Where Ch v = 0 , 8q 2 P1 (Th ), qr.vh = 0 )

mardi 3 juillet 12
Examples Quadratic problems
A non quadratic example

Stokes Cavity Flow :


Z Z
Discret Problem : find 1 minimizer of2
Find : u = argmin rv + rv
4 ,⌦ u 2 Kh
t
f.v
Jh (u) = (Au, u) v2K(b, u) ⌦

Where
K h = v :2 K
P =
(T
2 h )2
v 2
| CH
h
1
v (⌦)
= 02
, v
+ g 2
DirichletH 1
(⌦) 2
boundary
0 r.v = 0
, conditions
Z
(Where Ch v = 0 , 8q 2 P1 (Th ), qr.vh = 0 )

mardi 3 juillet 12
Examples Quadratic problems
A non quadratic example

Stokes Cavity Flow :


Discret Problem : find minimizer of
Jh (u) = (Au, u) (b, u) , u 2 Kh
Kh = v 2 P2 (Th )2 | Ch v = 0 + Dirichlet boundary conditions
Z
(Where Ch v = 0 , 8q 2 P1 (Th ), qr.vh = 0 )

mardi 3 juillet 12
Examples Quadratic problems
A non quadratic example

Stokes Cavity Flow :


Discret Problem : find minimizer of
Jh (u) = (Au, u) (b, u) , u 2 Kh
Kh = v 2 P2 (Th )2 | Ch v = 0 + Dirichlet boundary conditions
Z
(Where Ch v = 0 , 8q 2 P1 (Th ), qr.vh = 0 )

mardi 3 juillet 12
Examples Quadratic problems
A non quadratic example

Stokes Cavity Flow :


Discret Problem : find minimizer of
Jh (u) = (Au, u) (b, u) , u 2 Kh
Kh = v 2 P2 (Th )2 | Ch v = 0 + Dirichlet boundary conditions
Z
(Where Ch v = 0 , 8q 2 P1 (Th ), qr.vh = 0 )

To get back the dual variables and


store them in a P1 finite elements
function.

mardi 3 juillet 12
Examples Quadratic problems
A non quadratic example

Stokes Cavity Flow :


Discret Problem : find minimizer of
Jh (u) = (Au, u) (b, u) , u 2 Kh
Kh = v 2 P2 (Th )2 | Ch v = 0 + Dirichlet boundary conditions
Z
(Where Ch v = 0 , 8q 2 P1 (Th ), qr.vh = 0 )

➡Dual variables converge toward the pressure field

mardi 3 juillet 12
Examples Quadratic problem
A non quadratic example

A Constrained Minimal-Surface Example :

mardi 3 juillet 12
Examples Quadratic problem
A non quadratic example

A Constrained Minimal-Surface Example :


Given g, let E = v 2 L2 (⌦) | v g 2 H01 (⌦) , and :
Z p Z
8v 2 E, S(v) = 1 + |rv|2 , V (v) = v
⌦ ⌦

And, given V0 >0, try to find : u = argmin S(v)


v 2 E,
V (v) V0

mardi 3 juillet 12
Examples Quadratic problem
A non quadratic example

A Constrained Minimal-Surface Example :


Given g, let E = v 2 L2 (⌦) | v g 2 H01 (⌦) , and :
Z p Z
8v 2 E, S(v) = 1 + |rv|2 , V (v) = v
⌦ ⌦

And, given V0 >0, try to find : u = argmin S(v)


v 2 E,
V (v) V0
Computations with g = x2 y 2 , ⌦ = {(x, y) 2 R2 | x2 + y 2  1}
1
V0 = 0 V0 = V0 = 1 V0 = 2
2

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

«Signorini-like» Laplacian Problem :


Conjoint work with Z. Belhachmi, F. Ben Belgacem & F. Hecht
➡ Quadratic Finite Elements with Non-Matching Grids for the
Unilateral Boundary Contact

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

«Signorini-like» Laplacian Problem :


Conjoint work with Z. Belhachmi, F. Ben Belgacem & F. Hecht
➡ Quadratic Finite Elements with Non-Matching Grids for the
Unilateral Boundary Contact

⌦ s
⌦ i
⌦ , ⌦ : contiguous domains of R2
s i

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

«Signorini-like» Laplacian Problem :


Conjoint work with Z. Belhachmi, F. Ben Belgacem & F. Hecht
➡ Quadratic Finite Elements with Non-Matching Grids for the
Unilateral Boundary Contact

⌦ s
⌦ i
⌦ , ⌦ ⇣ : contiguous
s i
⌘ domains of R 2

= @ ⌦s [ ⌦ i

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

«Signorini-like» Laplacian Problem :


Conjoint work with Z. Belhachmi, F. Ben Belgacem & F. Hecht
➡ Quadratic Finite Elements with Non-Matching Grids for the
Unilateral Boundary Contact

⌦ s
⌦ i
⌦ , ⌦ ⇣ : contiguous
s i
⌘ domains of R 2

= @ ⌦s [ ⌦ i C = ⌦ s \ ⌦i
C

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

«Signorini-like» Laplacian Problem :


Conjoint work with Z. Belhachmi, F. Ben Belgacem & F. Hecht
➡ Quadratic Finite Elements with Non-Matching Grids for the
Unilateral Boundary Contact

Domain :
⌦ s
⌦ i
⌦ , ⌦ ⇣ : contiguous
s i
⌘ domains of R 2

= @ ⌦s [ ⌦ i C = ⌦s \ ⌦i
C

Problem :

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

«Signorini-like» Laplacian Problem :


Conjoint work with Z. Belhachmi, F. Ben Belgacem & F. Hecht
➡ Quadratic Finite Elements with Non-Matching Grids for the
Unilateral Boundary Contact

Domain :
⌦ s
⌦ i
⌦ , ⌦ ⇣ : contiguous
s i
⌘ domains of R 2

= @ ⌦s [ ⌦ i C = ⌦s \ ⌦i
C

i s
Problem : find p , p such that
• p ↵
= f ↵
in ⌦ ↵
(↵ = s, i)
• Dirichlet or Neumann conditions on
• [p] 0, @n p ↵
⇠ and (@n p ⇠)[p] = 0 on C

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

«Signorini-like» Laplacian Problem :

Domain :
⌦ s
⌦i
⌦s , ⌦i⇣ : contiguous
⌘ domains of R 2

= @ ⌦s [ ⌦ i C = ⌦s \ ⌦i
C

i s
Problem : find p , p such that
X 1Z Z Z
(ps , pi ) = argmin |ru↵ |2 f ↵ u↵ gn↵ u↵
(us ,ui )2K 2 ⌦↵ ⌦↵ ↵
↵2{s,i} n

Where

:
u↵ gd↵ 2 H01 (⌦↵ ) ↵ = i, s
K= (u , u ) 2 H (⌦ ) ⇥ H (⌦ )
s i 1 s 1 i
[u] 0
mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results

s
Th Thi

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results
Discret Problem : find minimizer of
s Jh (u) = (Au, u) (b, u) , u 2 Kh
Th Thi
Kh = u h 2 P2 (Th )
s
⇥ P2 (Th )
i
| Ch uh 0
+ Dirichlet boundary conditions

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results
Discret Problem : find minimizer of
s Jh (u) = (Au, u) (b, u) , u 2 Kh
Th Thi
Kh = u h 2 P2 (Th )
s
⇥ P2 (Th )
i
| Ch uh 0
+ Dirichlet boundary conditions

Building the needed objects :

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results
Discret Problem : find minimizer of
s Jh (u) = (Au, u) (b, u) , u 2 Kh
Th Thi
Kh = u h 2 P2 (Th )
s
⇥ P2 (Th )
i
| Ch uh 0
+ Dirichlet boundary conditions

Building the needed objects :


• A, b are directly obtained from the separated Poisson matrices and
second members
matrix A = [ [As , 0] , [0 , Ai] ];

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results
Discret Problem : find minimizer of
s Jh (u) = (Au, u) (b, u) , u 2 Kh
Th Thi
Kh = u h 2 P2 (Th )
s
⇥ P2 (Th )
i
| Ch uh 0
+ Dirichlet boundary conditions

Building the needed objects :


• A, b are directly obtained from the separated Poisson matrices and
second members
matrix A = [ [As , 0] , [0 , Ai] ];
• Dirichlet boundary conditions are treated as simple bounds, using a
trick allowed by the varf syntax

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results
Discret Problem : find minimizer of
s Jh (u) = (Au, u) (b, u) , u 2 Kh
Th Thi
Kh = u h 2 P2 (Th )
s
⇥ P2 (Th )
i
| Ch uh 0
+ Dirichlet boundary conditions

Building the needed objects :


• A, b are directly obtained from the separated Poisson matrices and
second members
matrix A = [ [As , 0] , [0 , Ai] ];
• Dirichlet boundary conditions are treated as simple bounds, using a
trick allowed by the varf syntax
• C depends on the unilateral conditions treatment
mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results :

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results :
Two exact solutions :

pi (x, y) = xy + [2 max(x, 0) min(x, 0) ⇤ sin(2⇡y) ]sin(3x)
ps (x, y) = xy + [ 2 max(x, 0) min(x, 0) ⇤ sin(2⇡y) ]sin(3x)

⇢ p p
p (x, y) = xy + x r + x
i
y r x p
p p
p (x, y) = xy x r + x
s
y r x , r = x2 + y2

Computations : we numerically evaluatekph pk with the H 1 , L2


1
and L norms, with decaying h in the three following cases :
• Conforming meshes, corresponding degrees of freedom are directly
compared.
• Non-conforming meshes with simple interpolation process.
• Non-conforming meshes with mortar projection (C is not sparse)
mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results : First solution

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results : First solution



pi (x, y) = xy + [2 max(x, 0) min(x, 0) ⇤ sin(2⇡y) ]sin(3x)
ps (x, y) = xy + [ 2 max(x, 0) min(x, 0) ⇤ sin(2⇡y) ]sin(3x)

H norm
1 L2 norm

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results : First solution



pi (x, y) = xy + [2 max(x, 0) min(x, 0) ⇤ sin(2⇡y) ]sin(3x)
ps (x, y) = xy + [ 2 max(x, 0) min(x, 0) ⇤ sin(2⇡y) ]sin(3x)

H 1 norm

L1 norm

L2 norm
mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results : Second solution

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results : Second solution


⇢ p p
p (x, y) = xy + x r + x
i
y r x p
p p
p (x, y) = xy x r + x
s
y r x , r = x2 + y2

H 1 norm L2 norm

mardi 3 juillet 12
«Signorini-like» Laplacian Problem Definition of the problem
Numerical results

Numerical Results : Second solution


⇢ p p
p (x, y) = xy + x r + x
i
y r x p
p p
p (x, y) = xy x r + x
s
y r x , r = x2 + y2

H 1 norm

L1 norm

L2 norm

mardi 3 juillet 12
Outlook

• A state of the art software for large-scale smooth optimization


directly available into FreeFem++
• Succesfully tested on several quadratic convex problems,
outperforming any of the previously available optimizers
• Limits :
➡ local optimization
➡ needs order two derivatives for full efficiency

mardi 3 juillet 12
Outlook

• A state of the art software for large-scale smooth optimization


directly available into FreeFem++
• Succesfully tested on several quadratic convex problems,
outperforming any of the previously available optimizers
• Limits :
➡ local optimization
➡ needs order two derivatives for full efficiency

Sequel :
• 3D computations for the Signorini problem
• Optimal shape design
• Development of (smart) tools to ease the computation of
derivatives within FreeFem++
mardi 3 juillet 12

You might also like