Gauss Quadrature Rule of Integration

Download Report

Transcript Gauss Quadrature Rule of Integration

Gauss Quadrature Rule of Integration

4/25/2020 Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker http://numericalmethods.eng.usf.edu

Transforming Numerical Methods Education for STEM Undergraduates http://numericalmethods.eng.usf.edu

1

Gauss Quadrature Rule of Integration

http://numericalmethods.eng.usf.edu

3

What is Integration?

Integration

The process of measuring the area under a curve.

y

b a

f ( x ) dx

f(x)

I

a

b f ( x ) dx

Where: f(x) is the integrand a= lower limit of integration b= upper limit of integration a b x http://numericalmethods.eng.usf.edu

4

Two-Point Gaussian Quadrature Rule

http://numericalmethods.eng.usf.edu

5

Basis of the Gaussian Quadrature Rule

Previously, the Trapezoidal Rule was developed by the method of undetermined coefficients. The result of that development is summarized below.

b a

f

(

x

)

dx

c

1

f

(

a

) 

c

2

f

(

b

) 

b

a

2

f

(

a

) 

b

a

2

f

(

b

) http://numericalmethods.eng.usf.edu

6

Basis of the Gaussian Quadrature Rule

The two-point Gauss Quadrature Rule is an extension of the Trapezoidal Rule approximation where the arguments of the function are not predetermined as a and b but as unknowns x 1 and x 2 . In the two-point Gauss Quadrature Rule, the integral is approximated as

I

a

b f ( x ) dx

c

1

f ( x

1

)

c

2

f ( x

2

)

http://numericalmethods.eng.usf.edu

7

Basis of the Gaussian Quadrature Rule

The four unknowns x the formula gives exact results for integrating a general third order polynomial,

f

1

(

, x

x

2

)

, c  1

a

and c 0 

a

2 1

x

are found by assuming that 

a

2

x

2 

a

3

x

3

.

Hence

a

b f ( x ) dx

 

a

b

a

 

a

0 0

x

 

a

1

x a

1 

x

2 2

a

2 

x

2

a

2 

a

3

x

3 

dx x

3 3 

a

3

x

4 4  

b a

a

0 

b

a

 

a

1  

b

2 

a

2 2   

a

2  

b

3 

a

3 3   

a

3  

b

4 

a

4 4   http://numericalmethods.eng.usf.edu

Basis of the Gaussian Quadrature Rule

8

a b

 It follows that

f ( x ) dx

c

1 

a

0 

a

1

x

1 

a

2

x

1 2 

a

3

x

1 3   2

a

0 

a

1

x

2 

a

2

x

2 2 

a

3

x

2 3  Equating Equations the two previous two expressions yield

a

0 

b

a

 

a

1  

b

2 

a

2 2   

a

2  

b

3 

a

3 3   

a

3  

b

4 

a

4 4   

c

1 

a

0 

a

1

x

1 

a

2

x

1 2 

a

3

x

1 3   2

a

0 

a

1

x

2 

a

2

x

2 2 

a

3

x

2 3  

a

0 

c

1 

c

2  

a

1 

c

1

x

1 

c

2

x

2  

a

2 

c

1

x

1 2 

c

2

x

2 2

a

3

c

1

x

1 3 

c

2

x

2 3  http://numericalmethods.eng.usf.edu

9

Basis of the Gaussian Quadrature Rule

Since the constants a 0 , a 1 , a 2 , a 3 are arbitrary

b

a

c

1 

c

2

b

3 

a

3 

c

1

x

1 2 

c

2

x

2 2 3

b

2 

a

2 

c

1

x

1 

c

2

x

2 2

b

4 

a

4 

c

1

x

1 3 

c

2

x

2 3 4 http://numericalmethods.eng.usf.edu

10

Basis of Gauss Quadrature

The previous four simultaneous nonlinear Equations have only one acceptable solution,

x

1  2

a

   1 3 

b

 2

a x

2  2

a

   1 3 

b

a

2

c

1 

b

a

2

c

2 

b

a

2 http://numericalmethods.eng.usf.edu

11

Basis of Gauss Quadrature

Hence Two-Point Gaussian Quadrature Rule

a

b f

(

x

)

dx

b

a

2 

c

1

f

  1 

c

2

f

  2

f

  

b

 2

a

   1 3    

b

a

2    

b

a

2

f

  

b

a

2    1 3    

b

 2

