![]() |
Matrix Characteristic Polynomial - Reloaded. - 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 Characteristic Polynomial - Reloaded. (/thread-248460.html) |
Matrix Characteristic Polynomial - Reloaded. - Ángel Martin - 08-19-2013 Just to keep you all updated, the SandMatrix module is close to release. While preparing the manual I’ve been tweaking and improving some of the routines, taking advantage of its extended function set. One of these has been CHRPOL, used to obtain the characteristic polynomial of a matrix. The new version code is about 1/3rd. of the original one, and does the job in about half the time – if not faster. Such is the improvement derived from the “direct approach”. An image is worth 1,000 words, so here’s the program listing for you.- Stay tuned, the real think will be packed… Magic in 60 program steps. Uses the Faddevv-Leverrier method - you can almost read the algorithm from the ALPHA register, directly using the abstraction layer of the Matrix functions.
1 LBL "CHRPOL" MNAME in Alpha The polynomial control word is left in X upon termination - that is, registers containing the n+1 coefficients in the form bbb.eee -from Rbbb to Reee.
Cheers,
PS. Here’s an article that may be useful to jog your memory:
Edited: 19 Aug 2013, 9:10 a.m.
Re: Matrix Characteristic Polynomial - Reloaded. - Massimo Gnerucci (Italy) - 08-19-2013
Re: Matrix Characteristic Polynomial - Reloaded. - Ángel Martin - 08-19-2013 LOL !!! You gotta love this forum :) A suitable ovation for what may well be "the last program ever to be written using the Advantage-based tool-set".
Cheers, 'AM
Re: Matrix Characteristic Polynomial - Reloaded. - Massimo Gnerucci (Italy) - 08-19-2013
Quote:
I really do! Re: Matrix Characteristic Polynomial - Reloaded. - Namir - 08-19-2013 Hey!! What are MY PARENTS doing in the first row of that picture!!!??????????!!!!!???????????!!!!??? :-)
Namir
Re: Matrix Characteristic Polynomial - Reloaded. - Jim Horn - 08-19-2013 And why are they sitting with my kids?
Re: Matrix Characteristic Polynomial - Reloaded. - Monte Dalrymple - 08-19-2013 'Angel, do you have a rough ETA? I'm putting together a new Flash image for the 41CL. Re: Matrix Characteristic Polynomial - Reloaded. - Robert Prosperi - 08-19-2013 Angel:
Quote: Wow, a blast from my very distant past! In college, I had a Mech Eng & Numerical Analysis Professor that seemed to be able to prove virtually anything he chose, using Feddevv-Leverrier. Always mentioned that Faddevv was married to Faddevva (sp?) and that they worked on these matrix equations together. Such Marital bliss... Were it not for your post I may have believed I imagined it all. Thanks for the mention. It's sometimes odd how these posts will hit you.
--bob prosperi
Re: Matrix Characteristic Polynomial - Reloaded. - Ángel Martin - 08-20-2013 I'm hoping for end of this week, just a couple of wrinkles left. I'll send you the ROM images as soon as they're ready, won't wait for the manual (which is another thick one).
Re: Matrix Characteristic Polynomial - Reloaded. - Thomas Klemm - 08-21-2013 For those interested here's a HP-15C version of the algorithm: Listing001 - 42,21,11 LBL A
Calculating the Trace of a MatrixDIM(n, n+1) AT DIM(1, n) DET
Example:![]()
3 Thus the characteristic polynomial is: p(x) = x3 - 10x2 + 4x - 40.
EigenvaluesWe can use this short program to solve p(x) = 0. LBL BThe other solutions are 2i and -2i which can't be found with the built-in solver.
Cheers
Edited: 21 Aug 2013, 4:39 p.m.
Re: Matrix Characteristic Polynomial - Reloaded. - Ángel Martin - 08-22-2013 Nice tricks Thomas! Would you also have one to create an identity matrix - the quickest possible way? Also if you're going to end up using the SOLVEr, might as well have started there, solving for x in the equation: Det( A - x I) = 0
Cheers,
Re: Matrix Characteristic Polynomial - Reloaded. - Thomas Klemm - 08-22-2013 If we know that A is invertible: RESULT E
Otherwise something along this: DIM(n+1, n) AT DIM(n, n)
Kind regards Re: Matrix Characteristic Polynomial - Reloaded. - Thomas Klemm - 08-22-2013 Quote:
That's actually a nice idea: LBL E
Cheers |