37
18 september 2002 Seminar SCG 1 Is integration in 2D or 3D really different from integration in 1D? Pieter Heres

Is integration in 2D or 3D really different from - TU/e · 18 september 2002 Seminar SCG 1 Is integration in 2D or 3D really different from integration in 1D? Pieter Heres

Embed Size (px)

Citation preview

18 september 2002 Seminar SCG 1

Is integration in 2D or 3D

reallydifferent from

integration in 1D?Pieter Heres

18 september 2002 Seminar SCG 2

Overview! Numerical integration in 1D! Numerical integration in xD! Literature! Available software

18 september 2002 Seminar SCG 3

Numerical integration1. Partition complex region into

fundamental ones

2. Use numerical integration on fundamental region

3. Adaptive: let partition depend on function

18 september 2002 Seminar SCG 4

Riemann integration! Approximation:

18 september 2002 Seminar SCG 5

Monte Carlo

∑∫=Ω

=N

kkxf

Nf

1

)(1

18 september 2002 Seminar SCG 6

Errors1. In basic region, due to

approximation error

2. Error due to non-exact covering of the region with basic regions

18 september 2002 Seminar SCG 7

Num. Integration of Basic Regions! Standard

! Advanced

Degrees of freedom: and

∑∫ =i

ii xfwf )(!

∑∑∫ =k p

kp

pk xfwf )()(,!

kw kx

18 september 2002 Seminar SCG 8

Error! A rule is called exact for f(x) if the

error, given by is zero.

! A rule is exact for degree n if it is exact for polynomials of degree up to n and not for n+1

∫ ∑− )( kk xfwf

18 september 2002 Seminar SCG 9

The best integration rule! Minimal amount of points, such

that the rule is exact for specific degree p

18 september 2002 Seminar SCG 10

Rules for integration1. Choose xk determine wk: Newton-

Cotes (demand degree p exact)2. Interpolate the function

then:

3. Determine xk and wk: Gauss-Legendre (demand degree p exact)

∑=

=n

kii xgfxf

1

)()()( α!

∑ ∫∫∑∫==

==n

iii

n

iii xgfxgfxf

11

)()()()()( αα!

18 september 2002 Seminar SCG 11

Rules for integration! Newton-Cotes via interpolation

" Error also via interpolation error

! Gauss-Legendre via orthogonal polynomials" Error also via orthogonal

polynomials

18 september 2002 Seminar SCG 12

Examples

! Newton-Cotes! Gauss-Legendre

18 september 2002 Seminar SCG 13

Orthogonal polynomialsIntegration over interval [a,b]! The optimal points are the zeros of

the orthogonal polynomial Pn(x) on [a,b].

for all polynomials Qn-1(x) of degree §n-1.

Proof in [1]

∫ =−

b

ann dxxQxP 0)()( 1

18 september 2002 Seminar SCG 14

Proof[1] A.H. Stroud “ Numerical Quadrature and

Solution of Ordinary Differential Equations”

and

0)(

)()(0)()( 11

=⇒

==∫ ∑ −−

kn

b

aknknknn

xP

xQxPwdxxQxP

"" #"" $%"#"$%0

1

exact

1

1212

)()()(

exact)()(

∫∫∫ ∑

−−

−−

+

=

dxxRxPdxxS

xQAdxxQ

nnn

knkn

18 september 2002 Seminar SCG 15

Orthogonal polynomials! It can be proven that:

" Pn(x) is unique (normalized)

" That zeros are real and distinct and lie in the open interval (a,b)

" Zeros distributed symmetrically?! Pn(x) can be found efficiently via

recursion relation.

1)()()()()()(

011

21

=−=−−= −−

xPxxPxPxPxxP nnnnn

βγβ

18 september 2002 Seminar SCG 16

Error Newton-Cotes! Error made with Newton-Cotes can

be determined with the interpolation error:

so:!

)()()()()()(

1 nfxxxxxpxf

n

nfξ−−=− …

∫∫∫ −−=−!

)()()()()()(

1 nfxxxxxpxf

n

nfξ…

18 september 2002 Seminar SCG 17

Error Gauss-Legendre! Also: weights are positive! The error made for arbitrary f(x) for

a simple region:

)())(()()!2(

1

)()()(

)2(2)2(

1

θθ nb

an

n

n

iii

cfdxxPfn

xfwfIfR

=

=−=

∑=

18 september 2002 Seminar SCG 18

Integration in 2D! For basic regions some formulae

exist or can be determined from 1D method

! Fundamental geometries

! For non-trivial regions:" Use Monte Carlo" Partition into basic regions

18 september 2002 Seminar SCG 19

Lagrange for basic region in xD! Let two Lagrangian polynomials be

given:

! Then the 2-dimensional interpolating function:

∑∑==

==m

jjjm

n

iiin yxfyyfLyxfxxfL

11

),()(),(,),()(),( µλ

∑∑= =

=≡n

i

m

jjijimnnm yxfyxyxfLLyxf

1 1

),()()()),,((),,( µλL

18 september 2002 Seminar SCG 20

Lagrange for basic region in xD

18 september 2002 Seminar SCG 21

Newton-Cotes for basic region in xD

! For simple domains only! Domain specific, example simplex

! Newton-Cotes cubatures can be found via cardinal functions [3]

18 september 2002 Seminar SCG 22

Newton-Cotes for basic region in xD

! Cardinal functions:

! Interpolating

! Which leads to a first-degree rule

,),(,),(),1(),( 3,12,11,1 yyxxyxyxyx ==−+−= λλλ

)1,0()0,1()0,0()1(),,(1 fyfxfyxyxfL ++−−=

)]1,0()0,1()0,0([61),,(

1

0

1

013 fffdydxyxfLfC

x

++== ∫ ∫−

18 september 2002 Seminar SCG 23

Given rules for 2D! Stroud [2] gives some rules for a

set of basic regions" Degree" Number of points

! With * are “particularly useful”

18 september 2002 Seminar SCG 24

Given rules for 2D! *-Example:

C2:5-1 degree 5, with 7 points:with weight

with weight

with weight

±±

31,

53

±

1514,0

( )0,0

V365

V72

V635

18 september 2002 Seminar SCG 25

The optimal choice?! Problem remains: is the choice of

your points optimal?

18 september 2002 Seminar SCG 26

Gauss for xD! Zeros of xD-orthogonal polynomials! Example 2D:! Square . Find cubature rule

with degree 2.! Orthogonal polynomials can be found:

! But, how many points to choose?

31),(),(

31),( 2)2,0()1,1(2)0,2( −==−= yyxpxyyxpxyxp

1, ≤yx

18 september 2002 Seminar SCG 27

Open problemGiven a fundamental geometryThen find the least amount of points

(and weights) such that

is exact for degree d.

Next session more about this problem

∑∫ =i

iie

xfwf )(ˆ

!

18 september 2002 Seminar SCG 28

Monte Carlo approach! First order method:

with N randomly chosen numbers

∑∫=Ω

=N

iixf

Nf

1

)(1

18 september 2002 Seminar SCG 29

LiteratureLibrary (CUL):[1] A.H. Stroud “ Numerical

Quadrature and Solution of Ordinary Differential Equations”,1974

[2] A.H. Stroud, “Appr. Calculation of Multiple Integrals”, 1971

[3] H. Engels, “Numerical Quadrate and Cubature”, 1980

Articles:

18 september 2002 Seminar SCG 30

@ARTICLEAllgGeor4,

AUTHOR="E. Allgower, K. Georg and R. Widmann",

TITLE="Volume integrals for boundary element methods",

JOURNAL="Journal of Computational and Applied Mathematics",

PAGES="17--29",

VOLUME="38",

YEAR="1991"

@ARTICLECooRab,

AUTHOR="R. Cools and P. Rabinowitz",

TITLE="Monomial cubature rules since ``Stroud'': a compilation",

JOURNAL="Journal of Computational and Applied Mathematics",

PAGES="309--326",

VOLUME="48",

YEAR="1993"

@ARTICLEDuve,

AUTHOR="D.A.~Dunavant",

TITLE="High degree efficient symmetric gauss quadrature rules for thetriangle",

JOURNAL="International Journal for Numerical Methods in Engineering",

PAGES="1129--1148",

VOLUME="21",

YEAR="1985"

@ARTICLEGeorWidm,

AUTHOR="K. Georg and R. Widmann",

TITLE="Adaptive quadratures over volumes",

JOURNAL="Computing",

PAGES="121--136",

VOLUME="47",

YEAR="1991"

18 september 2002 Seminar SCG 31

@ARTICLEGrund78,

AUTHOR="Axel Grundmann and H.M. M\"oller",

TITLE="Invariant integration formulas for the n-simplex by combinatorial methods",

JOURNAL="SIAM J. Numer. Anal.",

VOLUME="15",

NUMBER="2",

PAGES="282-290",

YEAR="1978"

@ARTICLEKaha91,

AUTHOR="D.K. Kahaner",

TITLE="A Survey of Existing multidimensional quadrature

Routines",

JOURNAL="Contemporary Mathematics",

VOLUME="155",

YEAR="1991"

@BOOKReich,

AUTHOR="S. Reich",

BOOKTITLE="Backward Error Analysis for Numerical Integrators",

YEAR="1996",

PUBLISHER="Preprint SC of the Konrad Zuse-Zentrum f\umlaut ur Informationstechnik Berlin,Berlin, October Germany”

@BOOKZumb1,

AUTHOR="G. W. Zumbusch",

BOOKTITLE="Adaptive h-p approximation procedures, graded meshes and anisotropic refinementfor Numerical Quadrature",

YEAR="1995",

PUBLISHER="Preprint SC of the Konrad Zuse-Zentrum f\umlaut ur Informationstechnik Berlin,Berlin, October Germany“

18 september 2002 Seminar SCG 32

Available software! NAG-Lib! QUADPACK! Net-lib! Mathematica

" Packages:# NumericalMath`GaussianQuadra-ture`

# NumericalMath`NewtonCotes`

# More…

" Normally Gauss-Konrod based! Matlab

18 september 2002 Seminar SCG 33

The answer is….

Yes!Integrating in 2D or 3D is really

different from integrating in 1D!

18 september 2002 Seminar SCG 34

18 september 2002 Seminar SCG 35

18 september 2002 Seminar SCG 36

Map to fundamental geometry! The domain Ω is divided into elements:

[ ] )(0

)(0

)(2

)(0

)(1 ˆ

ˆˆˆ lllll

l vyx

vvvvyx

F +

−−=

18 september 2002 Seminar SCG 37

Domain Decomposition! Integration per element:

! Assume a given quadrature rule:

! Then:

is a number dependent on the element.

∫∫ ∂=e

lle

xdxFxFfdxxfl ˆ

ˆ))ˆ(det())ˆ(()(

∑∫ =i

iie

xgwxdxg )ˆ(ˆ)ˆ(ˆ

!

∑∫ ∂=i

ilile

xFfwxFdxxfl

))ˆ(())ˆ(det()(

))ˆ(det( xFl∂