This program calls the preceding, and draws a solution curve through the cursor position each time you press [Enter]:
PROGRAM:RKG :Disp "STEPS" :Input N :prgmSLPFLD :FnOff :Lbl G :Input :Y->B :X->A :(Xmax-Xmin)/N->H :0->U :Lbl R :If U=1 :-H->H :A->X :B->Y :X->V :Y->W :Lbl Q :Y->Z :Line(V,W,X,Y) :X->V :Y->W :Z->Y :H*Y1->I :X+H/2->X :Z+I/2->Y :H*Y1->J :If abs(J)>1000000 :Goto F :Z+J/2->Y :H*Y1->K :X+H/2->X :Z+K->Y :H*Y1->L :Z+(I+2J+2K+L)/6->Y :If U=0 and X(< or =)Xmax :Goto Q :If U=1 and X(> or =)Xmin :Goto Q :If U=1 :Goto F :1->U :Goto R :Lbl F :Goto G
0. Y1 denotes the variable "Y sub 1" on the TI82 and "y sub 1" on the TI85.
1. The program SLPFLD draws the slope or flow field for the differential equation dy/dx = Y1.
2. The program RKG calls SLPFLD to draw the flow field, then enables you to move the cursor to choose an initial point. When you press [ENTER], the program draws a solution curve passing through that point, using the Runga-Kutta algorithm. When the program starts, it asks for an input called "STEPS:"; this is comparable to the number of subdivisions in Simpson's rule or Euler's method. The more steps, the greater accuracy; using 50 is usually more than enough.
3. The programs SLPFLD and RKG will work as is on the TI82 calculator. The only change needed for the TI85 is to change X and Y to lower case: x and y. (This also means changing the function "Y sub 1" to "y sub 1") On the TI81 the program SLPFLD should work pretty much as is, except that the instruction :RETURN should be End; in RKG, the command SLPFLD should be replaced by Prgm?:SLPFLD which is gotten from the PRGM EXEC menu choice.
4. Programing words such as Disp, Goto, Lbl, Input should be entered from the menus provided on the various calculators; see the ``Table of Commands'' in the back of your instruction book to find which menu to use. For example, the symbols "< or =" and "==" (test for equals) can be gotten from the TEST menu. The variable Y1 is gotten from the Y-VARS menu on the TI82/82; on the TI85 you can get it from the vars menu, but it's easier to type it as: y1 (note lower-case y).