SlideShare a Scribd company logo
Σ   YSTEMS


Optimal control of coupled PDE networks
    with automated code generation

            Dimitrios Papadopoulos
         Delta Pi Systems, Thessaloniki



          ICNAAM 2012, Kos, Greece




                                          1 / 23
Overview
  ◮   Application of PDE Networks
  ◮   Representation of PDE Networks as a Graph
  ◮   Optimal Control of PDEs
        ◮   Adjoint Equations and Gradient
        ◮   Continuous vs. Discrete Adjoint Approach
        ◮   Discretization of the control variables
  ◮   Flowchart
  ◮   Tools of the Trade
        ◮   DOT Language and PyDot
        ◮   SymPy
        ◮   Cog
        ◮   SfePy
        ◮   SciPy (and NumPy)
  ◮   Conclusions



                                                       Dimitris Papadopoulos — Delta Pi Systems


                                                                                        2 / 23
Application of PDE Networks




                              Dimitris Papadopoulos — Delta Pi Systems


                                                               3 / 23
Representation of PDE Networks as a Graph

                                       3



                              1                  2

         ∂y1
             + ∇ · (a · y1 ) − ∇ · (D∇yi ) = f (y1 , y2 , y3 ; u)
         ∂t
         ∂y2
             + ∇ · (a · y2 ) − ∇ · (D∇yi ) = f (y2 , y1 , y3 ; u)
         ∂t
            ∂y3
                + ∇ · (a · y3 ) − ∇ · (D∇yi ) = g(y3 , y1 ; u)
             ∂t



                                                             Dimitris Papadopoulos — Delta Pi Systems


                                                                                              4 / 23
Optimal Control of PDEs
Problem formulation
                                          t1
                  min J(y, u) =                        φ(y, u) dxdt subject to:
                    u                 0            Ω
           ∂yi
                + ∇ · (a · yi ) − ∇ · (D∇yi ) = fi , for i = 1, . . . , nn ,
            ∂t
where yi are the state variables, and y the state vector,
ui are the control variables, and u the control vector,
fi is a function of some yj and u,
nn is the number of nodes.

Lagrange function

                             nn       t1
                                                       ∂yi
min L(y, u, p) = J(y, u)+                          (       −fi )pi +(ayi −D∇yi )·∇pi dxdt+BC
 y,u
                            i=1   0            Ω       ∂t

where pi are the Lagrange multipiers or adjoint variables                  Dimitris Papadopoulos — Delta Pi Systems


                                                                                                            5 / 23
Optimal Control of PDEs (cont.)
Adjoint Equations

                                                       n   n
    ∂pi                                                  ∂fj
−       − ∇ · (a · pi ) − ∇ · (D∇pi ) = φyi (y, u) +         pi ,         for i = 1, . . . , nn ,
    ∂t                                               j=1
                                                         ∂yi


Gradient
                                   n    n        t1
                         ∂L   ∂J                          ∂fi
                            =    +                            pi dxdt
                         ∂u   ∂u i=1         0        Ω   ∂u




                                                                        Dimitris Papadopoulos — Delta Pi Systems


                                                                                                         6 / 23
Continuous vs. Discrete Adjoint
            nonlinear       linear     adjoint


   PDE




discrete
equations




                                     Dimitris Papadopoulos — Delta Pi Systems


                                                                      7 / 23
Back to the basics
                          ∂L        ∂L
How do you calculate      ∂u
                               or   ∂y
                                       ?
  ◮   Calculate analytical derivatives and implement them by hand (too time
      consuming and error prone)
  ◮   Symbolic differentiation (you have to add some code generation magic)
  ◮   Automatic (or algorithmic) differentiation (for each new problem you have
      to pass your code through your AD-tool)




                                                           Dimitris Papadopoulos — Delta Pi Systems


                                                                                            8 / 23
Discretization of the control variables
  ◮   B-spline basis functions

                       1 if τi−1 ≤ t < τi
           Ni0 (t) =                      ,
                       0 else
            n          t − τj−1      n−1     τj+n − t n−1
           Nj (t) =               Nj (t) +           N    (t),             n>1
                    τj+n−1 − τj−1           τj+n − τj j+1
  ◮   B-spline curve formed by control points ci
                                          L
                                                    n
                                 u(t) =         cj Nj (t)
                                          j=0




                                                            Dimitris Papadopoulos — Delta Pi Systems


                                                                                             9 / 23
Parametrization - Finding a knot sequence
  ◮   uniform or equidistant

                               (ti − ti−1 )/(ti+1 − ti ) = 1

  ◮   chord length
                                    ∆ti      ||∆di ||
                                         =
                                   ∆ti+1   ||∆di+1 ||
  ◮   cetripetal
                                                        1/2
                                 ∆ti      ||∆di ||
                                      =
                                ∆ti+1   ||∆di+1 ||
  ◮   Natural end conditions

                                ¨
                                u(t0 ) = 0,   ¨
                                              u(tm ) = 0




                                                               Dimitris Papadopoulos — Delta Pi Systems


                                                                                               10 / 23
Tensor Product Patches
  ◮   B-spline surface
                                         m   n
                         um,n (t, x) =             ci,j Nim (t)Nj (x)
                                                                n

                                         i=0 j=0

      where ci,j is a matrix representing all the control points of the (t, x) plane.
  ◮   A surface with the topology of a sphere is not representable as a tensor
      product surface, without degeneracies (but we don’t really care)




                                                                   Dimitris Papadopoulos — Delta Pi Systems


                                                                                                   11 / 23
