Home : Map : Chapter 5 : Java : Tech : Physics :
Integration Methods
JavaTech
Course Map
Chapter 5
File/Package/Import
  Demo 1
  Demo 2
Access/Visibility
final & Constants
Static Import
Jar Files
  Demo 3
Applet Directories
3rd Party Packages
CLASSPATH
javadoc
CodingConventions
Exercises

    Supplements
Scope
Debug Techniques
Java Runtime
Class Class
JVM Instructions 2
JVM Processing
pack200

     About JavaTech
     Codes List
     Exercises
     Feedback
     References
     Resources
     Tips
     Topic Index
     Course Guide
     What's New

Integration of functions is a common task in numerical analysis. In this chaper we look at some basic techniques.

Rectangle Approximation

As found in your calculus book, the integral of function f(x)

     

can be approximated by the summation of the areas of slices, or rectangles, beneath the function

     

where

     

and goes to zero as n goes to infinity.

This approximation can certainly be used for numerical integration but it will not provide very accurate values for most functions of interest. The flat top of the rectangle will not match well with curving functions and this error will accumulate for practical values for n. As n increases, eventually the accumulation of round off errors becomes the dominant error.

Trapezoid Rule

If we approximate the function over the dx interval with the linear interpolation formula:

     

then for a fixed we obtain

        

or

      

This is called the trapezoid rule as the sum is over the areas of trapezoids with sides of heights f(xi) and f(xi+1)and width delx.

 

References & Web Resources

            Tech
DecimalFormat
  Demo 1
  Demo 2

System.out.printf
  Demo 3
CJ Format Class
  Demo 4   Demo 5
Other Format Tools

Immutable Complex
Exercises

           Physics
Interpolation
Integration
  Demo 1
Simpson Rule
  Demo 2
Exercises

  Part I Part II Part III
Java Core 1  2  3  4  5  6  7  8  9  10  11  12 13 14 15 16 17
18 19 20
21
22 23 24
Supplements

1  2  3  4  5  6  7  8  9  10  11  12

Tech 1  2  3  4  5  6  7  8  9  10  11  12
Physics 1  2  3  4  5  6  7  8  9  10  11  12

Java is a trademark of Sun Microsystems, Inc.