We have seen two applications: signal smoothing root finding - - PowerPoint PPT Presentation

we have seen two applications signal smoothing root
SMART_READER_LITE
LIVE PREVIEW

We have seen two applications: signal smoothing root finding - - PowerPoint PPT Presentation

Lesson 10 D IFFERENTIATION AND I NTEGRATION We have seen two applications: signal smoothing root finding Today we look differentation integration These will form the basis for solving ODEs D IFFERENTIATION OF F OURIER


slide-1
SLIDE 1

DIFFERENTIATION AND INTEGRATION

Lesson 10

slide-2
SLIDE 2
  • We have seen two applications:

– signal smoothing – root finding

  • Today we look

– differentation – integration

  • These will form the basis for solving ODEs
slide-3
SLIDE 3

DIFFERENTIATION OF FOURIER SERIES

slide-4
SLIDE 4
  • For functions on the periodic interval, we have the Fourier representation

f(θ) =

  • k=

ˆ fkkθ

  • Its derivative is (formally) obvious:

f (θ) ∼

  • k=

k ˆ fkkθ

  • When does this converge? Whenever ˆ

fk decays fast enough

  • Numerically, we obtain the approximation:
  • ...
  • where

and is the DFT

slide-5
SLIDE 5
  • For functions on the periodic interval, we have the Fourier representation

f(θ) =

  • k=

ˆ fkkθ

  • Its derivative is (formally) obvious:

f (θ) ∼

  • k=

k ˆ fkkθ

  • When does this converge? Whenever ˆ

fk decays fast enough

  • Numerically, we obtain the approximation:

f (θ) ≈

  • αθ, . . . , βθ
  • α

... β

  • Ff

where f = (f(θ1), . . . , f(θm)) and F is the DFT

slide-6
SLIDE 6

Pointwise convergence of derivative of at zero

500 1000 1500 2000 10-12 10-9 10-6 0.001 1

Numerical derivative Direct interpolation number of points number of points

f(θ) = ecos(10θ−1)

500 1000 1500 2000 10-13 10-10 10-7 10-4 0.1

slide-7
SLIDE 7
  • The Nth order derivative is:

f (N)(θ) ∼

  • k=

(k)N ˆ fkkθ

  • Numerically, we obtain the approximation:

f (N)(θ) ≈

  • αθ, . . . , βθ
  • α

... β

  • N

Ff where f = (f(θ1), . . . , f(θm)) and F is the DFT

slide-8
SLIDE 8

Pointwise convergence of 10th derivative of at zero Numerical 10th derivative Direct interpolation number of points number of points

f(θ) = ecos(10θ−1)

500 1000 1500 2000 10-8 10-6 10-4 0.01 1 200 400 600 800 1000 10-14 10-11 10-8 10-5 0.01 10

slide-9
SLIDE 9

INTEGRATION OF FOURIER SERIES

slide-10
SLIDE 10
  • A function define don the periodic interval has the indefinite integral
  • f θ =
  • k=,k=0

ˆ fk k kθ + ˆ f0θ + C

  • This will converge whenever the Fourier series does!
  • Numerically, we obtain the approximation:
  • ...
  • ...
  • where

and is the DFT

  • This is stable because the error in each computed

is multiplied by a bounded number

slide-11
SLIDE 11
  • A function define don the periodic interval has the indefinite integral
  • f θ =
  • k=,k=0

ˆ fk k kθ + ˆ f0θ + C

  • This will converge whenever the Fourier series does!
  • Numerically, we obtain the approximation:
  • f θ ≈
  • αθ, . . . , βθ
  • 1

α

...

1

  • 1
  • ...

1 β

  • Ff +θe

0 Ff +C

where f = (f(θ1), . . . , f(θm)) and F is the DFT

  • This is stable because the error in each computed ˆ

fk is multiplied by a bounded number

slide-12
SLIDE 12

Pointwise convergence of integral of at zero number of points

200 400 600 800 1000 10-15 10-11 10-7 0.001

f(θ) = ecos(10θ−1)

slide-13
SLIDE 13
  • Letting C = 0 at each stage, we can iterate this N times:
  • · · ·
  • f θN ≈
  • αθ, . . . , βθ
  • 1

α

...

1 − 1

  • ...

1 β

  • N

Ff+ ˆ f0 N!θN

  • The stability of this approximation is maintained