Flowchart
   parse DOT graph


   build symbolic PDEs

                                                       initialize control points
   build symbolic adjoint PDEs
                                                        k    1                      k     k+1

    build symbolic gradient
                                                       solve direct problem

    generate source code for solution of PDEs
                                                       objective function                compute gradient
   generate source code for solution of adjoint PDEs

                                                                          no
                                                                  k
   generate source code for gradient                          J <ε                      solve adjoint problem

                                                            yes

                                                             solution




                                                                                   Dimitris Papadopoulos — Delta Pi Systems


                                                                                                                   12 / 23
Tools of the Trade

                       Extended DOT Language


                     Direct              Adjoint




                                        SymPy




                      Cog                 Cog




                     SfePy               SfePy




                               SciPy

                                                   Dimitris Papadopoulos — Delta Pi Systems


                                                                                   13 / 23
DOT Language
A DSL for graph representation

   digraph network {
     3->1 [type=1];
     3->2 [type=1];
     1->2 [style=dashed, type=2];
     2->1 [style=dashed, type=2];
     1->3 [style=dotted, type=3];
     3 [shape=box];}


                                 3



                          1          2
                                         Dimitris Papadopoulos — Delta Pi Systems


                                                                         14 / 23
Why Python?
 ◮   programmer’s time vs. computing time
 ◮   need for manipulation of the objects at runtime
 ◮   need for source code generation at runtime
 ◮   lisp, smalltalk, perl, python, ruby, javascript vs. C, C++, java
 ◮   Paul Graham’s classical closure example of the accumulator:
     def foo(n):
       s = [n]
       def bar(i):
          s[0] += i
          return s[0]
       return bar

 ◮   many tools and numerical libraries available




                                                             Dimitris Papadopoulos — Delta Pi Systems


                                                                                             15 / 23
PyDot
A Python library for the DOT language

   import pydot
   graph = pydot.graph_from_dot_file(’test.dot’)
   shape_dict = {}
   function_dict = {}
   for node in graph.get_nodes():
       my_name = node.get_name()
       shape_dict[my_name] = node.get(’shape’)
       function_dict[my_name] = node.get(’function’)
   type_dict = {}
   style_dict = {}
   for edge in graph.get_edges():
       my_edge = (edge.get_source(), edge.get_destination())
       type_dict[my_edge] = edge.get(’type’)
       style_dict[my_edge] = print edge.get(’style’)

                                               Dimitris Papadopoulos — Delta Pi Systems


                                                                               16 / 23
SymPy
A Python library for symbolic mathematics

   from sympy import Eq, Function, Symbol
   from sympy import Derivative as D, Integral
   from sympy.abc import x, t, a

   y_list = [] # same for u_list
   for node in graph.get_nodes():
       my_name = node.get_name()
       y_list.append(’y_’+str(my_name)) # same for u_list
   y = map(Function, y_list) # same for u_list
   f = y[1]+u # for example
   eq = Eq(D(y[1](x,t),t)+a*D(y[1](x,t),x)-D(D(y[1](x,t),x),x),f)




                                                 Dimitris Papadopoulos — Delta Pi Systems


                                                                                 17 / 23
SymPy (cont.)
Derivative of the Lagrangian
 1. Build list of symbols for functions,
 2. build a list of substitutions for the functions and the reverse,
 3. substitute for the functions,
 4. run derivatives with respect to the symbols,
 5. substitute functions for the symbols,
 6. take any derivatives with respect to the function variables.

Integral(Derivative(F.subs(u(x),foo),foo).doit().subs(foo,←֓
                                                   u(x))*v(x),x)




                                                              Dimitris Papadopoulos — Delta Pi Systems


                                                                                              18 / 23
Cog
A code generation tool

      ...
      # [[[cog
      # import cog
      # functions = [direct, adjoint, gradient]
      # for func in functions:
      #     cog.outl("def %s():" % func)
      #     cog.outl("    pass")
      # ]]]
      # [[[end]]]
      ...




                                                  Dimitris Papadopoulos — Delta Pi Systems


                                                                                  19 / 23
SfePy
A software for solving systems of coupled PDEs by the FEM
  ◮   SfePy: Simple finite element in python
  ◮   Other alternatives: FENICS or your favorite FE solver (needs to be general
      enough)
  ◮   Future work: bring metaprogramming to the next level, i.e.,
  ◮   use FENICS, which generates C++ at runtime from the problem
      formulation which can also be run parallel




          graph           symbolic      intermediated    parallel
      representation   representation    python code    C++ code




                                                            Dimitris Papadopoulos — Delta Pi Systems


                                                                                            20 / 23
SciPy (and NumPy)
A library for doing everything else

import numpy as np
from scipy.optimize import fmin_bfgs

from newly_created_file import objective, gradient

c0 = np.array([0.0, 0.0, 0.0, 0.0])
res = fmin_bfgs(objective, c0, gradient, args, gtol, norm, ...)


and the rest is a piece of cake!




                                               Dimitris Papadopoulos — Delta Pi Systems


                                                                               21 / 23
Conclusions
Summary
  ◮   Framework for optimal control of coupled PDE networks
  ◮   Automated code generation
  ◮   Graph representation of coupled PDEs
  ◮   Symbolic differentiation for the adjoint equations and the gradient
  ◮   Solution with the finite element method

Outlook
  ◮   Extention to more general equations,
  ◮   with 2D or 3D geometries,
  ◮   and constraints on the state or control variables.
  ◮   Adaptive refinement of the control variables.



                                                            Dimitris Papadopoulos — Delta Pi Systems


                                                                                            22 / 23
Thank you for your attention!