a

   http://numericalmethods.eng.usf.edu

12

Higher Point Gaussian Quadrature Formulas

http://numericalmethods.eng.usf.edu

Higher Point Gaussian Quadrature Formulas

13

b a

f

(

x

)

dx

c

1

f

(

x

1 ) 

c

2

f

(

x

2 ) 

c

3

f

(

x

3 ) is called the three-point Gauss Quadrature Rule. The coefficients c 1 , c 2 , and c 3 , and the functional arguments x 1 , x 2 , and x 3 are calculated by assuming the formula gives exact expressions for integrating a fifth order polynomial

a

b

a

0 

a

1

x

a

2

x

2 

a

3

x

3 

a

4

x

4 

a

5

x

5 

dx

General n-point rules would approximate the integral

a b

f ( x ) dx

c

1

f ( x

1

)

c

2

f ( x

2

)

.

.

.

.

.

.

.

c n f ( x n )

http://numericalmethods.eng.usf.edu

14 Arguments and Weighing Factors for n-point Gauss Quadrature Formulas In handbooks, coefficients and arguments given for n-point Gauss Quadrature Rule are given for integrals  1  1

g

(

x

)

dx

i n

  1

c i g

(

x i

) as shown in Table 1.

Table 1: Weighting factors c and function arguments x used in Gauss Quadrature Formulas.

Points Weighting Factors Function Arguments

2 3 4 c 1 c 2 c 3 c 1 c 2 c 3 c 4 c 1 c 2 = 1.000000000

= 1.000000000

= 0.555555556

= 0.888888889

= 0.555555556

= 0.347854845

= 0.652145155

= 0.652145155

= 0.347854845

x 1 x 2 = -0.577350269

= 0.577350269

x 1 x 2 x 3 = -0.774596669

= 0.000000000

= 0.774596669

x 1 x 2 x 3 x 4 = -0.861136312

= -0.339981044

= 0.339981044

= 0.861136312

http://numericalmethods.eng.usf.edu

15 Arguments and Weighing Factors for n-point Gauss Quadrature Formulas

Table 1 (cont.) : Weighting factors c and function arguments x used in Gauss Quadrature Formulas.

Points

5 6 c 1 c 2 c 3 c 4 c 5 c 1 c 2 c 3 c 4 c 5 c 6

Weighting Factors

= 0.236926885

= 0.478628670

= 0.568888889

= 0.478628670

= 0.236926885

= 0.171324492

= 0.360761573

= 0.467913935

= 0.467913935

= 0.360761573

= 0.171324492

Function Arguments

x 1 x 2 x 3 x 4 x 5 = -0.906179846

= -0.538469310

= 0.000000000

= 0.538469310

= 0.906179846

x 1 x 2 x 3 x 4 x 5 x 6 = -0.932469514

= -0.661209386

= -0.2386191860

= 0.2386191860

= 0.661209386

= 0.932469514

http://numericalmethods.eng.usf.edu

16 Arguments and Weighing Factors for n-point Gauss Quadrature Formulas

b a

 So if the table is given for

f ( x ) dx

 1  1

g ( x ) dx

integrals, how does one solve ? The answer lies in that any integral with limits of can be converted into an integral with limits   1

,

1  Let

x

b x

mt

c t t

  1  1 Such that:

m

b

a

2 http://numericalmethods.eng.usf.edu

17 Arguments and Weighing Factors for n-point Gauss Quadrature Formulas Then

c

b

a

2

x

b

 2

a t

b

a

2 Hence

dx

b

a dt

2 Substituting our values of x, and dx into the integral gives us

a

b f

(

x

)

dx

  1  1

f b

a t

 2

b

a

2

b

a dt

2 http://numericalmethods.eng.usf.edu

18

Example 1

For an integral Rule.

a b

f ( x ) dx ,

derive the one-point Gaussian Quadrature

Solution

The one-point Gaussian Quadrature Rule is

a b

f ( x ) dx

c

1

f

  1 http://numericalmethods.eng.usf.edu

19

Solution

The two unknowns x polynomial, 1 , and c 1 are found by assuming that the formula gives exact results for integrating a general first order

f

(

x

) 

a

0 

a

1

x

.

a

b f

(

x

)

dx

a

b

a

0  

a

1

x

dx

 

a

0

x

a

1

x

2 2  

b a

a

0 

b

a

 

a

1  

b

2 

a

2 2   http://numericalmethods.eng.usf.edu