slide-14
SLIDE 14

DIFFERENTIATION OF TAYLOR SERIES

slide-15
SLIDE 15
  • For functions in the disk, we have the Taylor series

f(z) =

  • k=0

ˆ fkzk

  • Derivative :

f (z) =

  • k=0

k ˆ fkzk1

  • Numerically, we obtain the (m − 1) × m matrix approximation:

f (z) ≈

  • 1 | · · · | zm2
  • 1

2 ... m − 1

  • T f

where f = (f(z1), . . . , f(zm)) and T is the discrete Taylor transform

slide-16
SLIDE 16

50 100 150 200 10-14 10-11 10-8 10-5 0.01

First derivative

50 100 150 200 10-8 10-5 0.01 10 104 107

10th derivative Error approximating exp(z) for z = {.1,.5,1.}exp(.1i) number of points

slide-17
SLIDE 17

INTEGRATION OF TAYLOR SERIES

  • Integral :
  • f(z) z =
  • k=0

ˆ fk k + 1zk+1 + C

  • Numerically, we obtain the (m + 1) × m matrix approximation:
  • f(z) z ≈

1 | · · · | zm

  • 1

1 2

...

1 m+1

  • T f + C

where f = (f(z1), . . . , f(zm)) and T is the discrete Taylor transform

  • Now this is stable both on and inside the unit circle!
slide-18
SLIDE 18

First integral 10th integral Error approximating exp(z) for z = {.1,.5,1.}exp(.1i) number of points

50 100 150 200 10-14 10-11 10-8 10-5 0.01 50 100 150 200 10-16 10-14 10-12 10-10 10-8

slide-19
SLIDE 19

DIFFERENTIATION OF LAURENT SERIES

  • For functions on the circle, we have the Laurent series

f(z) =

  • k=

ˆ fkzk

  • Derivative :

f (z) =

  • k=

k ˆ fkzk1 =

  • k=,k=1

(k + 1) ˆ fk+1zk

  • Numerically, we obtain the (square) approximation, where we changed our basis:

f (z) ≈

  • zα1 | · · · | zβ1
  • α

... β

  • Ff

where f = (f(z1), . . . , f(zm))

  • Clearly, it will only be somewhat accurate on the unit circle, and the error will grow
slide-20
SLIDE 20

INTEGRATION OF LAURENT SERIES

  • For functions on the circle, we have the Laurent series

f(z) =

  • k=

ˆ fkzk

  • Integral:
  • f(z) z =
  • k=,k=1

1 k + 1 ˆ fkzk+1 + ˆ f1 z + C

  • Numerically, we obtain the approximation where we changed bases:
  • f(z) z ≈
  • zα+1 | · · · | zβ+1
  • 1

α+1

...

1 1

1 ...

1 β+1

  • Ff+e1Ff z+C

where f = (f(z1), . . . , f(zm))

  • This will be stable
  • However, we cannot (easily) iterate integrals!
slide-21
SLIDE 21

INTEGRATION OF CHEBYSHEV SERIES

slide-22
SLIDE 22
  • We want to compute
  • f(x) x =
  • k=0

ˇ fk

  • Tk(x) x
  • The first two moments are
  • T0(x) x = x+C = T1(x)+C

and

  • T1(x) x = x2

2 +C = T2(x) − T0(x) 4 +C

  • For

, we do the change of variables to map to the unit circle:

  • (Now

!)

slide-23
SLIDE 23
  • We want to compute
  • f(x) x =
  • k=0

ˇ fk

  • Tk(x) x
  • The first two moments are
  • T0(x) x = x+C = T1(x)+C

and

  • T1(x) x = x2

2 +C = T2(x) − T0(x) 4 +C

  • For k > 1, we do the change of variables x = J(z) to map to the unit circle:

x

a

Tk(x) x = J−1

(x) J−1

(a)

Tk(J(z))J(z) z = 1 4 J−1

(x) J−1

(a)

  • zk + zk

1 − 1 z2

  • z
  • (Now

!)

slide-24
SLIDE 24
  • We want to compute
  • f(x) x =
  • k=0

ˇ fk

  • Tk(x) x
  • The first two moments are
  • T0(x) x = x+C = T1(x)+C

and

  • T1(x) x = x2

2 +C = T2(x) − T0(x) 4 +C

  • For k > 1, we do the change of variables x = J(z) to map to the unit circle:

