*********** INTEGREAT *********** * v1.0 * * (c)1987 By Steven Walter * * 72300,2646 * ********************************* INTEGREAT is an interactive BASIC program which computes numerical integrals using an iterative method called the trapezoidal rule. It assumes that the user has a working knowledge of Calculus. The great thing about this program is that you can enter your function to be integrated directly from the prompt without having to break the program. HOW TO RUN INTEGREAT: Although the program is fairly self-explanatory we'll run through the basic features of INTEGREAT...Here's how to operate it: 1) When prompted to enter your function, you must enter it in terms of X. You may use either an upper or lower case X (X or x) Here are some examples: X^2 2*(X+1)*Sin(3*X)+2/Cos(x) X^3-.045*x^2-X Exp(3*x^2) Log(X+2)+32*X^2-66*(X/(x+2)) 2) You are then prompted to enter the upper and lower bounds of the numerical integral (Inputs must be numerical) 3) Finally, you are asked to input the number of iterations. In most cases, the greater the number of iterations results in improved accuracy. By pressing [Enter] at this prompt you will get the default of 25. I suggest, however, that you use at least 100 for decent accuracy. Certain functions require a greater number of iterations. The number of iterations depends on your accuracy needs. 4)INTEGREAT then produces a result along with a relative error calculation. The method for error calculation is: Error=ABS((present value-previous value)/present value) This method, in some cases, may return a meaningless result. To get the percentage relative error, multiply the error by 100 (%Error=100*Error) WORDS OF CAUTION & COMMENTS: -Do NOT renumber this program! The program actually changes itself, and any renumbering changes could drastically alter program operation. -INTEGREAT changes the function key settings, and when it is done returns them to their default settings. I have done this to aid the user in creating a function. Try not to break the program in execution, or you may have to go through the inconvienience of resetting your function keys manually. -There is a limited error detection capability. Always try to avoid integrals that involve division by zero. For example: (1/X) evaluated from 0 to 1 This will result in a /0 error since the trapezoidal rule first exaluates the equation at X=0. In these cases, it would be fitting to rewrite the equation as: (1/(X+.00000000001)) evaluated from 0 to 1 -Always have the correct number of parenthases, and never leave a Sin, Cos, Exp, or other function "Open"....For example: This is INCORRECT: Cos(X+2 This is CORRECT: Cos(X+2) -Trigonometric fuctions are evaluated in radian mode....NOT DEGREES..So, for your upper and lower bounds use radians. -Since there are many times when one would like to evaluate the same integral more than once, with INTEGREAT you need only to input the desired function once. To do this you simply press [Enter] to continue and [Enter] at the function input prompt. This will re-enter the same equation in INTEGREAT. -INTEGREAT isn't the fastest way to do numerical integration, but with the right amount of iterations it returns a fairly accurate result. -Future versions will contain improved error checking/handling routines If I've forgotten anything, I'm sure I'll hear about it.... I welcome any questions or comments... STEVEN WALTER 72300,2646 Sept 20, 1987