The HP Calculator Specialist
Musings and comments about our common interest
We discussed a couple of days ago about the formula library designed by Eddie B. Shore. I have added several equations on my own - namely all the decibel-watt and decibel-voltage gain calculations, loudspeaker sensitivity; but do you have equations you want to have included?
Also, it is good practice to include the equation in the “print” area, so you know what the equation does before using the solver. Tomorrow I will post the program with this latter change - but also a couple of additional equations too.
I have found that some equations that worked in the HP17bII solver don’t work in the Prime’s. “Bad guess”, the system says. Go figure. The function is not linear by any means - it has a MIN() function, but nevertheless the variable usually searched for is outside of that MIN() function, so there should be no problem. Worthy of more investigation.
Due to the complexity of getting the right shipment option for the hp41c battery repair kit (it depends on the stage you are in the order), we have decided to increase the price a little and include the shipping cost in it. This is particularly beneficial for those out of the European Union, since they save also VAT.
Now the ordering should be much easier. Orders have begun to come in, so it must be working better than before!
On another subject: during this week end, we assembled 2 new JP 41CL with the latest circuit, including the new modules from Systemyde and Angel Martin (namely the HP16c function set clone). So, there are now 1 tall keys, satin-keyboard HP41c and 2 low keys, rugged keyboard HP41c. On demand, we could assemble too an HP41c - but personally I have always preferred the white border of the c models than the yellow of the CV or CX. Screen and keyboard are top-notch in all cases. No original box available, sorry!
There are also two Time modules available, one with English manual, and the other with French manual and original box. These are sold at 120 € if demanded with any of the HP41CLs, 150 € otherwise.
(As a comment aside, some customers complain that they can find some items cheaper in internet - but please compare apples with apples: our products bear 21% VAT on the sales price, provided that the customer sits in the European Union - hence a significant difference! Most second-hand dealers in the action sites don't charge VAT (and don't pay charge VAT to their tax administration!)
Sometimes a calculator has two users (typically a couple of brothers - not everyone can afford having two 150 € calculators in the same household for high school children), or there are times where you want to use some user settings, and in other case you want different settings. A question comes: how can settings can be stored or changed?
Settings are stored in different system variables, but not located in a single multi-variable set (list, matrix or string). The solution would imply putting all system variables in one of the above sets, and keep it there for further retrieval.
I have seen such program in hpmuseum.org, written by user Tyann. Here are the two programs required: one to store the current setting - the other to retrieve it later.
EXPORT STOF()
BEGIN
HVars(“Mode”):={HAngle,HFormat,HSeparator,HDigits,HComplex,Entry,Base,Bits,Signed};
END;
//HVars is a list of HOME user defined variables. Handle, Format, etc. are the system settings in Home
EXPORT RCLF()
BEGIN
LOCAL l;
l:=HVars(“Mode”);
Mangle:=l(1);HFormat:=l(2);
HSeparator:=l(3);HDigits:=l(4);
HComplex:=l(5);Entry:=l(6);
Base:=l(7);Bits:=l(8);Signed:=l(9);
END;
Today I would like to draw your attention to a small HP Prime site. Small but very well thought out. I could find elsewhere all that information, but it is very well organized.
The site is:
(There is a Russian version too, but 95% of our readers would feel better with the English one)
It has a very good command reference tool. In the DOCs area, apart from the manuals that you can find here, with their latest versions (by the way, I have updated the versions in our site too, to the 2015 versions), you can find all commands, both one by one or in a long list. It takes you to a very good command definition, where you can even post comments. This is the part I am now using most. Far better than perusing the long manuals!
There is also an area with customer apps. There are many games - I will have to put some in my children’s calls to get them interested. Some of them were from when we were young - very young. It will be also a good way to learn Prime programming.
There is also a software area, where the most recent firmware, communication tool and emulator are posted. For us Mac users, there is also a calculator for MacOs, based on Wine. I am now opening it and downloading the latest firmware upgrade. I’ll tell you how it works!
I loaded Eddie Shore’s Equation program in my HP Prime, tested it, and liked it a lot. There are a couple of things that could be improved, but it would require more work. But the program is very simple and good to go through and learn how easy is to achieve things in HP Prime with simple, easy to understand programs.
Let’s go through it together, and learn a couple of things meanwhile:
EXPORT eqnlib()
BEGIN
// March-April 2015 EWS
// Equation Library Similar to HP 48 series
// Variables A-Z & θ are global
// Initialization
LOCAL ch,d;
STARTAPP(“Solve”);
(Eddie didn’t use the #pragma instruction since it wasn’t available at the time he wrote the program. I have already had some problems with it due to that - but that’s an easy fix. Just remember to place it at the very beginning of the file.
Then he initializes some local variables, that will be used for the menu choices. After that, he starts the solve app - since you could be anywhere else.)
// Choose
// Main Menu
CHOOSE(ch,”Equation Library”,
{“Geometry”,”Finance”,”Temperature”,
“Physics-Motion”,
“Sound”,”Optics”,
“Electronics”,”Astronomy”,
“Great Circle”,
“Angle of Incidence”,
“Gases”,”Fluids”});
IF ch==0 THEN KILL; END;
This instruction creates a menu on the screen, gives it a title, lays down the choices, and stores the choice in the variable ch.
// 1 Geometry Loop
IF ch==1 THEN
CHOOSE(d,”Geometry”,{“Area: Circle”,
“Area: Ellipse”,
“Area: Trapezoid”,
“Volume: Sphere”,
“Volume: Cylinder”,
“Volume: Cone”,
“Surface Area: Sphere”,
“Surface Area: Cylinder”,
“Distance of 2 Points”,
“Regular Polygon: Σ Angles”,
“Area: Regular Polygon”});
IF d==0 THEN KILL; END;
Then, choice after choice on menu 1, he does the same thing, but with a level two menu: you choose the equations you will use. Again, the choice is stored in a variable: d in this case. if clicked out of the menu, or escaped, you get zero and you’re out of the program.
// 1.1 Area: Circle
IF d==1 THEN
“A=π*R^{2”▶E1};
PRINT();
PRINT(“A = Area”);
PRINT(“R = Radius”);
END;
Choice per choice, he stores the equation in the system variable E1 (which is the first equation in the solver). Then, prints on the screen the variables used. These will disappear when you click any key; and then you’re left with the solver. (Here is one of the improvements that could be done: we could print the formula after the variables used. I’ll do it on Monday night, when I have some time.
…
// 1.11 Area: Regular Polygon
IF d==11 THEN
“A=NS^{2}/4COT(180°/N)”▶E1;
PRINT();
PRINT(“A = Area”);
PRINT(“N = Number of Sides”);
PRINT(“S = Length of a Side”);
END;
// Close out Geometry Loop
END;
Let’s not forget this last end, to close the Geometry chapter loop!!
Finalizing, we have these two instructions, to display the solver using the formula we have set in E1:
// Display Solver
CHECK(1);
STARTVIEW(2,1);
END;
Check(1) selects the first formula in the current app, which is the solver. (Check(2) w ould have checked the second, and so on)
Startview(2,1):
STARTVIEW(ViewNumber[,Redraw])
Starts a view of the current app. Redraw, is optional; if Redraw, is true (non 0), it will force a refresh for the view.
The view numbers are as follows:
0=Symbolic
1=Plot
2=Numeric
3=Symbolic Setup
4=Plot Setup
5=Numeric Setup
6=App Info
7=Views key
Did you learn anything? I did.
If there is a problem with the HP Prime, it is the lack of software available for it for the different professional fields: finance, engineering, physics, etc. The calculator, while extremely powerful, and programmable in a much more user-friendly language than the elegant but complicated RPL, was intended for secondary education, with extension to university maths, due to its extensive CAS system. However, if you wanted to load a formula for any physics or engineering problem, you were out of luck - they had not been programmed before.
I have tried to put together some account sets in the solver app - but I am limited to 10 for each app I set for it; and the selection of functions, and its use, could be clearly improved.
I am now excited, since I have seen exactly what I was looking for. Eddie B. Shore has created an equation library with 47 different equations that can be loaded in the solver app, covering many categories:
I am now traveling, but I really look forward to get into my computer and load it in my Prime!
You can find the file with the program here:
To be honest with you, athough my HP41CL has the serial connector, I have never used it. I frear too much to block the calculator - and it is a quite expensive machine!
But I have read today in Monte Dalrymple's site that he is preparing a "Flashing the HP41CL for Dummies" document. That'll be ideal for those of us who are not microprocessor programmers like Monte, Diego and others! I look forward to be able to add more images to my system. The good thing is that you can know what's the latest module you have because you can test the modules based on the recording date in Monte's manual - the first missing will show "nonexistent" on your screen - and you need to load modules from that date on"
There is an undocumented function in HP Prime, very useful for us Central Europeans that insist on decimal comma instead of decimal point; and that had to move to decimal point if we wanted to be able to write programs that compile in all circumstances.
the line syntax is
Code:
This is telling the parser that, no matter what the calculator status is, you’re doing the programming with the following convention:
To insert the PRAGMA, while in program editor, press “Menu” key and “5 insert pragma”. It has to be put before the start of any program, or it will give a syntax error.
You can now test your programs with European and American conventions in the Home settings, and see what happens!
Some comments when buying calculators off eBay or other second hand sites. I have seen several times a seller with a lot experience and good rating selling calculators for parts. When I started in this business I bought from them a couple of times. In general:
A different thing is when you buy a non-working calculator from someone in eBay that doesn’t appear to be an expert. I am mostly focused on HP41cl, and I have had my fair share of mistakes, having aprox. 5 calculator bodies that cannot work or are in poor condition - not good enough for my customers. But the inexpert sellers may have a calculator that is easy to fix (when you talk about the HP41C). In any case, it is a fair bet, provided you don’t spend a lot on it, and the cosmetic appearance is good enough. Please remember to get a picture of the battery bay, to see the situation of its contacts!
A final comment: seen from Europe, buying from the US is so expensive when you factor in all the import costs, that it doesn’t make sense anymore. Either you use the standard post, and then it takes ages to come; or you use one of the main courier companies, and then it is extremely expensive. There are many european providers, with extremely cheap transport costs compared with the US.
There is a discussion on HPmuseum.org regarding accuracy on the HP Prime. There were some simple calculations that should give zero, but that give an infinitesimal value.
The learning for me is that now I understand why there is a Home and a CAS environment. In fact, from a point of view, you have two calculators in one.
CAS should be used for exact, symbolic calculations, and implements XCAS from Parisse as well as the HP team could implement. All calculations and real numbers are represented internally with binary numbers. Therefore, decimal numbers have no exact representation in binary - and this has an effect on the accuracy of many operations.
Home should be used for normal decimal calculations. The internal system represents number in BCD, binary coded decimal. What is BCD? If you’re a frequent visitor of hpmuseum.org, you already know; if not, bear with me for a while.
the BCD format (of which HP uses the “packed” version, where an 8-bit byte contains two decimal digits, each one occupying a 4-bit word, called sometimes “nibble”) was used in early computers, like the IBM System/360 and DEC’s VAX. The drawbacks of BCD are more complex routines and slightly lower compactness; the advantage is the perfect representation of decimal magnitudes, as opposed to pure binary, that cannot represent exactly some of them; also that there are very refined algorithms for both normal arithmetic and transcendent functions. Nowadays, with enough memory and processing power, there are not too many differences between both systems when you have enough significant digits in your routines.
Most HP calculators were made to work with BCD; only the 12C Platinum comes to my mind as binary, as well as the “external job” calculators like 9s and 30s machines. So it is curious that the HP Prime is both a BCD AND a binary calculator!!