INTRO TO PROGRAMING:
EVALUATE A FUNCTION - HP 48
Introduction
The instructions for entering, running, exiting, and editing are the same
for any program. The actual program on this sheet allows you to quickly
evaluate a function in a "table" format. This may be helpful when determining
a reasonable
window for graphing or investigating the value of a limit.
Initially the table appears as a list of ordered pairs on the stack. Use
the
key
to view the table in matrix form. This allows you to scroll up and down
through the table of values.
Anything in RED denotes a button on the calculator.
For example + is the addition button.
Your calculator manual will be very valuable for finding the commands
and buttons needed for programming.
If you have misplaced yours, visit the
HP website to view a copy.
HP Manuals
How to enter a new program
-
Clear the home screen using ON.
-
Now you are ready to type in your program.
-
These calculators are both case and space sensitive.
They distinguish between x and X, DT and D T for example. Since you enter
the commands on the program in one long line using the scrolling feature
on the calculator, it will not look identical to the program given here.
As a rule type in exactly what you see in print, using a space between
the last charactor in one line and the beginning charactor in the next
line. Although many of the commands can be found in menus or on keys, you
can also type them in letter by letter. Some of the commands found on the
keys have a built in space after them. Watch the screen as you type.
Symbols such as ", <<, and : automatically come in pairs.
-
When you are finished, move the cursor to the right
of the final >> symbol. Hit ENTER.
You will notice that your program now appears in a more readable form.
At this point you will name the program and store it. Type the name of
your program between single quotes then hit STO.
The best choice of a name is one which is descriptive and no more then
5 letters since it will appear in a menu. For example 'TABLE'.
-
Later you will be able to edit or view the lines
of your program by doing the following: Clear the home screen. Enter 'name
of your function' on the stack, hit ENTER
followed by EDIT
(HP 48G) or VISIT
(HP 48S). This procedure also works for viewing
the contents of any variables.
The Program
Remember: Enter the commands in a continuous line. After you compile the
program, the lines will appear in a more readable form.
<<"MINIMUM X" ":X:" |
|
INPUT OBJ 'X' STO |
|
"INCREMENT" ":H:" |
|
INPUT OBJ 'H' STO |
|
"# OF VALUES" ":N:" |
|
INPUT OBJ 'N' STO |
|
0 N START X FUNC EVAL |
|
X H + 'X' STO |
|
NEXT N 1 + 2 2 |
|
LIST ARRY
'X' |
|
PURGE>> |
|
How to run a program
-
In almost all the programs you will need to enter and
store a function into a variable called FUNC. Initially you can do this
as follows: Clear the home screen and type in your function between single
quote marks. 'X+SIN(X)' for example. Hit ENTER.
Type in 'FUNC'. Hit ENTER then
STO. Now you've
created the variable FUNC and stored X+SIN(X). When you want to change
the function, you can repeat the procedure except you do not have to type
in the word FUNC You can type the single quote marks, then use VAR
to choose FUNC in the menu.
-
To run the program, hit VAR
and choose the name of the program from the
menu. No single quote marks are used in this case.
-
In the program above, you will be asked to enter
some information to generate the table. MINIMUM X refers to the first X
value you want to use. The program treats this as an initial value. INCREMENT
refers to the difference between consecutive X values. # OF VALUES refers
to the additional number of ordered pairs you want to see (after the initial
ordered pair).
-
When you are finished, hit CLR
if you are looking at the table on the stack. Hit ON
then CLR if you are looking at the table in matrix form.