![]() |
Matrix functions on the WP 34s Build 1685: in a word "incredible" - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: Matrix functions on the WP 34s Build 1685: in a word "incredible" (/thread-199736.html) |
Matrix functions on the WP 34s Build 1685: in a word "incredible" - Gene Wright - 10-05-2011 I have been encouraging the smart people on the 34S to give us great matrix functionality in the machine. It's here. A couple of years ago, Valentin gave us some simple-looking matrices of two digit integers whose determinants equaled 1. The inverses of the matrices were also composed of integers and the determinant of the inverses were exactly equal to 1. AM3 was the most difficult matrix that Valentin generated and you can read about it here: Valentin's AM1, AM2 and AM3 thread I have just run the matrix determinant on AM3. It comes out to exactly 1 with no Tiny Element flag, no "Hey the matrix has integers so the determinant must be an integer" adjustments. It is simply 1 to the entire precision of the result displayed. Then, I computed the inverse of AM3 and the determinant of the resulting inverse. The result? 1 to the entire precision of the result. Incredible. Valentin needs to come back and get himself a WP-34S!
Edited: 5 Oct 2011, 12:33 p.m.
Re: Matrix functions on the WP 34s Build 1685: in a word "incredible" - Steve Simpkin - 10-05-2011 Quote:Oh, Way to go Gene! Excluding all of the not-so-smart people like me from testing that Matrix stuff. Next you will be telling us that the WP 34s is so easy to use, even a caveman could do it. Hmmmph. :) Re: Matrix functions on the WP 34s Build 1685: in a word "incredible" - Gene Wright - 10-05-2011 Lol. Now Steve... anyone can download the current revision and test to your heart's content!
Beta software can be troubling, however, as yesterday afternoon, a version of these commands locked my machine where I had to remove the batteries. Caveat FREE emptor.
Re: Matrix functions on the WP 34s Build 1685: in a word "incredible" - Richard J. Nelson - 10-05-2011 This is great progress. i will have to check on other matrix challenges that I may have in my library. X < > Y,
Richard
Re: Matrix functions on the WP 34s Build 1685: in a word "incredible" - Palmer O. Hanson, Jr. - 10-05-2011 Quote:Page 24 of Kahan's paper "Mathematics Written in Sand" proposed a difficult problem. namely the inversion of a modified 8x8 Hilbert matrix where the elements are defined by A(i,j) = 360360/(i + j - 1). The inverse correct to 12 significant figures is 1.77600177600E-4 -5.59440559441E-3 5.59440559441E-2 -0.256410256410 0.615384615385 .....where only the elements of the first, second and third columns and parts of the fourth and fifth columns are shown. The exact values for the elements of the first column are 8/45045, -4/715, 8/143, 10/39, 8/13, 8/10, 8/15 and -1/7.
The following table presents the results for only the first column of the inverse (I get tired typing in all the numbers) as found by Stefan's program on the HP-35s, the HP-28s, the HP-28s with one iteration of refinement and the TI-85. True HP-35S HP-28S HP-28S+ TI-85where the most striking thing is the major improvement with the iterative refinement on the HP-28.
Edited: 5 Oct 2011, 10:16 p.m.
Re: Matrix functions on the WP 34s Build 1685: in a word "incredible" - Crawl - 10-05-2011 Of course, if you did expansion in minors (iteratively), you should get the exact result as well ... right? Because then it's just multiplication and addition of integers, no division.
This would probably not be true for finding the determinant of the inverse, though, because in that case, the entries are so big that multiplying them out would lead to truncation error.
Re: Matrix functions on the WP 34s Build 1685: in a word "incredible" - Paul Dale - 10-05-2011 Expansion by minors is O(n!) time. The algorithm I've used is O(n3) time. For a 10x10 matrix this is likely to be significant. For small matrices there is no real difference. For the 7x7 examples here, I've no real feeling what the speed differential would be. Expansion by minors is also going to be at a great risk of bad cancellation if the intermediate results get truncated.
Re: Matrix functions on the WP 34s Build 1685: in a word "incredible" - Eddie W. Shore - 10-06-2011 Nice! Congratulations to the WP 34S Team!
Re: Matrix functions on the WP 34s Build 1685: in a word "incredible" - Paul Dale - 10-06-2011 The 34S seems to be getting 16 digit accuracy for this example assuming I've done things properly:
001 LBL A
Re: Matrix functions on the WP 34s Build 1685: in a word "incredible" - Crawl - 10-06-2011 For what it's worth, if you replace the 1,1 entry in matrix 1 (58) with 58+x, the determinant is 1+96360245x For matrix 2, it would be 1+193969587x and for matrix 3, 1+294228951x giving some hint as to why these three matrices are "ill conditioned".
Re: Matrix functions on the WP 34s Build 1685: in a word "incredible" - Rodger Rosenbaum - 10-09-2011 Valentin gave a matrix with an even higher condition number in this thread: He didn't call it AM7 in that thread, but in this document: http://membres.multimania.fr/albillo/calc/pdf/DatafileVA014.pdf
he identifies it as AM7.
Valentin's AM7 determinant on the WP 34S - Gene Wright - 10-09-2011 is 1.0000... to the limits of precision of the machine. The determinant of the inverse of this AM7 matrix is also 1.000... to the limits of the precision of the machine. Amazing!
P.S. the timing is as near to instantaneous as I can imagine for the determinant and the display barely has time to flash "Wait..." or such before the inverse is computed. The determinant of the inverse is instantaneous. Edited: 9 Oct 2011, 5:32 p.m.
Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-09-2011 Quote: I'll likely take out that wait display. I thought these would be slower than they are.
Re: Valentin's AM7 determinant on the WP 34S - Gene Wright - 10-09-2011 Maybe change it to say: "Don't blink" :-)
Good, take that thing out and it will look as fast as it is.
Re: Valentin's AM7 determinant on the WP 34S - fhub - 10-09-2011 Quote:But does this still hold for a 10x10 matrix? Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-09-2011 A second or less for a 10x10. You do see the wait message long enough to read it.
- Pauli
Re: Valentin's AM7 determinant on the WP 34S - Valentin Albillo - 10-09-2011 Quote:
Who knows ... try this one and see how it fares: Albillo Matrix #10 (AM#10): The HP-71B gives DET(AM#10) as 59.9605462429 instead of 1 so it's losing all significant digits and then some. You can quickly check whether you've inputted it correctly by computing its Frobenius norm, which should give:
FNORM(AM#10) -> 466.407547109
Best regards from V.
Re: Valentin's AM7 determinant on the WP 34S - Walter B - 10-09-2011 Buenas tardes, Valentin! Long time no see - welcome back :-)
Walter
Re: Valentin's AM7 determinant on the WP 34S - Dan W - 10-09-2011 Since a lot of us use Excel these days, I took several of these ill conditioned matrices and tried them in Excel (version 2007, on a Windows 7 PC). The determinants are: AM1 0.99999986183 AM2 0.99999977967 AM3 1.00000101670 AM10 1.00096388386
Edited: 9 Oct 2011, 7:10 p.m.
Re: Valentin's AM7 determinant on the WP 34S - Marcus von Cube, Germany - 10-09-2011
Quote:Try on a 10x10 in SLOW mode and consider again, please. Re: Valentin's AM7 determinant on the WP 34S - Valentin Albillo - 10-09-2011 Quote: Thanks, Walter. Regrettably, I can't visit the forum as frequently as in times past, just too busy ... :D
Best regards from V.
Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-09-2011 Welcome back. The determinant returned is 1.000000000000000. The internal working result is 0.999999999999999999998617199680615581171. So fifteen or so digits are lost during the computation.
Re: Valentin's AM7 determinant on the WP 34S - Peter Murphy (Livermore) - 10-09-2011 Valentín, Unless you have been following the Forum closely, you may not know how much AM #1 has contributed to improvement in the WP-34S matrix-handling capability: a lot. Testing that capability with AM #10 should be interesting to observe at least, and it may lead to further improvement. Many thanks for those matrices, which continue to have beneficial effects even in your unfortunate absence from this Forum.
Peter Murphy Re: Valentin's AM7 determinant on the WP 34S - Gene Wright - 10-09-2011 Valentin! Good to see you again.
Email me through the forum if you can or use an old email if you have one from the past. Thanks!
Slow mode? - Gene Wright - 10-09-2011 I didn't know it had AOS...
Again, simply incredible... - Gene Wright - 10-09-2011 The jaw just drops...
Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-09-2011 11 or 12 ticks for a 10x10 matrix inversion in SLOW mode. 7 ticks in FAST mode.
Edited: 9 Oct 2011, 10:33 p.m.
Re: Slow mode? - Marcus von Cube, Germany - 10-10-2011 It does not have Another Operating System but Another Operating Speed. :-)
SLOW reduces the speed but also the power draw on the poor button cells.
Re: Valentin's AM7 determinant on the WP 34S - Marcus von Cube, Germany - 10-10-2011 As log as the watchdog doesn't kick in you can leave out the message. If you see "Reset" but it back.
Re: Valentin's AM7 determinant on the WP 34S - Werner - 10-10-2011 The condition number of AM10 is about 3e14, so you can expect to lose at least 14 digits, that's about right then.
Werner
Re: Valentin's AM7 determinant on the WP 34S - Bunuel66 - 10-10-2011 Well, the mystery is still there, det(AM10) on HP39gs gives...1 exactly. Even doing the trick (det(AM10)-1)*10000 gives 0!
Regards
Re: Valentin's AM7 determinant on the WP 34S - Valentin Albillo - 10-14-2011 Quote: I suggest people with a WP 34S (and other calcs as well) should try (in non-exact mode) these two nifty 10x10 matrices I've concocted for the occasion #AM 11:
65 66 -58 74 -3 -46 28 29 11 6
-19 33 56 -6 -23 44 25 49 57 20 Despite the very small (2-digit or less) integer elements I expect non-exact calc algorithms to lose 20-23 significant digits while computing the determinant. The norms and sum of elements are included to check correct input.
Best regards from V.
Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-14-2011 Valentin, your guess as to the accuracy loss is spot on...
Matrix Returned result Internal result On more lost digit and the 34S will get the answer wrong. No that isn't a challenge, I'm sure it is possible.
Re: Valentin's AM7 determinant on the WP 34S - Gene Wright - 10-14-2011 Of course, at one point you were computing internally with more than 39 digits... but at a VERY large expense of memory, which would *not* be worth it at all. The real point (to me) is that the 34S matrix commands seem to be more accurate by far than anything we've ever had that was calculator-portable and *ought* to handle most anything that gets thrown at them.
Great job, and someone get Valentin a 34S !!
Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-14-2011 Currently, I'm doing the LU decomposition using temporaries of 34 digits and the multiply/accumulate calculations to 39. We're just fitting into the volatile RAM at the moment which is perfect.
Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-14-2011 Only two calculations are done to more than the internal 39 digits, they aren't used by the matrix code.
Re: Valentin's AM7 determinant on the WP 34S - Dan W - 10-15-2011 Here are the results in Excel 2007 for comparison. AM12 is really tough! AM1 0.99999986183 AM2 0.99999977967 AM3 1.00000101670 AM10 1.00096388386
AM12 4.49647974387
Re: Valentin's AM7 determinant on the WP 34S - Marcus von Cube, Germany - 10-15-2011 WP 34S does an LU decomposition to 34 digits with pivoting and then computes the determinant from the diagonal. This seems to be quite stable.
Pauli, correct me, if have misread your code.
Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-15-2011 This is correct. I'm using Dolittle's algorithm like the 15C. This is stable but not the fastest.
Re: Valentin's AM7 determinant on the WP 34S - Valentin Albillo - 10-16-2011 Quote: Indeed it is. Enter AM#13, another one of my 10x10 matrices entirely consisting in very small (2-3 digit) integer elements:
AM #13: 34 33 195 -18 213 238 -66 13 24 -56 Despite its simplicity I expect non-exact calc algorithms to lose 25-28 digits while computing its determinant. This will surely make the final 16-digit 34S result inexact in its last 4 or 5 digits. Less capable calcs or computing software (say Excel) will probably lose all their digits, as seen in the result given above for the HP-71B Math ROM's DET function.
Re: Valentin's AM7 determinant on the WP 34S - Walter B - 10-16-2011 Buenas tardes Valentin, please forgive me if my following question is mathematically trivial. But are there any smaller matrices of similar "nastyness" like AM#13? E.g. an 8x8 matrix? I'd estimate the probability for somebody keying in a 10x10 matrix into a pocket calculator being <0.01 even in an high math environment like this forum, and <1e-5 elsewhere.
TIA for your response, Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-16-2011 Yep, that does it. The returned value is 0.9999999999908109 instead of 1.
Re: Valentin's AM7 determinant on the WP 34S - Marcus von Cube, Germany - 10-17-2011 Still slightly better then the 71B. ;) There are 11 nines in the result so rounded to 10 digits it will still return a 1.
Walter, Pauli has committed a .wp34s source file that inputs the matrix. No need to type it in. :-)
Re: Valentin's AM7 determinant on the WP 34S - Werner - 10-17-2011 condition nr of AM13 is (about) 4e23, so you get 11 digits correct with 34-digit arithmetic.
Cheers, Werner
Re: Valentin's AM7 determinant on the WP 34S - Werner - 10-17-2011 There's no need to go even that far.
Take a 2x2 matrix [[ a a-1 ]its determinant is 1. Now, for decimal machines, take a=2^39 = 549'755'813'888, and compute the determinant. 12-digit machines return 0. Free42 with its 25 decimal digits of precision returns 0.956630091747The condition number of this 2x2 matrix is 1e24, even greater than Valentins 10x10 - of course, not with the same small elements. The 34S carries 16 digits normally, so try a=2^50. The condition number is (2*a+1)^2 or about 5e30, you'll get maybe 4 digits correct in the determinant.
Cheers, Werner Edited: 17 Oct 2011, 7:05 a.m. after one or more responses were posted
Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-17-2011 Try calculating this via:
5 :-) The matrix determinant code isn't as good.
Re: Valentin's AM7 determinant on the WP 34S - Werner - 10-17-2011 On the 42S I had to create the equivalent 3x3 matrix [[ a a-1 0 ]to bypass what you just demonstrated, because it uses the straightforward formula a*b-c*d to calculate 2x2 determinants. Here (as in the 34S) the matrix code must resort to ato calculate the determinant, and the first division introduces the small roundoff error. There's nothing to be done about that, that's my point. Cheers, Werner
Edited: 17 Oct 2011, 3:43 a.m.
How about a M-COND command? - Gene Wright - 10-17-2011 that returns the condition number of a matrix?
Re: How about a M-COND command? - Werner - 10-17-2011 a short and easy way would be what I use on a 42S: TRANbut of course, that implies inverting the matrix.. Another option would be to estimate it the way they do in LAPACK (SGECON), but that would be quite a lengthy routine, and as I've come to understand, life is short and flash is full - to paraphrase Bill Wickes.
Cheers, Werner
Re: How about a M-COND command? - fhub - 10-17-2011 Quote:That leads me to the following question: HOW do you compute this condition number of a matrix??? Since I didn't know its exact definition I searched a bit and found that cond(A)=norm(A)*norm(A^-1).
Well, now I have a problem with this definition: if A is ill-conditioned then computing A^-1 will give a quite inaccurate result, so also norm(A^-1) and thus cond(A) will be inaccurate. So again my question: what's the usual way to compute this cond(A)?
Franz
Re: How about a M-COND command? - Werner - 10-17-2011 The condition number does not have to be calculated to any great accuracy to be useful. If it is in the order of magnitude of 10^a, then we can expect to lose 'a' digits when calculating the determinant or solving a system of equations. If a is near the number of digits carried by your calculator, the matrix is said to be singular to working precision.
Cheers, Werner
Re: How about a M-COND command? - Marcus von Cube, Germany - 10-17-2011 Then it would be more appropriate to compute the log10 of the condition number as an integer.
Re: How about a M-COND command? - fhub - 10-17-2011 Quote:Well, that doesn't change the principle problem at all! :-( If you have to calculate A^-1 to get cond(A), then this A^-1 could already be SO wrong for a VERY-ill-conditioned matrix (just see some DET results in this thread!), that the computed cond(A) with this wrong A^-1 would not only be of "no great accuracy" but even completely wrong. It's the same as if you would try to measure the precision of any measuring instrument with this (unprecise) instrument itself. Franz
Edited: 17 Oct 2011, 10:28 a.m.
Re: How about a M-COND command? - Walter B - 10-17-2011 Quote:FWIW, this is one of the easiest jobs d:-) The solution won't help you in the matrix problem, however ... Re: How about a M-COND command? - Valentin Albillo - 10-17-2011 Hi, Franz:
Quote: You're absolutely correct that this is kinda chicken-and-egg problem, you need the inverse to compute the condition number and if the matrix is very ill-conditioned your computed inverse will be practically useless. The way out of this annoying conundrum is to simply estimate the necessary norm of the inverse as economically as possible without actually computing the inverse proper. You may want to have a look at this paper for a feasible approach: http:/www.math.ufl.edu/~hager/papers/condition.pdf
Best regards from V. Edited: 17 Oct 2011, 12:53 p.m.
Re: How about a M-COND command? - fhub - 10-17-2011 Quote:Arrogant as usual ... ;-) Re: How about a M-COND command? - fhub - 10-17-2011 Quote:Thanks Valentin! A short look at this paper tells me that it isn't worth the troubles. ;-) I've also found some other estimation algorithms on the internet, quite a few of them use the LU-decomposition of the matrix A. This M-LU is already coded in WP34s, so bringing it back to the user might not be the worst idea. :-)
Franz
Re: Valentin's AM7 determinant on the WP 34S - Valentin Albillo - 10-17-2011 Hi, Walter: Quote: Certainly. Have a look at this 8x8 matrix o'mine. Not as nasty as it sticks to small (2-3 digit) integer elements but still pretty nasty nevertheless:
AM#8: -65 153 -222 257 306 520 -121 461 Go and try your favourite calculator against it and see how it fares and how many digits are lost.
Quote: Maybe but you know what they say: "No pain, no gain". The Spanish version of said proverb begins with "El que quiera peces ..." and common decency prevents me from posting the end ... XD.
Quote: You're welcome.
Best regards from V.
Hey V ... check your email! - Gene Wright - 10-17-2011 ha!
Re: Valentin's AM7 determinant on the WP 34S - Ángel Martin - 10-17-2011 Quote: definitely much more a poetic version than the prosaic saxon one :-) Glad to see you're in top shape, as usual.
Best, Re: Valentin's AM7 determinant on the WP 34S - Valentin Albillo - 10-17-2011 Hi, Pauli: Quote: So the last 5 digits are lost as well, just as predicted ... :D Now it's quite simple to concoct a 10x10 matrix with integer elements, still relatively small (6 digits or less), which should make the 34S result lose all its digits (and about 10 more if they were available !) and there's no need to painstakingly key in the 100 elements. You simply use AM#13 squared, i.e., form a new matrix AM2#13 by multiplying AM#13 times itself. You'll get:
AM2#13:
If I'm correct you should lose 45-50 digits at the very least so completely ruining the 34S result (let alone other models' !). Of course it is possible to produce a 10x10 matrix with smaller integer elements and similarly high condition number but it would be necessary to key it in which would be a pain in the derriere.
Best regards from V. Re: Valentin's AM7 determinant on the WP 34S - Marcus von Cube, Germany - 10-17-2011 I think you can do this ad nauseam. Squaring an ill conditioned matrix should roughly square its condition number thus doubling the number of lost digits. Still interesting that you can do this with such harmless looking integers.
Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-17-2011 0.9999999999999997 Which displays as 1 of course :-)
Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-17-2011 I think the numbers stopped looking harmless when they hit three digits positive and negative ;-)
Re: How about a M-COND command? - Paul Dale - 10-17-2011 The condition number is one I'd like to have included. We're out of flash again and scraping any back is getting much harder so it is unlikely to ever go native. The reason I've not done this is as Franz has already pointed out: I don't know how without suffering the effects of any ill-conditioning. Valentin's link looks interesting.
Re: How about a M-COND command? - Walter B - 10-17-2011 Quote:It's really easy - it doesn't have to be complex just because you don't know it ;-) But since some folks earn their $$$ teaching that method I won't disclose it here. Re: How about a M-COND command? - fhub - 10-17-2011 Quote:Pfff, what a lame excuse! But I didn't expect anything else from you, because I already know you and your vacuous statements here since a few months. Re: Valentin's AM7 determinant on the WP 34S - Valentin Albillo - 10-17-2011 Quote: Oh really ? So I take it you're saying that the big bad 34-digit full-floating-point 34S is afraid of being harmed by those meanie three-digit positive and negative integers ? ... ;-) Pathetic ! ... Perhaps the 34S is not for me after all, I much prefer real-macho calculators which are afraid of nothing whatsoever I may throw at them ... XD
Best regards from V.
Re: How about a M-COND command? - Walter B - 10-18-2011 Quote::-/ Shall I say "ditto"? No, I won't follow your track. Else you'll eventually quit for the 16th time, and we all know already what will happen thereafter ;-) Re: Valentin's AM7 determinant on the WP 34S - Walter B - 10-18-2011 Buenas dias Valentin, Quote:Can't prevent you from taking Pauli's post your way ;-) But at the bottom line you must admit the WP 34S is proven to be the most macho matrix matador met so far :-)
Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-18-2011 Personally, I think you took Valentin's post the wrong way :-) Anyway, I never said the 34S was scared of anything, I only said I was. My years of pure mathematics never involved numbers as large as these, we'll not written out explicitly at any rate...
Re: Valentin's AM7 determinant on the WP 34S - Valentin Albillo - 10-18-2011 Quote: Yes, definitely. Doesn't matter, though, it happens all the time ...
Quote: Well, it should. Just try AM#13 squared, as above, and post what the computed result is, I'd be curious to know ...
TIA and best regards from V. Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-18-2011 Too many program steps for the matrix itself :-( Make the matrix simpler for goodness sake.... Assuming I've squared the matrix properly & I'm not sure I have after more half a dozen semi-decent (export) German beers and a third of a bottle of bad wine, the determinant is -142456776964.0436. Not really an unexpected result given the ill-conditioned nature of the matrix.
PS: Valentin, if you need a 34S, I'm willing to reflash one of mine and send it your way.
Re: Valentin's AM7 determinant on the WP 34S - fhub - 10-18-2011 Quote:Ohhh, then I hope you don't plan to make any WP34s code 'improvements' in the next 24 hours ... ;-)
Franz
Re: Valentin's AM7 determinant on the WP 34S - Paul Dale - 10-18-2011 Come on, most hard-core programmers code best after a bit of ethanol. Sadly, I think I'm a bit past that peak :-(
Re: How about a M-COND command? - Valentin Albillo - 10-18-2011 Quote: I'm about the last person to be qualified to have a say on this but I would hazard that the LU decomposition should always be exposed (i.e., available) to end users, as it's pretty useful for many advanced matrix processing. On the M-COND command, computing it reliably is not practical and a decent estimate (plus or minus one order of magnitude) is about the best that can be done within reasonable time and memory limits. However, on the other hand we should remember that what's important is the final goal and the condition number isn't it. The final goal is to get a decent estimation on the number of digits lost in the final result when computing the matrix determinant. Abour three years ago I wrote a full 16-page article discussing and implementing a novel idea I came up with in order to achieve this goal, with worked examples aplenty and intended for its immediate publication in HPCC Datafile magazine (together with four or five other very worthwhile articles, even though I say so myself) but most regrettably things went South then and there through no fault of my own and the articles never saw the light. They wanted both my articles and my money, though they had next to none of the former and simply way too much of the latter. They got neither.
Best regards from V.
Re: How about a M-COND command? - Paul Dale - 10-18-2011 Quote: I'd have said quite the opposite. When it comes to hard core mathematics, I value your opinion quite highly. I'll try hard to squeeze the exposed LU decomposition back in again. Maybe not in the upcoming release, but the one after...
Re: Valentin's AM7 determinant on the WP 34S - Rodger Rosenbaum - 10-19-2011 AM#8 has a condition number of about 5E19 according to Mathematica, but my HP50 says the condition number is about 5E15. If the goal is to determine the true condition number, then arithmetic with many more digits than the 15 digits internally in the HP50 would be necessary. However, if one's goal is to solve some system using the given matrix, knowing that the condition number is at least 5E15 is enough to know that any solution derived from that matrix is likely to have no correct digits (on an HP50)--we don't need to know that the true condition number is 5E19. Testing the COND function on the HP50, I have been unable to find a matrix with a true condition number greater than E12 which was inaccurately calculated to have a smaller condition number. The calculator doesn't seem to ever seriously underestimate the condition number.
Using a column matrix of: x=[-85.97057 -1328.61068 452.27432 61.401457 1570.67801 1770.08111 2566.08833 471.67052]T but, the exact solution is: [1 1 1 1 1 1 1 1]T We can see that the high condition number makes for no correct digits in the solution. Using the LSQ function to solve the system rather than the / key method gives much better results on the HP50--showing the first 4 digits of the results: [.7876 1.181 .7576 1.015 .7726 .8039 1.211 1.212]T
This shows the advantage of orthogonal methods of solution rather than the Gaussian method.
Re: Valentin's AM7 determinant on the WP 34S - Werner - 10-22-2011 Hi, Rodger! Long time no hear. Quote:But LSQ performs a rank determination, and will probably deem the matrix rank 7 (which, in 15-digit arithmetic, it is). Orthogonal transformations on the 8x8 matrix would not yield better results. I think ;-) (but I will be sure to verify)
Cheers, Werner
|