x

a

Tk(x) x = J−1

(x) J−1

(a)

Tk(J(z))J(z) z = 1 4 J−1

(x) J−1

(a)

  • zk + zk

1 − 1 z2

  • z

= 1 4 J−1

(x) J−1

(a)

  • zk + zk − zk2 − zk2

z

  • (Now

!)

slide-25
SLIDE 25
  • We want to compute
  • f(x) x =
  • k=0

ˇ fk

  • Tk(x) x
  • The first two moments are
  • T0(x) x = x+C = T1(x)+C

and

  • T1(x) x = x2

2 +C = T2(x) − T0(x) 4 +C

  • For k > 1, we do the change of variables x = J(z) to map to the unit circle:

x

a

Tk(x) x = J−1

(x) J−1

(a)

Tk(J(z))J(z) z = 1 4 J−1

(x) J−1

(a)

  • zk + zk

1 − 1 z2

  • z

= 1 4 J−1

(x) J−1

(a)

  • zk + zk − zk2 − zk2

z = 1 4 zk+1 k + 1 + z1k 1 − k − zk1 k − 1 − zk1 −k − 1

  • + C

(Now z = J1

(x)!)

slide-26
SLIDE 26
  • We want to compute
  • f(x) x =
  • k=0

ˇ fk

  • Tk(x) x
  • The first two moments are
  • T0(x) x = x+C = T1(x)+C

and

  • T1(x) x = x2

2 +C = T2(x) − T0(x) 4 +C

  • For k > 1, we do the change of variables x = J(z) to map to the unit circle:

x

a

Tk(x) x = J−1

(x) J−1

(a)

Tk(J(z))J(z) z = 1 4 J−1

(x) J−1

(a)

  • zk + zk

1 − 1 z2

  • z

= 1 4 J−1

(x) J−1

(a)

  • zk + zk − zk2 − zk2

z = 1 4 zk+1 k + 1 + z1k 1 − k − zk1 k − 1 − zk1 −k − 1

  • + C

(Now z = J1

(x)!)

= 1 2(k + 1) zk+1 + zk1 2 − 1 2(k − 1) zk1 + z1k 2 + C

slide-27
SLIDE 27
  • We want to compute
  • f(x) x =
  • k=0

ˇ fk

  • Tk(x) x
  • The first two moments are
  • T0(x) x = x+C = T1(x)+C

and

  • T1(x) x = x2

2 +C = T2(x) − T0(x) 4 +C

  • For k > 1, we do the change of variables x = J(z) to map to the unit circle:

x

a

Tk(x) x = J−1

(x) J−1

(a)

Tk(J(z))J(z) z = 1 4 J−1

(x) J−1

(a)

  • zk + zk

1 − 1 z2

  • z

= 1 4 J−1

(x) J−1

(a)

  • zk + zk − zk2 − zk2

z = 1 4 zk+1 k + 1 + z1k 1 − k − zk1 k − 1 − zk1 −k − 1

  • + C

(Now z = J1

(x)!)

= 1 2(k + 1) zk+1 + zk1 2 − 1 2(k − 1) zk1 + z1k 2 + C = Tk+1(x) 2(k + 1) − Tk1(x) 2(k − 1) + C

slide-28
SLIDE 28
  • We thus have the integration formula
  • f(x) x =
  • k=0

ˇ fk

  • Tk(x) x

= C + ˇ f0T1(x) + ˇ f1 T2(x) − T0(x) 4 + 1 2

  • k=2

ˇ fk Tk+1(x) k + 1 − Tk1(x) k − 1

  • Numerically, we approximate

and have the matrix for integration:

  • ...

... where and is the discrete cosine transform (DCT)

slide-29
SLIDE 29
  • We thus have the integration formula
  • f(x) x =
  • k=0

ˇ fk

  • Tk(x) x

= C + ˇ f0T1(x) + ˇ f1 T2(x) − T0(x) 4 + 1 2

  • k=2

ˇ fk Tk+1(x) k + 1 − Tk1(x) k − 1

  • = C −

ˇ f1 4 +

  • ˇ

f0 − ˇ f2 2

  • T1(x) + 1

2

  • k=2

ˇ fk1 − ˇ fk+1 k

  • Tk(x)
  • Numerically, we approximate

and have the matrix for integration:

  • ...

... where and is the discrete cosine transform (DCT)

