Home : Map : Chapter 5 : Java : Tech : Physics :
Exercises
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

These exercises develop techniques for numerical integration and also in class and interface development.

  1. The midpoint approximation method uses as the height of the rectangle the value of the function between the upper and lower range of the slice interval. Create a class for the midpoint method. Use it to integrate three functions of your choice and compare its results to those obtained from the 3 methods discussed here. Use one of the text format techniques from Chapter 5: Tech for the print output.

  2. Investigate round-off errors by replacing the double precision variables used in the integration methods with single (float) precision values. Compare the integrated values of three or more functions of your choice to analytically calculated values. Show that the error difference between the computed and calculated values decreases as the number of slices increases. Determine if this difference begins to increase, however, when the number of slices continues to grow to extremely large values.

  3. Create a set of classes and interfaces for the ODE solving techniques of Chapters 2 and 4. For example, an abstract class or interface could be created for ODEs. Subclasses of these then provide concrete instances of particular ODE problems.

    An instance of an ODE type can then be passed to an ODE_Solver type, of which subclasses implement particular ODE solving methods.

    The classes can be specific to a particular type of problem, e.g. projectile motion, or more general.

            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.