Eigenvalues on 42S? « Next Oldest | Next Newest »

 ▼ Steven Soto Unregistered Posts: 16 Threads: 4 Joined: Jan 1970 08-25-2003, 02:11 PM Does anyone know how to find all of the eigenvalues for a 3x3 matrix on a 42s? I know you can find ONE using the solver, but I'd like to be able to find all three, like on a 48g. Can this be done with "standard" matrix operations like inverse, determinant, etc.? ▼ Patrick Unregistered Posts: 266 Threads: 32 Joined: Jan 1970 08-25-2003, 02:49 PM I can't think of a direct method. Since you are only interested in a 3x3 (not nxn) you could go back to first principles. Take an arbitrary 3x3 matrix, A =[aij], and expand the expression det(A-xI) as a cubic polynomial in x. The roots of this cubic are, of course, the eigenvalues. The coefficients of the cubic should be readily expressible in terms of determinants of various sub-matrices of A (you could probably even find this written out explicitly in a beginner's book on eigenvectors). Write a program which computes the cubic's coefficients using the sub-matrix and determinant capabilities of the 42s, then feed the resulting cubic into the solver. ▼ Steven Soto Unregistered Posts: 16 Threads: 4 Joined: Jan 1970 08-25-2003, 03:12 PM Exactly my problem. I already knew I could get one from the solver: I want to know how to get all three. I guess I'll have to manually factor out the one result from the solver and then put the remaining result into the quadratic equation. Any ideas on how to write a program to do this that will simply output three values? ▼ Tizedes Csaba Unregistered Posts: 93 Threads: 15 Joined: Jan 1970 08-25-2003, 05:03 PM Hi Steven! If you can wait to next day, I will help you. Too late here, and the PC's keyboard is clicking, and my girlfriend not like that in the night. I haven't got 42S, I'll write a little program for 32SII, what can solve ANY REAL roots of an equation. (I'm hoping... :) ) A part of it is ready to run, the solver part I'll make tomorrow morning...! Good night! Csaba Patrick Unregistered Posts: 266 Threads: 32 Joined: Jan 1970 08-25-2003, 07:52 PM The cubic equation ```p(x) = det(A-xI) = c3x3 + c2x2 + c1x + c0 ``` has the following coefficients: ```c0 = det(A) c1 = -(sum of all 2x2 determinants obtained by deleting the same row and column from A) = -((a11a22 - a12a21) + (a11a33 - a13a31) + (a22a33 - a23a32)) c2 = sum of all 1x1 determinants obtained by deleting the same two rows and columns from A = a11 + a22 + a33 c3 = -1 ``` Now, if a cubic, p(x), has 3 real roots, then they occur between successive extrema of the cubic. If the extrema are located at x=x1 and x=x2, with x1 < x2, then the roots of the cubic are in the three ranges: ```(-inf, x1) (x1, x2) (x2, +inf) ``` You can compute x1 and x2 as the roots of a quadratic: ``` p'(x) = 3c3x2 + 2c2x + c1 ``` Once you have these roots, you can feed the ranges above into the solver as guesses. Of course, you'd have to do something intelligent in place of the infinities. Tizedes Csaba Unregistered Posts: 93 Threads: 15 Joined: Jan 1970 08-26-2003, 05:26 AM Hi Steven, this is a solution for your problem. This program can solve polinom-equations ANY of order (limited by mem). It's not too long, only 92 byte ;). It work fast with built-in solver, and use Horner-method: Only one problem with it, it's solve JUST REAL ROOTS... But in the real problems, like mechanical stress calculations, the roots are reals. This is the HP32SII version: ``` E01 LBL E #prepare of 'i' FIX 3 RCL N 1 add 1E3 div 1 add RND STO i 0 E13 RTN P01 LBL P #the 'dinamical polynom' XEQ E H01 LBL H #Horner's method RCL mul X RCL add (i) ISG i GTO H H06 RTN X01 LBL X #polynom solver SOLVE X GTO R #if found root goto 'R' SF 0 #no real root, set flag 0 X05 RTN D01 LBL D #decrement polynom order, XEQ E J01 LBL J #use a little modified Horner method RCL mul X RCL add (i) STO (i) #overwrite coefficients ISG i #with decremented polyn.'s coefficients GTO J J07 GTO X S01 LBL S #start-routine CF 0 CF 1 INPUT N S05 XEQ E I01 LBL I #coefficient input-routine INPUT (i) ISG i GTO I FN= P I06 GTO X R01 LBL R #we found a root VIEW X 1 STO sub N VIEW N #number of roots, what we dont found yet RCL N x<>0? #more root? GTO D #go decrement order, and solve again SF 1 #no more root, and all was REAL: set flag 1 R10 RTN 'add', 'sub', 'mul' and 'div' mean 'add', 'substract', 'multiply' and 'divide' in this order. The checksums: E:CK=0BE8 27.5 byte P:CK=E452 3.0 byte H:CK=3E78 9.0 byte X:CK=3894 7.5 byte D:CK=11DF 3.0 byte J:CK=C765 10.5 byte S:CK=BB8E 7.5 byte I:CK=32B5 9.0 byte R:CK=E775 15.0 byte An example: solve this polynom with this program: -2*x^6 -6*x^5 +82*x^4 +174*x^3 -800*x^2 -888*x +1440 =0 A*X^6 +B*X^5 +C*X^4 +D*X^3 +E*X^2 +F*X +G=0 In the program the coefficients are A, B, C, ... The limit of order N=12, because the 14th variable is N, and we use this variable for the order of solved polynom. If you replace it with Z, you can solve the 24th order of polynomials. And it's not a joke... Now, start the program: [XEQ S] the calc prompting for order of polynom: N? type 6 [R/S]. Then the program prompts for all of coefficients, type it in decrease order: A? -2 [R/S] B? -6 [R/S] C? 82 [R/S] D? 174 [R/S] E? -800 [R/S] F? -888 [R/S] G? 1440 [R/S] Then you will see the 'RUNNING/SOLVING' message, and the program stops with one of six roots: for example X=1. Press [R/S], and you'll see N=5 this mean, the polynom's got 5 root yet. Press [R/S] and repeat this method until all of roots founded. When N=0 press [R/S], the 'flag1' anunciator set and program end. 'flag1' set mean, all of roots was real. This polynom got 6 real roots: 1, -2, 3, -4, 5, -6, and the simplyfied form is: -2*(x-1)*(x+2)*(x-3)*(x+4)*(x-5)*(x+6) ``` I hope it help to you and anybody, who want to solve polynomials. The roots are 'more exacts' if the round off error is not a very big. Csaba ▼ Steven Soto Unregistered Posts: 16 Threads: 4 Joined: Jan 1970 08-26-2003, 08:01 AM Tizedes, Thanks. Very helpful and useful. I'm still amazed by the power of the pioneer series. I have used these calculators since 1988 starting with a 32s my freshman year in high school. I got a 42s as a senior in high school, and I still use that calculator today. I have a spare that I have tested, and never used which sits in a hard case without batteries. I have used this calculator all through undergraduate school and graduate school while everyone else seemed to migrate to TI's, I have yet to find something that I cannot get my 42s to do that I need it to. And yes, this eigenvalue problem was to solve three dimensional stress states. -Steven ▼ Tizedes Csaba Unregistered Posts: 93 Threads: 15 Joined: Jan 1970 08-27-2003, 02:09 AM Steven, don't mention it! I made it with pleasure! :) My friends said I'm crazy for that what haven't got more keys than 50 and LCD resolution less than 160x160 with 1 colour. :) And it's true! Csaba I am adding and subtracting I'm controlling and composing Valentin Albillo Unregistered Posts: 1,755 Threads: 112 Joined: Jan 2005 08-26-2003, 10:57 AM If your matrix is symmetric (which is usually the case in many real-life engineering problems), the eigenvalues will all be real, and Jacobi's method will produce them all at once, to full precision. Jacobi's method uses 2x2 rotation matrices applied iteratively to any arbitrary symmetric NxN matrix, till it reduces it to a diagonal matrix. The eigenvalues are then precisely the diagonal elements, and the corresponding eigenvectors are produced as well as a side effect. This algorithm is very straightforward, always converges without requiring any input from the user other than the NxN matrix itself, and converges very quickly, producing accurate results (great stability as well). Further, the transformation is made *in-place*, thus requiring a minimum amount of memory. I wrote such a program for the barebones HP-41C, which should run unchanged, as is, in any HP42S. It was published in the PPC Journal, circa 1980 or so, a little search will find it. It is only 100+ program steps, so you can key it in effortlessly. Else (or also), have a look at this excellent paper (PDF format): which includes a full, detailed description of the method, as well as a program listing. Best regards from V. ▼ hugh Unregistered Posts: 189 Threads: 23 Joined: Jan 1970 08-26-2003, 12:06 PM the method is also coded for the 15c in the advanced functions handbook page 148. however, i do like csaba's program as a good programmatic use of the solve feature. something ive been doing recently is the same problem the other way around. ive been finding it much better to use an eigenvalue approach to polynomial roots rather than the reverse. you also get the complex roots a lot easier this way too. ▼ V-PN Unregistered Posts: 785 Threads: 13 Joined: Jan 2005 08-26-2003, 10:45 PM "for the 15c in the advanced functions handbook page 148" Can you send it here or to me directly? VPN V-PN Unregistered Posts: 785 Threads: 13 Joined: Jan 2005 08-26-2003, 10:47 PM "I wrote such a program for the barebones HP-41C" Can you send it here or to me directly? VPN ▼ Valentin Albillo Unregistered Posts: 1,755 Threads: 112 Joined: Jan 2005 08-27-2003, 04:29 AM Thanks for your interest re my "Eigenvalues for an NxN symmetrical matrix: The Jacobi Method" article and program for the barebones HP-41C . I initially thought it was published in "PPC Journal", V7 or V8, but a cursory search in the PDF pages available online failed to locate it, which means it was published in "PPC Technical Notes" instead, which alas, has no online presence as far as I can tell. If you've got the first 10 issues or so of "PPC Technical Notes" (circa 1980 or 1981), you'll find it there for sure. I remember it was heavily optimized, took just 100+ steps or so (thus fitting in a single card, maybe even in just one side of a card), and could handle very large matrices as it made use of the fact that the matrix was symmetrical, so it only needed to store N*(N+1)/2 elements (i.e: only 120 elements for a 15x15 matrix) instead of N*N (i.e: 225 elements for said 15x15 matrix). The N eigenvalues were found all at once, simultaneously (not one by one), and very quickly. Best regards from V. Edited: 27 Aug 2003, 4:39 a.m.

 Possibly Related Threads… Thread Author Replies Views Last Post Using the Prime to solve for eigenvalues Michael de Estrada 28 8,535 10-27-2013, 07:21 AM Last Post: Tarcisi C 42s questions and 42s vs 35s snaggs 13 5,371 09-19-2011, 02:44 AM Last Post: snaggs HP-41C/CV/CX Eigenvalues/Vectors help mbrethen 2 1,153 02-06-2011, 02:41 AM Last Post: Ángel Martin Compute some Eigenvalues first thing in the morning, and nothing worse will happen to you all day. Eric Smith 18 4,151 07-22-2006, 10:44 AM Last Post: Karl Schneider RPN Program for Eigenvalues? Ángel Martin 2 944 03-23-2004, 10:22 AM Last Post: Ángel Martin

Forum Jump: