12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201 |
- REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
- % Miscellaneous matrix tests.
- % Tests of eigenfunction/eigenvalue code.
- v := mat((1,1,-1,1,0),(1,2,-1,0,1),(-1,2,3,-1,0),
- (1,-2,1,2,-1),(2,1,-1,3,0))$
- mateigen(v,et);
- {{et - 2,
- 1,
- [ 0 ]
- [ ]
- [ 0 ]
- [ ]
- [arbcomplex(1)]
- [ ]
- [arbcomplex(1)]
- [ ]
- [arbcomplex(1)]
- },
- 4 3 2
- {et - 6*et + 13*et + 5*et - 5,
- 1,
- [ 5*arbcomplex(2)*(et - 2) ]
- [ ---------------------------- ]
- [ 3 2 ]
- [ 2*et - 10*et + 23*et + 5 ]
- [ ]
- [ 2 ]
- [ arbcomplex(2)*et*( - et + 6*et - 8) ]
- [--------------------------------------]
- [ 3 2 ]
- [ 2*et - 10*et + 23*et + 5 ]
- [ ]
- [ arbcomplex(2)*et*( - 3*et + 7) ]
- [ -------------------------------- ]
- [ 3 2 ]
- [ 2*et - 10*et + 23*et + 5 ]
- [ ]
- [ 3 2 ]
- [ arbcomplex(2)*(et - 4*et + 10) ]
- [ ---------------------------------- ]
- [ 3 2 ]
- [ 2*et - 10*et + 23*et + 5 ]
- [ ]
- [ arbcomplex(2) ]
- }}
- eigv := third first ws$
- % Now check if the equation for the eigenvectors is fulfilled. Note
- % that also the last component is zero due to the eigenvalue equation.
- v*eigv-et*eigv;
- [ 0 ]
- [ ]
- [ 0 ]
- [ ]
- [arbcomplex(1)*( - et + 2)]
- [ ]
- [arbcomplex(1)*( - et + 2)]
- [ ]
- [arbcomplex(1)*( - et + 2)]
- % Example of degenerate eigenvalues.
- u := mat((2,-1,1),(0,1,1),(-1,1,1))$
- mateigen(u,eta);
- {{eta - 1,2,
- [arbcomplex(3)]
- [ ]
- [arbcomplex(3)]
- [ ]
- [ 0 ]
- },
- {eta - 2,1,
- [ 0 ]
- [ ]
- [arbcomplex(4)]
- [ ]
- [arbcomplex(4)]
- }}
- % Example of a fourfold degenerate eigenvalue with two corresponding
- % eigenvectors.
- w := mat((1,-1,1,-1),(-3,3,-5,4),(8,-4,3,-4),
- (15,-10,11,-11))$
- mateigen(w,al);
- {{al + 1,
- 4,
- [ arbcomplex(5) ]
- [ --------------- ]
- [ 5 ]
- [ ]
- [ - 5*arbcomplex(6) + 7*arbcomplex(5) ]
- [--------------------------------------]
- [ 5 ]
- [ ]
- [ arbcomplex(5) ]
- [ ]
- [ arbcomplex(6) ]
- }}
- eigw := third first ws;
- [ arbcomplex(5) ]
- [ --------------- ]
- [ 5 ]
- [ ]
- [ - 5*arbcomplex(6) + 7*arbcomplex(5) ]
- eigw := [--------------------------------------]
- [ 5 ]
- [ ]
- [ arbcomplex(5) ]
- [ ]
- [ arbcomplex(6) ]
- w*eigw - al*eigw;
- [ - arbcomplex(5)*(al + 1) ]
- [ --------------------------- ]
- [ 5 ]
- [ ]
- [ 5*arbcomplex(6)*al + 5*arbcomplex(6) - 7*arbcomplex(5)*al - 7*arbcomplex(5) ]
- [-----------------------------------------------------------------------------]
- [ 5 ]
- [ ]
- [ - arbcomplex(5)*(al + 1) ]
- [ ]
- [ - arbcomplex(6)*(al + 1) ]
- % Calculate the eigenvectors and eigenvalue equation.
- f := mat((0,ex,ey,ez),(-ex,0,bz,-by),(-ey,-bz,0,bx),
- (-ez,by,-bx,0))$
- factor om;
- mateigen(f,om);
- 4 2 2 2 2 2 2 2 2 2
- {{om + om *(bx + by + bz + ex + ey + ez ) + bx *ex + 2*bx*by*ex*ey
- 2 2 2 2
- + 2*bx*bz*ex*ez + by *ey + 2*by*bz*ey*ez + bz *ez ,
- 1,
- 2
- mat(((om *arbcomplex(7)*ez + om*arbcomplex(7)*(bx*ey - by*ex)
- 3 2 2 2
- + arbcomplex(7)*bz*(bx*ex + by*ey + bz*ez))/(om + om*(bz + ex + ey )
- )),
- 2
- (( - om *arbcomplex(7)*by + om*arbcomplex(7)*(bx*bz - ex*ez)
- 3 2 2 2
- - arbcomplex(7)*ey*(bx*ex + by*ey + bz*ez))/(om + om*(bz + ex + ey )
- )),
- 2
- ((om *arbcomplex(7)*bx + om*arbcomplex(7)*(by*bz - ey*ez)
- 3 2 2 2
- + arbcomplex(7)*ex*(bx*ex + by*ey + bz*ez))/(om + om*(bz + ex + ey )
- )),
- (arbcomplex(7)))
- }}
- % Specialize to perpendicular electric and magnetic field.
- let ez=0,ex=0,by=0;
- % Note that we find two eigenvectors to the double eigenvalue 0
- % (as it must be).
- mateigen(f,om);
- {{om,
- 2,
- [ arbcomplex(9)*bx - arbcomplex(8)*bz ]
- [-------------------------------------]
- [ ey ]
- [ ]
- [ arbcomplex(8) ]
- [ ]
- [ 0 ]
- [ ]
- [ arbcomplex(9) ]
- },
- 2 2 2 2
- {om + bx + bz + ey ,
- 1,
- [ - arbcomplex(10)*ey ]
- [ ---------------------- ]
- [ bx ]
- [ ]
- [ - arbcomplex(10)*bz ]
- [ ---------------------- ]
- [ bx ]
- [ ]
- [ 2 2 2 ]
- [ arbcomplex(10)*(bx + bz + ey ) ]
- [----------------------------------]
- [ om*bx ]
- [ ]
- [ arbcomplex(10) ]
- }}
- % The following has 1 as a double eigenvalue. The corresponding
- % eigenvector must involve two arbitrary constants.
- j := mat((9/8,1/4,-sqrt(3)/8),
- (1/4,3/2,-sqrt(3)/4),
- (-sqrt(3)/8,-sqrt(3)/4,11/8));
- [ 9 1 - sqrt(3) ]
- [ --- --- ------------]
- [ 8 4 8 ]
- [ ]
- [ 1 3 - sqrt(3) ]
- j := [ --- --- ------------]
- [ 4 2 4 ]
- [ ]
- [ - sqrt(3) - sqrt(3) 11 ]
- [------------ ------------ ---- ]
- [ 8 4 8 ]
- mateigen(j,x);
- {{x - 1,
- 2,
- [sqrt(3)*arbcomplex(12) - 2*arbcomplex(11)]
- [ ]
- [ arbcomplex(11) ]
- [ ]
- [ arbcomplex(12) ]
- },
- {x - 2,
- 1,
- [ - sqrt(3)*arbcomplex(13) ]
- [ --------------------------- ]
- [ 3 ]
- [ ]
- [ - 2*sqrt(3)*arbcomplex(13) ]
- [-----------------------------]
- [ 3 ]
- [ ]
- [ arbcomplex(13) ]
- }}
- % The following is a good consistency check.
- sym := mat(
- (0, 1/2, 1/(2*sqrt(2)), 0, 0),
- (1/2, 0, 1/(2*sqrt(2)), 0, 0),
- (1/(2*sqrt(2)), 1/(2*sqrt(2)), 0, 1/2, 1/2),
- (0, 0, 1/2, 0, 0),
- (0, 0, 1/2, 0, 0))$
- ans := mateigen(sym,eta);
- ans := {{eta,
- 1,
- [ 0 ]
- [ ]
- [ 0 ]
- [ ]
- [ 0 ]
- [ ]
- [ - arbcomplex(14)]
- [ ]
- [ arbcomplex(14) ]
- },
- {eta - 1,
- 1,
- [ 2*arbcomplex(15) ]
- [------------------]
- [ sqrt(2) ]
- [ ]
- [ 2*arbcomplex(15) ]
- [------------------]
- [ sqrt(2) ]
- [ ]
- [ 2*arbcomplex(15) ]
- [ ]
- [ arbcomplex(15) ]
- [ ]
- [ arbcomplex(15) ]
- },
- {2*eta + 1,
- 1,
- [ - arbcomplex(16)]
- [ ]
- [ arbcomplex(16) ]
- [ ]
- [ 0 ]
- [ ]
- [ 0 ]
- [ ]
- [ 0 ]
- },
- 2
- {4*eta + 2*eta - 1,
- 1,
- [ - arbcomplex(17) ]
- [ ------------------- ]
- [ 2*sqrt(2)*eta ]
- [ ]
- [ - arbcomplex(17) ]
- [ ------------------- ]
- [ 2*sqrt(2)*eta ]
- [ ]
- [ arbcomplex(17)*( - 2*eta + 1) ]
- [-------------------------------]
- [ 2*eta ]
- [ ]
- [ arbcomplex(17) ]
- [ ]
- [ arbcomplex(17) ]
- }}
- % Check of correctness for this example.
- for each j in ans do
- for each k in solve(first j,eta) do
- write sub(k,sym*third j - eta*third j);
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- % Tests of nullspace operator.
- a1 := mat((1,2,3,4),(5,6,7,8));
- [1 2 3 4]
- a1 := [ ]
- [5 6 7 8]
- nullspace a1;
- {
- [ 1 ]
- [ ]
- [ 0 ]
- [ ]
- [ - 3]
- [ ]
- [ 2 ]
- ,
- [ 0 ]
- [ ]
- [ 1 ]
- [ ]
- [ - 2]
- [ ]
- [ 1 ]
- }
-
- b1 := {{1,2,3,4},{5,6,7,8}};
- b1 := {{1,2,3,4},{5,6,7,8}}
- nullspace b1;
- {{1,0,-3,2},{0,1,-2,1}}
- % Example taken from a bug report for another CA system.
- c1 :=
- {{(p1**2*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2), 0,
- (p1*p3*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2),
- -((p1**2*p2*(s + z))/(p1**2 + p3**2)), p1*(s + z),
- -((p1*p2*p3*(s + z))/(p1**2 + p3**2)),
- -((p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)), 0,
- (p1**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)},
- {0, 0, 0, 0, 0, 0, 0, 0, 0},
- {(p1*p3*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2), 0,
- (p3**2*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2),
- -((p1*p2*p3*(s + z))/(p1**2 + p3**2)), p3*(s + z),
- -((p2*p3**2*(s + z))/(p1**2 + p3**2)),
- -((p3**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)), 0,
- (p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)},
- {-((p1**2*p2*(s + z))/(p1**2 + p3**2)), 0,
- -((p1*p2*p3*(s + z))/(p1**2 + p3**2)),
- -((p1**2*p2**2*(s + 2*z))/((p1**2 + p3**2)*z)), (p1*p2*(s + 2*z))/z,
- -((p1*p2**2*p3*(s + 2*z))/((p1**2 + p3**2)*z)),
- -((p1*p2*p3*z)/(p1**2 + p3**2)), 0, (p1**2*p2*z)/(p1**2 + p3**2)},
- {p1*(s + z), 0, p3*(s + z), (p1*p2*(s + 2*z))/z,
- -(((p1**2+p3**2)*(s+ 2*z))/z), (p2*p3*(s + 2*z))/z, p3*z,0, -(p1*z)},
- {-((p1*p2*p3*(s + z))/(p1**2 + p3**2)), 0,
- -((p2*p3**2*(s + z))/(p1**2 + p3**2)),
- -((p1*p2**2*p3*(s + 2*z))/((p1**2 + p3**2)*z)), (p2*p3*(s + 2*z))/z,
- -((p2**2*p3**2*(s + 2*z))/((p1**2 + p3**2)*z)),
- -((p2*p3**2*z)/(p1**2 + p3**2)), 0, (p1*p2*p3*z)/(p1**2 + p3**2)},
- {-((p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)), 0,
- -((p3**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)),
- -((p1*p2*p3*z)/(p1**2 + p3**2)),p3*z,-((p2*p3**2*z)/(p1**2 + p3**2)),
- -((p3**2*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z))), 0,
- (p1*p3*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z))},
- {0, 0, 0, 0, 0, 0, 0, 0, 0},
- {(p1**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2), 0,
- (p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2),
- (p1**2*p2*z)/(p1**2 + p3**2), -(p1*z), (p1*p2*p3*z)/(p1**2 + p3**2),
- (p1*p3*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z)), 0,
- -((p1**2*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z)))}};
- 2 2 2 2 2
- p1 *(p1 + p2 + p3 - s*z - z )
- c1 := {{----------------------------------,
- 2 2
- p1 + p3
- 0,
- 2 2 2 2
- p1*p3*(p1 + p2 + p3 - s*z - z )
- ------------------------------------,
- 2 2
- p1 + p3
- 2
- - p1 *p2*(s + z)
- -------------------,
- 2 2
- p1 + p3
- p1*(s + z),
- - p1*p2*p3*(s + z)
- ---------------------,
- 2 2
- p1 + p3
- 2 2 2
- - p1*p3*(p1 + p2 + p3 )
- ----------------------------,
- 2 2
- p1 + p3
- 0,
- 2 2 2 2
- p1 *(p1 + p2 + p3 )
- -----------------------},
- 2 2
- p1 + p3
- {0,0,0,0,0,0,0,0,0},
- 2 2 2 2
- p1*p3*(p1 + p2 + p3 - s*z - z )
- {------------------------------------,
- 2 2
- p1 + p3
- 0,
- 2 2 2 2 2
- p3 *(p1 + p2 + p3 - s*z - z )
- ----------------------------------,
- 2 2
- p1 + p3
- - p1*p2*p3*(s + z)
- ---------------------,
- 2 2
- p1 + p3
- p3*(s + z),
- 2
- - p2*p3 *(s + z)
- -------------------,
- 2 2
- p1 + p3
- 2 2 2 2
- - p3 *(p1 + p2 + p3 )
- --------------------------,
- 2 2
- p1 + p3
- 0,
- 2 2 2
- p1*p3*(p1 + p2 + p3 )
- -------------------------},
- 2 2
- p1 + p3
- 2
- - p1 *p2*(s + z)
- {-------------------,
- 2 2
- p1 + p3
- 0,
- - p1*p2*p3*(s + z)
- ---------------------,
- 2 2
- p1 + p3
- 2 2
- p1 *p2 *( - s - 2*z)
- ----------------------,
- 2 2
- z*(p1 + p3 )
- p1*p2*(s + 2*z)
- -----------------,
- z
- 2
- p1*p2 *p3*( - s - 2*z)
- ------------------------,
- 2 2
- z*(p1 + p3 )
- - p1*p2*p3*z
- ---------------,
- 2 2
- p1 + p3
- 0,
- 2
- p1 *p2*z
- -----------},
- 2 2
- p1 + p3
- {p1*(s + z),
- 0,
- p3*(s + z),
- p1*p2*(s + 2*z)
- -----------------,
- z
- 2 2 2 2
- - p1 *s - 2*p1 *z - p3 *s - 2*p3 *z
- --------------------------------------,
- z
- p2*p3*(s + 2*z)
- -----------------,
- z
- p3*z,
- 0,
- - p1*z},
- - p1*p2*p3*(s + z)
- {---------------------,
- 2 2
- p1 + p3
- 0,
- 2
- - p2*p3 *(s + z)
- -------------------,
- 2 2
- p1 + p3
- 2
- p1*p2 *p3*( - s - 2*z)
- ------------------------,
- 2 2
- z*(p1 + p3 )
- p2*p3*(s + 2*z)
- -----------------,
- z
- 2 2
- p2 *p3 *( - s - 2*z)
- ----------------------,
- 2 2
- z*(p1 + p3 )
- 2
- - p2*p3 *z
- -------------,
- 2 2
- p1 + p3
- 0,
- p1*p2*p3*z
- ------------},
- 2 2
- p1 + p3
- 2 2 2
- - p1*p3*(p1 + p2 + p3 )
- {----------------------------,
- 2 2
- p1 + p3
- 0,
- 2 2 2 2
- - p3 *(p1 + p2 + p3 )
- --------------------------,
- 2 2
- p1 + p3
- - p1*p2*p3*z
- ---------------,
- 2 2
- p1 + p3
- p3*z,
- 2
- - p2*p3 *z
- -------------,
- 2 2
- p1 + p3
- 2 2 2 2
- - p3 *z*(p1 + p2 + p3 )
- -------------------------------,
- 2 2 2 2
- p1 *s + p1 *z + p3 *s + p3 *z
- 0,
- 2 2 2
- p1*p3*z*(p1 + p2 + p3 )
- -------------------------------},
- 2 2 2 2
- p1 *s + p1 *z + p3 *s + p3 *z
- {0,0,0,0,0,0,0,0,0},
- 2 2 2 2
- p1 *(p1 + p2 + p3 )
- {-----------------------,
- 2 2
- p1 + p3
- 0,
- 2 2 2
- p1*p3*(p1 + p2 + p3 )
- -------------------------,
- 2 2
- p1 + p3
- 2
- p1 *p2*z
- -----------,
- 2 2
- p1 + p3
- - p1*z,
- p1*p2*p3*z
- ------------,
- 2 2
- p1 + p3
- 2 2 2
- p1*p3*z*(p1 + p2 + p3 )
- -------------------------------,
- 2 2 2 2
- p1 *s + p1 *z + p3 *s + p3 *z
- 0,
- 2 2 2 2
- - p1 *z*(p1 + p2 + p3 )
- -------------------------------}}
- 2 2 2 2
- p1 *s + p1 *z + p3 *s + p3 *z
- nullspace c1;
- {{p3,0, - p1,0,0,0,0,0,0},
- {0,1,0,0,0,0,0,0,0},
- {0,0,0,p3,0, - p1,0,0,0},
- 2 2
- {0,0,0,0,p2*p3,p1 + p3 ,0,0,0},
- {0,0,0,0,0,0,p1,0,p3},
- {0,0,0,0,0,0,0,1,0}}
-
- d1 := mat
- (((p1**2*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2), 0,
- (p1*p3*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2),
- -((p1**2*p2*(s + z))/(p1**2 + p3**2)), p1*(s + z),
- -((p1*p2*p3*(s + z))/(p1**2 + p3**2)),
- -((p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)), 0,
- (p1**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)),
- (0, 0, 0, 0, 0, 0, 0, 0, 0),
- ((p1*p3*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2), 0,
- (p3**2*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2),
- -((p1*p2*p3*(s + z))/(p1**2 + p3**2)), p3*(s + z),
- -((p2*p3**2*(s + z))/(p1**2 + p3**2)),
- -((p3**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)), 0,
- (p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)),
- ( ((p1**2*p2*(s + z))/(p1**2 + p3**2)), 0,
- -((p1*p2*p3*(s + z))/(p1**2 + p3**2)),
- -((p1**2*p2**2*(s + 2*z))/((p1**2 + p3**2)*z)), (p1*p2*(s + 2*z))/z,
- -((p1*p2**2*p3*(s + 2*z))/((p1**2 + p3**2)*z)),
- -((p1*p2*p3*z)/(p1**2 + p3**2)), 0, (p1**2*p2*z)/(p1**2 + p3**2)),
- (p1*(s + z), 0, p3*(s + z), (p1*p2*(s + 2*z))/z,
- -(((p1**2 + p3**2)*(s + 2*z))/z),(p2*p3*(s + 2*z))/z,p3*z,0,-(p1*z)),
- (-((p1*p2*p3*(s + z))/(p1**2 + p3**2)), 0,
- -((p2*p3**2*(s + z))/(p1**2 + p3**2)),
- -((p1*p2**2*p3*(s + 2*z))/((p1**2 + p3**2)*z)), (p2*p3*(s + 2*z))/z,
- -((p2**2*p3**2*(s + 2*z))/((p1**2 + p3**2)*z)),
- -((p2*p3**2*z)/(p1**2 + p3**2)), 0, (p1*p2*p3*z)/(p1**2 + p3**2)),
- (-((p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)), 0,
- -((p3**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)),
- -((p1*p2*p3*z)/(p1**2 + p3**2)),p3*z,-((p2*p3**2*z)/(p1**2 + p3**2)),
- -((p3**2*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z))), 0,
- (p1*p3*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z))),
- (0, 0, 0, 0, 0, 0, 0, 0, 0),
- ((p1**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2), 0,
- (p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2),
- (p1**2*p2*z)/(p1**2 + p3**2), -(p1*z), (p1*p2*p3*z)/(p1**2 + p3**2),
- (p1*p3*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z)), 0,
- -((p1**2*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z)))));
- 2 2 2 2 2
- p1 *(p1 + p2 + p3 - s*z - z )
- d1 := mat((----------------------------------,0,
- 2 2
- p1 + p3
- 2 2 2 2 2
- p1*p3*(p1 + p2 + p3 - s*z - z ) - p1 *p2*(s + z)
- ------------------------------------,-------------------,p1*(s + z),
- 2 2 2 2
- p1 + p3 p1 + p3
- 2 2 2
- - p1*p2*p3*(s + z) - p1*p3*(p1 + p2 + p3 )
- ---------------------,----------------------------,0,
- 2 2 2 2
- p1 + p3 p1 + p3
- 2 2 2 2
- p1 *(p1 + p2 + p3 )
- -----------------------),
- 2 2
- p1 + p3
- (0,0,0,0,0,0,0,0,0),
- 2 2 2 2
- p1*p3*(p1 + p2 + p3 - s*z - z )
- (------------------------------------,0,
- 2 2
- p1 + p3
- 2 2 2 2 2
- p3 *(p1 + p2 + p3 - s*z - z ) - p1*p2*p3*(s + z)
- ----------------------------------,---------------------,p3*(s + z),
- 2 2 2 2
- p1 + p3 p1 + p3
- 2 2 2 2 2
- - p2*p3 *(s + z) - p3 *(p1 + p2 + p3 )
- -------------------,--------------------------,0,
- 2 2 2 2
- p1 + p3 p1 + p3
- 2 2 2
- p1*p3*(p1 + p2 + p3 )
- -------------------------),
- 2 2
- p1 + p3
- 2 2 2
- p1 *p2*(s + z) - p1*p2*p3*(s + z) p1 *p2 *( - s - 2*z)
- (----------------,0,---------------------,----------------------,
- 2 2 2 2 2 2
- p1 + p3 p1 + p3 z*(p1 + p3 )
- 2
- p1*p2*(s + 2*z) p1*p2 *p3*( - s - 2*z) - p1*p2*p3*z
- -----------------,------------------------,---------------,0,
- z 2 2 2 2
- z*(p1 + p3 ) p1 + p3
- 2
- p1 *p2*z
- -----------),
- 2 2
- p1 + p3
- p1*p2*(s + 2*z)
- (p1*(s + z),0,p3*(s + z),-----------------,
- z
- 2 2 2 2
- - p1 *s - 2*p1 *z - p3 *s - 2*p3 *z p2*p3*(s + 2*z)
- --------------------------------------,-----------------,p3*z,0,
- z z
- - p1*z),
- 2 2
- - p1*p2*p3*(s + z) - p2*p3 *(s + z) p1*p2 *p3*( - s - 2*z)
- (---------------------,0,-------------------,------------------------,
- 2 2 2 2 2 2
- p1 + p3 p1 + p3 z*(p1 + p3 )
- 2 2 2
- p2*p3*(s + 2*z) p2 *p3 *( - s - 2*z) - p2*p3 *z p1*p2*p3*z
- -----------------,----------------------,-------------,0,------------
- z 2 2 2 2 2 2
- z*(p1 + p3 ) p1 + p3 p1 + p3
- ),
- 2 2 2 2 2 2 2
- - p1*p3*(p1 + p2 + p3 ) - p3 *(p1 + p2 + p3 )
- (----------------------------,0,--------------------------,
- 2 2 2 2
- p1 + p3 p1 + p3
- 2 2 2 2 2
- - p1*p2*p3*z - p2*p3 *z - p3 *z*(p1 + p2 + p3 )
- ---------------,p3*z,-------------,-------------------------------,0,
- 2 2 2 2 2 2 2 2
- p1 + p3 p1 + p3 p1 *s + p1 *z + p3 *s + p3 *z
- 2 2 2
- p1*p3*z*(p1 + p2 + p3 )
- -------------------------------),
- 2 2 2 2
- p1 *s + p1 *z + p3 *s + p3 *z
- (0,0,0,0,0,0,0,0,0),
- 2 2 2 2 2 2 2 2
- p1 *(p1 + p2 + p3 ) p1*p3*(p1 + p2 + p3 ) p1 *p2*z
- (-----------------------,0,-------------------------,-----------,
- 2 2 2 2 2 2
- p1 + p3 p1 + p3 p1 + p3
- 2 2 2
- p1*p2*p3*z p1*p3*z*(p1 + p2 + p3 )
- - p1*z,------------,-------------------------------,0,
- 2 2 2 2 2 2
- p1 + p3 p1 *s + p1 *z + p3 *s + p3 *z
- 2 2 2 2
- - p1 *z*(p1 + p2 + p3 )
- -------------------------------))
- 2 2 2 2
- p1 *s + p1 *z + p3 *s + p3 *z
- nullspace d1;
- {
- [0]
- [ ]
- [1]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- ,
- [ 0 ]
- [ ]
- [ 0 ]
- [ ]
- [ 0 ]
- [ ]
- [ p3 ]
- [ ]
- [ 0 ]
- [ ]
- [ - p1]
- [ ]
- [ 0 ]
- [ ]
- [ 0 ]
- [ ]
- [ 0 ]
- ,
- [ 0 ]
- [ ]
- [ 0 ]
- [ ]
- [ 0 ]
- [ ]
- [ 0 ]
- [ ]
- [ p2*p3 ]
- [ ]
- [ 2 2]
- [p1 + p3 ]
- [ ]
- [ 0 ]
- [ ]
- [ 0 ]
- [ ]
- [ 0 ]
- ,
- [0 ]
- [ ]
- [0 ]
- [ ]
- [0 ]
- [ ]
- [0 ]
- [ ]
- [0 ]
- [ ]
- [0 ]
- [ ]
- [p1]
- [ ]
- [0 ]
- [ ]
- [p3]
- ,
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [1]
- [ ]
- [0]
- }
- % The following example, by Kenton Yee, was discussed extensively by
- % the sci.math.symbolic newsgroup.
- m := mat((e^(-1), e^(-1), e^(-1), e^(-1), e^(-1), e^(-1), e^(-1), 0),
- (1, 1, 1, 1, 1, 1, 0, 1),(1, 1, 1, 1, 1, 0, 1, 1),
- (1, 1, 1, 1, 0, 1, 1, 1),(1, 1, 1, 0, 1, 1, 1, 1),
- (1, 1, 0, 1, 1, 1, 1, 1),(1, 0, 1, 1, 1, 1, 1, 1),
- (0, e, e, e, e, e, e, e));
- [ 1 1 1 1 1 1 1 ]
- [--- --- --- --- --- --- --- 0]
- [ e e e e e e e ]
- [ ]
- [ 1 1 1 1 1 1 0 1]
- [ ]
- [ 1 1 1 1 1 0 1 1]
- [ ]
- m := [ 1 1 1 1 0 1 1 1]
- [ ]
- [ 1 1 1 0 1 1 1 1]
- [ ]
- [ 1 1 0 1 1 1 1 1]
- [ ]
- [ 1 0 1 1 1 1 1 1]
- [ ]
- [ 0 e e e e e e e]
- eig := mateigen(m,x);
- eig := {{x - 1,
- 3,
- [ 0 ]
- [ ]
- [ - arbcomplex(20)]
- [ ]
- [ - arbcomplex(19)]
- [ ]
- [ - arbcomplex(18)]
- [ ]
- [ arbcomplex(18) ]
- [ ]
- [ arbcomplex(19) ]
- [ ]
- [ arbcomplex(20) ]
- [ ]
- [ 0 ]
- },
- {x + 1,
- 3,
- arbcomplex(23)
- mat((----------------),
- e
- (arbcomplex(22)),
- (arbcomplex(21)),
- (( - arbcomplex(23)*e - arbcomplex(23) - 2*arbcomplex(22)*e
- - 2*arbcomplex(21)*e)/(2*e)),
- (( - arbcomplex(23)*e - arbcomplex(23) - 2*arbcomplex(22)*e
- - 2*arbcomplex(21)*e)/(2*e)),
- (arbcomplex(21)),
- (arbcomplex(22)),
- (arbcomplex(23)))
- },
- 2 2
- { - e *x + e*x - 6*e*x + 7*e - x,
- 1,
- 8 7 7 6 6
- mat(((6*arbcomplex(24)*(e *x + 23*e *x - 7*e + 179*e *x - 119*e
- 5 5 4 4 3 3
- + 565*e *x - 581*e + 768*e *x - 890*e + 565*e *x - 581*e
- 2 2 3 8 7
- + 179*e *x - 119*e + 23*e*x - 7*e + x))/(e *(e *x + 30*e *x
- 7 6 6 5 5
- - 7*e + 333*e *x - 168*e + 1692*e *x - 1365*e
- 4 4 3 3 2
- + 4023*e *x - 4368*e + 4470*e *x - 5145*e + 2663*e *x
- 2
- - 2520*e + 576*e*x - 251*e + 36*x))),
- 9 8 8 7 7
- ((arbcomplex(24)*(e *x + 29*e *x - 7*e + 310*e *x - 161*e
- 6 6 5 5 4
- + 1520*e *x - 1246*e + 3577*e *x - 3836*e + 4283*e *x
- 4 3 3 2 2
- - 4795*e + 2988*e *x - 3065*e + 978*e *x - 672*e + 132*e*x
- 2 8 7 7 6 6
- - 42*e + 6*x))/(e *(e *x + 30*e *x - 7*e + 333*e *x - 168*e
- 5 5 4 4 3
- + 1692*e *x - 1365*e + 4023*e *x - 4368*e + 4470*e *x
- 3 2 2
- - 5145*e + 2663*e *x - 2520*e + 576*e*x - 251*e + 36*x)))
- ,
- 9 8 8 7 7
- ((arbcomplex(24)*(e *x + 29*e *x - 7*e + 310*e *x - 161*e
- 6 6 5 5 4
- + 1520*e *x - 1246*e + 3577*e *x - 3836*e + 4283*e *x
- 4 3 3 2 2
- - 4795*e + 2988*e *x - 3065*e + 978*e *x - 672*e + 132*e*x
- 2 8 7 7 6 6
- - 42*e + 6*x))/(e *(e *x + 30*e *x - 7*e + 333*e *x - 168*e
- 5 5 4 4 3
- + 1692*e *x - 1365*e + 4023*e *x - 4368*e + 4470*e *x
- 3 2 2
- - 5145*e + 2663*e *x - 2520*e + 576*e*x - 251*e + 36*x)))
- ,
- 9 8 8 7 7
- ((arbcomplex(24)*(e *x + 29*e *x - 7*e + 310*e *x - 161*e
- 6 6 5 5 4
- + 1520*e *x - 1246*e + 3577*e *x - 3836*e + 4283*e *x
- 4 3 3 2 2
- - 4795*e + 2988*e *x - 3065*e + 978*e *x - 672*e + 132*e*x
- 2 8 7 7 6 6
- - 42*e + 6*x))/(e *(e *x + 30*e *x - 7*e + 333*e *x - 168*e
- 5 5 4 4 3
- + 1692*e *x - 1365*e + 4023*e *x - 4368*e + 4470*e *x
- 3 2 2
- - 5145*e + 2663*e *x - 2520*e + 576*e*x - 251*e + 36*x)))
- ,
- 9 8 8 7 7
- ((arbcomplex(24)*(e *x + 29*e *x - 7*e + 310*e *x - 161*e
- 6 6 5 5 4
- + 1520*e *x - 1246*e + 3577*e *x - 3836*e + 4283*e *x
- 4 3 3 2 2
- - 4795*e + 2988*e *x - 3065*e + 978*e *x - 672*e + 132*e*x
- 2 8 7 7 6 6
- - 42*e + 6*x))/(e *(e *x + 30*e *x - 7*e + 333*e *x - 168*e
- 5 5 4 4 3
- + 1692*e *x - 1365*e + 4023*e *x - 4368*e + 4470*e *x
- 3 2 2
- - 5145*e + 2663*e *x - 2520*e + 576*e*x - 251*e + 36*x)))
- ,
- 9 8 8 7 7
- ((arbcomplex(24)*(e *x + 29*e *x - 7*e + 310*e *x - 161*e
- 6 6 5 5 4
- + 1520*e *x - 1246*e + 3577*e *x - 3836*e + 4283*e *x
- 4 3 3 2 2
- - 4795*e + 2988*e *x - 3065*e + 978*e *x - 672*e + 132*e*x
- 2 8 7 7 6 6
- - 42*e + 6*x))/(e *(e *x + 30*e *x - 7*e + 333*e *x - 168*e
- 5 5 4 4 3
- + 1692*e *x - 1365*e + 4023*e *x - 4368*e + 4470*e *x
- 3 2 2
- - 5145*e + 2663*e *x - 2520*e + 576*e*x - 251*e + 36*x)))
- ,
- 9 8 8 7 7
- ((arbcomplex(24)*(e *x + 29*e *x - 7*e + 310*e *x - 161*e
- 6 6 5 5 4
- + 1520*e *x - 1246*e + 3577*e *x - 3836*e + 4283*e *x
- 4 3 3 2 2
- - 4795*e + 2988*e *x - 3065*e + 978*e *x - 672*e + 132*e*x
- 2 8 7 7 6 6
- - 42*e + 6*x))/(e *(e *x + 30*e *x - 7*e + 333*e *x - 168*e
- 5 5 4 4 3
- + 1692*e *x - 1365*e + 4023*e *x - 4368*e + 4470*e *x
- 3 2 2
- - 5145*e + 2663*e *x - 2520*e + 576*e*x - 251*e + 36*x)))
- ,
- (arbcomplex(24)))
- }}
- % Now check the eigenvectors and calculate the eigenvalues in the
- % respective eigenspaces:
- factor expt;
- for each eispace in eig do
- begin scalar eivaleq,eival,eivec;
- eival := solve(first eispace,x);
- for each soln in eival do
- <<eival := rhs soln;
- eivec := third eispace;
- eivec := sub(soln,eivec);
- write "eigenvalue = ", eival;
- write "check of eigen equation: ",
- m*eivec - eival*eivec>>
- end;
- eigenvalue = 1
- check of eigen equation:
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- eigenvalue = -1
- check of eigen equation:
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- 4 3 2 2
- sqrt(e + 12*e + 10*e + 12*e + 1) + e + 6*e + 1
- eigenvalue = ----------------------------------------------------
- 2*e
- check of eigen equation:
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- 4 3 2 2
- - sqrt(e + 12*e + 10*e + 12*e + 1) + e + 6*e + 1
- eigenvalue = -------------------------------------------------------
- 2*e
- check of eigen equation:
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- % For the special choice:
- let e = -7 + sqrt 48;
- % we get only 7 eigenvectors.
- eig := mateigen(m,x);
- eig := {{x + 1,
- 4,
- arbcomplex(27)
- mat((----------------),
- 4*sqrt(3) - 7
- (arbcomplex(26)),
- (arbcomplex(25)),
- ((2*sqrt(3)
- *( - arbcomplex(27) - 2*arbcomplex(26) - 2*arbcomplex(25))
- + 3*arbcomplex(27) + 7*arbcomplex(26) + 7*arbcomplex(25))/(
- 4*sqrt(3) - 7)),
- ((2*sqrt(3)
- *( - arbcomplex(27) - 2*arbcomplex(26) - 2*arbcomplex(25))
- + 3*arbcomplex(27) + 7*arbcomplex(26) + 7*arbcomplex(25))/(
- 4*sqrt(3) - 7)),
- (arbcomplex(25)),
- (arbcomplex(26)),
- (arbcomplex(27)))
- },
- {x - 1,
- 3,
- [ 0 ]
- [ ]
- [ - arbcomplex(30)]
- [ ]
- [ - arbcomplex(29)]
- [ ]
- [ - arbcomplex(28)]
- [ ]
- [ arbcomplex(28) ]
- [ ]
- [ arbcomplex(29) ]
- [ ]
- [ arbcomplex(30) ]
- [ ]
- [ 0 ]
- },
- {x + 7,
- 1,
- [ arbcomplex(31) ]
- [ ----------------- ]
- [ 56*sqrt(3) - 97 ]
- [ ]
- [ - 14*sqrt(3)*arbcomplex(31) + 24*arbcomplex(31) ]
- [--------------------------------------------------]
- [ 168*sqrt(3) - 291 ]
- [ ]
- [ - 14*sqrt(3)*arbcomplex(31) + 24*arbcomplex(31) ]
- [--------------------------------------------------]
- [ 168*sqrt(3) - 291 ]
- [ ]
- [ - 14*sqrt(3)*arbcomplex(31) + 24*arbcomplex(31) ]
- [--------------------------------------------------]
- [ 168*sqrt(3) - 291 ]
- [ ]
- [ - 14*sqrt(3)*arbcomplex(31) + 24*arbcomplex(31) ]
- [--------------------------------------------------]
- [ 168*sqrt(3) - 291 ]
- [ ]
- [ - 14*sqrt(3)*arbcomplex(31) + 24*arbcomplex(31) ]
- [--------------------------------------------------]
- [ 168*sqrt(3) - 291 ]
- [ ]
- [ - 14*sqrt(3)*arbcomplex(31) + 24*arbcomplex(31) ]
- [--------------------------------------------------]
- [ 168*sqrt(3) - 291 ]
- [ ]
- [ arbcomplex(31) ]
- }}
- for each eispace in eig do
- begin scalar eivaleq,eival,eivec;
- eival := solve(first eispace,x);
- for each soln in eival do
- <<eival := rhs soln;
- eivec := third eispace;
- eivec := sub(soln,eivec);
- write "eigenvalue = ", eival;
- write "check of eigen equation: ",
- m*eivec - eival*eivec>>
- end;
- eigenvalue = -1
- check of eigen equation:
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- eigenvalue = 1
- check of eigen equation:
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- eigenvalue = -7
- check of eigen equation:
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- % The same behaviour for this choice of e.
- clear e;
- let e = -7 - sqrt 48;
- % we get only 7 eigenvectors.
- eig := mateigen(m,x);
- eig := {{x + 1,
- 4,
- - arbcomplex(34)
- mat((-------------------),
- 4*sqrt(3) + 7
- (arbcomplex(33)),
- (arbcomplex(32)),
- ((2*sqrt(3)
- *( - arbcomplex(34) - 2*arbcomplex(33) - 2*arbcomplex(32))
- - 3*arbcomplex(34) - 7*arbcomplex(33) - 7*arbcomplex(32))/(
- 4*sqrt(3) + 7)),
- ((2*sqrt(3)
- *( - arbcomplex(34) - 2*arbcomplex(33) - 2*arbcomplex(32))
- - 3*arbcomplex(34) - 7*arbcomplex(33) - 7*arbcomplex(32))/(
- 4*sqrt(3) + 7)),
- (arbcomplex(32)),
- (arbcomplex(33)),
- (arbcomplex(34)))
- },
- {x - 1,
- 3,
- [ 0 ]
- [ ]
- [ - arbcomplex(37)]
- [ ]
- [ - arbcomplex(36)]
- [ ]
- [ - arbcomplex(35)]
- [ ]
- [ arbcomplex(35) ]
- [ ]
- [ arbcomplex(36) ]
- [ ]
- [ arbcomplex(37) ]
- [ ]
- [ 0 ]
- },
- {x + 7,
- 1,
- [ - arbcomplex(38) ]
- [ ------------------- ]
- [ 56*sqrt(3) + 97 ]
- [ ]
- [ - 14*sqrt(3)*arbcomplex(38) - 24*arbcomplex(38) ]
- [--------------------------------------------------]
- [ 168*sqrt(3) + 291 ]
- [ ]
- [ - 14*sqrt(3)*arbcomplex(38) - 24*arbcomplex(38) ]
- [--------------------------------------------------]
- [ 168*sqrt(3) + 291 ]
- [ ]
- [ - 14*sqrt(3)*arbcomplex(38) - 24*arbcomplex(38) ]
- [--------------------------------------------------]
- [ 168*sqrt(3) + 291 ]
- [ ]
- [ - 14*sqrt(3)*arbcomplex(38) - 24*arbcomplex(38) ]
- [--------------------------------------------------]
- [ 168*sqrt(3) + 291 ]
- [ ]
- [ - 14*sqrt(3)*arbcomplex(38) - 24*arbcomplex(38) ]
- [--------------------------------------------------]
- [ 168*sqrt(3) + 291 ]
- [ ]
- [ - 14*sqrt(3)*arbcomplex(38) - 24*arbcomplex(38) ]
- [--------------------------------------------------]
- [ 168*sqrt(3) + 291 ]
- [ ]
- [ arbcomplex(38) ]
- }}
- for each eispace in eig do
- begin scalar eivaleq,eival,eivec;
- eival := solve(first eispace,x);
- for each soln in eival do
- <<eival := rhs soln;
- eivec := third eispace;
- eivec := sub(soln,eivec);
- write "eigenvalue = ", eival;
- write "check of eigen equation: ",
- m*eivec - eival*eivec>>
- end;
- eigenvalue = -1
- check of eigen equation:
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- eigenvalue = 1
- check of eigen equation:
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- eigenvalue = -7
- check of eigen equation:
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- % For this choice of values
- clear e;
- let e = 1;
- % the eigenvalue 1 becomes 4-fold degenerate. However, we get a complete
- % span of 8 eigenvectors.
- eig := mateigen(m,x);
- eig := {{x - 1,
- 4,
- [ - arbcomplex(42)]
- [ ]
- [ - arbcomplex(41)]
- [ ]
- [ - arbcomplex(40)]
- [ ]
- [ - arbcomplex(39)]
- [ ]
- [ arbcomplex(39) ]
- [ ]
- [ arbcomplex(40) ]
- [ ]
- [ arbcomplex(41) ]
- [ ]
- [ arbcomplex(42) ]
- },
- {x + 1,
- 3,
- [ arbcomplex(45) ]
- [ ]
- [ arbcomplex(44) ]
- [ ]
- [ arbcomplex(43) ]
- [ ]
- [ - (arbcomplex(45) + arbcomplex(44) + arbcomplex(43))]
- [ ]
- [ - (arbcomplex(45) + arbcomplex(44) + arbcomplex(43))]
- [ ]
- [ arbcomplex(43) ]
- [ ]
- [ arbcomplex(44) ]
- [ ]
- [ arbcomplex(45) ]
- },
- {x - 7,
- 1,
- [arbcomplex(46)]
- [ ]
- [arbcomplex(46)]
- [ ]
- [arbcomplex(46)]
- [ ]
- [arbcomplex(46)]
- [ ]
- [arbcomplex(46)]
- [ ]
- [arbcomplex(46)]
- [ ]
- [arbcomplex(46)]
- [ ]
- [arbcomplex(46)]
- }}
- for each eispace in eig do
- begin scalar eivaleq,eival,eivec;
- eival := solve(first eispace,x);
- for each soln in eival do
- <<eival := rhs soln;
- eivec := third eispace;
- eivec := sub(soln,eivec);
- write "eigenvalue = ", eival;
- write "check of eigen equation: ",
- m*eivec - eival*eivec>>
- end;
- eigenvalue = 1
- check of eigen equation:
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- eigenvalue = -1
- check of eigen equation:
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- eigenvalue = 7
- check of eigen equation:
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- [ ]
- [0]
- ma := mat((1,a),(0,b));
- [1 a]
- ma := [ ]
- [0 b]
- % case 1:
- let a = 0;
- mateigen(ma,x);
- {{x - 1,1,
- [arbcomplex(47)]
- [ ]
- [ 0 ]
- },
- { - b + x,1,
- [ 0 ]
- [ ]
- [arbcomplex(48)]
- }}
- % case 2:
- clear a;
- let a = 0, b = 1;
- mateigen(ma,x);
- {{x - 1,2,
- [arbcomplex(49)]
- [ ]
- [arbcomplex(50)]
- }}
- % case 3:
- clear a,b;
-
- mateigen(ma,x);
- {{ - b + x,
- 1,
- [ arbcomplex(51)*a ]
- [------------------]
- [ b - 1 ]
- [ ]
- [ arbcomplex(51) ]
- },
- {x - 1,1,
- [arbcomplex(52)]
- [ ]
- [ 0 ]
- }}
- % case 4:
- let b = 1;
-
- mateigen(ma,x);
- {{x - 1,2,
- [arbcomplex(53)]
- [ ]
- [ 0 ]
- }}
- % Example from H.G. Graebe:
- m1:=mat((-sqrt(3)+1,2 ,3 ),
- (2 ,-sqrt(3)+3,1 ),
- (3 ,1 ,-sqrt(3)+2));
- [ - sqrt(3) + 1 2 3 ]
- [ ]
- m1 := [ 2 - sqrt(3) + 3 1 ]
- [ ]
- [ 3 1 - sqrt(3) + 2]
- nullspace m1;
- {
- [ 3*sqrt(3) - 7 ]
- [ ]
- [ sqrt(3) + 5 ]
- [ ]
- [ - 4*sqrt(3) + 2]
- }
- for each n in ws collect m1*n;
- {
- [0]
- [ ]
- [0]
- [ ]
- [0]
- }
- end;
- (TIME: matrix 5070 5619)
|