Delta Pi Systems
Thessaloniki, Greece
http://www.delta-pi-systems.eu




                                 Dimitris Papadopoulos — Delta Pi Systems


                                                                 23 / 23

More Related Content

What's hot

Learning Sparse Representation
Learning Sparse RepresentationLearning Sparse Representation
Learning Sparse Representation
Gabriel Peyré
 
Signal Processing Course : Sparse Regularization of Inverse Problems
Signal Processing Course : Sparse Regularization of Inverse ProblemsSignal Processing Course : Sparse Regularization of Inverse Problems
Signal Processing Course : Sparse Regularization of Inverse Problems
Gabriel Peyré
 
Mixture Models for Image Analysis
Mixture Models for Image AnalysisMixture Models for Image Analysis
11.solution of linear and nonlinear partial differential equations using mixt...
11.solution of linear and nonlinear partial differential equations using mixt...11.solution of linear and nonlinear partial differential equations using mixt...
11.solution of linear and nonlinear partial differential equations using mixt...
Alexander Decker
 
Solution of linear and nonlinear partial differential equations using mixture...
Solution of linear and nonlinear partial differential equations using mixture...Solution of linear and nonlinear partial differential equations using mixture...
Solution of linear and nonlinear partial differential equations using mixture...
Alexander Decker
 
Andreas Eberle
Andreas EberleAndreas Eberle
Andreas Eberle
BigMC
 
Digital Signal Processing[ECEG-3171]-Ch1_L02
Digital Signal Processing[ECEG-3171]-Ch1_L02Digital Signal Processing[ECEG-3171]-Ch1_L02
Digital Signal Processing[ECEG-3171]-Ch1_L02
Rediet Moges
 
Lecture on nk [compatibility mode]
Lecture on nk [compatibility mode]Lecture on nk [compatibility mode]
Lecture on nk [compatibility mode]
NBER
 
Estimation of the score vector and observed information matrix in intractable...
Estimation of the score vector and observed information matrix in intractable...Estimation of the score vector and observed information matrix in intractable...
Estimation of the score vector and observed information matrix in intractable...
Pierre Jacob
 
Geodesic Method in Computer Vision and Graphics
Geodesic Method in Computer Vision and GraphicsGeodesic Method in Computer Vision and Graphics
Geodesic Method in Computer Vision and Graphics
Gabriel Peyré
 
Signal Processing Course : Inverse Problems Regularization
Signal Processing Course : Inverse Problems RegularizationSignal Processing Course : Inverse Problems Regularization
Signal Processing Course : Inverse Problems Regularization
Gabriel Peyré
 
EM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysisEM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysis
zukun
 
Discrete Models in Computer Vision
Discrete Models in Computer VisionDiscrete Models in Computer Vision
Discrete Models in Computer Vision
Yap Wooi Hen
 
Biomathematics
BiomathematicsBiomathematics
Biomathematics
Francis Mponda
 
Neural Processes
Neural ProcessesNeural Processes
Neural Processes
Sangwoo Mo
 
Tele4653 l4
Tele4653 l4Tele4653 l4
Tele4653 l4
Vin Voro
 
Spectral Learning Methods for Finite State Machines with Applications to Na...
  Spectral Learning Methods for Finite State Machines with Applications to Na...  Spectral Learning Methods for Finite State Machines with Applications to Na...
Spectral Learning Methods for Finite State Machines with Applications to Na...
LARCA UPC
 
Mesh Processing Course : Active Contours
Mesh Processing Course : Active ContoursMesh Processing Course : Active Contours
Mesh Processing Course : Active Contours
Gabriel Peyré
 
Paris2012 session1
Paris2012 session1Paris2012 session1
Paris2012 session1
Cdiscount
 
Olivier Cappé's talk at BigMC March 2011
Olivier Cappé's talk at BigMC March 2011Olivier Cappé's talk at BigMC March 2011
Olivier Cappé's talk at BigMC March 2011
BigMC
 

What's hot (20)

Learning Sparse Representation
Learning Sparse RepresentationLearning Sparse Representation
Learning Sparse Representation
 
Signal Processing Course : Sparse Regularization of Inverse Problems
Signal Processing Course : Sparse Regularization of Inverse ProblemsSignal Processing Course : Sparse Regularization of Inverse Problems
Signal Processing Course : Sparse Regularization of Inverse Problems
 
Mixture Models for Image Analysis
Mixture Models for Image AnalysisMixture Models for Image Analysis
Mixture Models for Image Analysis
 
11.solution of linear and nonlinear partial differential equations using mixt...
11.solution of linear and nonlinear partial differential equations using mixt...11.solution of linear and nonlinear partial differential equations using mixt...
11.solution of linear and nonlinear partial differential equations using mixt...
 
Solution of linear and nonlinear partial differential equations using mixture...
Solution of linear and nonlinear partial differential equations using mixture...Solution of linear and nonlinear partial differential equations using mixture...
Solution of linear and nonlinear partial differential equations using mixture...
 
Andreas Eberle
Andreas EberleAndreas Eberle
Andreas Eberle
 
Digital Signal Processing[ECEG-3171]-Ch1_L02
Digital Signal Processing[ECEG-3171]-Ch1_L02Digital Signal Processing[ECEG-3171]-Ch1_L02
Digital Signal Processing[ECEG-3171]-Ch1_L02
 
Lecture on nk [compatibility mode]
Lecture on nk [compatibility mode]Lecture on nk [compatibility mode]
Lecture on nk [compatibility mode]
 
Estimation of the score vector and observed information matrix in intractable...
Estimation of the score vector and observed information matrix in intractable...Estimation of the score vector and observed information matrix in intractable...
Estimation of the score vector and observed information matrix in intractable...
 
