; ************************************************************
; Runge-Kutta Method (Systems of Differential Equations
; ************************************************************
; From: Sourcebook for Programmable Calculators
;        (Pages 3-15 thru 3-25)

#EMULATOR c:\ti-59\prg2\run-kut\run-kut.t59
#LISTING c:\ti-59\prg2\run-kut\run-kut.lst
#POCKETPC c:\ti-59\prg2\run-kut\run-kut.ti

;Stores delta x, x0, y0, and y2 (if necessary)
;---------------------------------------------
  lbl a
  sto 0 r/s sto 4 r/s sto 5 r/s sto 6 r/s

;Moves j+1 values of x and y's for next integration step
;-------------------------------------------------------
  lbl b
  rcl 4 sto 1 rcl 5 sto 2 rcl 6 sto 3

;Stores j values of x and y's to begin computation.  Calls
; Subroutine A' to compute f1 and f2
;---------------------------------------------------------
  lbl c
  rcl 1 sto 7 rcl 2 sto 8 rcl 3 sto 9 a'

;Computes k(1,1) and stores it in R12.  Computes Yj(1) + K(1,1)/2
; and stores it.  If flag 1 is set, transfers to step 079. (Skips
; computation of K(1,2).  
;----------------------------------------------------------------
  rcl 10 * rcl 0 = sto 12 / 2 + rcl 2 = sto 8
  iff 1 79

;Computes K(1,2) and stores it in R13.  Computes Jj(2) + K(1,2)/2
; and stores it.
;----------------------------------------------------------------
rcl 11 * rcl 0 = sto 13 / 2 + rcl 3 = sto 9

;Computes Xj + delta X/2 and stores it. Calls subroutine A' to 
; compute f1 and f2.
;------------------------------------------------------------- 
rcl 1 + rcl 0 / 2 = sto 7 a'
 

#end
 