Introduction
This program plots the slope field for the differential equation in the
form
.
If you have not used one of the programs posted on this website before,
you should read through
the information in the Intro to Programming
section first.
The Program
| << RCLF 'flags' STO | |
| -19 SF -2 SF ERASE | |
| {# 0d # 0d} PVIEW | |
| DRAX PPAR EVAL 4 | |
| DROPN OBJ |
|
| 'Xmax' STO OBJ |
|
| STO 'Xmin' STO | |
| '7 * (Xmax - Xmin) / 97' | |
| '7 * (Ymax - Ymin) / 64' | |
| '1 / (0.4 * H) ^ 2' |
|
| STO '1 / (0.4 * K) ^ 2' |
|
| 'B' STO 0.5 H * Xmin + | |
| 'X' STO 0.5 K* Ymin + | |
| 'Z' STO 1 'I' STO SUB1 | |
| {C S Y J I Z T X B A | |
| K H Xmin Ymin Xmax | |
| Ymax} PURGE flags STOF | |
| 'flags' PURGE>> | |
| ENTER 'SFLD' STO | {This stores the program under variable name SFLD.} |
| <<1 'J' STO Z 'Y' STO | |
| SUB2 X H + 'X' STO | |
| 'I' INCR IF 20 < THEN | |
| SUB1 END>> | |
| ENTER 'SUB1' STO | {This stores the program under variable name SUB1.} |
| <<FUNC |
|
| '1 / |
{The |
| 'C' STO T C * 'S' STO | |
| X C - Y S - |
|
| X C + Y S + |
|
| LINE Y K + 'Y' STO | |
| 'J' INCR IF 10 < THEN | |
| SUB2 END >> | |
| ENTER 'SUB2' STO | {This stores the program under variable name SUB2.} |
Running the Program
You will need to enter a function f(x,y)
into
a variable called FUNC before running the program. Follow the instructions
in Intro to Programming if you have not
done this before.
Adjust the WINDOW accordingly before running the program.