Big Red Integration Package Program Listing
**************************************************
Note: This listing works on both a TI-85 and a TI-86.
You might need to make a few modifications to get it
to run on other calculators (for example, earlier TIs
might not have all of the commands used below).
Lines beginning with "\" are comment lines
and can be ignored. The STORE button (bottom left,
just above the ON button) is indicated below
by \->\.
**************************************************
\START\
\COMMENT=Program file dated 09/09/98, 20:44
\NAME=INTEG
\FILE=integ.85P
ClLCD
Disp "BIG RED"
Disp "INTEGRATION PACKAGE"
Disp ""
Prompt xMin
Prompt xMax
Disp ""
Disp "Do you want graphics"
Menu(1,"Yes",YES,5,"No",NO)
Lbl NO
0\->\G
Goto SETUP
Lbl YES
1\->\G
ClDrw
FnOff
FnOn 1
fMax(y1,x,xMin,xMax)\->\V1
evalF(y1,x,V1)\->\yMax
fMin(y1,x,xMin,xMax)\->\V1
evalF(y1,x,V1)\->\yMin
(yMax-yMin)/62\->\H
yMax+H\->\yMax
yMin-H\->\yMin
If yMin>0
0\->\yMin
If yMax<0
0\->\yMax
DrawF y1
StPic fngr
FnOff
Lbl SETUP
ClLCD
Disp "Number of Intervals:"
Prompt N
(xMax-xMin)/N\->\D
0\->\S
0\->\T
ClLCD
Disp "Left hand sum"
Disp "Right hand sum"
Disp "Midpoint rule"
Disp "Trapezoidal rule"
Disp "Simpson rule"
Menu(1,"Left",LEFT,2,"Right",RIGHT,3,"Mid",MID,4,"Trap",TRAP,5,"Simp",S\#\
IMP)
Lbl SIMP
1\->\S
Lbl TRAP
1\->\T
D\->\LR
ClLCD
Disp "TRAPEZOIDAL RULE"
Goto SUMM
Lbl LEFT
0\->\LR
ClLCD
Disp "LEFT HAND SUM"
Goto SUMM
Lbl RIGHT
D\->\LR
ClLCD
Disp "RIGHT HAND SUM"
Goto SUMM
Lbl MID
D/2\->\LR
ClLCD
Disp "MIDPOINT RULE"
Lbl SUMM
0\->\RSum
xMin\->\X
evalF(y1,x,X)\->\Y0
Y0\->\Y
If G==0
Goto LOOP
ClDrw
RcPic fngr
Lbl LOOP
For(I,1,N,1)
If T==1
Y\->\YL
X+LR\->\x
y1\->\Y
If T==0
Y\->\YL
If G==0
Goto ADDON
Line(X,0,X,YL)
Line(X,YL,X+D,Y)
Line(X+D,0,X+D,Y)
Lbl ADDON
RSum+Y\->\RSum
X+D\->\X
End
If T==1
RSum+(Y0-Y)/2\->\RSum
If G==1
Pause
RSum*D\->\RES
If S==1
Then
2\->\S
0\->\T
RES\->\TR
Goto MID
End
If S==2
Then
(2*RES+TR)/3\->\RES
ClLCD
Disp "SIMPSON RULE"
End
Disp "ANSWER =",RES
Menu(1,"Again",SETUP,5,"Quit",QUIT)
Lbl QUIT
\STOP\