Top Banner
M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento d‘Ingegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical Analysis Dr.-Ing. Michael Dumbser 24 / 09 / 2008
18

M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

Mar 27, 2015

Download

Documents

Sydney Lane
Welcome message from author
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
Page 1: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

1 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

Lecture on Numerical Analysis

Dr.-Ing. Michael Dumbser

24 / 09 / 2008

Page 2: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

2 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

Numerical Integration (Quadrature) of Functions - Motivation

a b x

f

b

a

n

ii

n

i

x

x

dhxfhdxxfdxxfi

i1

1

01

)()()(1

b

a

dxxf ?)(

h

n

abh

hiaxi

Task: compute approximately

Solution strategy:

• Divide interval [a;b] into n smaller subintervals

• Approximate f(x) by interpolation polynomials on the subintervals, e.g. using Lagrange interpolation

• Integrate these polynomials exactly on each subinterval and sum up

• So-called Newton-Cotes formulae

ni ,...1,0

Page 3: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

3 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

Transformation of the Integration Interval

1

0

1

0

)(~

:)()(1

dfhdhxfhdxxf i

x

x

i

i

The computation of numerical quadrature formulae for each sub-interval can be technically considerably simplified using the following variable substitution:

hxx i ii xxh 1 hd

dx

Therefore, it is sufficient, without the loss of generality, to consider from now on the case of numerical integration in the reference interval [0;1].

...)(~1

0

df

Page 4: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

4 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

The Newton-Cotes Formulae

The integral of f(x) is approximated in the following steps:

1. First, the function f(x) is interpolated by a polynomial of degree k insideeach sub-interval. The interpolation points are distributed in an equidistantmanner in each sub-interval.

2. Second, the interpolation polynomial is integrated analytically.

3. Steps 1 and 2 produce an approximation of the integral of f(x) in termsof the function values fi at the interpolation points and the step size h.

Page 5: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

5 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

The Trapezium or Trapezoid Rule

a b

f

hn

abh

hiaxi 1

Use linear interpolation polynomials, i.e. polynomials of degree one in the subintervals [xi;xi+1] [0;1]:

01

0

10

111

ii ffPf

1

1

0

1 2

1

2

1 ii ffdP

11 2

1

ii

x

x

ffh

dxxPi

i

x

11 1 ii ffP

Page 6: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

6 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

The Simpson Rule (Originally Discovered by Johannes Kepler in 1615)

a b

f

hn

abh

hiaxi 1

Use quadratic interpolation polynomials, i.e. polynomials of degree two:

2

1

21

121

21

21

21

2

101

0

10

10

100

1

21

ii

i

ff

fPf

1

1

0

2 6

1

3

2

6

121 iii fffdP 12

21

1

46

iii

x

x

fffh

dxxPi

i

x

2

12

22

24

132

21 ii

i

ff

fP

Page 7: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

7 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

The 3/8 Rule

Use cubic interpolation polynomials, i.e. polynomials of degree three:

3

231

32

31

132

31

32

32

31

31

32

31

31

32

32

31

32

31

3

1101

0

10

10

10

10

1000

1

32

31

ii

ii

ff

ffPf

1

1

0

3 8

1

8

3

8

3

8

132

31 iiii ffffdP

3223

129

312

343

227

322

353

227

92

91123

29

3

32

312

ii

ii

ff

ffP

Page 8: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

8 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

Isaac Newton

Sir Isaac Newton - (* 4. January 1643 in Woolsthorpe; † 31. March 1727 in Kensington)

• Physicist, Mathematician, Astronomer and Philosopher

• Together with Leibniz, Newton is one of the inventors of infinitesimal calculus (differentiation and integration)

• 1667: Fellow of Trinity College, Cambridge

• 1687: Philosophiae Naturalis Principia Mathematica. Newton discovered the universal law of gravitation and the laws of motion of classical mechanics

• 1704: Opticks. A corpuscular theory of light.

• From 1703 president of the Royal Society

• Buried in Westminster abbey in London

Page 9: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

9 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

The Gaussian Quadrature Formulae

The previously derived formulae were all of the form

and were very easy to obtain since an equidistant spacing of the nodes was imposed and only the weights j had to be computed. The aim of the Gaussian quadrature formulae is now to obtain an optimal quadrature formula with a given number of points by making also the nodes an unknown in the derivation procedure of the quadrature formula and to come up with an optimal set of nodes xj and weights wj.

An explicit construction strategy for Gaussian integration formulae:

(1) Using M quadrature points, we have M unknowns for the positions and also M unknowns for the weights, i.e. a total of 2M unknowns.

(2) We need 2M equations to determine uniquely the 2M unknowns.

(3) The equations are obtained by requiring that the integration formula is exact for polynomials from degree 0 up to degree 2M-1 !

jM

jj fdf

1

1

01

1

M

jj

Page 10: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

10 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

The Gaussian Quadrature Formulae

This means we have 2M equations of the form to solve for j and j.

For Pi(), any polynomial of degree i can be used, in particular also the monomial i.

ji

M

jji PdP

1

1

0

12...1,0 Mj

Example 1: One integration point, i.e. M = 1, leading to the two equations:

111 101

1

0

1

0

0

j

M

jjPddP

1111

1

0

1

0

1 2

1

j

M

jjPddP

11

112

1

2

1,1 11

Page 11: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

11 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

The Gaussian Quadrature Formulae

Example 2: Two integration points, i.e. M = 2, leading to the 4 equations:

21

1

0

11 d

2211

1

0 2

1 d

36

1

2

1,3

6

1

2

1,

2

12121

222

211

1

0

2

3

1 d

322

311

1

0

3

4

1 d

Page 12: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

12 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

The Gaussian Quadrature Formulae

A more efficient and more general way of obtaining the Gaussian quadrature formulaemakes use of so-called orthogonal polynomials Li(), which are the so-called Legendrepolynomials.

1

0

)()(, dgfgf

The set of polynomials Li() is called orthogonal, if it satisfies the relation

ji

jiLL

iji if

if0,

First, we define the scalar-product of two functions f and g as follows:

With this scalar product available, we can define the L2 norm of a function f as

fff ,

Page 13: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

13 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

The Gaussian Quadrature Formulae

The polynomials Li() can be constructed via Gram-Schmidt orthogonalization from the monomials M0 = 1, M1 = 2, M3 = 3, … Mn = n as follows:

We first use the analogy of the scalar product of two functions with thescalar product already known for vectors:

i

ii baba

, aaa

,

The Gram-Schmidt orthogonalization then proceeds as follows:

00 : LM

1M

0

0

0

01, L

L

L

LM

0

0

0

0111 ,

L

L

L

LMML

1M

Page 14: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

14 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

The Gaussian Quadrature Formulae

Instead of performing orthogonalization of vectors, we now perform the orthogonalization of functions as follows:

1:)(0 L

00

01011 ,

,)()(

LL

LMLML

00 LM

1M 1M

00

020

11

12122 ,

,

,

,)()(

LL

LML

LL

LMLML

00

030

11

131

22

23233 ,

,

,

,

,

,)()(

LL

LML

LL

LML

LL

LMLML

0

0

0

0111 ,

L

L

L

LMML

0

0

0

01, L

L

L

LM

Page 15: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

15 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

The Gaussian Quadrature Formulae

Using the orthogonality property of the Legendre polynomials, we find that

else0

0if1,1)(

1

0

iLdL ii

The Gaussian quadrature formulae are written as

)()(1

1

0

j

n

jj fdf

If we now apply formula (2) to the integrals given in (1), we obtain the following linear equation system for the weights j, if we suppose the positions j to be known:

(1)

(2)

else0

0 if1)()(

1

1

0

iLdL ji

n

jji (3)

)(with jiijijijLLeL

(3‘)

Page 16: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

16 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

The Gaussian Quadrature Formulae

Theorem:

If the n positions j are given be the n roots of the polynomial Ln ( Ln( j ) = 0 ), and the weights are given by the solution of system (3), then the Gaussian

quadrature rules are exact for polynomials up to degree 2n-1, i.e.

Proof:

Suppose p() is an arbitrary polynomial of the space of polynomials of degree 2n-1, i.e.

Then we can write the polynomial p() as

12)( nPp

)()()()( rqLp n 1)(),( nPrq

)()(1

0

n

kkkLq )()(

1

0

n

kkkLr

n

jjj pdp

1

1

0

)()(

Page 17: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

17 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

The Gaussian Quadrature Formulae

Proof (continued):

We have

We also have

0

1

0

1

0

,1,)()()()( rqLdrqLdp nn

)()()()(11

jjjn

n

jjj

n

jj rqLp

1

011

)()(n

kjkk

n

jjj

n

jj Lp

01

1

01

)()(

n

jjkj

n

kkj

n

jj Lp

This finishes the proof. QED

Page 18: M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.

M. Dumbser

18 / 18

Analisi NumericaUniversità degli Studi di TrentoDipartimento d‘Ingegneria Civile ed AmbientaleDr.-Ing. Michael Dumbser

Integration of Improper IntegralsIf the integration interval goes to infinity, it can be very useful to change the integration variables use the following substitution:

222

11)(,)(

1111)(

1

1

1

1

1

1 ttftgdttgdt

ttfdt

ttfdxxf

a

b

a

b

b

a

b

a

2

111

tdt

dx

xt

tx

Example:

0

1

0

12

1 11)( dttgdt

ttfdxxf

0ab

If the integrand is singular at a known position c, than it is usually useful to split the integral as:

b

c

c

a

b

a

dxxfdxxfdxxf

)()()(

Note: Gaussian quadrature formulae never use the interval endpoints,which makes them very useful for the computation of improper integrals!