Preface The Chebfun system Functional Newton iteration Automatic differentiation in Chebfun Chebops for automatic iterations for BVPs Automatic Differentiation in Chebfun for Solution of Nonlinear Boundary-Value Problems Asgeir Birkisson [email protected]Collaboration with Prof. Toby Driscoll, Univ. of Delaware and the Chebfun team University of Oxford, Mathematical Institute, Numerical Analysis Group Eleventh European Workshop on Automatic Differentiation December, 2010 Asgeir Birkisson Automatic Fr´ echet Differentiation
61
Embed
Automatic Differentiation in Chebfun for Solution of ...
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
PrefaceThe Chebfun system
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
Automatic Differentiation in Chebfunfor Solution of Nonlinear Boundary-Value Problems
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
BackgroundchebfunsLinear operators in Chebfun – linops
Chebfun
From the Chebfun website [5] (first result for a Google search on“chebfun”):
Chebfun is a collection of algorithms, and a software system inobject-oriented Matlab , which extends familiar powerfulmethods of numerical computation involving numbers tocontinuous or piecewise-continuous functions.
It also implements continuous analogues of linear algebranotions like the QR decomposition and the SVD, and solvesordinary differential equations.
The mathematical basis of the system combines tools ofChebyshev expansions, fast Fourier transform, barycentricinterpolation, recursive zerofinding, and automaticdifferentiation.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
BackgroundchebfunsLinear operators in Chebfun – linops
Chebfun
From the Chebfun website [5] (first result for a Google search on“chebfun”):
Chebfun is a collection of algorithms, and a software system inobject-oriented Matlab , which extends familiar powerfulmethods of numerical computation involving numbers tocontinuous or piecewise-continuous functions.
It also implements continuous analogues of linear algebranotions like the QR decomposition and the SVD, and solvesordinary differential equations.
The mathematical basis of the system combines tools ofChebyshev expansions, fast Fourier transform, barycentricinterpolation, recursive zerofinding, and automaticdifferentiation.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
BackgroundchebfunsLinear operators in Chebfun – linops
Chebfun
From the Chebfun website [5] (first result for a Google search on“chebfun”):
Chebfun is a collection of algorithms, and a software system inobject-oriented Matlab , which extends familiar powerfulmethods of numerical computation involving numbers tocontinuous or piecewise-continuous functions.
It also implements continuous analogues of linear algebranotions like the QR decomposition and the SVD, and solvesordinary differential equations.
The mathematical basis of the system combines tools ofChebyshev expansions, fast Fourier transform, barycentricinterpolation, recursive zerofinding, and automaticdifferentiation.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
BackgroundchebfunsLinear operators in Chebfun – linops
Chebfun
From the Chebfun website [5] (first result for a Google search on“chebfun”):
Chebfun is a collection of algorithms, and a software system inobject-oriented Matlab , which extends familiar powerfulmethods of numerical computation involving numbers tocontinuous or piecewise-continuous functions.
It also implements continuous analogues of linear algebranotions like the QR decomposition and the SVD, and solvesordinary differential equations.
The mathematical basis of the system combines tools ofChebyshev expansions, fast Fourier transform, barycentricinterpolation, recursive zerofinding, and automaticdifferentiation.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
BackgroundchebfunsLinear operators in Chebfun – linops
Chebfun demo
In the Chebfun system, we work with functions defined on aninterval [a, b]; the functions are represented by interpolants insuitably rescaled Chebyshev points {xj}nj=0, such that
xj = cos(jπ/n), 0 ≤ j ≤ n.
By overloading common Matlab functions, (and introducingnew ones), we can carry out computations with chebfuns.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
BackgroundchebfunsLinear operators in Chebfun – linops
Chebfun demo
In the Chebfun system, we work with functions defined on aninterval [a, b]; the functions are represented by interpolants insuitably rescaled Chebyshev points {xj}nj=0, such that
xj = cos(jπ/n), 0 ≤ j ≤ n.
By overloading common Matlab functions, (and introducingnew ones), we can carry out computations with chebfuns.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
BackgroundchebfunsLinear operators in Chebfun – linops
Chebfun demo
In the Chebfun system, we work with functions defined on aninterval [a, b]; the functions are represented by interpolants insuitably rescaled Chebyshev points {xj}nj=0, such that
xj = cos(jπ/n), 0 ≤ j ≤ n.
By overloading common Matlab functions, (and introducingnew ones), we can carry out computations with chebfuns.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
BackgroundchebfunsLinear operators in Chebfun – linops
Linear operators in Chebfun – linops
When working with vectors, we apply matrices to form newvectors.
In the functional settings, these becomes linear operators.
In Chebfun, the class linops represents such operators [4].
Linops can amongst other uses be used to representdifferentiation (diff), integration (cumsum) andmultiplication (diag) operators.
A linop can be “expanded” to form a matrix which is thediscretization of the operator it represents on thecorresponding Chebyshev grid with the same number ofpoints.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
BackgroundchebfunsLinear operators in Chebfun – linops
Linear operators in Chebfun – linops
When working with vectors, we apply matrices to form newvectors.
In the functional settings, these becomes linear operators.
In Chebfun, the class linops represents such operators [4].
Linops can amongst other uses be used to representdifferentiation (diff), integration (cumsum) andmultiplication (diag) operators.
A linop can be “expanded” to form a matrix which is thediscretization of the operator it represents on thecorresponding Chebyshev grid with the same number ofpoints.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
BackgroundchebfunsLinear operators in Chebfun – linops
Linear operators in Chebfun – linops
When working with vectors, we apply matrices to form newvectors.
In the functional settings, these becomes linear operators.
In Chebfun, the class linops represents such operators [4].
Linops can amongst other uses be used to representdifferentiation (diff), integration (cumsum) andmultiplication (diag) operators.
A linop can be “expanded” to form a matrix which is thediscretization of the operator it represents on thecorresponding Chebyshev grid with the same number ofpoints.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
BackgroundchebfunsLinear operators in Chebfun – linops
Linear operators in Chebfun – linops
When working with vectors, we apply matrices to form newvectors.
In the functional settings, these becomes linear operators.
In Chebfun, the class linops represents such operators [4].
Linops can amongst other uses be used to representdifferentiation (diff), integration (cumsum) andmultiplication (diag) operators.
A linop can be “expanded” to form a matrix which is thediscretization of the operator it represents on thecorresponding Chebyshev grid with the same number ofpoints.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
BackgroundchebfunsLinear operators in Chebfun – linops
Linear operators in Chebfun – linops
When working with vectors, we apply matrices to form newvectors.
In the functional settings, these becomes linear operators.
In Chebfun, the class linops represents such operators [4].
Linops can amongst other uses be used to representdifferentiation (diff), integration (cumsum) andmultiplication (diag) operators.
A linop can be “expanded” to form a matrix which is thediscretization of the operator it represents on thecorresponding Chebyshev grid with the same number ofpoints.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
IntroductionNewton iteration for rootfindingNewton iteration for BVPsFrechet derivatives
Newton iteration for BVPs
Now assume we want to solve the nonlinear BVP
φ(u) = 0,
α(u)∣∣x=a
= 0, β(u)∣∣x=b
= 0,
where u is a function (i.e. u = u(x)) and φ, α, and β areoperators between suitable normed function spaces;presumably, φ is a differential operator, and α and β may alsobe differential operators of lower order.
Letting N denote a BVP operator, we also refer to thisproblem simply as
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
IntroductionNewton iteration for rootfindingNewton iteration for BVPsFrechet derivatives
Newton iteration for BVPs
Now assume we want to solve the nonlinear BVP
φ(u) = 0,
α(u)∣∣x=a
= 0, β(u)∣∣x=b
= 0,
where u is a function (i.e. u = u(x)) and φ, α, and β areoperators between suitable normed function spaces;presumably, φ is a differential operator, and α and β may alsobe differential operators of lower order.
Letting N denote a BVP operator, we also refer to thisproblem simply as
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
IntroductionNewton iteration for rootfindingNewton iteration for BVPsFrechet derivatives
Newton iteration for BVPs
Definition
Let V and W be Banach spaces and let U be an open subset ofV . Then for φ : U →W , the Frechet derivative of φ at u ∈ U isdefined (when possible) as the unique linear operator A = φ′(u),A : V →W , such that
limv→0
‖φ(u + v)− φ(u)− Av‖W‖v‖V
= 0.
Note in this definition that v is a function, and we require that thelimit exists as v → 0 in any manner.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
The use of ADOur AD implementationCode modificationsEvaluation of Frechet derivativesExample of evaluation
AD in Chebfun
Even though Frechet differentiation and normal differentiationw.r.t. a function are conceptually different, they both rely onsimilar rules from calculus (e.g. chain rule).
We can thus use automatic differentiation to calculate theFrechet derivatives of the operators involved – we chooseforward mode AD.
Since Chebfun already overloads Matlab methods, operatoroverloaded AD implementation was our choice.
Since Chebfun has many other uses from solving ODEs, weput a high emphasis on minimizing computational overheadfor all uses.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
The use of ADOur AD implementationCode modificationsEvaluation of Frechet derivativesExample of evaluation
AD in Chebfun
Even though Frechet differentiation and normal differentiationw.r.t. a function are conceptually different, they both rely onsimilar rules from calculus (e.g. chain rule).
We can thus use automatic differentiation to calculate theFrechet derivatives of the operators involved – we chooseforward mode AD.
Since Chebfun already overloads Matlab methods, operatoroverloaded AD implementation was our choice.
Since Chebfun has many other uses from solving ODEs, weput a high emphasis on minimizing computational overheadfor all uses.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
The use of ADOur AD implementationCode modificationsEvaluation of Frechet derivativesExample of evaluation
AD in Chebfun
Even though Frechet differentiation and normal differentiationw.r.t. a function are conceptually different, they both rely onsimilar rules from calculus (e.g. chain rule).
We can thus use automatic differentiation to calculate theFrechet derivatives of the operators involved – we chooseforward mode AD.
Since Chebfun already overloads Matlab methods, operatoroverloaded AD implementation was our choice.
Since Chebfun has many other uses from solving ODEs, weput a high emphasis on minimizing computational overheadfor all uses.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
The use of ADOur AD implementationCode modificationsEvaluation of Frechet derivativesExample of evaluation
AD in Chebfun
Even though Frechet differentiation and normal differentiationw.r.t. a function are conceptually different, they both rely onsimilar rules from calculus (e.g. chain rule).
We can thus use automatic differentiation to calculate theFrechet derivatives of the operators involved – we chooseforward mode AD.
Since Chebfun already overloads Matlab methods, operatoroverloaded AD implementation was our choice.
Since Chebfun has many other uses from solving ODEs, weput a high emphasis on minimizing computational overheadfor all uses.
Figure: Recursive diff. of g with respect f , where f = sin(x),g1 = cos(f ), g2 = xf 2 and g = g1 + g2. In the figure, I stands for theidentity operator, M for a multiplication operator (such thatMh(x) : k(x) 7→ h(x)k(x)) and O for the zero operator on the domain ofthe functions.
Functional Newton iterationAutomatic differentiation in Chebfun
Chebops for automatic iterations for BVPs
IntroductionExamples
A. Birkisson and T. Driscoll, Automatic Frechetdifferentiation for the numerical solution of boundary-valueproblems.
Submitted.
A. Birkisson and T. Driscoll, Tech. Rep. 10/15, OxfordUniversity Mathematical Institute, November 2010.
P. Deuflhard, Newton Methods for Nonlinear Problems,Springer-Verlag, Berlin/Heidelberg, 2006.
T. A. Driscoll, F. Bornemann, and L. N. Trefethen, Thechebop system for automatic solution of differential equations, BITNumerical Mathematics, 48 (2008), pp. 701–723.
L. N. Trefethen, N. Hale, R. B. Platte, T. A. Driscoll,and R. Pachon, Chebfun version 3.