• Aucun résultat trouvé

Approximation of D-finite Functions

N/A
N/A
Protected

Academic year: 2022

Partager "Approximation of D-finite Functions"

Copied!
37
0
0

Texte intégral

(1)

Rigorous Uniform Approximation of D-finite Functions

Alexandre Benoit (INRIA),

Joint work with

Mioara Jolde¸s (ENS Lyon, INRIA) and Marc Mezzarobba (INRIA)

March 16, 2011

(2)

I Introduction

(3)

Introduction Computation of the coefficients Validation Conclusion

Approximation of D-finite Functions

Definition

A function isD-finiteif it is solution of alinear differential equation with polynomial coefficients.

Examples

About60% of Abramowitz & Stegun

cos, arccos, Airy functions, Bessel functions, ...

How can we approximate a D-finite functionf? Polynomial approximation:

f(x)≈

n

X

i=0

fixi

(4)

Approximation of D-finite Functions

Definition

A function is D-finite if it is solution of a linear differential equation with polynomial coefficients.

Examples

About 60% of Abramowitz & Stegun

cos, arccos, Airy functions, Bessel functions, ...

How can we approximate a D-finite functionf? Polynomial approximation:

f(x)≈

n

X

i=0

fixi

(5)

Introduction Computation of the coefficients Validation Conclusion

Uniform Approximation of D-finite Functions

Problem

Given an integerd, anda D-finite functionf specified by a differential equation with polynomial coefficients and suitable boundary conditions, find the coefficients of a polynomialp(x) of degreed and a “small”

boundB such that |p(x)−f(x)|<B for allx in [−1,1].

Applications: Repeated evaluationon a line segment Plot

Numerical integration

Computation of minimax approximation polynomials using the Remez algorithm

(6)

Uniform Approximation of D-finite Functions

Problem

Given an integerd, and a D-finite functionf specified by a differential equation with polynomial coefficients and suitable boundary conditions, find the coefficients of a polynomialp(x) of degreed and a “small”

boundB such that |p(x)−f(x)|<B for allx in [−1,1].

Applications: Repeated evaluationon a line segment Plot

Numerical integration

Computation of minimax approximation polynomials using the Remez algorithm

(7)

Introduction Computation of the coefficients Validation Conclusion

Rigorous Uniform Approximation of D-finite Functions

Why?

Get the correct answer, not an “almost” correct one

Bridge the gap between scientific computing and pure mathematics - speed and reliability

How?

Use Floating-Point as support for fast computations

Bound roundoff, discretization, truncation errors in numerical algorithms

Compute enclosures instead of approximations What?

Interval arithmetic

(8)

Introduction Computation of the coefficients Validation Conclusion

Rigorous Uniform Approximation of D-finite Functions

Why?

Get the correct answer, not an “almost” correct one

Bridge the gap between scientific computing and pure mathematics - speed and reliability

How?

Use Floating-Point as support for fast computations

Bound roundoff, discretization, truncation errors in numerical algorithms

Computeenclosuresinstead ofapproximations

What?

Interval arithmetic

(9)

Rigorous Uniform Approximation of D-finite Functions

Why?

Get the correct answer, not an “almost” correct one

Bridge the gap between scientific computing and pure mathematics - speed and reliability

How?

Use Floating-Point as support for fast computations

Bound roundoff, discretization, truncation errors in numerical algorithms

Compute enclosures instead of approximations What?

Interval arithmetic

(10)

Chebyshev Series vs Taylor Series I

Two approximations of f: by Taylor series

f =

+∞

X

n=0

cnxn, cn=f(n)(0) n! , or by Chebyshev series

f =

+∞

X

n=−∞

tnTn(x),

tn= 1 π

Z 1

−1

Tn(t) f(t)

√1−t2dt.

Basic properties of Chebyshev polynomials

Tn(cos(θ)) = cos(nθ)

Z 1

−1

Tn(x)Tm(x)

√1−x2 dx=

0 if m6=n

