DISCRETE FUNCTIONS  

INTERACTIVE E-BOOK

INTEGRATION

MAJOR

GENERAL

On non Internet Explorer browsers, the equations may not show up.

As an alternative or if you prefer,

you can see the pdf version of the ebook instead

Title

An interactive e-book for illustrating integration of discrete functions.

Creator

Autar K Kaw

Subject and Keywords

Discrete Functions, Numerical Integration, Mathcad, Maple, Mathematica, Matlab, Simulations.

Description

An interactive E-book for illustrating integration of discrete functions.  It includes links to simulations in Mathcad, Maple, Mathematica and Matlab for the algorithm.

Publisher

Holistic Numerical Methods Institute,

College of Engineering,

University of South Florida, Tampa, FL 33620-5350.

Contributors

Autar Kaw, Michael Keteltas

Format

Text/HTML

Last Revised

June 14, 2004

Identifier

http://numericalmethods.eng.usf.edu/ebooks/discrete_07int_ebook.pdf

Language

English

Rights

http://numericalmethods.eng.usf.edu/rights.htm

 

Table of Contents

Background

        What is integration

Discrete Functions

Example 1: Velocity as a function of time

          Method 1: Average velocity method

          Method 2: Trapezoidal Rule

          Method 3: Polynomial interpolation

          Method 4: Spline interpolation

Example 2: Finding Error

          Method 1: Average velocity error

          Method 2: Trapezoidal Rule error

          Method 3: Polynomial interpolation error

          Method 4: Spline interpolation error

Simulation

            [MAPLE] [MATHCAD] [MATHEMATICA] [MATLAB]

 

Background

This is an example of how an instructor of a Numerical Methods course can develop an E-book on a single topic by using resources that are only available at the Holistic Numerical Methods Institute (HNMI) Website.

Although one of the primary advantages of a web-based resource is that one can use documents outside of its own domain, we are particularly using this example as a way to illustrate the holistic nature of the resources available at HNMI.   You are welcome to modify and edit this e-book to suit your purpose.

Using the textbook document written in MS Word 2000 as a foundation, it was made interactive within MS Word 2000 by putting bookmarks and hyperlinks to background information, PowerPoint presentations, Mathcad simulations, historical anecdotes, multiple choice tests, problem sets, etc.  Then the MS Word 2000 file was saved as a webpage and that is what you are about to read here.

Back to TOC

 

What is integration?

Integration is the process of measuring the area under a function plotted on a graph.  Why would we want to do so?  Among the most common examples are finding the velocity of a body from acceleration functions, and displacement of a body from velocity data.  Throughout the engineering fields, there are (what sometimes seems like) countless applications for integral calculus.  Sometimes, the evaluation of expressions involving these integrals can become daunting, if not indeterminate.  For this reason, a wide variety of numerical methods have been developed to simplify the integral.  Here, we will discuss the use of numerical integration with discrete data points, which can involve unequal segments.


 

Figure 1: Integration of a function

 

Back to TOC

 

INTEGRATING DISCRETE FUNCTIONS

The method of integrating discrete functions is shown below using an example.

Example 1

The upward velocity of a rocket is given as a function of time in Table 1.

Table 1:  Velocity as a function of time

t

v(t)

s

m/s

0

0

10

227.04

15

362.78

20

517.35

22.5

602.97

30

901.67

Figure 1: Velocity vs. time data for the rocket example

 

Determine the distance,  covered by the rocket from  to  using the velocity data provided and any applicable numerical technique.

 

Solution

Method 1: Average Velocity Method

The velocity of the rocket is not provided at  and  so we will have to use the interval that includes  to find the average velocity of the rocket within that range.  In this case, the interval  will suffice.

           

           

           

           

     

                                        

Since  we get

           

Back to TOC

Method 2: Trapezoidal Rule

If we were finding the distance traveled between times on the data table, we would simply find the area of the trapezoids with the corner points given as the velocity and time data points.  For example

and applying the trapezoidal rule over each of the above integrals gives

 

The values of v(10), v(15) and v(20) are given in Table 1.

However, we are interested in finding

and applying the trapezoidal rule over each of the above integrals gives

            

How do we find v(11) and v(16)?   We use linear interpolation.  To find v(11),

                      

    

             

and to find v(16)

                                              

                                

Then

            =

                           

                          

Back to TOC

Method 3: Polynomial Interpolation to find velocity profile

Because we are finding the area under the curve from  we must use three points,   and  to fit a quadratic through the data.  Using polynomial interpolation, our resulting velocity function is (refer to notes on direct method of interpolation)

           

Now, we simply take the integral of the quadratic within our limits, giving us

           

              

              

              

 

Method 4: Spline Interpolation to find the velocity profile

Fitting quadratic splines (refer to notes on spline method of interpolation) through the data obtains the following set of quadratics

                                                 

                            

                        

                        

                     

The value of the integral would then simply be

           

              

              

              

              

Back to TOC

Example 2

What is the absolute relative true error for each of the above four methods if the above data in Table 1 was actually obtained from the velocity profile of

, where v is given in m/s and t in s.

Solution

The distance covered between t=11 and t=16 is

           

              

Method 1:

The approximate value obtained using average velocity method was 1845.3 m, hence, the absolute relative true error, , is

           

                 

Back to TOC

Method 2:

The approximate value obtained using the trapezoidal rule was 1604.9 m, hence, the absolute relative true error, , is

           

                 

Back to TOC

Method 3:

The approximate value obtained using the direct polynomial was 1604.3 m, hence, the absolute relative true error, , is

           

                 

Back to TOC

Method 4:

The approximate value obtained using the spline interpolation was 1595.9m, hence, the absolute relative true error, , is

           

                 

Table 2: Comparison of Discrete Function Methods of Numerical Integration

 

Method

Value

Average Velocity

1845.3

14.979%

Trapezoidal Rule

1612.2

0.455%

Polynomial Interpolation

1604.3

0.037%

Spline Interpolation

1595.9

0.561%

Back to TOC

 

Simulations [MAPLE] [MATHCAD] [MATHEMATICA] [MATLAB]

 

Appendix

Trapezoidal Rule for Discrete Functions with Unequal Segments

 

For a general case of a function given at n data points,,, …..,, where,  are in an ascending order,

the approximate value of the integralis given by

This approach uses the trapezoidal rule in the intervals , , …..,  and then adds the obtained values.


Back to TOC

Example 3

The upward velocity of a rocket is given as a function of time in Table 2.

Table 1:  Velocity as a function of time

t

v(t)

s

m/s

0

0

10

227.04

15

362.78

20

517.35

22.5

602.97

30

901.67

Figure 2: Velocity vs. time data for the rocket example

Determine the distance,  covered by the rocket from