QC 1.5 Quick Calculus Functions for the hp48 Written in 100% SysRPL by Peter Teichman teichman@nr.infi.net I first wrote this library to provide support for indefinite integrals, one feature which I found to be lacking internally in the hp48. In its current form, QC performs that as well as differentiation. The integration routine uses the internal routines of the HP, so anything it cannot handle will be rejected. Contents: 1. Disclaimer 2. Functions in the QC library 3. Programs distributed with QC 4. Usage of user-defined simplification routines 5. Explanation of tags 6. List mode --------- 1. Disclaimer First, the obligatory disclaimer: This library is written in SysRPL, so it may very well fry your memory - make a backup before using it. Also, I have used several unsupported entries, listed below: #5EC9 - So far as I can tell, the only decent way to break a tagged object down into an object and its tag. #1F201 - The UserRPL integration command, without argument checking. These addresses are for my revision R ROM. Because of these two entries, I cannot suggest using this library on any other ROM revision. If you have another revision and would like to use this library, please email me. I will try to pull together a copy that uses only supported entries. --------- 2. Functions in the library: --- XDIFF --- Differentiates the expression on level one of the stack, with respect to the variable 'X'. This program just places 'X' on the stack and calls DIFF. --- XINTEG --- Integrates the expression on level one with respect to 'X'. This program just places 'X' on the stack and calls INTEG. --- DIFF --- Differentiates the expression given on level 2 with respect to the variable on level 1. This runs whatever is in the global variable 'Simp' after performing the differentiation. --- INTEG --- Integrates the expression on level 2 with respect to the variable given on level 1. This command will integrate anything that the HP can do internally, since I am basically just calling those routines in ROM. Unfortunately, the HP is rather limited in what forms it can recognize. Any integral that it can't work with will return a "Integral not defined" error message. This runs whatever is in the global variable 'Simp' after performing the integration. --- FAST --- Written by Detlef Muellor, this useful little program turns off the display, evaluates the first level of the stack, and then restores the display. It is said that this reduces execution time of programs by ~11%. The four other commands in the QC library are run with FAST. --- ABOUT --- Displays a screen giving the version number of the library and my email address. --------- 3. Programs distributed with QC --- FSIMP --- This is a slightly modified version of Jack Levy's FSIM program. It simplifies the expression on level one of the stack in this manner: First, it runs EXPAN until it can expand no more. Then it runs COLCT until there is no change in the expression. FSIMP utilizes FAST to speed itself up. The modifications made are these: - The two separate SysRPL commands DUP and ROT were found twice in the original. I replaced both instances with the single command DUPROT. - The left and right annunciators are used to show where FSIMP is in the simplification process. The left annunciator is turned on during the EXPAN cycle, and the right during COLCT. - The internal command ->Qpi is run after the COLCT cycle. --- SDISP --- This program takes an expression on level 1 of the stack and displays it as if it was in the equation writer. This used to be included in the library itself, but I took it out because many people have no need for it. It is basically here for those who don't use an alternate stack that would give a nice display of the equation. --------- 4. Usage of user-defined simplification routines If it is found, a program called 'Simp' (case sensitive) will be run after any calculus function. This should be a program that runs all of your favorite simplification routines. At very least, I suggest that you run the FSIMP program here. --------- 5. Explanation of tags I have used tags to keep track of how many times a function has been integrated, in order to determine what subscript should be on the 'C' added after the indefinite integration. --------- 6. List mode If user flag 42 is set, QC will be in its list mode. This has been implemented so that you can easily import a chain of functions into an equation solver. If a list is present on the stack level above the expression on which a calculus function is operating, the calculus function is called and the result is appended onto the list, without tags. If no list is present, the equation will be placed into a new list, the calculus function called, and its answer appended after the original function. --------- I hope that you find this library useful. Comments, suggestions, or (gasp) bug reports should be sent to me at teichman@nr.infi.net Peter Teichman teichman@nr.infi.net ------- Changes: v1.4 - v1.5: - Rewrote DISPIT to keep it from corrupting the display. - The routines don't try to run Simp if it doesn't exist. - DISPIT doesn't strip its argument's tags. - Integration routines keep the tag constant if integration fails. - Serious internal rework & optimization. - Tags are built after Simp is run, as simplification programs frequently strip them. - Added an 'About' screen. - Added list support, for easy importing into equation solvers. - SIMP runs ->Qpi instead of ->Q - QCa is no longer around - its SIMP routine is distributed seperately as FSIMP. - DISPIT removed from the library, renamed SDISP, distributed seperately. v1.3 - v1.4: - Made DISPIT a visible command, and stopped automatic execution of it.. It is now run when user flag 43 is set. - Implemented addition of constants after integration. v1.0 - v1.3: - I learned SysRPL. - Two versions of the library distributed, one with built-in simplification, based on Jack Levy's FSIM, and one with support for a user-defined 'Simp' function. - Added equation writer-like view after simplification. - Removed PreSimp support.