π if m= 0

π

2 otherwise Tn+1= 2xTn−Tn−1 T0(x) = 1

T1(x) =x T2(x) = 2x2−1 T3(x) = 4x3−3x

(11)

Chebyshev Series vs Taylor Series I

Two approximations of f: by Taylor series

f =

+∞

X

n=0

cnxn, cn=f(n)(0) n! , or by Chebyshev series

f =

+∞

X

n=−∞

tnTn(x),

tn= 1 π

Z 1

−1

Tn(t) f(t)

√1−t2dt.

−1 −0.5 0 0.5 1

x

−0.05

−0.025 0.025 0.05

Error of approximation for exp(x)

Taylor expansion of order 3 Chebyshev expansion of order 3

(12)

Chebyshev Series vs Taylor Series II

x

Approximation of arctan(2x) by Taylor expansion of degree 1

−0.5 −0.25 0 0.25 0.5

−1

−0.5 0.5 1

arctan(2x) Taylor approximation

(13)

Chebyshev Series vs Taylor Series II

x Bad approximation outside its circle of convergence

−1 −0.5 0 0.5 1

−1.5

−1

−0.5 0.5 1 1.5

arctan(2x) Taylor approximation

(14)

Chebyshev Series vs Taylor Series II

x

Aspproximation of arctan(2x) by Chebyshev expansion of degree 1

−1 −0.5 0 0.5 1

−1.5

−1

−0.5 0.5 1 1.5

arctan(2x)

Chebyshev approximation Taylor approximation

(15)

Previous Work

Computation of the Chebyshev coefficients for D-finite functions

Using a relation between coefficients Clenshaw(1957)

Using the recurrence relation between the coefficients Fox-Parker (1968)

The tau method ofLanczos (1938),Ortiz(1969-1993)

Validation:

Kaucher-Miranker(1984)

(16)

Our Work

Given a linear differential equation with polynomial coefficients, boundary conditions and an integerd

Compute a polynomial approximationpon [−1,1] of degreed of the solutionf in the Chebyshev basis inO(d) arithmetic operations.

Compute a sharp bound B such that|f(x)−p(x)|<B, x∈[−1,1]

in O(d) arithmetic operations.

(17)

II Computation of the coefficients

(18)

Introduction Computation of the coefficientsValidation Conclusion

Chebyshev Series of D-finite Functions

Theorem (60’s, BenoitJoldesMezzarobba11)

PunTn(x)issolution of a linear differential equation with polynomial coefficients iff the sequence unis cancelled by alinear recurrence with polynomial coefficients.

Recurrence relation + good initial conditions⇒Fast numerical computa- tion of the coefficients

Taylor: exp=P 1 n!xn Rec: u(n+ 1) =u(n)n+1

u(0) = 1 1/0! = 1

u(1) = 1 1/1! = 1

u(2) = 0,5 1/2! = 0,5 ..

. ...

u(50)≈3,28.10−65 1/50!≈3,28.10−65

(19)

Chebyshev Series of D-finite Functions

Theorem (60’s, BenoitJoldesMezzarobba11)

PunTn(x)is solution of a linear differential equation with polynomial coefficients iff the sequence unis cancelled by a linear recurrence with polynomial coefficients.

Recurrence relation + good initial conditions⇒Fast numerical computa- tion of the coefficients

Taylor: exp=P 1 n!xn Rec: u(n+ 1) =u(n)n+1

u(0) = 1 1/0! = 1

u(1) = 1 1/1! = 1

u(2) = 0,5 1/2! = 0,5 ..

. ...

u(50)≈3,28.10−65 1/50!≈3,28.10−65

(20)

Introduction Computation of the coefficientsValidation Conclusion

Chebyshev Series of D-finite Functions

Theorem (60’s, BenoitJoldesMezzarobba11)

PunTn(x)is solution of a linear differential equation with polynomial coefficients iff the sequence unis cancelled by a linear recurrence with polynomial coefficients.

