![]() |
HP35s Calculator Max Rope Tension Program - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: HP35s Calculator Max Rope Tension Program (/thread-258040.html) |
HP35s Calculator Max Rope Tension Program - Jean-Marc Biram (Australia) - 12-08-2013 Hi, This is my first post on the forum. I would like to introduce myself as an engineer that is still using a calculator instead of an iPhone application at work. In 2007 I bought the HP35s as a replacement for another calculator and wrote a few programs to simplify several tasks. As a programming beginner I found the key stroke style much easier to use and get results. I stumbled on this site by accident searching for HP35s programming examples online. I also obtained the matrix program from stefan's website which helped a lot. As my thanks to all the volunteers I am posting this simple program to calculate rope tension. Useful for riggers on the field who owns an HP35s calculator. Schematic of problem :: HP35s Calculator Max Rope Tension Program
Keystrokes Display Description XEQ P ENTER Run: program P pulley/sheavesLine Instruction Comments P001 LBL PCompiled by Jean-Marc Biram, Copyright © 2007 Free Software Foundation Distributed under the version 3, GNU general public license
I tried to get the formatting as best I could Re: HP35s Calculator Max Rope Tension Program - Les Koller - 12-08-2013 Nice work, and welcome to the forum!
Re: HP35s Calculator Max Rope Tension Program - Jeff O. - 12-09-2013 Hello, The ENTER commands in lines 7, 11, 16, 18, 24, 26, 31, 40, and 42 are unnecessary due to automatic stack lift. The RCL instructions in lines 8, 19, 43, 45, and 47 which are each followed by an arithmetic operation could be replaced with the corresponding combined instruction, e.g.,
RCL B may be replaced with RCLx B
With the above changes, your program is shortened to 35 steps: Line Instruction Comments I believe my suggestions are valid, as I get the correct answer for your sample calculation. FYI, unfortunately the LN and CK figures on the 35s do not have any useful meaning as different users will get different values on different machines. For example, your original program produces LN =153, CK=2B98 on my 35s. My revised version gives LN=111, CK=7DC5. (See the complete HP 35s "bug list".)
My apologies if you were well aware of the above suggested improvements and simply prefer your code to be structured as in your original.
Re: HP35s Calculator Max Rope Tension Program - Willy R. Kunz - 12-09-2013 Thank you for sharing the program. Re: HP35s Calculator Max Rope Tension Program - Thomas Klemm - 12-09-2013 When I understand your program correctly the following is calculated: A = (1 + F)^(N - 1)
But for the geometric series we can use a closed form: T = ((1 + F)^N - 1)/(1 + F - 1) = ((1 + F)^N - 1)/F
Thus we end up with: P = (1 + F)^(N + D - 1)*L*F/((1 + F)^N - 1)
This can be reduced by (1 + F)^N: P = (1 + F)^(D - 1)*L*F/(1 - (1 + F)^-N)
Now you could enter that formula in algebraic mode. P001 LBL P
Kind regards Edited: 9 Dec 2013, 12:52 p.m.
Re: HP35s Calculator Max Rope Tension Program - Thomas Klemm - 12-09-2013 The loop could still be improved a little: Quote:
P019 1
Cheers Re: HP35s Calculator Max Rope Tension Program - Gerson W. Barbosa - 12-09-2013 Very nice, Thomas, your finding of a closed-form solution! And thank you, Jean-Marc, for presenting an interesting program (even though not from my field of expertise). Don't worry about size, most import thing is to get the job done (my first RPN programs had a lot of needless ENTERs as well). I won't be surprise if someone shovels a step or two (you'll be surprised by the size-optimization some people here are capable of). Some fellow engineers might also like this: http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv021.cgi?read=213222 Welcome to the club, Jean-Marc, and Best regards, Gerson.
Re: HP35s Calculator Max Rope Tension Program - Jean-Marc Biram (Australia) - 12-12-2013 Yes you understood the equation and improved it.
Re: HP35s Calculator Max Rope Tension Program - Jean-Marc Biram (Australia) - 12-12-2013 There is a link to a sketch for the problem on the first post its under:-
Quote:
It shows in blue on my browser. Edited: 12 Dec 2013, 12:10 a.m.
Re: HP35s Calculator Max Rope Tension Program - Jean-Marc Biram (Australia) - 12-12-2013 Thanks
Re: HP35s Calculator Max Rope Tension Program - Jean-Marc Biram (Australia) - 12-12-2013 I am always learning and improving and I don't mind listening to constructive suggestions.
|