(11C) Tree Heights

11022018, 01:24 PM
(This post was last modified: 11022018 01:26 PM by Gamo.)
Post: #1




(11C) Tree Heights
This program was adapted from the HandHeldCalculator Programs
for the Field Forester. More detail information attached here. Procedure: 1. Enter slope distance to base of tree [A] >Display known distance 2. Enter Slope percent to tip, [R/S] > Display 0 (Slope to tip Stored) 3. Enter Slope percent to Base. I. If Positive [B] > display 0 // slope base entered II. If Negative [C] > display 0 // slope base entered 4. [D] > Tree Heights  Example: FIX 1 Slope Percent to tip = 40 Negative slope percent to base = 20 Distance to tree = 56 What is the Tree Heights? 56 [A] display 56 40 [R/S] display 0 20 [C] display 0 [D] 32.9 Tree Heights is 32.9  Slope Percent to tip = 40 Positive slope percent to base = 20 Distance to tree = 56 What is the Tree Heights? 56 [A] display 56 40 [R/S] display 0 20 [B] display 0 [D] 10.9 Tree Heights is 10.9 Program: Code:
Gamo 

11022018, 02:43 PM
Post: #2




RE: (11C) Tree Heights
An excellent read:
HandHeldCalculator Programs for the Field Forester Wayne D. Shepperd, Associate Silviculturist General Technical Report RM76 (July 1980) Rocky Mountain Forest and Range Experiment Station Forest Service U.S. Department of Agriculture Abstract A library of programs written for handheld, programmable calculators is described which eliminates many of the computations previously done by hand in the field. Programs for scaling aerial photos, variable plot cruising, basal area factor gauge calibration, and volume calculations are included. Contents Introduction............................ 1 Slope to Horizontal Distance....... 2 Basal Area Computation............ 3 Tree Heights.......................... 4 Adequacy of Sample Test.......... 5 Multispecies Board Foot Volumes 7 BAF Gauge Calibration.............. 9 Limiting Distance................... 10 Photo Work Program............... 12 Spruce Variable Plot Cruising.... 14 Literature Cited..................... 17 BEST! SlideRule 

11022018, 06:15 PM
(This post was last modified: 11022018 09:48 PM by Dieter.)
Post: #3




RE: (11C) Tree Heights
(11022018 01:24 PM)Gamo Wrote: This program was adapted from the HandHeldCalculator Programs Thank you very much. The attached program description seems to refer to a TI program: enter three values with four (!) label keys, finally press another key for the result. But this is HP, the 11C uses RPN, here all this can be done much shorter and more straightforward, even without using a single data register. A direct translationm on the other hand, duplicates the clumsy original procedure: (11022018 01:24 PM)Gamo Wrote: 1. Enter slope distance to base of tree [A] >Display known distance We can do better. ;) First of all, mathematically there is no need to distinguish positive or negative base angles and handle them separately. The same formula will work for both cases, as tan(–x) = –tan(x). Also there is no need to calculate sin(90°–B1) as this is equivalent to cos(B1). Converting the slope values to angles is done in a subroutine. But on the 11C this is merely four steps,*) so two calls require (2x GSB, LBL, 4 steps, RTN) eight lines altogether. This does not save any program steps, compared to having the same four steps twice in the program. So a subroutine has no advantage, and without it the program would even run slightly faster. I left it in there anyway so that the user may do the slopetoangle conversion with f[E], independently from the rest of the program. Here is my attempt at realizing all this in a compact 10/11/15C program, but it should run just as well on many other HPs. If your calculator does not feature LBL A or LBL E simply replaced them with numeric ones. Code: 01 LBL A Enter base distance [ENTER] tip slope percent [ENTER] base slope percent. Press f[A] to get the tree height. Additional feature: Enter slope percent, press f[E] and get the equivalent angle. Examples, using your above data: 56 [ENTER] 40 [ENTER] –20 f[A] => 32,95 56 [ENTER] 40 [ENTER] 20 f[A] => 10,98 What is the equivalent angle for a slope of 30% ? 30 f[E] => 16,70° Edit: here is a version for the HP25(C) which may also run on other calculators without labels and subroutines: Code: 01 ENTER Dieter __________ *) In your original program you could even do it with 3 steps: 1 % TANˉ¹ 

11022018, 07:03 PM
Post: #4




RE: (11C) Tree Heights  
11022018, 07:41 PM
Post: #5




RE: (11C) Tree Heights
(11022018 07:03 PM)SlideRule Wrote: Here's the program Ah, thank you very much. But I don't see much of a real program. It's more like a "program outline", as stated in the attachment, a kind of recipe for writing your own program. BTW the result for the second example, rounded to one decimal, should be 11,0 instead of 10,9. Dieter 

11032018, 01:35 AM
(This post was last modified: 11032018 01:38 AM by Gamo.)
Post: #6