Recurrence relation + good initial conditions⇒Fast numerical computa- tion of the coefficients

Taylor: exp=P 1 n!xn Rec: u(n+ 1) =u(n)n+1

u(0) = 1 1/0! = 1

u(1) = 1 1/1! = 1

u(2) = 0,5 1/2! = 0,5 ..

. ...

u(50)≈3,28.10−65 1/50!≈3,28.10−65

Chebyshev: exp=P

In(1)Tn(x) Rec: u(n+ 1) =−2nu(n) +u(n−1)

u(0) = 1,266 I0(1)≈1,266 u(1) = 0,565 I1(1)≈0,565 u(2)≈0,136 I2(1)≈0,136

..

. ...

u(50)≈4,450.1067 I50(1)≈2,934.10−80

(21)

Chebyshev Series of D-finite Functions

Theorem (60’s, BenoitJoldesMezzarobba11)

PunTn(x)is solution of a linear differential equation with polynomial coefficients iff the sequence unis cancelled by a linear recurrence with polynomial coefficients.

Recurrence relation + good initial conditions⇒Fast numerical computa- tion of the coefficients

Taylor: exp=P 1 n!xn Rec: u(n+ 1) =u(n)n+1

u(0) = 1 1/0! = 1

u(1) = 1 1/1! = 1

u(2) = 0,5 1/2! = 0,5 ..

. ...

u(50)≈3,28.10−65 1/50!≈3,28.10−65

Chebyshev: exp=P

In(1)Tn(x) Rec: u(n+ 1) =−2nu(n) +u(n−1)

u(0) = 1,266 I0(1)≈1,266 u(1) = 0,565 I1(1)≈0,565 u(2)≈0,136 I2(1)≈0,136

..

. ...

u(50)≈4,450.1067 I50(1)≈2,934.10−80

(22)

Introduction Computation of the coefficientsValidation Conclusion

Convergent and Divergent Solutions of the Recurrence

Study of the Chebyshev recurrence Ifu(n) is solution, then there exists another solutionv(n)∼ u(n)1

S n

κ−3

κ−2=· · ·=κ2

κ3

Newton polygon of a Chebyshev recurrence

For the recurrenceu(n+ 1) + 2nu(n)−u(n−1)

Two independent solutions areIn(1)∼(2n)!1 andKn(1)∼(2n)!

Miller’s algorithm

To compute the firstN coefficients of the most convergent solution of a recurrence relation of order 2

Initializeu(N) = 0 andu(N−1) = 1 and compute the first coefficients using the recurrence backwards

Normalize uwith the initial condition of the recurrence

(23)

Introduction Computation of the coefficientsValidation Conclusion

Convergent and Divergent Solutions of the Recurrence

Study of the Chebyshev recurrence Ifu(n) is solution, then there exists another solutionv(n)∼ u(n)1

S n

κ−3

κ−2=· · ·=κ2

κ3

Newton polygon of a Chebyshev recurrence

For the recurrenceu(n+ 1) + 2nu(n)−u(n−1)

Two independent solutions areIn(1)∼ (2n)!1 andKn(1)∼(2n)!

Miller’s algorithm

To compute the firstN coefficients of the most convergent solution of a recurrence relation of order 2

Initializeu(N) = 0 andu(N−1) = 1 and compute the first coefficients using the recurrence backwards

Normalize uwith the initial condition of the recurrence

(24)

Convergent and Divergent Solutions of the Recurrence

Study of the Chebyshev recurrence Ifu(n) is solution, then there exists another solutionv(n)∼ u(n)1

S n

κ−3

κ−2=· · ·=κ2

κ3

Newton polygon of a Chebyshev recurrence

For the recurrenceu(n+ 1) + 2nu(n)−u(n−1)

Two independent solutions areIn(1)∼ (2n)!1 andKn(1)∼(2n)!

Miller’s algorithm

To compute the firstN coefficients of the most convergent solution of a recurrence relation of order 2

