Indo-European network on Advanced Instability Methods Sensitivity and Adjoint operators: a simple matlab example (the discrete adjoint approach)‏

Slides:



Advertisements
Similar presentations
Partial Differential Equations
Advertisements

Ch 7.7: Fundamental Matrices
SOLUTION OF STATE EQUATION
Eigenvalues and Eigenvectors
ENGG2013 Unit 17 Diagonalization Eigenvector and eigenvalue Mar, 2011.
Ch 7.3: Systems of Linear Equations, Linear Independence, Eigenvalues
Matrix Algebra THE INVERSE OF A MATRIX © 2012 Pearson Education, Inc.
Copyright © Cengage Learning. All rights reserved. 16 Vector Calculus.
Math 3120 Differential Equations with Boundary Value Problems
ON MULTIVARIATE POLYNOMIAL INTERPOLATION
1 Adjoint Method in Network Analysis Dr. Janusz A. Starzyk.
Basic Models in Theoretical Neuroscience Oren Shriki 2010 Differential Equations.
Differential Equations and Boundary Value Problems
Autar Kaw Humberto Isaza
Boyce/DiPrima 9th ed, Ch 7.3: Systems of Linear Equations, Linear Independence, Eigenvalues Elementary Differential Equations and Boundary Value Problems,
Applied Discrete Mathematics Week 9: Relations
Lecture 35 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
Compiled By Raj G. Tiwari
ORDINARY DIFFERENTIAL EQUATION (ODE) LAPLACE TRANSFORM.
CHAPTER 2 MATRIX. CHAPTER OUTLINE 2.1 Introduction 2.2 Types of Matrices 2.3 Determinants 2.4 The Inverse of a Square Matrix 2.5 Types of Solutions to.
6.1 Antiderivatives and Slope Fields Objectives SWBAT: 1)construct antiderivatives using the fundamental theorem of calculus 2)solve initial value problems.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 4 (Part 3): Mathematical Reasoning, Induction.
Chapter 8 With Question/Answer Animations 1. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Computational Physics Introduction 3/30/11. Goals  Calculate solutions to physics problems  All physics problems can be formulated mathematically. 
Continuing with Integrals of the Form: & Partial Fractions Chapter 7.3 & 7.4.
SECTION 13.8 STOKES ’ THEOREM. P2P213.8 STOKES ’ VS. GREEN ’ S THEOREM  Stokes ’ Theorem can be regarded as a higher- dimensional version of Green ’
Time-dependent Schrodinger Equation Numerical solution of the time-independent equation is straightforward constant energy solutions do not require us.
Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Advanced Counting Techniques CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Diagonalization and Similar Matrices In Section 4.2 we showed how to compute eigenpairs (,p) of a matrix A by determining the roots of the characteristic.
Introduction Examples of differential equations and related problems Analytical versus numerical solutions Ideas of numerical representations of solutions.
Numerical Methods.
PHYS 773: Quantum Mechanics February 6th, 2012
Chapter 24 Sturm-Liouville problem Speaker: Lung-Sheng Chien Reference: [1] Veerle Ledoux, Study of Special Algorithms for solving Sturm-Liouville and.
Quality of model and Error Analysis in Variational Data Assimilation François-Xavier LE DIMET Victor SHUTYAEV Université Joseph Fourier+INRIA Projet IDOPT,
1 EEE 431 Computational Methods in Electrodynamics Lecture 18 By Dr. Rasime Uyguroglu
1 Lecture 4: March 13, 2007 Topic: 1. Uniform Frequency-Sampling Methods (cont.)
7.2 Solving Linear Recurrence Relations Some of these recurrence relations can be solved using iteration or some other ad hoc technique. However, one important.
1/6/20161 CS 3343: Analysis of Algorithms Lecture 2: Asymptotic Notations.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 27.
State Observer (Estimator)
(COEN507) LECTURE III SLIDES By M. Abdullahi
STROUD Worked examples and exercises are in the text Programme 5: Matrices MATRICES PROGRAMME 5.
5 5.1 © 2016 Pearson Education, Ltd. Eigenvalues and Eigenvectors EIGENVECTORS AND EIGENVALUES.
Differential Equations MTH 242 Lecture # 28 Dr. Manshoor Ahmed.
1 Radiative Transfer Models and their Adjoints Paul van Delst.
Finite Element Method. History Application Consider the two point boundary value problem.
2 2.2 © 2016 Pearson Education, Ltd. Matrix Algebra THE INVERSE OF A MATRIX.
STROUD Worked examples and exercises are in the text PROGRAMME 5 MATRICES.
Matrices CHAPTER 8.9 ~ Ch _2 Contents  8.9 Power of Matrices 8.9 Power of Matrices  8.10 Orthogonal Matrices 8.10 Orthogonal Matrices 
DETERMINA NT. Adjoint Matrix – Minors and Cofactors  The adjoint matrix of [A], Adj[A] is obtained by taking the transpose of the cofactor matrix of.
Properties Of the Quadratic Performance Surface
Systems of First Order Linear Equations
Trigonometric Identities
Quantum One.
Degree and Eigenvector Centrality
Autonomous Cyber-Physical Systems: Dynamical Systems
Quantum Two.
Chapter 27.
Modern Control Systems (MCS)
Copyright © Cengage Learning. All rights reserved.
§1-2 State-Space Description
Maths for Signals and Systems Linear Algebra in Engineering Lectures 13 – 14, Tuesday 8th November 2016 DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR)
Slope Fields and Euler’s Method
Linear Algebra Lecture 32.
Programming assignment #1 Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Matrix Algebra THE INVERSE OF A MATRIX © 2012 Pearson Education, Inc.
Chapter 2 Determinants.
Chapter 2 A Survey of Simple Methods and Tools
Recapitulation of Lecture 12
Presentation transcript:

Indo-European network on Advanced Instability Methods Sensitivity and Adjoint operators: a simple matlab example (the discrete adjoint approach)‏

Indo-European network on Advanced Instability Methods Adjoint operator If is a scalar product and A is a linear operator we define the adjoint of A as the operator A + satisfying = for every choice of u and v. If A is a matrix from the definition we have that A + = A t so that the adjoint operator coincides with the transpose. 2

Indo-European network on Advanced Instability Methods Numerical Approach To Adjoint Computations: continuous approach 3 Direct Continuous Problem Discretize [A - σ B]  q = 0 Direct Discrete Problem Generalized Eigenvalue Problem q direct eigenvector Direct Continuous Problem Discretize [C – σ B]  z = 0 Discrete Adjoint Problem: Generalized Eigenvalue Problem z adjoint eigenvector Generalized Green’s identity

Indo-European network on Advanced Instability Methods Numerical Approach To Adjoint Computations: discrete approach 4 Direct Continuous Problem Discretize [A - σ B]  q = 0 Direct Discrete Problem Generalized Eigenvalue Problem q direct eigenvector Adjoint of discrete problem Direct Continuous Problem z  [A - σ B] = 0 Discrete Adjoint Problem: The adjoint eigvec z is the left eigvec of the direct problem Generalized Green’s identity

Indo-European network on Advanced Instability Methods Advantages of discrete adjoint approach The discrete approach have several advantages over the continuous approach. For example  You do not need to derive the continuous adjoint equations using the generalized Green’s theorem (tedious !!!!)‏  The boundary conditions for the adjoint field (which in the continuous approach must be carefully chosen ) are automatically taken into account in the discrete approach. (easy implementation !!!)‏  In the generalized eigenvalue problem the bi-orthogonality conditions between the direct and the adjoint eigenvectors are satisfied to machine precision 5

Indo-European network on Advanced Instability Methods Suppose we have the following PDE With boundary and conditions given by Suppose we are interested in evaluating where k(x) is a given function and u(x,T) is the solution at time t=T. Question: How does change with the initial condition ? Answer: 6 A simple example

Indo-European network on Advanced Instability Methods The quantity is the sensitivity of with respect to the initial conditions. For a problem with many degree of freedom a convenient way to evaluate the sensitivity is to use the adjoint equations which can be obtained by integrating by parts: A simpe example: integration by part 7 If v(1,t)=v(0,t)=0

Indo-European network on Advanced Instability Methods A simple example: the continuous adjoint equation 8 The adjoint equation for the problem is therefore defined as This is a parabolic PDE which must be marched backward in time! = Direct Equation 0 = Adjoint Equation 0 Taking now the initial condition for the adjoint as We obtain

Indo-European network on Advanced Instability Methods A simple example: discretization of the direct problem So the variation of of due to a variation in the initial conditions can be expressed as so that the sensitivity previously introduced is given by Let now solve the problem numerically. We start with the following simple discretization of the equation 9

Indo-European network on Advanced Instability Methods Example of Matlab Program function [unew]=March(n,m,uold,a,Re,dx,dt)‏ unew=uold; rhs=zeros(n+1,1); for k=1:m+1 uold=unew; A=BuildMat(n,Re,dx,dt); rhs=BuildRhs(n,uold,a,dx,dt); unew=Solve(A,rhs); end 10

Indo-European network on Advanced Instability Methods Example: building the adjoint code Direct Initialize var1 Sub1(var1,var2) Sub2(var2,var3)‏ Sub3(var3,var4)‏ Sub4(var5,var6)‏ Solution=var6 11 Adjoint Solution = avar1 AdjSub1(avar1,avar2)‏ AdjSub2(avar2,avar3)‏ AdjSub3(avar3,avar4)‏ AdjSub4(avar5,avar6)‏ Initialize avar6 input output The program that solves the direct equation (marching) is a sequence of linear operations which are executed in a given order. If we want to solve the adjoint equation we have to derive the adjoint of our direct code. This can be done by writing down the adjoint of each direct subroutine (which performs a linear operation between the input and the output) and then calling them in a reversed sequence.

Indo-European network on Advanced Instability Methods A simple example: the adjoint of a given subroutine I Sub1(var1,var2) var2=M  var1 End Sub1 12 AdjSub1(avar1,avar2)‏ avar1=M t  avar2 End AdjSub1 Each subroutine performs a linear operation between the input and the output and can be represented through the action of a matrix M. In a real code, however, this operation can be implemented through a complicated sequence of operations and loops. So care must be taken in deriving the correct calling sequence of operations in the adjoint subroutine which gives the correct results.

Indo-European network on Advanced Instability Methods A simple example: testing the adjoint subroutine 13 Considering that each subroutine performs a linear operation we can use the definition of the adjoint to test our adjoint subroutine. In fact giving two random values to var1 and avar2 and calling the direct and adjoint subroutine the following identity must be satisfied to machine precision =