Geodesic Method in Computer Vision and Graphics
Geodesic Method in Computer Vision and GraphicsGeodesic Method in Computer Vision and Graphics
Geodesic Method in Computer Vision and Graphics
 
Signal Processing Course : Inverse Problems Regularization
Signal Processing Course : Inverse Problems RegularizationSignal Processing Course : Inverse Problems Regularization
Signal Processing Course : Inverse Problems Regularization
 
EM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysisEM algorithm and its application in probabilistic latent semantic analysis
EM algorithm and its application in probabilistic latent semantic analysis
 
Discrete Models in Computer Vision
Discrete Models in Computer VisionDiscrete Models in Computer Vision
Discrete Models in Computer Vision
 
Biomathematics
BiomathematicsBiomathematics
Biomathematics
 
Neural Processes
Neural ProcessesNeural Processes
Neural Processes
 
Tele4653 l4
Tele4653 l4Tele4653 l4
Tele4653 l4
 
Spectral Learning Methods for Finite State Machines with Applications to Na...
  Spectral Learning Methods for Finite State Machines with Applications to Na...  Spectral Learning Methods for Finite State Machines with Applications to Na...
Spectral Learning Methods for Finite State Machines with Applications to Na...
 
Mesh Processing Course : Active Contours
Mesh Processing Course : Active ContoursMesh Processing Course : Active Contours
Mesh Processing Course : Active Contours
 
Paris2012 session1
Paris2012 session1Paris2012 session1
Paris2012 session1
 
Olivier Cappé's talk at BigMC March 2011
Olivier Cappé's talk at BigMC March 2011Olivier Cappé's talk at BigMC March 2011
Olivier Cappé's talk at BigMC March 2011
 

Viewers also liked

Doing math with python.ch04
Doing math with python.ch04Doing math with python.ch04
Doing math with python.ch04
Seok-joon Yun
 
Manual del modulo Sympy
Manual del modulo SympyManual del modulo Sympy
Manual del modulo Sympy
AngieB
 
Meekins Resume 2016
Meekins Resume 2016Meekins Resume 2016
Meekins Resume 2016
Lesli Meekins
 
Rondônia – Senador Ivo Cassol pode passar o final de ano com bens bloqueados
Rondônia – Senador Ivo Cassol pode passar o final de ano com bens bloqueados Rondônia – Senador Ivo Cassol pode passar o final de ano com bens bloqueados
Rondônia – Senador Ivo Cassol pode passar o final de ano com bens bloqueados
Rondoniadinamica Jornal Eletrônico
 
Alfa Equipments, Chennai, Liquid Paint Coating Equipment
Alfa Equipments, Chennai, Liquid Paint Coating EquipmentAlfa Equipments, Chennai, Liquid Paint Coating Equipment
Alfa Equipments, Chennai, Liquid Paint Coating Equipment
IndiaMART InterMESH Limited
 
R A J Recipe Book
R A J  Recipe  BookR A J  Recipe  Book
R A J Recipe Book
karenjberthelson
 
Optimization and control of processes and systems
Optimization and control of processes and systemsOptimization and control of processes and systems
Optimization and control of processes and systems
Delta Pi Systems
 
Derechos humanos diego alejandro gonzalez.pptx
Derechos humanos diego alejandro gonzalez.pptxDerechos humanos diego alejandro gonzalez.pptx
Derechos humanos diego alejandro gonzalez.pptx
Uriel NUÑEZ
 
Vida de brinquedo
Vida de brinquedoVida de brinquedo
Vida de brinquedo
spssilvana
 
Resumo de pratica simulada penal iii
Resumo de pratica simulada penal  iiiResumo de pratica simulada penal  iii
Resumo de pratica simulada penal iii
Walter Marinho
 
DAELIBS for Security Service Providers
DAELIBS for Security Service ProvidersDAELIBS for Security Service Providers
DAELIBS for Security Service Providers
Michael Jones
 
Provident Providers
Provident ProvidersProvident Providers
Provident Providers
Malia Tafua
 
Conclusiones sobre el plagio en internet
Conclusiones sobre el plagio en internetConclusiones sobre el plagio en internet
Conclusiones sobre el plagio en internet
Katherine Araujo
 
Amit Electricals, Delhi, Lamp Holders
Amit Electricals, Delhi, Lamp HoldersAmit Electricals, Delhi, Lamp Holders
Amit Electricals, Delhi, Lamp Holders
IndiaMART InterMESH Limited
 

Viewers also liked (15)

Doing math with python.ch04
Doing math with python.ch04Doing math with python.ch04
Doing math with python.ch04
 
Manual del modulo Sympy
Manual del modulo SympyManual del modulo Sympy
Manual del modulo Sympy
 
Meekins Resume 2016
Meekins Resume 2016Meekins Resume 2016
Meekins Resume 2016
 
Rondônia – Senador Ivo Cassol pode passar o final de ano com bens bloqueados
Rondônia – Senador Ivo Cassol pode passar o final de ano com bens bloqueados Rondônia – Senador Ivo Cassol pode passar o final de ano com bens bloqueados
Rondônia – Senador Ivo Cassol pode passar o final de ano com bens bloqueados
 
4t B SG-Barcelona
4t B SG-Barcelona4t B SG-Barcelona
4t B SG-Barcelona
 
Alfa Equipments, Chennai, Liquid Paint Coating Equipment
Alfa Equipments, Chennai, Liquid Paint Coating EquipmentAlfa Equipments, Chennai, Liquid Paint Coating Equipment
Alfa Equipments, Chennai, Liquid Paint Coating Equipment
 
