PUT RSUMCOM.82p A program to compare the various ways of doing Riemann sums. Accuracy is checked against the numeric integration function. ----begin documentation---- RSUMSCOM is a program to compare various ways of doing Riemann Sums. For a fixed n, The program gives the sum using the right-hand, left hand, trapezoid, and midpoint rules, Simpson's rules, and the calculator's numeric integral. The user is prompted for a function, the limits of integration, and the number of subdivisions. The 6 values are then computed and presented on a single screen where they can be compared. This allows comparison of the effectiveness of the various methods. Loops are inserted for the user to change the number of subintervals, or the limits of integration, or the function. When running the program, the user is reminded that on the TI-82, inputing a function through a program requires that the function start with a double quote mark. The program uses the variables A, B, C, E, F, H, I, J, L, M, N, Q, R, S, T, U, and Z and thus changes the values of those memory locations. The function is stored in Y0. This program was written by Mike May, S.J. from the Department of Mathematics and Computer Science at Saint Louis University. Send comments to: maymk@slu.edu The most current copy is kept on a web page devoted to courseware kept at http://euler.slu.edu ----end documentation---- ----begin ASCII---- \START82\ \COMMENT=Program file dated 03/17/96, 21:04 \NAME=RSUMSCOM \FILE=RSUMSCOM.82p Func FnOff 1\->\Z Repeat Z=0 Disp "ENTER FUNCTION" Disp "DON'T FORGET" Disp "QUOTES BEFORE" Disp "THE FUNCTION" Prompt \Y0\ 1\->\A Repeat A=0 Lbl W Disp "ENTER" Disp "LOWER LIMIT" Prompt L Disp "ENTER" Disp "UPPER LIMIT" Prompt U If L\B Repeat B=0 Disp "NUMBER OF SUB" Disp "INTERVALS" Prompt N If N\>=\1 Goto Y Disp "NEED N \>=\ 1" Goto X Lbl Y fnInt(\Y0\,X,L,U)\->\I (U-L)/N\->\H (L+H/2)\->\C 0\->\E \Y0\(C)\->\F For(J,1,N-1,1) E+\Y0\(L+J*H)\->\E F+\Y0\(C+J*H)\->\F End H*(E+\Y0\(L))\->\R H*(E+\Y0\(U))\->\Q (R+Q)/2\->\T H*F\->\M (T+2*M)/3\->\S Disp "APROXIMATION" Disp "WITH RIGHT," Disp "LEFT, TRAPAZOID," Disp "MIDPOINT," Disp "SIMPSONS RULE," Disp "AND NUMERIC INT" Pause Disp "R,L,T,M,S,INT Disp R,Q,T,M,S,I Pause Disp "A DIFFERENT" Disp "NUMBER OF" Disp "SUBDIVISIONS?" Disp "1 FOR YES" Disp "0 FOR NO" Prompt B End Disp "NEW LIMITS" Disp "FOR THE" Disp "INTEGRAL?" Disp "1 FOR YES" Disp "0 FOR NO" Prompt A End Disp "ANOTHER" Disp "FUNCTION?" Disp "1 FOR YES" Disp "0 FOR NO" Prompt Z End FnOff \STOP82\ ----end ASCII---- ----begin UUE---- begin 664 RSUMSCOM.82p M*BI423@R*BH:"@!0*E%53U1%4RE"149/4D4J M/]XJ5$A%*4953D-424].*C_=7AD_,01!/])!:C`_UE<_WBI%3E1%4BH_WBI, M3U=%4BE,24U)5"H_W4P_WBI%3E1%4BH_WBI54%!%4BE,24U)5"H_W54_SDQK M53_76#_>*DY%140J/]XJ3$]715(I:RE54%!%4BH_UU<_UE@_,01"/])":C`_ MWBI.54U"15(I3T8I4U5"*C_>*DE.5$525D%,4RH_W4X_SDYN,3_763_>*DY% M140I3BEN*3$J/]=8/]99/R1>&2M8*TPK51$$23\057%,$8-.!$@_$$QP2(,R M$01#/S`$13]>&1!#$01&/]-**S$K3G$Q*S$1/T5P7AD03'!*@D@1!$4_1G!> M&1!#<$J"2!$$1C_4/TB"$$5P7AD03!$1!%(_2((017!>&1!5$1$$43\04G!1 M$8,R!%0_2()&!$T_$%1P,H)-$8,S!%,_WBI!4%)/6$E-051)3TXJ/]XJ5TE4 M2"E224=(5"LJ/]XJ3$5&5"LI5%)!4$%:3TE$*RH_WBI-24103TE.5"LJ/]XJ M4TE-4%-/3E,I4E5,12LJ/]XJ04Y$*4Y5345224,I24Y4*C_8/]XJ4BM,*U0K M32M3*TE.5#_>4BM1*U0K32M3*TD_V#_>*D$I1$E&1D5214Y4*C_>*DY534)% M4BE/1BH_WBI354)$259)4TE/3E.O*C_>*C$I1D]2*5E%4RH_WBHP*49/4BE. M3RH_W4(_U#_>*DY%5RE,24U)5%,J/]XJ1D]2*51(12H_WBI)3E1%1U)!3*\J M/]XJ,2E&3U(I6453*C_>*C`I1D]2*4Y/*C_=03_4/]XJ04Y/5$A%4BH_WBI& M54Y#5$E/3J\J/]XJ,2E&3U(I6453*C_>*C`I1D]2*4Y/*C_=6C_4/Y>OYP`` end ----end UUE---- eof (end of file)