Post Reply 
Favorite HP-41 programs and techniques
01-28-2021, 11:37 PM (This post was last modified: 01-28-2021 11:38 PM by Valentin Albillo.)
Post: #6
RE: Favorite HP-41 programs and techniques
(01-28-2021 03:55 PM)smartin Wrote:  To brush up on my skills, I'd like to look at good programming examples. What are your favorite well-crafted FOCAL programs?


Congratulations on your rekindled interest in the HP-41, if you're after non-trivial programs for it you might be interested in some of the ones I wrote for it, namely these 11:

pdf HP Program VA411 - HP-41C Finding Roots of Equations
  • 4-page paper featuring a 42-step RPN program for the HP-41C to find real roots of an arbitrary user-supplied equation f(x)=0 using Newton’s method and a user-given initial guess. Interactive and non-interactive versions provided. Five worked examples included.

pdf HP Program VA412 - HP-41C Finding Extrema of Functions
  • 3-page paper featuring a 28-step RPN program for the HP-41C to find extrema (maxima and/or minima) of an arbitrary user-supplied function y=f(x) by calling program RF (Root Finder) internally as part of the computation. Two worked examples are included.

pdf HP Program VA413 - HP-41C 3-point Gaussian Integration
  • 3-page paper featuring a 55-step RPN program for the HP-41C to evaluate the definite integral between given limits of an arbitrary user-supplied function f(x) using the fast 3-point Gauss-Legendre quadrature formula applied over a number of subintervals. Three worked examples included.

pdf HP Program VA414 - HP-41C Dice Rolling with Graphics
  • 3-page paper featuring a 90/62-step RPN program for the HP-41C programmable calculator series to simulate randomly throwing two dice, which are printed graphically followed by their sum.

    It includes a subroutine which can be globally called from other programs or from the keyboard to accumulate in the printer buffer the graphics for any single die face. Both Standard and Synthetic Programming versions are included.
pdf HP Program VA415 - HP-41C Systems of 1st-order Differential Equations
  • 7-page paper featuring a 137-step program for the HP-41C programmable calculator to obtain quickly and accurately an approximate numerical solution for a system of N simultaneous first-order differential equations or, conversely, a single differential equation of the Nth-order, using a fourth-order Runge-Kutta method. It will also run in the HP-41CV, HP-41CX and the HP42S. Two worked examples included.

pdf HP Program VA416 - HP-41C Mate w King Bishop Knight Practice
  • 7-page, 13-diagram paper featuring a 285-step program for the HP-41C programmable calculator (will also run as-is in the HP-41CV or the HP-41CX and with trivial changes in the HP42S as well as in compatible devices or emulators). The program is intended to help the user practice in order to achieve the difficult basic checkmate of King, Bishop and Knight (controlled by the user) vs. King alone (controlled by the program) within a specified number of moves. The user must try and checkmate before the allotted moves elapse while the program does its best to avoid being checkmated.

Two worked examples included, one of them against the world-class chess engine Stockfish 9 (released in 2018 and rated at more than 3,300 ELO), the other against a human user.

pdf HP Program VA417 - HP-41C Systems of Linear Equations - Gauss-Seidel
  • 4-page paper featuring a 129-step RPN program for the HP-41C programmable calculator (will also run as-is in the HP-41CV/CX and in the HP42S with trivial changes) to obtain a numerical solution for a system of N algebraic linear equations in N unknowns using the iterative method of Gauss-Seidel, a relaxation/overrelaxation method.

A system of up to 15 equations can be solved if using all 4 memory modules (HP-41C) and the input matrix is left unchanged by the procedure so it can be reused for further processing. Also, full details are given to modify it to use synthetic instructions to save registers, if desired. Two worked examples included.

pdf HP Program VA418 - HP-41C Memory Game and Trainer
  • 3-page paper featuring a 142-step fun game RPN program for the HP-41C to challenge your memory by testing your ability to remember what you’ve just seen and offering afterwards an accurate comment on your performance.

pdf HP Program VA419 - HP-41C ESP Tester
  • 2-page paper featuring an 85-step fun RPN program for the HP-41C to test your “ESP” (Extra-Sensorial Powers) by conducting a series of 10 tests, after which it reports the % of success and an evaluation of your alleged extrasensorial abilities (if any). One sample run included.

pdf HP Program VA420 - HP-41C Eigenvalues of Symmetric Matrices - Jacobi
  • 5-page paper featuring a 215-step RPN program for the HP-41C programmable calculator (will also run as-is in the HP-41CV/CX and in the HP42S with trivial changes) to find all eigenvalues of a real symmetric NxN matrix using the iterative method of Jacobi, which is fast and always converges.

    Matrices up to 22x22 can be treated and full details are given about the algorithm and on how to modify the program to use synthetic instructions to save registers, if desired. One worked example and two test cases with solutions included.

pdf HP Program VA421 - HP-41C NxN Matrix Inversion
  • 4-page paper featuring a 170-step RPN program I wrote in 1980 for the HP-41C programmable calculator (will also run as-is in the HP-41CV/CX) to compute the inverse of a real NxN matrix (no Advantage module back then), where N ranges from 1 up to 16, using a non-gaussian interchange method.

V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Favorite HP-41 programs and techniques - Valentin Albillo - 01-28-2021 11:37 PM



User(s) browsing this thread: 2 Guest(s)