R A J Recipe Book
R A J  Recipe  BookR A J  Recipe  Book
R A J Recipe Book
 
Optimization and control of processes and systems
Optimization and control of processes and systemsOptimization and control of processes and systems
Optimization and control of processes and systems
 
Derechos humanos diego alejandro gonzalez.pptx
Derechos humanos diego alejandro gonzalez.pptxDerechos humanos diego alejandro gonzalez.pptx
Derechos humanos diego alejandro gonzalez.pptx
 
Vida de brinquedo
Vida de brinquedoVida de brinquedo
Vida de brinquedo
 
Resumo de pratica simulada penal iii
Resumo de pratica simulada penal  iiiResumo de pratica simulada penal  iii
Resumo de pratica simulada penal iii
 
DAELIBS for Security Service Providers
DAELIBS for Security Service ProvidersDAELIBS for Security Service Providers
DAELIBS for Security Service Providers
 
Provident Providers
Provident ProvidersProvident Providers
Provident Providers
 
Conclusiones sobre el plagio en internet
Conclusiones sobre el plagio en internetConclusiones sobre el plagio en internet
Conclusiones sobre el plagio en internet
 
Amit Electricals, Delhi, Lamp Holders
Amit Electricals, Delhi, Lamp HoldersAmit Electricals, Delhi, Lamp Holders
Amit Electricals, Delhi, Lamp Holders
 

Similar to Optimal control of coupled PDE networks with automated code generation

Jyokyo-kai-20120605
Jyokyo-kai-20120605Jyokyo-kai-20120605
Jyokyo-kai-20120605
ketanaka
 
Simplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution AlgorithmsSimplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution Algorithms
Per Kristian Lehre
 
Simplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution AlgorithmsSimplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution Algorithms
PK Lehre
 
100 things I know
100 things I know100 things I know
100 things I know
r-uribe
 
Introduction to inverse problems
Introduction to inverse problemsIntroduction to inverse problems
Introduction to inverse problems
Delta Pi Systems
 
SLC 2015 talk improved version
SLC 2015 talk improved versionSLC 2015 talk improved version
SLC 2015 talk improved version
Zheng Mengdi
 
3 grechnikov
3 grechnikov3 grechnikov
3 grechnikov
Yandex
 
MUMS Opening Workshop - Model Uncertainty in Data Fusion for Remote Sensing -...
MUMS Opening Workshop - Model Uncertainty in Data Fusion for Remote Sensing -...MUMS Opening Workshop - Model Uncertainty in Data Fusion for Remote Sensing -...
MUMS Opening Workshop - Model Uncertainty in Data Fusion for Remote Sensing -...
The Statistical and Applied Mathematical Sciences Institute
 
2014 spring crunch seminar (SDE/levy/fractional/spectral method)
2014 spring crunch seminar (SDE/levy/fractional/spectral method)2014 spring crunch seminar (SDE/levy/fractional/spectral method)
2014 spring crunch seminar (SDE/levy/fractional/spectral method)
Zheng Mengdi
 
Numerical integration based on the hyperfunction theory
Numerical integration based on the hyperfunction theoryNumerical integration based on the hyperfunction theory
Numerical integration based on the hyperfunction theory
HidenoriOgata
 
CME Deliverable Interest Rate Swap Future
CME Deliverable Interest Rate Swap FutureCME Deliverable Interest Rate Swap Future
CME Deliverable Interest Rate Swap Future
Clarus Financial Technology
 
Introduction to modern Variational Inference.
Introduction to modern Variational Inference.Introduction to modern Variational Inference.
Introduction to modern Variational Inference.
Tomasz Kusmierczyk
 
Estimation of the score vector and observed information matrix in intractable...
Estimation of the score vector and observed information matrix in intractable...Estimation of the score vector and observed information matrix in intractable...
Estimation of the score vector and observed information matrix in intractable...
Pierre Jacob
 
WE4.L09 - POLARIMETRIC SAR ESTIMATION BASED ON NON-LOCAL MEANS
WE4.L09 - POLARIMETRIC SAR ESTIMATION BASED ON NON-LOCAL MEANSWE4.L09 - POLARIMETRIC SAR ESTIMATION BASED ON NON-LOCAL MEANS
WE4.L09 - POLARIMETRIC SAR ESTIMATION BASED ON NON-LOCAL MEANS
grssieee
 
Anomaly Detection Using Projective Markov Models
Anomaly Detection Using Projective Markov ModelsAnomaly Detection Using Projective Markov Models
Anomaly Detection Using Projective Markov Models
Sean Meyn
 
Computational Information Geometry on Matrix Manifolds (ICTP 2013)
Computational Information Geometry on Matrix Manifolds (ICTP 2013)Computational Information Geometry on Matrix Manifolds (ICTP 2013)
Computational Information Geometry on Matrix Manifolds (ICTP 2013)
Frank Nielsen
 
9 pd es
9 pd es9 pd es
9 pd es
Sachin Ghalme
 
Seminar Talk: Multilevel Hybrid Split Step Implicit Tau-Leap for Stochastic R...
Seminar Talk: Multilevel Hybrid Split Step Implicit Tau-Leap for Stochastic R...Seminar Talk: Multilevel Hybrid Split Step Implicit Tau-Leap for Stochastic R...
Seminar Talk: Multilevel Hybrid Split Step Implicit Tau-Leap for Stochastic R...
Chiheb Ben Hammouda
 
