From: bd628@torfree.net (Bill Markwick)
Subject: Symbolic to Numeric Matrices
Date: 18 Jan 1999 00:00:00 GMT
Message-ID: <F5qGMH.6Jt.0.sheppard@torfree.net>
Organization: Toronto Free-Net
Newsgroups: comp.sys.hp48

Once I downloaded AIO48 from the archive (http://hp48.ml.org), I could
finally make symbolic matrices. Since there's no pleasing some people, I
couldn't wait to turn them back into numeric again.  <-- joke

Seriously, I was using symbolic matrices to work out some simple
resistive circuits, and I wanted to have a copy of the matrix in numeric
form for specific reals so I could tinker with it. I wrote EVALM to do
that. If you examine the programming, the word "elegant" doesn't come to
mind, although "brute force" does.  <-- not a joke
  Still, it's tiny and it works.

First, store the desired test values as global variables. Put the
symbolic matrix, which must be 2 x 2 or 3 x3, on the stack and run
EVALM. The symbolic variables will be replaced with the stored values.
Use UNDO to change the matrix back to symbolic again (or dupe it first
to save a copy on the stack).

Example: let's say the 2 x 2 matrix has two unknowns, R and r. Store 2
into R and 3 into r. Put the matrix on the stack and press EVALM.

  2R/r  -r              1.333...  -3
               --->
  -1/R   1               -.5       1

The above is with STD display using EQSTK; run ->Q or QPI (also in the
archive) if you want rational numbers. That's it; hope somebody can use
it or improve it.

%%HP: T(3)A(R)F(.);
\<<
  \<< EVAL
  \>> DOLIST
  \<< EVAL
  \>> DOLIST OBJ\->
  IF 4 ==
  THEN 2 \->LIST 3
ROLLD 2 \->LIST SWAP
2 \->LIST
  ELSE 3 \->LIST 7
ROLLD 3 \->LIST 5
ROLLD 3 \->LIST 3
ROLLD 3 \->LIST
  END
\>>


Regards,

Bill

-- 
- Bill Markwick,  Toronto, Ontario, Canada  -  bd628@torfree.net
