






|
Calculators | Hewlett Packard | Program Notes
Programming the HP38G
By Pat Forster
If you use or quote from the following programs, please acknowledge the author above.

Programming the HP38G
Two levels of programming are possible on the HP38G:
- Saving Aplets (Function, Statistics applications etc.) where the user saves their equations or data entries, setups, notes and sketches under an Aplet name of their choice
- Programming in the Program facility of the calculator.
The first method is viable and potentially useful for all calculator users especially students while the second relies on an understanding of computer programming and can be time consuming and frustrating to the non-expert.
An alternative is to use programs available on the Internet. All these options are considered here.
Warning: Programs, including saved Aplets use up memory which might better left available for calculation.

Writing and Saving Aplets
Example for Applicable Mathematics:
Upper tail normal probability, P(z > than a given value), is obtained with the function:
UTNP(mean, variance, standardised value)
This, among other functions, might be useful to store in the calculator in a Solve Aplet saved as TEESOLVE. Use the following procedure.
Highlight the Solve Aplet in LIB and RESET (screen key) it.
Enter the equation in SYMB using Capital letters that relate to the variables. The function UTNP is accessed through:
MATH
P
Move the cursor onto Prob then across and down to UTNP.
OK
Save the equation:
LIB
Save (screen key)
Type in TEESOLVE and OK
TEESOLVE now appears in the list of Aplets in LIB and other equations can be added to it (as well as notes or sketches but remember these use memory). Save any additions as before (don't rename the Aplet - just select OK).
In NUM, using the equation for UTNP, the solution for unknown mean, variance, z, or probability can be obtained if given three of the four values.
Suggestions for teaching with the calculator, relevant to West Australian courses, are available in Using Graphics Calculators : Reference File.
Some approaches in this publication could be prepared by teachers as Aplets for transmitting to students. eg. a set of functions with axes set up appropriately could be transmitted for student exploration.

Transferring and Storing Aplets
Aplets may be transmitted between calculators using the infrared port. Instructions are in the calculator manual, pages 8 - 6.
Aplets can be stored and retrieved from the disc drive of a computer or a floppy disc. (Eg. a student might have a disc for his/her Chemistry, Physics, Mathematics Aplets). This requires a connectivity kit which comes with instructions and again refer to pages 8 - 6 in the manual.

Suggestions for Programming the Calculator for Exams
Have a minimum number of saved Aplets on the calculator because they use up memory.
Except for very specialised applications, eg. a linear programming Aplet, students are probably best advised to customise their own calculators - the process of entering equations might help them understand what each variable means in a formula.
An Aplet for linear programming is available (information and downloadable .zip file) from Colin Croft's
Customising should occur progressively through the year so that students get used to what the functions do. Eg. introducing the UTNP function just before an exam would be confusing if normal probabilities had been learnt using lower tail values from the tables book.
Students could save their Aplets on a floppy to make maximum memory available for the examination of different subjects. If this is not possible an alternative would be for teachers to keep a standard set of Aplets on some calculators to be available for transmitting to the students' calculators.
Clear unwanted data and functions.
Clear HOME, and anything not wanted in PROGRAMS, MATRIX etc.
Aplets can be cleared in two ways:
- Reset the standard Aplets (highlight each in turn in LIB and RESET). Students should be familiar with the default settings which include radians for angle measure-change this is in SYMB SETUP (for all standard Aplets) if degrees are preferred.
- Clear screens individually. This might be appropriate for the Statistics Aplet where, for example, an Applicable Mathematics student wants to keep SYMB set to fit a linear function in S1, a log linear function in S3 and a Quadratic function in S3 as shown. These settings could be saved as a separate Aplet but would use memory.
Saved Aplets cannot be RESET and students need to know that previous values for variables will reside in the memory of the calculator. Eg. the value last obtained for P when Solving a formula with P in it will stay in the memory.
Functions or equations that are used regularly in a subject, or which cause difficulties, should be considered for storing in the calculator (either saved in a separate Aplet or residing in a standard one). These might include:
- For Year 10 (in Solve) volume and surface area of a sphere, the sine rule and cosine rule (with angles set in degrees).
- For Applicable Mathematics
- (in Solve)

to calculate probabilities (or any of the parameters) for the exponential distribution,
COMB(N,R) = C to calculate combinations,
P = Q*e^(K*T) for exponential growth
- (in Function) to generate the Newton Rhapson method, F2(X)= dX (F1(X)) and
F3(X) = X-F1(X)/F2(X).
The student enters the function in F1(X), then in NUM enters the first approximation in the X column and reads off the next approximation from the F3(X) column then enters this in the X column, repeating the process to get successive iterations.
Unless F2(X) and F3(X) are evaluated first (EVAL is a key on the SYMB screen) the process is very slow, but if EVAL is used the set up is not available for other equations.
- For Discrete Mathematics
- (in Solve) the term and sum formulae for arithmetic and geometric sequences
Y = K*A^X for exponential growth,
- (in Sequence) the formula for Fibonacci sequences U1(N)=U1(N-1)+U1(N-2) and the compound and reducible interest formulae.

Successful Programming
It is possible but very tedious to type programs directly into the calculator. The alternative is to download the Aplet Development kit (ADK) software from the Hewlett Packard site which includes a tutorial on programming.
Steps to Success!
- Download the Adk file, unzip it into an empty folder and print out the file called Tutorial.
- Follow the tutorial!
- Read Colin Croft's article on .
- Open the programs that come with the Adk software and observe their format. The calculator manual has all the programming commands listed in Chapter 8.
- Download Chaos or Transformations programs into your calculator, print out the program listing, and see how the programs work. They each use different programming ideas.
- Write an application and share it with others: You can publish programs on Colin Croft's web site.

Avoiding Problems with the HP38G
Problem: giving a solution when there is none.
Eg. in Solve x2 + 3 = - (x - 1)2 + 3 gives x = 0.5 on the calculator.
Strategy: always look at Info (on the NUM screen) after solving or look at the graph to check there is an intersection point. If there is no intersection, the calculator gives the x value where the sides of the equation are closest in value.
- Problem:
Not giving a correct solution, even when one exists.
Eg. in Solve, Solving for h in cos x = a /h starting with a = 7, x = 35 and h = 26
yields h = 13.1, whereas the correct solution is h = 8.5.
Solving for x in tan x = 22 / 7 , with x starting at 0°, solves on the calculator to give 51° instead of the correct answer of 77°.
Problem: Giving a different solution than expected.
Solving for r in a volume question and getting a negative answer.
Solving equations which graph to have asymptotes.
Strategy: start the iteration near the solution (this may involve putting the cursor near the solution on the graph screen, or guessing a numerical value in Solve). This problem is inherent to the Newton-Rhapson method which the calculator uses to solve equations. Also don't have stationary points between the cursor and the required solution.
- Problem:
No room to print scientific notation on the graph screen.
One turning point for y = (x -3)2(5x + 8) is given as (-6.666666..., 72.10074...) whereas it should be (- 0.066666.....,
Strategy: check the graph.
- Problem:
Awkward Scales
Strategies:
- Set the scale to take account of the number of pixels on the screen (HP38g: for the full screen, 130 for the x axis, 63 for the y axis) so have a range that is a fraction or multiple of 13 on the horizontal axis.
- Start with a decimal scale and zoom in by a factor of 2, 5 or 10.
- Problem:
Syntax Errors
- Only the positive half of the curve is graphed for x1/ 5.
Use .
- The HP needs a * after a variable if a bracket follows.
- Students need to remember brackets for (-5)2, 1/(x-2), 2(x-3) etc.
Many other problems are addressed on Colin Croft's
[ TOP ] [ HOME ] [ SITE MAP ]
Copyright © Department of Education, Western Australia. All Rights Reserved.
updated January 2002
|