Initializeu(N) = 0 andu(N−1) = 1 and compute the first coefficients using the recurrence backwards

(25)

Algorithm for Computing the Coefficients

Algorithm

Input: a differential equation of order r with boundary conditions Output: a polynomial approximation of degree N of the solution

compute the Chebyshev recurrence of order2s≥2r for i from 1 to s

using the recurrence relation backwards, compute the first N coefficients of the sequence u[i]starting with the initial conditions

u[i](N+ 2s),· · ·,u[i](N+i),· · ·,u[i](N+ 1)

= (0,· · ·,1,· · ·,0) combine the s sequences u[i] according to the r boundary conditions and the s−r symmetry relations

(26)

Introduction Computation of the coefficientsValidation Conclusion

Example: Back to exp

u(52) = 0 I52(1)≈2,77.10−84

u(51) = 1 I51(1)≈2,88.10−82

u(50) =−102 I50(1)≈2,93.10−80

..

. ...

u(2)≈ −4,72.1080 I2(1)≈0,14 u(1)≈1,96.1081 I1(1)≈ −0,57 u(0)≈ −4,4.1081 I0(1)≈1,27

C=

50

X

n=−50

u(n)Tn(0)≈ −3,48.1081

(27)

Example: Back to exp

u(52) = 0 I52(1)≈2,77.10−84

u(51) = 1 I51(1)≈2,88.10−82

u(50) =−102 I50(1)≈2,93.10−80

..

. ...

u(2)≈ −4,72.1080 I2(1)≈0,14 u(1)≈1,96.1081 I1(1)≈ −0,57 u(0)≈ −4,4.1081 I0(1)≈1,27

C=

50

X

n=−50

u(n)Tn(0)≈ −3,48.1081

(28)

Example: Back to exp

u(52)

C = 0 I52(1)≈2,77.10−84

u(51)

C ≈ −2,88.10−82 I51(1)≈2,88.10−82 u(50)

C ≈2,93.10−80 I50(1)≈2,93.10−80 ..

. ...

u(2)

C ≈0,14 I2(1)≈0,14

u(1)

C ≈ −0,57 I1(1)≈ −0,57 u(0)

C ≈1.27 I0(1)≈1,27

C =

50

X

n=−50

u(n)Tn(0)≈ −3,48.1081

(29)

III Validation

(30)

Introduction Computation of the coefficients Validation Conclusion

Fixed Point Theorem Applied to a Differential Equation

f is solution of

y0(x)−a(x)y(x) = 0, withy(0) =y0, if and only iff is a fixed point ofτ defined by

τ(y)(t) =y0+ Z t

0

a(x)y(x)dx.

For all rational functionsa(x), there exists i such thatτi is a contraction map from the space of continuous functions to itself. We deduce:

τi(B(p,R))⊂B(p,R) =⇒ f ∈B(p,R)

Goal: Computation ofR

Givenp, findi,pi andRi such that τi(B(p,R))⊂B(pi,Ri)⊂B(p,R)

(31)

Introduction Computation of the coefficients Validation Conclusion

Fixed Point Theorem Applied to a Differential Equation

f is solution of

y0(x)−a(x)y(x) = 0, withy(0) =y0, if and only iff is a fixed point ofτ defined by

τ(y)(t) =y0+ Z t

0

a(x)y(x)dx.

For all rational functionsa(x), there exists i such thatτi is a contraction map from the space of continuous functions to itself. We deduce:

τi(B(p,R))⊂B(p,R) =⇒ f ∈B(p,R)

Goal: Computation ofR

Givenp, findi,pi andRi such that τi(B(p,R))⊂B(pi,Ri)⊂B(p,R)

(32)

Fixed Point Theorem Applied to a Differential Equation

f is solution of

y0(x)−a(x)y(x) = 0, withy(0) =y0, if and only iff is a fixed point ofτ defined by

τ(y)(t) =y0+ Z t

0

a(x)y(x)dx.

