Re: HP35s Calculator Max Rope Tension Program Message #4 Posted by Jeff O. on 9 Dec 2013, 10:29 a.m., in response to message #1 by Jean-Marc Biram (Australia)
Hello,
Nice program. I don't think I will ever need to calculate rope tension for rigging, but I appreciate the use of the 35s. Since you state that you are a relatively new user to RPN, I'll risk pointing out a few improvements that might be made. Please don't take my suggestions as criticism, just trying to be helpful. With that said, your program could be shortened as follows:
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
x
may be replaced with
RCLx B
With the above changes, your program is shortened to 35 steps:
Line Instruction Comments
P001 LBL P
P002 INPUT L Enter load L
P003 INPUT F Enter friction coeficient e.g 0.02
P004 INPUT N Enter the number of line parts
P005 INPUT D This is the number of deflected sheaves
P006 1
P007 RCL+ F
P008 RCL N
P009 1
P010 -
P011 yx
P012 STO A
P013 1
P014 RCL+ F
P015 RCL D
P016 yx
P017 STO B
P018 0
P019 RCL N
P020 1
P021 -
P022 RCL F
P023 1
P024 +
P025 x<>y
P026 yx
P027 +
P028 DSE N
P029 GTO P019
P030 STO T
P031 RCL A
P032 RCLx B
P033 RCL÷ T
P034 RCLx L
P035 STOP
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.
|