HP-15c Program IndexUpdated 29 December 2023ContentsUse the browser "back control" to return here.
IntroductionThe following programs and program compilations have been prepared using Torsten Manz's HP-15c Simulator and Smultron a programming editor for macOS. Bike1, BisecnewtP, Composite, Maths1, Maths2, Physics1 and ToolkitP are collections of smaller programs. In each case, calling the appropriate label will run the desired program. Themes include Maths, Cycling, Spectroscopy and Physics. Use the references in the documentation to find the original programs. Collections can be created using a simple text editor by cutting and pasting smaller programs into one file. The line numbering will be fixed once the Simulator saves the composite file. Documentation can be combined in a similar way, mostly by pasting lines beginning with #D: and adding new headings. Normally documentation is created with the Simulator editor and a final edit would be done there. There are of course more modern ways to solve all these problems, including spreadsheets such as Excel and Numbers. Graphing calculators are inexpensive and useful. Tools such as Mathematica, Maple, Matlab and programs in languages such as Python are popular. Entering a formula in a web browser toolbar will lead to sites which can solve equations online. My only defence is that these programs really do fit in my shirt pocket with ease, using my DM15 calculator from SwissMicros. In many cases I have included information about how the programs actually work. For my solvers I have included spreadsheets as part of the download. Bike1 - 4 Programs - J E PattersonBike1 - 4 Programs - DownloadBike1 - 4 Programs - Documentation
EbikeMax - Ebike maximum speed from motor rpm - J E Patterson
Bike Power - J E Patterson
Bike Development - J E Patterson
Bike Speed - J E Patterson
BisecnewtP - 3 Solvers - J E PattersonBisecnewtP - DownloadBisecnewtP - Documentation I have combined the BisectionP, SecantP and Newton-Raphson routines into one program. The three solvers in this program have their own particular strengths. With the additional choice of the built-in solver in the HP-15C Simulator solutions to most root finding problems can be found. This program is suitable for some calculators which don't include the HP Solver. GSB A runs a Bisection solver which acts on f(x) = 0 under label E. Two guesses for x are required. GSB B runs a Secant solver which acts on f(x) = 0 under label E. Two guesses for x are required. GSB C runs a Newton-Raphson solver which acts on f(x) = 0 under label E. One guess for x is required. Apple Numbers and Microsoft Excel versions of these solvers are included in the download. BisecnewtP2 - 4 Solvers - J E PattersonBisecnewtP2 - DownloadBisecnewtP2 - Documentation I have combined the BisectionP, SecantP and Newton-Raphson routines into one program. SOLVE is also included. The four solvers in this program have their own particular strengths. With the additional choice of the built-in solver in the HP-15C Simulator, solutions to most root finding problems can be found. Initial guesses can also be recovered using RCL 1 and RCL 2. GSB A runs a Bisection solver which acts on f(x) = 0 under label E. Two guesses for x are required. GSB B runs a Secant solver which acts on f(x) = 0 under label E. Two guesses for x are required. GSB C runs a Newton-Raphson solver which acts on f(x) = 0 under label E. One guess for x is required. GSB D runs the internal SOLVE program which acts on f(x) = 0 under label E. Two guesses for x are required. Apple Numbers and Microsoft Excel versions of the three programmed solvers are included in the download. BisecnewtP3 - 4 Solvers with single entry of guesses - J E PattersonBisecnewtP3 - DownloadBisecnewtP3 - Documentation I have combined the BisectionP, SecantP and Newton-Raphson routines into one program. The built-in SOLVE is also included. The four solvers in this program have their own particular strengths. With the additional choice of the built-in solver in the HP-15C Simulator, solutions to most root finding problems can be found. This program offers an alternative way of using solvers to find the roots of equations. GSB A Two entered guesses for x are recovered from the stack and stored in memory. Initial guesses can also be recovered using RCL 1 and RCL 2. GSB B runs a Bisection solver which acts on f(x) = 0 under label 0. Two guesses for x are recovered from memory. GSB C runs a Secant solver which acts on f(x) = 0 under label 0. Two guesses for x are recovered from memory. GSB D runs a Newton-Raphson solver which acts on f(x) = 0 under label 0. One guess for x is recovered from memory. The initial guess can be recovered using RCL 1. GSB E runs the internal SOLVE program which acts on f(x) = 0 under label 9. Two guesses for x are recovered from memory. Apple Numbers and Microsoft Excel versions of the three programmed solvers are included in the download. BisectionP Solver - J E PattersonBisectionP - DownloadBisectionP - Documentation GSB A runs a bisection solver which acts on f(x) = 0 under label E. This program is suitable for some calculators which don't include the HP Solver. Apple Numbers and Microsoft Excel versions of Bisection, Secant and Newton-Raphson solvers are included in the download. Composite - 12 programs - J E PattersonComposite - 12 programs - DownloadComposite - 12 programs - Documentation
CurveP - J E Patterson
TVM - Accurate TVM - Jeff Kearns
HgCalP - J E Patterson
RGCalP - J E Patterson
Parallel Resistances - J E Patterson
Quadratic Equation Solver program for the HP-15c - from Torsten Manz
Convert to Fraction - Guido Socher
Solve a System of Linear Equations - J E Patterson
EbikeMax - Ebike maximum speed from motor rpm - J E Patterson
Bike Power - J E Patterson
Bike Development - J E Patterson
Function tests - J E Patterson
CurveP - J E PattersonCurveP - Curve Fitting -DownloadCurveP - Curve Fitting - Documentation The program fits data that may be linear at low x,y amplitudes but y falls off at higher x values. This is a common issue in many physical systems. x1, y1 should preferably be on the linear part of the curve. CurveP is not a regression. It assumes that the data is reasonably precise. Linear and power fit data sets also work well. DiophantineP - Sum of 3 Cubes - J E PattersonDiophantineP - Pseudo Diophantine equation - sum of 3 cubes zip-file - DownloadDiophantineP - Pseudo Diophantine equation - sum of 3 cubes - Documentation IntroductionPublished 3 cubes solutions can be derived from just a few least significant digits of, what can sometimes be extremely large, numbers. This 37 step program calculates the sum of cubes for 3 such numbers using just the 3 least significant digits in each term. Numbers are truncated to three digits using FRAC. Negative numbers are complimented by having 1000 added to them to make a new positive number. This term is adjusted so the number of zeros = the number of significant digits, 3 in this case. Each 3 digit number is cubed and then they are summed. Finally the result is again truncated to 3 digits, using FRAC, leaving just the published 3 cubes sum. This little discovery is probably obvious to mathematicians, but I found it interesting. It was also interesting to not truncate the final sum. Using two digits from the example below the result is 50742. Using three digits the result was 387848042. Using four digits the result was 668216100042. At this point the significant digit range of the HP-15c is exceeded so this was calculated using Thomas Okken's Free42 simulator. Another option is to use Wolfram Alpha. For example 751458175153 + (100000000000 - 38812075974)3 + 232973356313 = 666070721166961397611075000000042. The number of zeros seen increases to just 15 when all the significant digits are in place, producing 529784370469658641488703464414602800000000000000042. Removing the now fully expanded 100000000000000000 leaves a result of 42. Taking simple cubes produced sums ending in 058 for two digits, 9958 for three, 0042 for four and 99958 for five digits. Example
Enter the last 3 digits (or more) of each number including the sign.
The 3 numbers are now in x, y and z on the stack. The sum of cubes is displayed. This program produces the same results as a full summation of cubes for sums less than 1000.
804357581458175153−805387388120759743+126021232973356313 = 42
Free42 ProgramI have also included a Free42 program which calculates the 3 cubes problem in full with a few exceptions, where FRAC helps to extract the solution. This seems to work in most cases. The cut and paste capability of Free42 helps with entering large numbers. Torsten Manz's HP-15c Simulator also has this capability. It has been claimed that Free42 and the SwissMicros DM42 could not do the 3 cubes sum for 42. Of course, with the correct programming they can. This is really a demonstration that such numbers can be processed, albeit in the wrong direction. The Free42 program splits each long integer x and calculates x3 = (a + b)3 = a3 + 3(a2b + b2a) + b3. The 3 equations are summed from the largest terms to the smallest. Calculating this way means the sum of cubes for 42 will just fit if the last negative b terms are also complimented into a positive number by adding 1E9, and 1E9 is subtracted for each first a term. Diophantine.rtf now has documentation and details about the labels and registers used. The program listing or dioph.raw can be dropped onto the FREE42 program window. The program is installed after existing programs. Diop.rtf and Diop.raw duplicates the HP-15c program above for the HP-42s, Free42 and the DM15c. I last did number splitting in 1968 on a Sanyo printing calculator with 32 programming steps and a few registers. I was able to program a linear regression in that space. Numbers were separated by several zeros which acted as guard digits. Some business calculators of that time had many display digits to attract abacus or Soroban users. My Soroban has 23 digits. Enter the three integers onto the stack complete with signs. Stack registers z, y and x now hold integers which, in the case of the 42 result, are 17 digits long. XEQ DIAPH will show 42 as the sum of the three cubed integers. LinksThe links below are representative of many on this subject. The first is a research paper by Andrew Booker for the number 33. The second is a general article about the solution for 42 which has better researched content than most.
Cracking the problem with 33
HP-15c Program Examples - 14 Programs - Download HP-15c Program Examples - Documentation
Polygon inscribed in circle - J E Patterson
CurveP - J E Patterson
Dumarey equation. Mercury vapour standard concentration ng/ml - J E Patterson
Ebike maximum speed from motor rpm - J E Patterson
Fibonacci Number - J E Patterson
Function tests - J E Patterson
Mercury vapour standard concentration ng/ml - J E Patterson
Little Gauss formula for the HP-15c - J E Patterson
Parallel Resistances - J E Patterson
RainGaugeCalP - J E Patterson
HP-15c random number simulator - J E Patterson
Random7 Repeat RAN# n times - J E Patterson
StrayLightP - Stray light curve correction - J E Patterson
Test many functions - J E Patterson
HP-15c Owner's Handbook - 14 Programs - Download HP-15c Owner's Handbook - Documentation
Calculate time an object takes to fall to the ground
Mother's Kitchen, a canning company
Predict the diminishing radioactivity of a radioisotope
Slope of a secant line
Solve a system of linear equations
Solve a system of linear equations
Solving a system of linear equations
Cabbages and broccoli
Complex Matrix Transformations
Electric circuit analysis
Matrix function tests
Solve Example program for the HP-15c
Throwing a ridget
Open-top box form problem
HP-15c Advanced Functions Handbook - 7 Programs - Download HP-15c Advanced Functions Handbook - Documentation
Arctic explorer Jean-Claude Coulerre in anticipation of the sun's reappearance
Design of a vertical broadcasting tower
Discounted cash flow analysis
Special functions for any argument x
Using Complex Mode
Calculating the nth Roots of a Complex Number
Solving an Equation for Its Complex Roots
HP-15c Matrix test routines - 2 Programs - Download HP-15c Matrix test routines - Documentation
Matrix Example test 0 - Function test - J E Patterson
Matrix Example test 0b - Function test - J E Patterson
HP-15c Owner's Handbook Matrix examples - 9 Programs - Download HP-15c Owner's Handbook Matrix examples - Documentation
Solving a system of linear equations
Complex matrix in Zc form converted to Zp partitioned form
Electric circuit calculation
Make an identity matrix
Matrix Example test 5, Function test
Matrix Example test 5b, Function test
Cabbages and broccoli
Simple matrix divide test
Matrix division
InductancePInductanceP - DownloadInductanceP - Documentation This program calculates the inductance L (μH) of a coil using a 50 ohm output signal generator and an oscilloscope. See A Simple Method to Measure Unknown Inductors by Ronald Dekker. This version accounts for inductor resistance using a modified equation by Karen Orton. The signal generator output amplitude is first measured at about 20,000 kHz using an oscilloscope. The unknown inductor is then connected across the signal generator output and the frequency f (kHz) is adjusted until the oscilloscope shows a reading of half the original amplitude. On a digital oscilloscope I prefer to take rms readings as they are more stable than peak to peak readings.
The equation is quite simple: L =1000*√(21.11 + 0.84R - 0.025R2)/f.
R (ohms) ENTER Maths1 - 8 ProgramsMaths1 - 8 Programs - DownloadMaths1 - 8 Programs - Documentation
CurveP - J E Patterson
Prime Factorisation - Eddie Shore
Little Gauss formula for the HP-15c - J E Patterson
TVM - Accurate TVM - Jeff Kearns
Quadratic Equation Solver program for the HP-15c - from Torsten Manz
Convert to Fraction - Guido Socher
Solve a System of Linear Equations - J E Patterson
Nth-degree Polynomial Fitting - Valentín Albillo
Maths2 - 12 ProgramsMaths2 - 12 Programs - DownloadMaths2 - 12 Programs - Documentation
Gaussian Integration - Valentín Albillo
Decimal to Fraction - Joseph Horn
Base Conversion - Thomas Klemm
Prime Factorisation - Eddie Shore
Numerical Derivative - Eddie Shore
Modulo - Gamo
Big Factorial program for the HP-15c - Torsten Manz
2D Coordinate Rotation - Eddie Shore
Stair Calculation - Eddie Shore
Triangle Solution provided 2 sides and 1 angle - Gamo
RNEAR - Round to nearest 1/n - Eddie Shore, Dieter. Modified for HP-15c - J E Patterson.
Hyperfocal Distance - Gamo, Dieter.
Mercury vapour standard concentration ng/ml - J E PattersonHgCalP - Calibrate Mercury Analyser - DownloadHgCalP - Calibrate Mercury Analyser - Documentation The concentration of mercury vapour in air, above liquid mercury, depends on the temperature. A good calibration can be obtained using a simplified Dumarey equation. Reference: R. Dumarey, E. Temmerman, R. Dams, J. Hoste, Analyst. Chim. Acta 170, 337 (1985). NewtonP - Newton-Raphson Solver - J E PattersonNewtonP - Newton-Raphson Solver - DownloadNewtonP - Newton-Raphson Solver - Documentation GSB A runs a Newton-Raphson solver which acts on f(x) = 0 under label E. A single guess is required. This program is suitable for some calculators which don't include the HP Solver. Apple Numbers and Microsoft Excel versions of Bisection, Secant and Newton-Raphson solvers are included in the download. Physics1 - 8 Programs - Dr. D G SimpsonPhysics1 - 8 Programs - DownloadPhysics1 - 8 Programs - Documentation
1. Projectile Problem - Dr. D G Simpson
2. Kepler’s Equation - Dr. D G Simpson
3. Hyperbolic Kepler’s Equation - Dr. D G Simpson
4. Barker’s Equation - Dr. D G Simpson
5. Reduction of an Angle - Dr. D G Simpson
6. Helmert’s Equation - Dr. D G Simpson
7. Pendulum Period - Dr. D G Simpson
8. 1D Perfectly Elastic Collisions - Dr. D G Simpson
ReactanceP - Reactance calculations, inductor turns - J E PattersonReactanceP - Reactance calculations zip-file - DownloadReactanceP - Reactance calculations, including inductor turns - Documentation This program calculates solutions to common reactance problems and also allows an inductor to be specified. Solver is not needed to do reactance calculations. The equations can be solved directly. The advantage with using Solver is that programs can be shorter. The equations which follow are all used in this program. An unknown variable C, L or f can be calculated by entering it as zero.
The factor 5040 in front of the standard Wheeler formula corrects for henrys instead of microhenrys (1000) and mm instead of inches (5.04). This factor was wrongly set at 1000 in the initial version of this program. RladderP - Resistance ladder calculation - J E PattersonRladderP - DownloadRladderP - Documentation GSB A calculates the resistance of a ladder-like array of resistances arranged so that R1 is distributed along one rail, R2 occupies the rungs and the remaining rail is conductive. Arrays like these are found in analog to digital converters. In linear A/D converters R2 has twice the resistance of R1. In the general case the following formula applies: R = R1 x (1 + √(1 + 4 x R2 / R1)) / 2 This equation arises from the solution of a quadratic equation noting that the first cell is in parallel with the total resistance of the remaining cells. R = R1 + (R2 x R)/(R2 + R) since the remaining resistance after the first cell is also R for an infinite array. SecantP - Solver - J E PattersonSecantP - DownloadSecantP - Documentation GSB A runs a secant solver which acts on f(x) = 0 under label E. This program is suitable for some calculators which don't include the HP Solver. Apple Numbers and Microsoft Excel versions of Bisection, Secant and Newton-Raphson solvers are included in the download. Stat5P - linear, logarithmic, power and exponential curve fitting - J E PattersonStat5P - Statistical curve fitting - DownloadStat5P - Curve fitting with linear, logarithmic, power and exponential equations - Documentation This program provides linear, logarithmic, power and exponential regressions with a single entry of a data set. I have replaced R/S statements at lines 142,145,154 and 157 with PSE statements. This makes the program easier to use. I have also revised the documentation.
StrayLightP - Stray light curve correction - J E PattersonStrayLightP - Curve Fitting - DownloadStrayLightP - Stray light curve correction - Documentation Spectrophotometers have some stray light or detector dark current which causes the calibration to be non linear at high absorbances. This program corrects for the calibration curvature caused by the presence of stray light. ToolkitP - TVM, Equation solving and Curve fitting - J E PattersonToolkitP - DownloadToolkitP - Documentation This Toolkit is intended to help a little with the use of laboratory equipment and processing the data produced. If income is earned the Toolkit can help with that too. There are 5 programs:
|
JEP Links
JEP Related Links ProgramsThe following material is intended for use with computers rather than phones or tablets. The HP-15c Simulator at this stage only runs on a computer running Windows, Linux or macOS. Clicking on any of the following links will cause a ZIP file to be downloaded. The extracted folder contains HP-15c program files, as well as documentation. Use the HP-15c Simulator to open the program file, which can also be transferred to a SwissMicros DM15 calculator. Bike1 - 4 ProgramsBisecnewtP - Solver for HP programmable calculators BisectionP - Solver for HP programmable calculators Composite - 12 programs CurveP - Curve Fitting DiophantineP - Pseudo Diophantine equation - sum of 3 cubes HP-15c Program Examples - 14 Programs HP-15c Owner's Handbook - 14 Programs HP-15c Advanced Functions Handbook - 7 Programs HP-15c Matrix test routines - 2 Programs HP-15c Owner's Handbook Matrix examples - 9 Programs Maths1 - 8 Programs Maths2 - 12 Programs HgCalP - Calibrate Mercury Analyser NewtonP - Newton Raphson Solver Physics1 - 8 Programs ReactanceP.15c - Reactance calculations, including inductor turns SecantP - Solver for HP programmable calculators Stat5P.15c - linear, logarithmic, power and exponential curve fitting StraylightP - Stray light curve correction ToolkitP - TVM, equation solving and curve fitting |