From: jhmeyers@miu.edu (John H Meyers)
Newsgroups: comp.sys.hp48
Subject: Function Table Generator (like TI, HP38G)
Date: 27 Mar 1998 15:20:29 GMT
Organization: MIU Computer Services,  Fairfield, IA 52557.  Not Approved.
Lines: 127
Message-ID: <6fgg3t$ear$2@news.iastate.edu>
References: <uB6$pvQV9GA.48@upnetnews02.moswest.msn.net>,<6fe7cg$upv$1@news.iastate.edu>
Reply-To: jhmeyers@miu.edu
NNTP-Posting-Host: vax1.mum.edu
Xref: republic.btigate.com comp.sys.hp48:8602

It is frequently asked how to create and view a table of function values
(as certain TI brand calculators may provide along with function graphs),
although the very idea of scrolling through a table is what a graphing
calculator was more or less meant to supersede (or to provide in another
fashion, using its "trace" mode on the graph).  However, students (or is
it just teachers?) seem to want both, and with a split screen, no less,
so TI (and HP38G) go along and provide this, although the HP48 offers
only the "trace" mode, and neither a table nor a split screen.

Interestingly, the language used in the HP38G advertising uses phrases
like "Here's your no-fear way to experiment and explore math concepts,"
"The equation solver will get you cyber-answers at the touch of a
button," and "15 zoom features make your calc come alive like a
digital microscope" (which reminds me of the anachronistic "Anacin is
like a Doctor's prescription"), while the HP48G box is adorned with
a different set of phrases, such as "The Professional Advantage"
and "Powerful enough for your education and your career,"
which highlights its different positioning in the market.

Why do we almost never hear a whisper about the HP38G?
Should this newsgroup have been named comp.sys.hpcalc,
so as to be as all-encompassing as the TI newsgroup
(and what will we do when the HP-?? is announced?)

Did the HP38G get no market share at all, or is it
a bad case of "What's in a [newsgroup] name?"

At any rate, returning to the matter at hand, Jack Levy's "MathTools"
library (7K bytes for version 7.0) includes a very nice table-generating
interface, allowing you to scroll all the way to infinity (generating
new values as it goes), and to jump to any new argument or to change
the increment at any time.  Of course, you still can't see the table
along with the graph, and neither can you do so with the program below,
which is about 120 bytes worth of simple program to generate tables
which you can view with the Matrix Writer.  If you are a bit low on
memory, this may tide you over until you get tired of looking at tables
anyway, and can appreciate how little value this added feature may be,
except for cyber-marketing, considering that the "trace" mode
already does this sort of thing.

Wouldn't it be logical, however, for that "next calc" to incorporate
all those new features which have come along meanwhile, including
both the TI and HP38G features?  Will it be "one calc fits all,"
or still one for school, and another for career?  Or, how about
a whole slew of models, one for every income bracket and lifestyle,
or adding one new feature every six months, perhaps?  If we don't
start trading in those old models for new ones at a faster rate,
Detroit may soon have to step in and take over HP :)

So, without further ado, here's that table generator:


%%HP: T(3); @ Simple table [matrix] generator for function results:

@ Args:  Function(s)  'Var'  Start  End  Increment   [similar to SEQ]
@ (Use a function list if there is more than one function)
@ Note:  Include the function 'Var' to display the variable itself; e.g.
@ { 'SIN(X)' X 'COS(X)' } 'X' 0 90 10  (args suitable for DEG angle mode)

@ Result is a matrix whose column(s) contain the specified function(s),
@ with a row for each argument value between 'start' and 'end'
@ (at intervals specified by 'increment')

@ All dependence of each function upon the named variable must be explicit
@ (e.g. you can't use 'EQ' where 'EQ' depends in turn upon 'X').
@ A program may be used as a function, e.g. \<< X SIN \>>; the program
@ must be in User-RPL (but it may in turn invoke any other programs).
@ The limitations in this paragraph are imposed by the SEQ command.

@ All results are rounded, per the current number display mode;
@ therefore, you should set the desired mode (number of digits)
@ in advance, e.g. 4 FIX (as used in the "MathTools" table generator).
@ Note that no rounding occurs if you leave the HP48 in STD mode.

@ The advantage of rounding is that you can view three matrix columns
@ in STD mode afterwards, without losing visible digits, if values are
@ pre-rounded to 4 FIX mode, whereas otherwise only two untruncated
@ columns will fit at one time.  Likewise, four columns may be viewed
@ if pre-rounded to 3 FIX (if values are unsigned and less than 1).

@ If you were wondering whether there was a program hidden somewhere
@ between all these comments, here it is:

\<< 5 ROLL { } + DUP SIZE 6 ROLLD
  1 \<< { \->NUM 12 RND } OBJ\-> DROP \>> DOSUBS 5 ROLLD SEQ
  OBJ\-> DUP 2 + ROLL SWAP OVER / SWAP 2 \->LIST \->ARRY \>>

@ After the array is generated, you can display it in the Matrix Writer
@ using the VIEW key, or STD #42D46h SYSEVAL (ViewLevel1), or in the
@ Command line using the EDIT key, or #42D32h SYSEVAL (EditLevel1).

@ These particular SYSEVAL addresses are "supported" (all HP48 versions)
@ and are always safe to use at any time (but verify correct addresses!)

@ Adjust Matrix Writer column width to suit, using <-WID or WID->

@ This program can be used with HP48S/SX if you obtain posted versions
@ of G/GX commands SEQ and DOSUBS (or DOLIST) which work in the HP48S/SX.

@ Program ends (snip here).


What would have happened if Fermat or Gauss had had better calculators?
Or 200 cable channels?  If ancient Greeks, Romans, Stonehenge builders
and Masons had had more precise Materials Science and Engineering,
would anything they built still stand?

"There are more things in Heaven and Earth, Horatio
 Than are dreamt of in your philosophy"  [Hamlet I,5]

"I do not know what I may appear to the world, but to myself
 I seem to have been only like a boy playing on the seashore, and
 diverting myself in now and then finding a smoother pebble or a
 prettier shell than ordinary, whilst the great ocean of truth
 lay all undiscovered before me"    - Isaac Newton

"A human being is part of a whole, called by us the Universe, a part
 limited in time and space.  He experiences himself, his thoughts and
 feelings, as something separated from the rest -- a kind of optical
 delusion of his consciousness.  This delusion is a kind of prison for
 us, restricting us to our personal desires and to affection for a few
 persons nearest us.  Our task must be to free ourselves from this prison
 by widening our circles of compassion to embrace all living creatures
 and the whole of nature in its beauty"         - Albert Einstein

-----------------------------------------------------------
With best wishes from:   John H Meyers   <jhmeyers@mum.edu>