20

Solution

It follows that

a b

f

(

x

)

dx

c

1 

a

0 

a

1

x

1  Equating Equations, the two previous two expressions yield

a

0 

b

a

 

a

1  

b

2 

a

2 2   

c

1 

a

0 

a

1

x

1  

a

0 (

c

1 ) 

a

1 (

c

1

x

1 ) http://numericalmethods.eng.usf.edu

21

Basis of the Gaussian Quadrature Rule

Since the constants a 0 , and a 1 are arbitrary

b

a

c

1

b

2 

a

2 

c

1

x

1 2 giving

c

1 

b

a x

1 

b

a

2 http://numericalmethods.eng.usf.edu

22

Solution

Hence One-Point Gaussian Quadrature Rule

a

b f

(

x

)

dx

c

1

f

  1  (

b

a

)

f

 

b

2

a

   http://numericalmethods.eng.usf.edu

23

Example 2

In an attempt to understand the mechanism of the depolarization process in a fuel cell, an electro-kinetic model for mixed oxygen-methanol current on platinum was developed in the laboratory at FAMU. A very simplified model of the reaction developed suggests a functional relation in an integral form. To find the time required for 50% of the oxygen to be consumed, the time, T (s) is given by

T

   0 .

61  10  1 .

22  10  6 6   6 .

73

x

 4 .

3025  2 .

316  10  11 10

x

 7  

dx

a) Use two-point Gauss Quadrature Rule to find the time required for 50% of the oxygen to be consumed.

E t

 http://numericalmethods.eng.usf.edu

24

Solution

a) to [-1,1] by previous relations as follows  1 .

22  10  6 , 0 .

61   6  0 .

61  10  6  1 .

22  10 

f

6 (

x

)

dx

 0 .

61  10  6  1 .

22  10  6 2  1  1

f

  0 .

61  10  6  1 .

22  10  6 2

x

 0 .

61  10  6  1 .

22  10  6 2  

dx

  0 .

305  10  6   1 1

f

  3 .

05  10  6

x

 0 .

915  10  6 

dx

http://numericalmethods.eng.usf.edu

25

Solution (cont)

Next, get weighting factors and function argument values from Table 1 for the two point rule,

c

1  1 .

0000

x

1   0 .

57735

c

2 

x

2  1 .

0000 0 .

57735 http://numericalmethods.eng.usf.edu

Solution (cont.)

26 Now we can use the Gauss Quadrature formula  0 .

305  10  6   1 1

f

  0 .

305  10  6

x

 0 .

915  10  6 

dx

  0 .

305  10  6 

c

1

f

  0 .

305  10  6

x

1  0 .

915  10  6  

c

2

f

  0 .

305  10  6

x

2  0 .

915  10  6     0 .

305  10  6 

f

  0 .

305  10  6 (  0 .

57735 )  0 .

915  10  6    0 .

305  10  6 ( 0 .

57735 )  0 .

915  10  6     0 .

305  10  6 

f

( 1 .

0911  10  6 ) 

f

( 0 .

73891  10  6 )    0 .

305  10  6  (  3 .

0761  10 11 )  (  3 .

1573  10 11 )   190120

s

http://numericalmethods.eng.usf.edu

27

Solution (cont)

since

f

 1 .

0911  10  6      6 .

73  1 .

0911  2 .

316  10 10  11  6   4 .

3025  1 .

0911  10  6   10  7     3 .

0761  10 11

f

 0 .

73891  10  6      6 .

73  0 .

73891 2 .

316  10  6  10  11    4 .

3025 0 .

73891  10  6  10   7     3 .

1573  10 11 http://numericalmethods.eng.usf.edu

28 c) b)

Solution (cont)

E t E t

True Value

Approximat e Value

 1 .

90140  10 5  1 .

90120  10 5  15 .

595 The absolute relative true error, 

t

, is (Exact value = 190140s ) 

t

 1 .

90140  10 5  190120 1 .

90140  10 5  100  0 .

0082023 % http://numericalmethods.eng.usf.edu

Additional Resources

For all resources on this topic such as digital audiovisual lectures, primers, textbook chapters, multiple-choice tests, worksheets in MATLAB, MATHEMATICA, MathCad and MAPLE, blogs, related physical problems, please visit http://numericalmethods.eng.usf.edu/topics/gauss_qua drature.html

THE END

http://numericalmethods.eng.usf.edu