slide-30
SLIDE 30
  • We thus have the integration formula
  • f(x) x =
  • k=0

ˇ fk

  • Tk(x) x

= C + ˇ f0T1(x) + ˇ f1 T2(x) − T0(x) 4 + 1 2

  • k=2

ˇ fk Tk+1(x) k + 1 − Tk1(x) k − 1

  • = C −

ˇ f1 4 +

  • ˇ

f0 − ˇ f2 2

  • T1(x) + 1

2

  • k=2

ˇ fk1 − ˇ fk+1 k

  • Tk(x)
  • Numerically, we approximate

f(x) ≈

  • 1 | · · · | Tn1(x)
  • Cf

and have the (n + 1) × n matrix for integration:

  • f(x) x ≈
  • 1 | · · · | Tn(x)
  • − 1

4

1 − 1

2 1 4

− 1

4

... ...

1 2(n2)

1 2(n2) 1 2(n1) 1 2n

  • Cf

where f = (f(x1), . . . , f(xn)) and C is the discrete cosine transform (DCT)

slide-31
SLIDE 31

First integral 10th integral Error approximating exp(x) for x = .1 number of points

10 20 30 40 50 10-13 10-10 10-7 10-4 0.1 10 20 30 40 50 10-14 10-12 10-10 10-8

slide-32
SLIDE 32

DIFFERENTIATION OF CHEBYSHEV SERIES

slide-33
SLIDE 33
  • Let's try decomposing the terms:

f (x) =

  • k=0

ˇ fkT

k(x)

  • We want to rewrite T

k(x) in terms of T0(x), . . . , Tk1(x)

  • Let's try an experiment:

Use Tk(x) = k x, so T

k(x) = k k x

  • 1x2

Therefore, we can numerically evaluate CTk(x) = C

  • T

k(x1)

. . . T

k(xn)

  • to get the coefficients
slide-34
SLIDE 34

0 1. 3. 5. 7. 9. 4. 8. 12. 16. 20. 6. 10. 14. 18. 8. 12. 16. 20. 10. 14. 18. 12. 16. 20. 14. 18. 16. 20. 18. 20.

Problem: the operation is dense!

CT

0(x) | · · · | CT 10(x)

=

slide-35
SLIDE 35
  • Instead, we will use the fact that differentiation is the opposite of integration
  • We want to find the vector of coefficients u = (ˇ

u0, . . . , ˇ un2) so that             − 1

4

1 − 1

2 1 4

− 1

4

... ...

1 2(n3)

1 2(n3) 1 2(n2) 1 2(n1)

            u = Cf

  • We can apply backward substitution:

. . .

  • What about the last condition

? This condition is not necessary because the constant of integration is arbitrary

slide-36
SLIDE 36
  • Instead, we will use the fact that differentiation is the opposite of integration
  • We want to find the vector of coefficients u = (ˇ

u0, . . . , ˇ un2) so that             − 1

4

1 − 1

2 1 4

− 1

4

... ...

1 2(n3)

1 2(n3) 1 2(n2) 1 2(n1)

            u = Cf

  • We can apply backward substitution:

ˇ un2 = 2(n − 1) ˇ fn1 ˇ un3 = 2(n − 2) ˇ fn2 . . .

  • What about the last condition

? This condition is not necessary because the constant of integration is arbitrary

slide-37
SLIDE 37
  • Instead, we will use the fact that differentiation is the opposite of integration
  • We want to find the vector of coefficients u = (ˇ

u0, . . . , ˇ un2) so that             − 1

4

1 − 1

2 1 4

− 1

4

... ...

1 2(n3)

1 2(n3) 1 2(n2) 1 2(n1)

            u = Cf

  • We can apply backward substitution:

ˇ un2 = 2(n − 1) ˇ fn1 ˇ un3 = 2(n − 2) ˇ fn2 ˇ un4 = 2(n − 3) ˇ fn3 + ˇ un2 . . . ˇ u0 = ˇ f1 + ˇ u2 2

  • What about the last condition − ˇ

u1 4 = ˇ

f0? This condition is not necessary because the constant of integration is arbitrary

slide-38
SLIDE 38

First derivative 10th derivative Error approximating exp(x) for x = .1 number of points

10 20 30 40 50 10-13 10-10 10-7 10-4 0.1 10 20 30 40 50 10-5 10-4 0.001 0.01 0.1 1 10