Presentation is loading. Please wait.

Presentation is loading. Please wait.

MA2213 Lecture 4 Numerical Integration. Introduction Definition is the limit of Riemann sums I(f)

Similar presentations


Presentation on theme: "MA2213 Lecture 4 Numerical Integration. Introduction Definition is the limit of Riemann sums I(f)"— Presentation transcript:

1 MA2213 Lecture 4 Numerical Integration

2 Introduction Definition is the limit of Riemann sums http://www.slu.edu/classes/maymk/Riemann/Riemann.html I(f) is called an integral and the process of calculating it is called integration – it has an enormous range of applications http://en.wikipedia.org/wiki/Riemann_sum http://www.intmath.com/Applications-integration/Applications-integrals-intro.php

3 Method of Exhaustion was used in ancient times to compute areas and volumes of standard geometric objects http://www.ugrad.math.ubc.ca/coursedoc/math101/notes/integration/area.html Example: area of region between the x-axis, the graph of a function y = f(x), and the vertical lines x = a, and x = b, is given by http://en.wikipedia.org/wiki/Method_of_exhaustion

4 Fundamental Theorem of Calculus (Newton and Leibniz) implies that where F is any antiderivative of f, this means that Unfortunately, not all integrands f have ‘closed form’ antiderivatives

5 Left Riemann Sum [f(x 0 ) + f(x 1 ) +... + f(x n-1 )] *Delta x

6 Right Riemann Sum [f(x 1 ) + f(x 2 ) +... + f(x n )] * Delta x http://mathews.ecs.fullerton.edu/a2001/Animations/Quadrature/Midpoint/Midpointaa.html Midpoint Rule Animation

7 Midpoint Rule [f(m 1 ) + f(m 2 ) +... + f(m n )] * Delta x http://mathews.ecs.fullerton.edu/a2001/Animations/Quadrature/Midpoint/Midpointaa.html Animation

8 Trapezoidal Rule The trapezoid approximation associated with a uniform partition a = x0 < x1 <... < xn = b is given by.5*[f(x0) + 2f(x1) +... + 2f(xn-1) + f(xn)]*Delta x

9 Review Questions How can the trapezoidal rule be obtained from the left and right Riemann sums ? How can the trapezoidal rule be obtained from the midpoint rule ? How can the trapezoidal rule be obtained by approximating the integral of a f by the integral of an interpolant of f ?

10 Simpson’s Rule is obtained by computing the integral of a quadratic interpolating polynomial where

11 Simpson’s Rule in general divides the interval [a,b] into equal length intervals and applies the previous formula to each interval to obtain (for positive even integers n) whereand

12 Quadrature is based on the exact integration of polynomials of increasing degree, [a,b] is not subdivided Theorem 1 If nodes whenever are given then there exist unique weights such that in is a polynomial with degree

13 Quadrature 1 st Proof (Theorem 1) The quadrature equations have a nonsingular coefficient matrix (why)? 2 nd Proof Question What are?

14 Gaussian Quadrature is based on strategic choice of nodes (only a genius could make such a choice) so that when weightsare chosen with then also (as if by MAGIC) for polynomials f with degree We seem to get n extra equations for free ! Let us examine cases for n = 1 and for n = 2.

15 Gaussian Quadrature Case n = 1 for polynomials f of as large degree as possible. is to hold For f(x) = 1 Question Why is this quadrature formula exact for ALL linear polynomials ? For f(x) = x

16 Gaussian Quadrature Case n = 2 is to hold for the polynomials f(x) = This yields the system of four nonlinear equations whose solution is

17 Gaussian Quadrature Example Not bad for an estimate based on 2 nodes ! Question Why is where and why is this useful ?

18 Gaussian Quadrature Case n > 2 Findsuch that for Gauss solved this using orthogonal polynomials. http://en.wikipedia.org/wiki/Gaussian_quadrature Error Bounds Trapezoidal Simpson Gauss minimax error

19 Orthogonal Polynomials Definition A sequence (finite or infinite) of polynomials is called orthogonal over an interval [a,b] if Question 1. Show that condition 1 implies that (called the scalar product of the 2 functions) is a basis for { poly. deg < k}

20 Orthogonal Polynomials Question 2. Show that conditions 1 and 2 imply for polynomials Theorem 2. with deg hasdistinct roots in Proof Assume thathas only m < k distinct roots with odd multiplicity in Define Sincedoes not change sign on This contradicts Question 2.

21 Gaussian Quadrature Theorem 2. If zeros ofwhere are chosen to be the and are orthogonal by Thm 1 so that whenever f is a poly. deg < n are chosen then this same equation holds if f has deg. < 2n polynomials over Proof Divide to obtainwhere g and h are polynomials with Then

22 Homework Due at End of Lab 2 Question 1. for the function Compute the least squares approximation over the interval [-1,1] from the set S of functions that are continuous on [-1,1] and linear on [-1,0] and on [0,1]. Express your solution as a linear combination of the basis functions for S described in the 1 st vufoil in Lecture 3. The coefficients of this linear combination are solutions of a system of 3 linear equation whose matrix of coefficients is the Gramm matrix that you computed for Question 4 in the previous Homework. Write a MATLAB program in an MATLAB.m-file to solve this linear system of equations.


Download ppt "MA2213 Lecture 4 Numerical Integration. Introduction Definition is the limit of Riemann sums I(f)"

Similar presentations


Ads by Google