Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Gauss Quadrature and Composite Quadrature Formulas in Numerical Integration - Prof. Dmitri, Study notes of Mathematics

Gauss quadrature, a method for numerical integration that chooses nodes and weights to make the formula exact for a polynomial of maximum degree. The document also covers composite quadrature formulas, which approximate integrals by approximating each integral with a low degree quadrature formula. Examples and explanations of the gauss-legendre quadrature formulas, composite midpoint rule, composite trapezoidal rule, and composite simpson's rule. Matlab's functions for numerical integration, quad and trapz, are also mentioned.

Typology: Study notes

Pre 2010

Uploaded on 09/17/2009

koofers-user-4e2
koofers-user-4e2 🇺🇸

10 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MATH 5520
Numerical Integration 2.
Dmitriy Leykekhman
Spring 2009
IGauss Quadrature.
IComposite Quadrature Formulas.
IMATLAB’s Functions.
D. Leykekhman - MATH 5520 Finite Element Methods 1 Numerical Integration 2 1
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Gauss Quadrature and Composite Quadrature Formulas in Numerical Integration - Prof. Dmitri and more Study notes Mathematics in PDF only on Docsity!

MATH 5520

Numerical Integration 2.

Dmitriy Leykekhman

Spring 2009

I (^) Gauss Quadrature.

I (^) Composite Quadrature Formulas.

I (^) MATLAB’s Functions.

Gauss Quadrature.

I (^) Idea of the Gauss Quadrature is to choose nodes x 0 ,... , xn and the weights w 0 ,... , wn such that the formula ∫ (^) b

a

p(x) dx ≈

∑^ n

i=

wip(xi).

is exact for a polynomial of maximum degree.

I Lemma

There is no choice of nodes x 0 ,... , xn and weights w 0 ,... , wn such that ∫ (^) b

a

pN (x) dx ≈

∑^ n

i=

wipN (xi).

for all polynomials pN of degree less or equal to N if N > 2 n + 1. I (^) The above lemma give an upper bound on the maximum degree.

Gauss Quadrature.

Example

Let’s force the formula to be exact for 1 , x, x^2 , and x^3. This gives us

w 1 + w 2 =

− 1

1 dx = 2

w 1 x 1 + w 2 x 2 =

− 1

x dx = 0

w 1 x^21 + w 2 x^22 =

− 1

x^2 dx =

w 1 x^31 + w 2 x^32 =

− 1

x^3 dx = 0.

a nonlinear system of 4 equations with for unknowns. Usually we need a nonlinear solver to solve nonlinear systems, but in this example we can solve it analytically to obtain

w 1 = w 2 = 1, x 1 = −

, x 2 =

Table of Gauss-Legendre Quadrature Formulas.

The weights and nodes for the first 3 Gauss-Legendre formulas on [− 1 , 1]. xi wi exact for pN ,

− √^13 , √^13 1,1 N = 3

3 5 ,^0 ,

3 5

5 9 ,^

8 9 ,^

5 9 N^ = 5

-0. -0.

N = 7

Composite Midpoint Rule.

Example

∫ (^) b

a

f (x)dx ≈

n∑− 1

i=

(xi+1 − xi)f

xi+1 + xi 2

Composite Trapezoidal Rule.

Example

∫ (^) b

a

f (x)dx ≈

n∑− 1

i=

xi+1 − xi 2

(f (xi+1) + f (xi))

The function values f (x 1 ), f (x 2 ),... , f (xn− 1 ) appear twice in the summation. This has to be utilized in the implementation of the composite Trapezoidal rule: ∫ (^) b

a

f (x)dx ≈ x 1 − x 0 2

f (x 0 )

n∑− 1

i=

xi − xi− 1 2

xi+1 − xi 2

f (xi)

xn − xn− 1 2

f (xn)

MATLAB’s quad, trapz

MATLAB has several build in functions for numerical integration. We will mention a couple quad and trapz. You can get more information by typing

help quad help trapz

MATLAB’s quad

The syntax for quad

QUAD Numerically evaluate integral, adaptive Simpson quadrature.

Q = QUAD(FUN,A,B) tries to approximate the integral of scalar-valued function FUN from A to B to within an error of 1.e-6 using recursive adaptive Simpson quadrature.

FUN is a function handle.

The function Y=FUN(X) should accept a vector argument X and return a vector result Y, the integrand evaluated at each element of X.