Differential Equations

on the TI-8x Graphing Calculator

Under Much Construction


Contents

  1. General
  2. Numerical Solutions
    1. Line at a Time
    2. Simple Loop Program

[Prev] [TI Calc Intro] [Nexti]

General

The TI-8x calculators are most easily used to numerically estimate the solutions of differential equations. Some of the higher end models have other other functions which can be used:

Numerical Solutions

These calculators (and any calculators) can be effectively used to numerically solve differential equations using any of the usual methods. We will implement Euler's method, Heun's method (improved Euler's) and Runge-Kutta. The methods will be implemented in a number of ways, ranging from simple use of the calculators to more sophisticated use of their programming capabilities.

Line at a Time

The simplest method is to type in the steps of the algorithm one at a time. The steps can be repeated easily by using the key sequence [2nd][ENTRY], which brings the previous command up for editing and use. Pressing [2nd][ENTRY] twice goes back two commands, etc.

Euler's Method

As an example, we use this method with Euler's method to numerically solve the equation y'=sin(x)-y with initial conditions y(0)=1 and step size h=0.25.

0->X (keys [0][STO>][X][ENTER])
1->Y (keys [1][STO>][Y][ENTER])
0.25->H (keys [0][.][2][5][STO>][H][ENTER])
Y+H*(sin X - Y)->Y (keys [ALPHA][Y][+][ALPHA][H][x][(][sin][ALPHA][X][-][ALPHA][Y][)][STO>][Y])
X+H->X (keys [ALPHA][X][+][ALPHA][H][STO>][X])

Now repeat the basic steps three more times in order to run the computation out to get y(1).

Y+H*(sin X - Y)->Y (keys [2nd][ENTRY][2nd][ENTRY][ENTER])
X+H->X (keys [2nd][ENTRY][2nd][ENTRY][ENTER])
Y+H*(sin X - Y)->Y (keys [2nd][ENTRY][2nd][ENTRY][ENTER])
X+H->X (keys [2nd][ENTRY][2nd][ENTRY][ENTER])
Y+H*(sin X - Y)->Y (keys [2nd][ENTRY][2nd][ENTRY][ENTER])
X+H->X (keys [2nd][ENTRY][2nd][ENTRY][ENTER])

Heun's Method (Improved Euler's)

We now use Heun's Method to numerically solve the same equation y'=sin(x)-y with initial conditions y(0)=1 and step size h=0.25.

0->X (keys [0][STO>][X][ENTER])
1->Y (keys [1][STO>][Y][ENTER])
0.25->H (keys [0][.][2][5][STO>][H][ENTER])
sin X - Y->M (keys [sin][ALPHA][X][-][ALPHA][Y][)][STO>][M])
sin (X+H) - (Y+H*M)->N (keys [sin][(][ALPHA][X][+][ALPHA][H][)][-][(][ALPHA][Y][+][ALPHA][H][x][ALPHA][M][)][STO>][N])
Y+H*(M+N)/2->Y (keys [ALPHA][Y][+][ALPHA][H][x][(][ALPHA][M][+][ALPHA][N][)][STO>][Y])
X+H->X (keys [ALPHA][X][+][ALPHA][H][STO>][X])

Now repeat the basic steps three more times in order to run the computation out to get y(1).

sin X - Y->M (keys [2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][ENTER])
sin (X+H) - (Y+H*M)->N (keys [2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][ENTER])
Y+H*(M+N)/2->Y (keys [2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][ENTER])
X+H->X (keys [2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][ENTER])
sin X - Y->M (keys [2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][ENTER])
sin (X+H) - (Y+H*M)->N (keys [2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][ENTER])
Y+H*(M+N)/2->Y (keys [2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][ENTER])
X+H->X (keys [2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][ENTER])
sin X - Y->M (keys [2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][ENTER])
sin (X+H) - (Y+H*M)->N (keys [2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][ENTER])
Y+H*(M+N)/2->Y (keys [2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][ENTER])
X+H->X (keys [2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][2nd][ENTRY][ENTER])

Simple Loop Program

For any more than a very few steps it is worth using the simple programming ability of the TI-8x to run a loop. Enter the program editor by pressing the [PRGM] key. Either edit an existing program or create a new program.

Write the following program and give it a name like "EUL".

While X<1 (keys [PRGM][CTL][While][ALPHA][X][2nd][TEST][<][1][ENTER])
Y+H*(sin X - Y)->Y (keys [ALPHA][Y][+][ALPHA][H][x][(][sin][ALPHA][X][-][ALPHA][Y][)][STO>][Y][ENTER])
X+H->X (keys [ALPHA][X][+][ALPHA][H][STO>][X][ENTER])
END (keys [CTL][END][ENTER])

Now return to the home screen (with the keys [2nd][QUIT]) and run the following sequence of commands:

0->X (keys [0][STO>][X][ENTER])
1->Y (keys [1][STO>][Y][ENTER])
0.25->H (keys [0][.][2][5][STO>][H][ENTER])
EUL (keys [PRGM][NAMES/EXEC][select EUL][ENTER])
Y (keys [ALPHA][Y][ENTER])

Robert Campbell, <campbell@math.umbc.edu>
9 October, 2005