RE: (11C) Tree Heights
Dieter thanks for the better program update.
This book only show the program guide line to adapted to any programmable calculator as state at the beginning of the book. Personally I program this Tree Height as simple to operate as possible so I put all input operation separately on each labels like so [A] For Known Distance and Slope Tip [B] For known Positive Slope Base [C] For Known Negative Slope Base [D] Compute Tree Height  SlideRule Thanks for the program guide line page. Remark: At second page of this book there are marked for the typo error On Page 5 Example on the first line: Should be: Positive Slope Percent to Tip=40  Gamo 

11032018, 12:47 PM
(This post was last modified: 11032018 02:13 PM by Dieter.)
Post: #7




RE: (11C) Tree Heights
(11032018 01:35 AM)Gamo Wrote: Dieter thanks for the better program update. See below. ;) (11032018 01:35 AM)Gamo Wrote: Personally I program this Tree Height as simple to operate as possible Does it get simpler than entering the three values on the stack? (11032018 01:35 AM)Gamo Wrote: so I put all input operation separately on each labels like so Again: there is no need for separate calculations for positive or negative slope values. Try it: simply enter –20 at [B]. You may also use two separate labels for the distance and the slope percent to the tip. Finally here is another version: In many cases it is a good idea not to follow a given path but to try a new approach instead. This is also the case here. The tree height can also be calculated this way: b = a·cos(B2) · tan(B1) – a·sin(B2) The point here is that the sine and cosine term can be simultaneously calculated by means of the P–>R command. And the tangent simply is the tip slope divided by 100. This leads to the following even shorter program: Code: 01 LBL A And here is a version that uses the label keys: Code: 01 LBL A f[USER] Enter base distance [A] Enter base slope percent [B] (may be positive or negative) Enter tip slope percent [C] Calculate tree height with [D] 56 [A] => 56,00 20 [B] => 20,00 40 [C] => 40,00 [D] => 10,98 20 [B] => 20,00 [D] => 32,95 Addendum: I was playing around a bit with a TI59 emulator, so here also is a version for the TI58/59. Code: 000 76 LBL Usage is the same as above. The final steps round the result to two decimals. Dieter 

11042018, 03:32 PM
Post: #8




RE: (11C) Tree Heights
We don't really need trigonometric functions here.
Good old Pythagoras is good enough: Code: 01 LBL A Examples: 56 ENTER 20 ENTER 40 A 10.9825 56 ENTER 20 ENTER 40 A 32.9475 Cheers Thomas 

11042018, 04:57 PM
(This post was last modified: 11042018 05:35 PM by Dieter.)
Post: #9




RE: (11C) Tree Heights
(11042018 03:32 PM)Thomas Klemm Wrote: We don't really need trigonometric functions here. Great! This way it can also be done on the 12C and other calculators without trigs or polar/rectangular conversion: Code: 01 X<>Y Since no →P is required this may even run slightly faster than Thomas' original version. If available, replace "ENTER x" with x². (11042018 03:32 PM)Thomas Klemm Wrote: Examples: Same for the above version. Press [R/S] instead of [A]. ;) I you, like me, prefer to enter base distance [ENTER] tip slope [ENTER] base slope, simply remove the first line. Gamo, if you want to implement this for the 11C using the label keys A...D, here is an adapted version: Code: 01 LBL A This thread shows once again how a new approach and a bit of better mathematical insight can substantially improve a given solution. So don't adapt programs or algorithms, rethink the problem and realize your own solution. Or "dare to think for yourself", as others have put it. Dieter 

11052018, 12:52 AM
Post: #10




RE: (11C) Tree Heights
Thanks Thomas Klemm and Dieter
Programs updates is more streamline now even work on HP12C Excellent Idea !! Gamo 

11222018, 05:27 PM
(This post was last modified: 11222018 05:35 PM by ijabbott.)
Post: #11




RE: (11C) Tree Heights
(11042018 04:57 PM)Dieter Wrote:(11042018 03:32 PM)Thomas Klemm Wrote: We don't really need trigonometric functions here. That's a neat solution! It's also worth mentioning that if you know the tangent, sine or cosine of an angle between 0 and 90 degrees, you can derive the others with standard arithmetic and the square root function. \( \tan(x) = \frac{\sqrt{1\cos^2(x)}}{\cos(x)} \), or: \( \tan(x) = \sqrt{\frac{1}{\cos^2(x)}  1} \) Code: ENTER \( \cos(x) = \frac{1}{\sqrt{1 + \tan^2(x)}} \) Code: ENTER \( \tan(x) = \frac{\sin(x)}{\sqrt{1  \sin^2(x)}} \) Code: ENTER \( \sin(x) = \frac{\tan(x)}{\sqrt{1 + \tan^2(x)}} \) Code: ENTER \( \sin(x) = \sqrt{1  \cos^2(x)} \), and: \( \cos(x) = \sqrt{1  \sin^2(x)} \) Code: ENTER Of course, "ENTER", "×" can be replaced by "x²" in all of the above, if available. — Ian Abbott 

« Next Oldest  Next Newest »

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