Re: Even More Simultaneous Equation Solutions Message #13 Posted by Rodger Rosenbaum on 28 Mar 2006, 12:49 a.m., in response to message #1 by Palmer O. Hanson, Jr.
Quote:
Rodger: You are correct about the typo. My apologies.
I sort of remember that I encountered other instances (but rarely and not only with RREF solutions) where the product of the solution vector and the input matrix yield exactly the input vector. I will try to find them.
The RREF solutions on my TI-83+ and TI-95 do some strange things. I'll include a couple of examples with my next submission.
Apology? No apology needed! It's next to impossible to type in a bunch of numbers like that without a typo or two. I wish I had a way to cut and paste.
By the way, Palmer, would you type VERSION into your HP49 emulator and see what version of the firmware it's emulating?
Here some little programs to play with. Assuming you have a directory on your HP49(G+) with Valentin's original A and B matrices in variables of those names, type in:
SRREF (Expects B and A on the stack; solves via RREF; leaves solution vector on the stack like B/A does)
<< SWAP { 7 } RDM 8 COL+ RREF 8 COL- SWAP DROP { 7 1 ) RDM >>
IREF (Does iterative refinement; needs stack to have B A X on levels 3, 2 and 1; keeps B and A on stack above the solution vector so the IREF function can be executecd repeatedly; X is the solution vector which was obtained by any method, such as B/A or SRREF)
<< 3 DUPN RSD 3 PICK / + >>
TST0 (calculates the residual of a solution; expects B A X on the stack; the calculated residual can be dropped and B A X will still be on the stack for further testing; deliberately DOESN'T use the RSD function; if the test solution is exact, the residual will be all zeroes)
<< DUP 3 PICK SWAP * 4 PICK - >>
So, having all this in your directory, type B A B A then press SRREF. The solution vector will be on level 1. Now press TST0 and see [0 0 0 0 0 0 0], indicating the solution was exact (with 12-digit floating point arithmetic, that is). Now DROP the residual off the bottom of the stack and press IREF to get a new solution vector; press TST0 again and see that this solution is also exact (the residual is [0 0 0 0 0 0 0]); DROP the residual after you examine it. If you press IREF a few more times, you'll eventually get the solution [1 1 1 1 1 1 1].
Start over with B A B A on the stack and then press SSREF. Press TST0 and note that the solution is exact; DROP the residual. Now enter a number close to 1; say between .9 and 1.1 such as .98456; press * to multiply every element of the solution vector by that number. Press TST0 to see that the solution is NOT exact; DROP that result off the stack and press IREF to do iterative refinement once. Now TST0 and see that the new solution vector is exact (in 12-digit arithmetic, of course); DROP the residual. Occasionally this doesn't work and the solution vector isn't quite exact; if this happens, IREF again and it will almost always be exact this time. Always remember to DROP the residual from TST0 before you do any more IREFs. Multiply the solution vector again by some number between .9 and 1.1 and then IREF. You will almost always get an exact solution vector, different from any previous one. This is one way to show that there are a LOT of solution vectors that are "exact" in 12-digit floating point arithmetic.
|