home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sources / hp48 / 233 < prev    next >
Encoding:
Text File  |  1992-07-28  |  6.2 KB  |  223 lines

  1. Newsgroups: comp.sources.hp48
  2. Path: sparky!uunet!seq!spell
  3. From: Mike Morgan <m00012@KANGA.STCLOUD.MSUS.EDU>
  4. Subject:  v06i012:  tbls_mm - Create a table of function values v1.2, Part01/01
  5. Message-ID: <1992Jul29.011844.22826@seq.uncwil.edu>
  6. Followup-To: comp.sys.hp48
  7. Sender: spell@seq.uncwil.edu (Chris Spell)
  8. Organization: Univ. of North Carolina @ Wilmington
  9. Date: Wed, 29 Jul 1992 01:18:44 GMT
  10. Approved: spell@seq.uncwil.edu
  11. Lines: 214
  12.  
  13. Checksum: 2556376129 (verify with brik -cv)
  14. Submitted-by: Mike Morgan <m00012@KANGA.STCLOUD.MSUS.EDU>
  15. Posting-number: Volume 6, Issue 12
  16. Archive-name: tbls_mm/part01
  17.  
  18.  
  19. BEGIN_DOC tbls.doc
  20. ************************
  21. **                    **
  22. **     TBLS V. 1.2    **
  23. **                    **
  24. **  By:  Mike Morgan  **
  25. **                    **
  26. ************************
  27.  
  28. This program creates a table of function values.
  29.  
  30. UFTABLE is the user friendly version.  It prompts the user for the required
  31. parameters, which are placed on the stack, and calls TABLE
  32.  
  33. TABLE is the program that makes the table.  It may be used alone, or it may
  34. be called, as UFTABLE does, by other programs.  It takes from the stack as
  35. input, for example:
  36.  
  37. 4:           '2*X^2'
  38. 3:               1
  39. 2:               3
  40. 1:               6
  41.  
  42. And returns, using the previous example:
  43.  
  44. 1:   [[ 3 18 ]
  45.       [ 4 32 ]
  46.       [ 5 50 ]
  47.       [ 6 72 ]]
  48.  
  49. Generally, it takes from the stack:
  50.  
  51. 4:     function of (upper-case) X
  52. 3:     partition
  53. 2:     start value
  54. 1:     end value
  55.  
  56. And returns to the stack:
  57.  
  58. 1:  [[ Xi f(Xi) ]...
  59.   ...[ Xn f(Xn) ]...
  60.   ...[ Xf f(Xf) ]]
  61.  
  62. The returned matrix can then be viewed in the matrix writer by pushing the
  63. down arrow.
  64.  
  65. NOTE:  If an irrational partition and/or irrational end value are/is used,
  66.        the last value desired may not be included in the table.  (I wanted
  67.        to keep this program as small as possible.)  You may easily
  68.        compensate for this by using an end value which is slightly greater
  69.        than that which is actually deisired when using an irrational
  70.        partition.
  71.  
  72. NOTE:  TABLE can be run without UFTABLE.
  73.  
  74. Anyway, I have found this program EXTREMELY helpful for labs in my physics
  75. and introductory circuit analysis courses.
  76.  
  77. If the directory is stored as TBLS, you'll get:
  78.  
  79. checksum:  # 13440d
  80.    bytes:       545
  81.  
  82. Mike Morgan, Student at St. Cloud State University
  83.  
  84. M00012@KANGA.STCLOUD.MSUS.EDU
  85. mmorgan@solar.stcloud.msus.edu
  86.  
  87. 428 7th Ave. S.
  88. St. Cloud, MN 56301
  89. (612) 654-6010
  90.  
  91. P.S.  Feel free to change the program (the INPUT prompts, for instance--
  92.       or delete ABOUT to conserve memory) as you desire.  As soon as I
  93.       learn system RPL, I will rewrite TABLE to see if I can make it even
  94.       quicker than it already is.  (It is reasonably quick.)
  95.  
  96. END_DOC
  97.  
  98.  
  99.  
  100. BEGIN_RPL tbls.rpl
  101. %%HP: T(3)A(D)F(.);
  102. DIR
  103.  
  104. UFTABLE@User friendly table, i.e., prompts user for input.
  105. \<<
  106.         "  Function (of X)"
  107.         { { 1 2 } ALG "''" V } INPUT
  108.         OBJ\->
  109.         "  \GDX"
  110.         { "" V } INPUT
  111.         OBJ\->
  112.         "  X min"
  113.         { "" V } INPUT
  114.         OBJ\->
  115.         "  X max"
  116.         { "" V } INPUT
  117.         OBJ\->
  118.         TABLE
  119. \>>
  120.  
  121.  
  122. @&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  123. @
  124. @    Program:  TABLE
  125. @ Programmer:  Mike Morgan
  126. @       Date:  May 29, 1992
  127. @
  128. @ takes from stack:
  129. @ 4: function of X
  130. @ 3: increment
  131. @ 2: Xi
  132. @ 1: Xf
  133. @
  134. @ Places on stack
  135. @ 1: [ [ Xi f(Xi)]...
  136. @   ...[ Xn f(Xn)]...
  137. @   ...[ Xf f(Xf)] ]
  138. @
  139. @&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  140. TABLE
  141. \<<
  142.         0
  143.         \-> p n x c
  144.         \<<
  145.                 'F(X)'
  146.                 SWAP
  147.                 =
  148.                 DEFINE
  149.                 n x
  150.                 FOR n
  151.                         n n
  152.                         F
  153.                         1
  154.                         'c' STO+
  155.                 p STEP
  156.                 c
  157.                 2
  158.                 2
  159.                 \->LIST
  160.                 \->ARRY
  161.       \>>
  162.       'F' PURGE
  163. \>>
  164.  
  165. About @Only final user may delete the following to save on memory.
  166. \<<
  167.         CLLCD
  168.         "       Tables" 1 DISP
  169.         "      Version 1.2" 2 DISP
  170.         "(Creates a table of" 3 DISP
  171.         "function values)" 4 DISP
  172.         "Another program by..." 6 DISP
  173.         "Mike Morgan, SCSU" 7 DISP
  174.         7 FREEZE
  175. \>>
  176. END
  177. END_RPL
  178.  
  179.  
  180. BEGIN_ASC tbls.asc
  181. %%HP: T(3)A(D)F(.);
  182. "69A20FF7FB20000000501426F6574750D9D20E1632858A1C2A20F10000202020
  183. 2020202451626C656379C2A2485A1C2A20720000202020202026556273796F6E
  184. 60213E223ED2A2485A1C2A20B20008234275616475637021602471626C65602F
  185. 6663F2A2485A1C2A20520006657E6364796F6E6026716C657563792803A2485A
  186. 1C2A20F200014E6F647865627020727F6762716D6022697E2E2E2233A2485A1C
  187. 2A2072000D496B65602D4F6277616E6C20235343555743A2485A1743A24A5A19
  188. 3632B21307710050451424C45450D9D20E16324B2A21C432D6E201007D6E2010
  189. E6D6E201087D6E201036E16328BA2084E2010858BA2084E201064B21309FF300
  190. 46F1B2130DBBF18D8A156D02D6E2010E6D6E2010870A132D6E2010E6D6E2010E
  191. 6D6E2010E684E2010649C2A245632D6E20103697632B4402D6E20100708332D6
  192. E201036ED2A2ED2A2387C1900D1EF5324563284E20106497632EFE0293632B21
  193. 3043100705564451424C45470D9D20E1632C2A207200002026457E6364796F6E
  194. 60282F66602859247A2047A209C2A2ED2A2B213084E203014C474C2A20900007
  195. 27284E201065B2130AC422B7FC1C2A20D00000202B98547A20C2A205000084E2
  196. 01065B2130AC422B7FC1C2A203100002028502D696E647A20C2A205000084E20
  197. 1065B2130AC422B7FC1C2A203100002028502D6168747A20C2A205000084E201
  198. 065B2130AC422B7FC184E2050451424C45493632B21300843"
  199. END_ASC
  200.  
  201. BYTES: 3480h 534.5
  202.  
  203. BEGIN_UU tbls.uue
  204. begin 644 tbls
  205. M2%!(4#0X+466*O!_OP(````%06)O=70%G2W@82-8J,&B`A\```("`@("`D(5
  206. M)L96-I<L*H2EP:(")P```@("`@)B528WE_;F!A+C(N,M*H2EP:("*P"`,B17
  207. M%D97-@<2!D(7)L96!O)F-B\JA*7!H@(E`&!6YS9&E_;F!F(7QE97-I>","J$
  208. MI<&B`B\`$.3V1H=6)@<")_=V)A?6!B*6Y^+B(C,JA*7!H@(G`-"4ME8&TO0F
  209. M=Q;FQ@(R-315=30JA*5Q-"JDI9%C(RLQ<!<`!51!0DQ%!9TMX&$CM*(23"-M
  210. M+A``U^8"`6YM+A"`U^8"`6,>-H*K`D@N$("%JP)(+A!@M!(#^3\`9!\K,="[
  211. M']BH4=8@;2X0X-;F`@%XH#'2Y@(!;FTN$.#6Y@(!;D@N$&"4+"I4-M+F`@%C
  212. M>3:R1"!M+A``!S@C;2X0,.8M*MZB,G@<"=#A7R-4-H+D`@%&>3;B[R`Y-K(2
  213. M`S0!<%!E1!4DQ%1TT-D"'C;"H@(G```"8E3G-D:7]N8&@O)F!H*50J<"="J0
  214. M+"K>HK(2`T@N,!#$=,2B`@D`<'*"Y`(!5BLQH$PB>\_!H@(-```"LHE%IP(L
  215. M*E```$@N$&"U$@/*)++W'"PJ,`$`("!8(&UI;G0JP*("!0"`Y`(!5BLQH$PB
  216. M>\_!H@(3```"@@72%H9'IP(L*E```$@N$&"U$@/*)++W'$@N4$`5),14E&,C
  217. #*S$`
  218. `
  219. end
  220. sum -r/size 16555/771 section (from "begin" to "end")
  221. sum -r/size 37019/543 entire input file
  222. END_UU
  223.