Programming Question on HP15CE
|
06-20-2024, 06:10 PM
Post: #1
|
|||
|
|||
Programming Question on HP15CE
Hi,
So it's seriously been years since I used my 41CX and even then, I wasn't a programming guru. I recently picked up the 15CE and wanted to go thru the manual and learn the programming, etc.. The first example is to program a simple equation for time to fall from a certain height. The formula is: t = square root of 2H/g. When they make the program, it's straight forward and when they execute the program they just input the h and then execute the program and the correct answer is displayed. My question is, how did the program know that the value of H was inside the square root, for the life of me, I can't figure that out.. For those interested, the reference I'm reffering to can be found on pages 14 and 15 of the 15CE Collector Edition's user manual. Thanks! |
|||
06-20-2024, 11:44 PM
Post: #2
|
|||
|
|||
RE: Programming Question on HP15CE
I had to remember RPN when I got mine too!. I think its just the order of the keystrokes and the efficient and concise way that RPN works. h is entered, 2 is entered and multiplied by the previous value which was h, 9.8 is entered for g, and divided into the previous result which was 2h, then the square root of all that is taken.
The global supply of brackets was not reduced. And isn't that a beautifully written manual? |
|||
06-21-2024, 07:30 AM
Post: #3
|
|||
|
|||
RE: Programming Question on HP15CE
The answer is called "Reverse Polish Notation".
So execution step-by-step gives : http://ti58c.phweb.me http://clones.phweb.me http://www.instagram.com/ti58c "No! Do or Do not. There is no try!" [Master Yoda] |
|||
06-21-2024, 07:51 AM
Post: #4
|
|||
|
|||
RE: Programming Question on HP15CE
RPN allowing you to interpret order of operations yourself!
|
|||
06-21-2024, 08:56 AM
Post: #5
|
|||
|
|||
RE: Programming Question on HP15CE
You could use the Python to RPN - source code converter with the following program:
Code: def time(H): This is the converted program for the HP-42S: Code: 01 LBL "time" In this case we don't really need to use the register H as the value is already on the stack. And then no utility functions are used. Thus we can skip them too. The text-label "time" is not supported by the HP-15C and has to be replaced for instance by label A. So we end up with: Code: 01▸LBL A |
|||
06-21-2024, 12:04 PM
Post: #6
|
|||
|
|||
RE: Programming Question on HP15CE
(06-21-2024 08:56 AM)Thomas Klemm Wrote: Pierre's program This is not my program but, in response to tones688, the one he was referring. (on pages 14 and 15 of the 15CE Collector Edition's user manual) http://ti58c.phweb.me http://clones.phweb.me http://www.instagram.com/ti58c "No! Do or Do not. There is no try!" [Master Yoda] |
|||
06-21-2024, 12:46 PM
Post: #7
|
|||
|
|||
RE: Programming Question on HP15CE
Hello!
If in doubt, aks ChatGPT: „Please write a program for the hp-15c to calculate the time it takes for an object to fall a given height on earth“ The first result used a storage register for the input value, so I asked again: „Can you please rewrite that program without using a memory register“ Ang got almost the same listing as has been shown above several times already, albeit with one unnecessary ENTER: Code: 001 - f LBL A ; Label A The code comes with a very detailed explanation of the equations and detailed instructions on how to use it. Regards Max |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)