Numerical solution of spatiotemporal models from ecology
Numerical solution of spatiotemporal models from ecologyNumerical solution of spatiotemporal models from ecology
Numerical solution of spatiotemporal models from ecology
Kyrre Wahl Kongsgård
 
Accelerating Pseudo-Marginal MCMC using Gaussian Processes
Accelerating Pseudo-Marginal MCMC using Gaussian ProcessesAccelerating Pseudo-Marginal MCMC using Gaussian Processes
Accelerating Pseudo-Marginal MCMC using Gaussian Processes
Matt Moores
 

Similar to Optimal control of coupled PDE networks with automated code generation (20)

Jyokyo-kai-20120605
Jyokyo-kai-20120605Jyokyo-kai-20120605
Jyokyo-kai-20120605
 
Simplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution AlgorithmsSimplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution Algorithms
 
Simplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution AlgorithmsSimplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution Algorithms
 
100 things I know
100 things I know100 things I know
100 things I know
 
Introduction to inverse problems
Introduction to inverse problemsIntroduction to inverse problems
Introduction to inverse problems
 
SLC 2015 talk improved version
SLC 2015 talk improved versionSLC 2015 talk improved version
SLC 2015 talk improved version
 
3 grechnikov
3 grechnikov3 grechnikov
3 grechnikov
 
MUMS Opening Workshop - Model Uncertainty in Data Fusion for Remote Sensing -...
MUMS Opening Workshop - Model Uncertainty in Data Fusion for Remote Sensing -...MUMS Opening Workshop - Model Uncertainty in Data Fusion for Remote Sensing -...
MUMS Opening Workshop - Model Uncertainty in Data Fusion for Remote Sensing -...
 
2014 spring crunch seminar (SDE/levy/fractional/spectral method)
2014 spring crunch seminar (SDE/levy/fractional/spectral method)2014 spring crunch seminar (SDE/levy/fractional/spectral method)
2014 spring crunch seminar (SDE/levy/fractional/spectral method)
 
Numerical integration based on the hyperfunction theory
Numerical integration based on the hyperfunction theoryNumerical integration based on the hyperfunction theory
Numerical integration based on the hyperfunction theory
 
CME Deliverable Interest Rate Swap Future
CME Deliverable Interest Rate Swap FutureCME Deliverable Interest Rate Swap Future
CME Deliverable Interest Rate Swap Future
 
Introduction to modern Variational Inference.
Introduction to modern Variational Inference.Introduction to modern Variational Inference.
Introduction to modern Variational Inference.
 
Estimation of the score vector and observed information matrix in intractable...
Estimation of the score vector and observed information matrix in intractable...Estimation of the score vector and observed information matrix in intractable...
Estimation of the score vector and observed information matrix in intractable...
 
WE4.L09 - POLARIMETRIC SAR ESTIMATION BASED ON NON-LOCAL MEANS
WE4.L09 - POLARIMETRIC SAR ESTIMATION BASED ON NON-LOCAL MEANSWE4.L09 - POLARIMETRIC SAR ESTIMATION BASED ON NON-LOCAL MEANS
WE4.L09 - POLARIMETRIC SAR ESTIMATION BASED ON NON-LOCAL MEANS
 
Anomaly Detection Using Projective Markov Models
Anomaly Detection Using Projective Markov ModelsAnomaly Detection Using Projective Markov Models
Anomaly Detection Using Projective Markov Models
 
Computational Information Geometry on Matrix Manifolds (ICTP 2013)
Computational Information Geometry on Matrix Manifolds (ICTP 2013)Computational Information Geometry on Matrix Manifolds (ICTP 2013)
Computational Information Geometry on Matrix Manifolds (ICTP 2013)
 
9 pd es
9 pd es9 pd es
9 pd es
 
Seminar Talk: Multilevel Hybrid Split Step Implicit Tau-Leap for Stochastic R...
Seminar Talk: Multilevel Hybrid Split Step Implicit Tau-Leap for Stochastic R...Seminar Talk: Multilevel Hybrid Split Step Implicit Tau-Leap for Stochastic R...
Seminar Talk: Multilevel Hybrid Split Step Implicit Tau-Leap for Stochastic R...
 
Numerical solution of spatiotemporal models from ecology
Numerical solution of spatiotemporal models from ecologyNumerical solution of spatiotemporal models from ecology
Numerical solution of spatiotemporal models from ecology
 
Accelerating Pseudo-Marginal MCMC using Gaussian Processes
Accelerating Pseudo-Marginal MCMC using Gaussian ProcessesAccelerating Pseudo-Marginal MCMC using Gaussian Processes
Accelerating Pseudo-Marginal MCMC using Gaussian Processes
 

More from Delta Pi Systems

Introduction to CAGD for Inverse Problems
Introduction to CAGD for Inverse ProblemsIntroduction to CAGD for Inverse Problems
Introduction to CAGD for Inverse Problems
Delta Pi Systems
 
Introduction to the theory of optimization
Introduction to the theory of optimizationIntroduction to the theory of optimization
Introduction to the theory of optimization
Delta Pi Systems
 
Introduction to Calculus of Variations
Introduction to Calculus of VariationsIntroduction to Calculus of Variations
Introduction to Calculus of Variations
Delta Pi Systems
 
Introduction to Grid Generation
Introduction to Grid GenerationIntroduction to Grid Generation
Introduction to Grid Generation
Delta Pi Systems
 
Οικονομικά οφέλη από προγράμματα διαχείρισης
Οικονομικά οφέλη από προγράμματα διαχείρισηςΟικονομικά οφέλη από προγράμματα διαχείρισης
Οικονομικά οφέλη από προγράμματα διαχείρισηςDelta Pi Systems
 