For all rational functionsa(x), there exists i such thatτi is a contraction map from the space of continuous functions to itself. We deduce:

τi(B(p,R))⊂B(p,R) =⇒ f ∈B(p,R)

Goal: Computation ofR

Givenp, findi,pi andRi such that τi(B(p,R))⊂B(pi,Ri)⊂B(p,R)

(33)

Introduction Computation of the coefficients Validation Conclusion

Algorithm for a Differential Equation of Order 1

Givenp, findi,pi andRi such that τi(B(p,R))⊂B(pi,Ri)⊂B(p,R)

Algorithm (FindR) p0:=p

while i!<kaki

Compute pi(t)a “good” approximation of y0+Rt

0a(x)pi−1(x)dx Mi =kτ(pi−1)−pik

Return

R= kpi−pk+Pi

j=1Mjkakj!j 1−kaki!i

f ∈B(p,R) =⇒ f =τi(f)∈B(pi,Ri), with

Ri=

i

X

j=1

kakjMj

j! +kakiR|t|i i!

kf −pk≤ kf −pik+kp−pik≤Ri+kp−pik=R

(34)

Introduction Computation of the coefficients Validation Conclusion

Algorithm for a Differential Equation of Order 1

Givenp, findi,pi andRi such that τi(B(p,R))⊂B(pi,Ri)⊂B(p,R)

Algorithm (FindR) p0:=p

while i!<kaki

Compute pi(t)a “good” approximation of y0+Rt

0a(x)pi−1(x)dx Mi =kτ(pi−1)−pik

Return

R= kpi−pk+Pi

j=1Mjkakj!j 1−kaki!i

f ∈B(p,R) =⇒ f =τi(f)∈B(pi,Ri), with

Ri=

i

X

j=1

kakjMj

j! +kakiR|t|i i!

kf −pk≤ kf −pik+kp−pik≤Ri+kp−pik=R

(35)

Algorithm for a Differential Equation of Order 1

Givenp, findi,pi andRi such that τi(B(p,R))⊂B(pi,Ri)⊂B(p,R)

Algorithm (FindR) p0:=p

while i!<kaki

Compute pi(t)a “good” approximation of y0+Rt

0a(x)pi−1(x)dx Mi =kτ(pi−1)−pik

Return

R= kpi−pk+Pi

j=1Mjkakj!j 1−kaki!i

f ∈B(p,R) =⇒ f =τi(f)∈B(pi,Ri), with

Ri=

i

X

j=1

kakjMj

j! +kakiR|t|i i!

(36)

IV Conclusion

(37)

Final Algorithm

Algorithm

INPUT: Differential equation with boundary conditions and a degree d OUTPUT: a polynomial approximation of degree d and a bound

Compute an approximation P of degree d of the solution with the first algorithm

Compute the bound B of the approximation with the second algorithm.

return the pair P, B

Références

Documents relatifs

In section 6, we give our modification on Chudnovsky and Chudnovsky’s algorithm for computing one term in a recurrence with polynomial coefficients; a generalization to several terms

We have compared our algorithm to a full gradient proximal approach as well as to a randomized block coordinate algorithm that considers uniform sampling and cyclic block

For continuous Galerkin finite element methods, there now exists a large amount of literature on a posteriori error estimations for (positive definite) problems in mechanics

The definition of the spectrum given by Berkovich is the following: Let (k, |.|) be complete field with respect to an ultrametric absolute value and let A 1,an k be the Berkovich

In order to obtain an energy estimate without any condition on the time step ∆t, we choose a time discretization for the non-linear terms such that the right hand side of (3.4) is

Given an integer d, and a D-finite function f specified by a differential equation with polynomial coefficients and suitable boundary conditions, find the coefficients of a

The first one is called the Godunov scheme, since it is based on the exact solution of the Riemann problem associated with the conservation law.. This Riemann problem may be

In Section 4 we study some closure properties of Laurent series of “low” complexity (addition, Hadamard product, derivative, Cartier operator) and we prove Theorem 1.4; in