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 analysiszukun
 
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 l4Vin 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 SympyAngieB
 
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
 
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 systemsDelta 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 brinquedospssilvana
 
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-20120605ketanaka
 
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 problemsDelta 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 MEANSgrssieee
 
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
 
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 ecologyKyrre 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 GenerationDelta 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
 

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

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 

Recently uploaded (20)

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 

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