Agile development of processes and systems
Agile development of processes and systemsAgile development of processes and systems
Agile development of processes and systemsDelta Pi Systems
 
Outsourcing in Greece
Outsourcing in GreeceOutsourcing in Greece
Outsourcing in Greece
Delta Pi Systems
 

More from Delta Pi Systems (7)

Introduction to CAGD for Inverse Problems
Introduction to CAGD for Inverse ProblemsIntroduction to CAGD for Inverse Problems
Introduction to CAGD for Inverse Problems
 
Introduction to the theory of optimization
Introduction to the theory of optimizationIntroduction to the theory of optimization
Introduction to the theory of optimization
 
Introduction to Calculus of Variations
Introduction to Calculus of VariationsIntroduction to Calculus of Variations
Introduction to Calculus of Variations
 
Introduction to Grid Generation
Introduction to Grid GenerationIntroduction to Grid Generation
Introduction to Grid Generation
 
Οικονομικά οφέλη από προγράμματα διαχείρισης
Οικονομικά οφέλη από προγράμματα διαχείρισηςΟικονομικά οφέλη από προγράμματα διαχείρισης
Οικονομικά οφέλη από προγράμματα διαχείρισης
 
Agile development of processes and systems
Agile development of processes and systemsAgile development of processes and systems
Agile development of processes and systems
 
Outsourcing in Greece
Outsourcing in GreeceOutsourcing in Greece
Outsourcing in Greece
 

Recently uploaded

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 

Recently uploaded (20)

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 

Optimal control of coupled PDE networks with automated code generation

  • 1. Σ YSTEMS Optimal control of coupled PDE networks with automated code generation Dimitrios Papadopoulos Delta Pi Systems, Thessaloniki ICNAAM 2012, Kos, Greece 1 / 23
  • 2. Overview ◮ Application of PDE Networks ◮ Representation of PDE Networks as a Graph ◮ Optimal Control of PDEs ◮ Adjoint Equations and Gradient ◮ Continuous vs. Discrete Adjoint Approach ◮ Discretization of the control variables ◮ Flowchart ◮ Tools of the Trade ◮ DOT Language and PyDot ◮ SymPy ◮ Cog ◮ SfePy ◮ SciPy (and NumPy) ◮ Conclusions Dimitris Papadopoulos — Delta Pi Systems 2 / 23
  • 3. Application of PDE Networks Dimitris Papadopoulos — Delta Pi Systems 3 / 23
  • 4. Representation of PDE Networks as a Graph 3 1 2 ∂y1 + ∇ · (a · y1 ) − ∇ · (D∇yi ) = f (y1 , y2 , y3 ; u) ∂t ∂y2 + ∇ · (a · y2 ) − ∇ · (D∇yi ) = f (y2 , y1 , y3 ; u) ∂t ∂y3 + ∇ · (a · y3 ) − ∇ · (D∇yi ) = g(y3 , y1 ; u) ∂t Dimitris Papadopoulos — Delta Pi Systems 4 / 23
  • 5. Optimal Control of PDEs Problem formulation t1 min J(y, u) = φ(y, u) dxdt subject to: u 0 Ω ∂yi + ∇ · (a · yi ) − ∇ · (D∇yi ) = fi , for i = 1, . . . , nn , ∂t where yi are the state variables, and y the state vector, ui are the control variables, and u the control vector, fi is a function of some yj and u, nn is the number of nodes. Lagrange function nn t1 ∂yi min L(y, u, p) = J(y, u)+ ( −fi )pi +(ayi −D∇yi )·∇pi dxdt+BC y,u i=1 0 Ω ∂t where pi are the Lagrange multipiers or adjoint variables Dimitris Papadopoulos — Delta Pi Systems 5 / 23
  • 6. Optimal Control of PDEs (cont.) Adjoint Equations n n ∂pi ∂fj − − ∇ · (a · pi ) − ∇ · (D∇pi ) = φyi (y, u) + pi , for i = 1, . . . , nn , ∂t j=1 ∂yi Gradient n n t1 ∂L ∂J ∂fi = + pi dxdt ∂u ∂u i=1 0 Ω ∂u Dimitris Papadopoulos — Delta Pi Systems 6 / 23
  • 7. Continuous vs. Discrete Adjoint nonlinear linear adjoint PDE discrete equations Dimitris Papadopoulos — Delta Pi Systems 7 / 23
  • 8. Back to the basics ∂L ∂L How do you calculate ∂u or ∂y ? ◮ Calculate analytical derivatives and implement them by hand (too time consuming and error prone) ◮ Symbolic differentiation (you have to add some code generation magic) ◮ Automatic (or algorithmic) differentiation (for each new problem you have to pass your code through your AD-tool) Dimitris Papadopoulos — Delta Pi Systems 8 / 23
  • 9. Discretization of the control variables ◮ B-spline basis functions 1 if τi−1 ≤ t < τi Ni0 (t) = , 0 else n t − τj−1 n−1 τj+n − t n−1 Nj (t) = Nj (t) + N (t), n>1 τj+n−1 − τj−1 τj+n − τj j+1 ◮ B-spline curve formed by control points ci L n u(t) = cj Nj (t) j=0 Dimitris Papadopoulos — Delta Pi Systems 9 / 23
  • 10. Parametrization - Finding a knot sequence ◮ uniform or equidistant (ti − ti−1 )/(ti+1 − ti ) = 1 ◮ chord length ∆ti ||∆di || = ∆ti+1 ||∆di+1 || ◮ cetripetal 1/2 ∆ti ||∆di || = ∆ti+1 ||∆di+1 || ◮ Natural end conditions ¨ u(t0 ) = 0, ¨ u(tm ) = 0 Dimitris Papadopoulos — Delta Pi Systems 10 / 23
  • 11. Tensor Product Patches ◮ B-spline surface m n um,n (t, x) = ci,j Nim (t)Nj (x) n i=0 j=0 where ci,j is a matrix representing all the control points of the (t, x) plane. ◮ A surface with the topology of a sphere is not representable as a tensor product surface, without degeneracies (but we don’t really care) Dimitris Papadopoulos — Delta Pi Systems 11 / 23
  • 12. Flowchart parse DOT graph build symbolic PDEs initialize control points build symbolic adjoint PDEs k 1 k k+1 build symbolic gradient solve direct problem generate source code for solution of PDEs objective function compute gradient generate source code for solution of adjoint PDEs no k generate source code for gradient J <ε solve adjoint problem yes solution Dimitris Papadopoulos — Delta Pi Systems 12 / 23
  • 13. Tools of the Trade Extended DOT Language Direct Adjoint SymPy Cog Cog SfePy SfePy SciPy Dimitris Papadopoulos — Delta Pi Systems 13 / 23
  • 14. DOT Language A DSL for graph representation digraph network { 3->1 [type=1]; 3->2 [type=1]; 1->2 [style=dashed, type=2]; 2->1 [style=dashed, type=2]; 1->3 [style=dotted, type=3]; 3 [shape=box];} 3 1 2 Dimitris Papadopoulos — Delta Pi Systems 14 / 23
  • 15. Why Python? ◮ programmer’s time vs. computing time ◮ need for manipulation of the objects at runtime ◮ need for source code generation at runtime ◮ lisp, smalltalk, perl, python, ruby, javascript vs. C, C++, java ◮ Paul Graham’s classical closure example of the accumulator: def foo(n): s = [n] def bar(i): s[0] += i return s[0] return bar ◮ many tools and numerical libraries available Dimitris Papadopoulos — Delta Pi Systems 15 / 23
  • 16. PyDot A Python library for the DOT language import pydot graph = pydot.graph_from_dot_file(’test.dot’) shape_dict = {} function_dict = {} for node in graph.get_nodes(): my_name = node.get_name() shape_dict[my_name] = node.get(’shape’) function_dict[my_name] = node.get(’function’) type_dict = {} style_dict = {} for edge in graph.get_edges(): my_edge = (edge.get_source(), edge.get_destination()) type_dict[my_edge] = edge.get(’type’) style_dict[my_edge] = print edge.get(’style’) Dimitris Papadopoulos — Delta Pi Systems 16 / 23
  • 17. SymPy A Python library for symbolic mathematics from sympy import Eq, Function, Symbol from sympy import Derivative as D, Integral from sympy.abc import x, t, a y_list = [] # same for u_list for node in graph.get_nodes(): my_name = node.get_name() y_list.append(’y_’+str(my_name)) # same for u_list y = map(Function, y_list) # same for u_list f = y[1]+u # for example eq = Eq(D(y[1](x,t),t)+a*D(y[1](x,t),x)-D(D(y[1](x,t),x),x),f) Dimitris Papadopoulos — Delta Pi Systems 17 / 23
  • 18. SymPy (cont.) Derivative of the Lagrangian 1. Build list of symbols for functions, 2. build a list of substitutions for the functions and the reverse, 3. substitute for the functions, 4. run derivatives with respect to the symbols, 5. substitute functions for the symbols, 6. take any derivatives with respect to the function variables. Integral(Derivative(F.subs(u(x),foo),foo).doit().subs(foo,←֓ u(x))*v(x),x) Dimitris Papadopoulos — Delta Pi Systems 18 / 23
  • 19. Cog A code generation tool ... # [[[cog # import cog # functions = [direct, adjoint, gradient] # for func in functions: # cog.outl("def %s():" % func) # cog.outl(" pass") # ]]] # [[[end]]] ... Dimitris Papadopoulos — Delta Pi Systems 19 / 23
  • 20. SfePy A software for solving systems of coupled PDEs by the FEM ◮ SfePy: Simple finite element in python ◮ Other alternatives: FENICS or your favorite FE solver (needs to be general enough) ◮ Future work: bring metaprogramming to the next level, i.e., ◮ use FENICS, which generates C++ at runtime from the problem formulation which can also be run parallel graph symbolic intermediated parallel representation representation python code C++ code Dimitris Papadopoulos — Delta Pi Systems 20 / 23
  • 21. SciPy (and NumPy) A library for doing everything else import numpy as np from scipy.optimize import fmin_bfgs from newly_created_file import objective, gradient c0 = np.array([0.0, 0.0, 0.0, 0.0]) res = fmin_bfgs(objective, c0, gradient, args, gtol, norm, ...) and the rest is a piece of cake! Dimitris Papadopoulos — Delta Pi Systems 21 / 23
  • 22. Conclusions Summary ◮ Framework for optimal control of coupled PDE networks ◮ Automated code generation ◮ Graph representation of coupled PDEs ◮ Symbolic differentiation for the adjoint equations and the gradient ◮ Solution with the finite element method Outlook ◮ Extention to more general equations, ◮ with 2D or 3D geometries, ◮ and constraints on the state or control variables. ◮ Adaptive refinement of the control variables. Dimitris Papadopoulos — Delta Pi Systems 22 / 23
  • 23. Thank you for your attention! Delta Pi Systems Thessaloniki, Greece http://www.delta-pi-systems.eu Dimitris Papadopoulos — Delta Pi Systems 23 / 23