MATRIX.LOG 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201
  1. REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
  2. % Miscellaneous matrix tests.
  3. % Tests of eigenfunction/eigenvalue code.
  4. v := mat((1,1,-1,1,0),(1,2,-1,0,1),(-1,2,3,-1,0),
  5. (1,-2,1,2,-1),(2,1,-1,3,0))$
  6. mateigen(v,et);
  7. {{et - 2,
  8. 1,
  9. [ 0 ]
  10. [ ]
  11. [ 0 ]
  12. [ ]
  13. [arbcomplex(1)]
  14. [ ]
  15. [arbcomplex(1)]
  16. [ ]
  17. [arbcomplex(1)]
  18. },
  19. 4 3 2
  20. {et - 6*et + 13*et + 5*et - 5,
  21. 1,
  22. [ 5*arbcomplex(2)*(et - 2) ]
  23. [ ---------------------------- ]
  24. [ 3 2 ]
  25. [ 2*et - 10*et + 23*et + 5 ]
  26. [ ]
  27. [ 2 ]
  28. [ arbcomplex(2)*et*( - et + 6*et - 8) ]
  29. [--------------------------------------]
  30. [ 3 2 ]
  31. [ 2*et - 10*et + 23*et + 5 ]
  32. [ ]
  33. [ arbcomplex(2)*et*( - 3*et + 7) ]
  34. [ -------------------------------- ]
  35. [ 3 2 ]
  36. [ 2*et - 10*et + 23*et + 5 ]
  37. [ ]
  38. [ 3 2 ]
  39. [ arbcomplex(2)*(et - 4*et + 10) ]
  40. [ ---------------------------------- ]
  41. [ 3 2 ]
  42. [ 2*et - 10*et + 23*et + 5 ]
  43. [ ]
  44. [ arbcomplex(2) ]
  45. }}
  46. eigv := third first ws$
  47. % Now check if the equation for the eigenvectors is fulfilled. Note
  48. % that also the last component is zero due to the eigenvalue equation.
  49. v*eigv-et*eigv;
  50. [ 0 ]
  51. [ ]
  52. [ 0 ]
  53. [ ]
  54. [arbcomplex(1)*( - et + 2)]
  55. [ ]
  56. [arbcomplex(1)*( - et + 2)]
  57. [ ]
  58. [arbcomplex(1)*( - et + 2)]
  59. % Example of degenerate eigenvalues.
  60. u := mat((2,-1,1),(0,1,1),(-1,1,1))$
  61. mateigen(u,eta);
  62. {{eta - 1,2,
  63. [arbcomplex(3)]
  64. [ ]
  65. [arbcomplex(3)]
  66. [ ]
  67. [ 0 ]
  68. },
  69. {eta - 2,1,
  70. [ 0 ]
  71. [ ]
  72. [arbcomplex(4)]
  73. [ ]
  74. [arbcomplex(4)]
  75. }}
  76. % Example of a fourfold degenerate eigenvalue with two corresponding
  77. % eigenvectors.
  78. w := mat((1,-1,1,-1),(-3,3,-5,4),(8,-4,3,-4),
  79. (15,-10,11,-11))$
  80. mateigen(w,al);
  81. {{al + 1,
  82. 4,
  83. [ arbcomplex(5) ]
  84. [ --------------- ]
  85. [ 5 ]
  86. [ ]
  87. [ - 5*arbcomplex(6) + 7*arbcomplex(5) ]
  88. [--------------------------------------]
  89. [ 5 ]
  90. [ ]
  91. [ arbcomplex(5) ]
  92. [ ]
  93. [ arbcomplex(6) ]
  94. }}
  95. eigw := third first ws;
  96. [ arbcomplex(5) ]
  97. [ --------------- ]
  98. [ 5 ]
  99. [ ]
  100. [ - 5*arbcomplex(6) + 7*arbcomplex(5) ]
  101. eigw := [--------------------------------------]
  102. [ 5 ]
  103. [ ]
  104. [ arbcomplex(5) ]
  105. [ ]
  106. [ arbcomplex(6) ]
  107. w*eigw - al*eigw;
  108. [ - arbcomplex(5)*(al + 1) ]
  109. [ --------------------------- ]
  110. [ 5 ]
  111. [ ]
  112. [ 5*arbcomplex(6)*al + 5*arbcomplex(6) - 7*arbcomplex(5)*al - 7*arbcomplex(5) ]
  113. [-----------------------------------------------------------------------------]
  114. [ 5 ]
  115. [ ]
  116. [ - arbcomplex(5)*(al + 1) ]
  117. [ ]
  118. [ - arbcomplex(6)*(al + 1) ]
  119. % Calculate the eigenvectors and eigenvalue equation.
  120. f := mat((0,ex,ey,ez),(-ex,0,bz,-by),(-ey,-bz,0,bx),
  121. (-ez,by,-bx,0))$
  122. factor om;
  123. mateigen(f,om);
  124. 4 2 2 2 2 2 2 2 2 2
  125. {{om + om *(bx + by + bz + ex + ey + ez ) + bx *ex + 2*bx*by*ex*ey
  126. 2 2 2 2
  127. + 2*bx*bz*ex*ez + by *ey + 2*by*bz*ey*ez + bz *ez ,
  128. 1,
  129. 2
  130. mat(((om *arbcomplex(7)*ez + om*arbcomplex(7)*(bx*ey - by*ex)
  131. 3 2 2 2
  132. + arbcomplex(7)*bz*(bx*ex + by*ey + bz*ez))/(om + om*(bz + ex + ey )
  133. )),
  134. 2
  135. (( - om *arbcomplex(7)*by + om*arbcomplex(7)*(bx*bz - ex*ez)
  136. 3 2 2 2
  137. - arbcomplex(7)*ey*(bx*ex + by*ey + bz*ez))/(om + om*(bz + ex + ey )
  138. )),
  139. 2
  140. ((om *arbcomplex(7)*bx + om*arbcomplex(7)*(by*bz - ey*ez)
  141. 3 2 2 2
  142. + arbcomplex(7)*ex*(bx*ex + by*ey + bz*ez))/(om + om*(bz + ex + ey )
  143. )),
  144. (arbcomplex(7)))
  145. }}
  146. % Specialize to perpendicular electric and magnetic field.
  147. let ez=0,ex=0,by=0;
  148. % Note that we find two eigenvectors to the double eigenvalue 0
  149. % (as it must be).
  150. mateigen(f,om);
  151. {{om,
  152. 2,
  153. [ arbcomplex(9)*bx - arbcomplex(8)*bz ]
  154. [-------------------------------------]
  155. [ ey ]
  156. [ ]
  157. [ arbcomplex(8) ]
  158. [ ]
  159. [ 0 ]
  160. [ ]
  161. [ arbcomplex(9) ]
  162. },
  163. 2 2 2 2
  164. {om + bx + bz + ey ,
  165. 1,
  166. [ - arbcomplex(10)*ey ]
  167. [ ---------------------- ]
  168. [ bx ]
  169. [ ]
  170. [ - arbcomplex(10)*bz ]
  171. [ ---------------------- ]
  172. [ bx ]
  173. [ ]
  174. [ 2 2 2 ]
  175. [ arbcomplex(10)*(bx + bz + ey ) ]
  176. [----------------------------------]
  177. [ om*bx ]
  178. [ ]
  179. [ arbcomplex(10) ]
  180. }}
  181. % The following has 1 as a double eigenvalue. The corresponding
  182. % eigenvector must involve two arbitrary constants.
  183. j := mat((9/8,1/4,-sqrt(3)/8),
  184. (1/4,3/2,-sqrt(3)/4),
  185. (-sqrt(3)/8,-sqrt(3)/4,11/8));
  186. [ 9 1 - sqrt(3) ]
  187. [ --- --- ------------]
  188. [ 8 4 8 ]
  189. [ ]
  190. [ 1 3 - sqrt(3) ]
  191. j := [ --- --- ------------]
  192. [ 4 2 4 ]
  193. [ ]
  194. [ - sqrt(3) - sqrt(3) 11 ]
  195. [------------ ------------ ---- ]
  196. [ 8 4 8 ]
  197. mateigen(j,x);
  198. {{x - 1,
  199. 2,
  200. [sqrt(3)*arbcomplex(12) - 2*arbcomplex(11)]
  201. [ ]
  202. [ arbcomplex(11) ]
  203. [ ]
  204. [ arbcomplex(12) ]
  205. },
  206. {x - 2,
  207. 1,
  208. [ - sqrt(3)*arbcomplex(13) ]
  209. [ --------------------------- ]
  210. [ 3 ]
  211. [ ]
  212. [ - 2*sqrt(3)*arbcomplex(13) ]
  213. [-----------------------------]
  214. [ 3 ]
  215. [ ]
  216. [ arbcomplex(13) ]
  217. }}
  218. % The following is a good consistency check.
  219. sym := mat(
  220. (0, 1/2, 1/(2*sqrt(2)), 0, 0),
  221. (1/2, 0, 1/(2*sqrt(2)), 0, 0),
  222. (1/(2*sqrt(2)), 1/(2*sqrt(2)), 0, 1/2, 1/2),
  223. (0, 0, 1/2, 0, 0),
  224. (0, 0, 1/2, 0, 0))$
  225. ans := mateigen(sym,eta);
  226. ans := {{eta,
  227. 1,
  228. [ 0 ]
  229. [ ]
  230. [ 0 ]
  231. [ ]
  232. [ 0 ]
  233. [ ]
  234. [ - arbcomplex(14)]
  235. [ ]
  236. [ arbcomplex(14) ]
  237. },
  238. {eta - 1,
  239. 1,
  240. [ 2*arbcomplex(15) ]
  241. [------------------]
  242. [ sqrt(2) ]
  243. [ ]
  244. [ 2*arbcomplex(15) ]
  245. [------------------]
  246. [ sqrt(2) ]
  247. [ ]
  248. [ 2*arbcomplex(15) ]
  249. [ ]
  250. [ arbcomplex(15) ]
  251. [ ]
  252. [ arbcomplex(15) ]
  253. },
  254. {2*eta + 1,
  255. 1,
  256. [ - arbcomplex(16)]
  257. [ ]
  258. [ arbcomplex(16) ]
  259. [ ]
  260. [ 0 ]
  261. [ ]
  262. [ 0 ]
  263. [ ]
  264. [ 0 ]
  265. },
  266. 2
  267. {4*eta + 2*eta - 1,
  268. 1,
  269. [ - arbcomplex(17) ]
  270. [ ------------------- ]
  271. [ 2*sqrt(2)*eta ]
  272. [ ]
  273. [ - arbcomplex(17) ]
  274. [ ------------------- ]
  275. [ 2*sqrt(2)*eta ]
  276. [ ]
  277. [ arbcomplex(17)*( - 2*eta + 1) ]
  278. [-------------------------------]
  279. [ 2*eta ]
  280. [ ]
  281. [ arbcomplex(17) ]
  282. [ ]
  283. [ arbcomplex(17) ]
  284. }}
  285. % Check of correctness for this example.
  286. for each j in ans do
  287. for each k in solve(first j,eta) do
  288. write sub(k,sym*third j - eta*third j);
  289. [0]
  290. [ ]
  291. [0]
  292. [ ]
  293. [0]
  294. [ ]
  295. [0]
  296. [ ]
  297. [0]
  298. [0]
  299. [ ]
  300. [0]
  301. [ ]
  302. [0]
  303. [ ]
  304. [0]
  305. [ ]
  306. [0]
  307. [0]
  308. [ ]
  309. [0]
  310. [ ]
  311. [0]
  312. [ ]
  313. [0]
  314. [ ]
  315. [0]
  316. [0]
  317. [ ]
  318. [0]
  319. [ ]
  320. [0]
  321. [ ]
  322. [0]
  323. [ ]
  324. [0]
  325. [0]
  326. [ ]
  327. [0]
  328. [ ]
  329. [0]
  330. [ ]
  331. [0]
  332. [ ]
  333. [0]
  334. % Tests of nullspace operator.
  335. a1 := mat((1,2,3,4),(5,6,7,8));
  336. [1 2 3 4]
  337. a1 := [ ]
  338. [5 6 7 8]
  339. nullspace a1;
  340. {
  341. [ 1 ]
  342. [ ]
  343. [ 0 ]
  344. [ ]
  345. [ - 3]
  346. [ ]
  347. [ 2 ]
  348. ,
  349. [ 0 ]
  350. [ ]
  351. [ 1 ]
  352. [ ]
  353. [ - 2]
  354. [ ]
  355. [ 1 ]
  356. }
  357. b1 := {{1,2,3,4},{5,6,7,8}};
  358. b1 := {{1,2,3,4},{5,6,7,8}}
  359. nullspace b1;
  360. {{1,0,-3,2},{0,1,-2,1}}
  361. % Example taken from a bug report for another CA system.
  362. c1 :=
  363. {{(p1**2*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2), 0,
  364. (p1*p3*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2),
  365. -((p1**2*p2*(s + z))/(p1**2 + p3**2)), p1*(s + z),
  366. -((p1*p2*p3*(s + z))/(p1**2 + p3**2)),
  367. -((p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)), 0,
  368. (p1**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)},
  369. {0, 0, 0, 0, 0, 0, 0, 0, 0},
  370. {(p1*p3*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2), 0,
  371. (p3**2*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2),
  372. -((p1*p2*p3*(s + z))/(p1**2 + p3**2)), p3*(s + z),
  373. -((p2*p3**2*(s + z))/(p1**2 + p3**2)),
  374. -((p3**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)), 0,
  375. (p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)},
  376. {-((p1**2*p2*(s + z))/(p1**2 + p3**2)), 0,
  377. -((p1*p2*p3*(s + z))/(p1**2 + p3**2)),
  378. -((p1**2*p2**2*(s + 2*z))/((p1**2 + p3**2)*z)), (p1*p2*(s + 2*z))/z,
  379. -((p1*p2**2*p3*(s + 2*z))/((p1**2 + p3**2)*z)),
  380. -((p1*p2*p3*z)/(p1**2 + p3**2)), 0, (p1**2*p2*z)/(p1**2 + p3**2)},
  381. {p1*(s + z), 0, p3*(s + z), (p1*p2*(s + 2*z))/z,
  382. -(((p1**2+p3**2)*(s+ 2*z))/z), (p2*p3*(s + 2*z))/z, p3*z,0, -(p1*z)},
  383. {-((p1*p2*p3*(s + z))/(p1**2 + p3**2)), 0,
  384. -((p2*p3**2*(s + z))/(p1**2 + p3**2)),
  385. -((p1*p2**2*p3*(s + 2*z))/((p1**2 + p3**2)*z)), (p2*p3*(s + 2*z))/z,
  386. -((p2**2*p3**2*(s + 2*z))/((p1**2 + p3**2)*z)),
  387. -((p2*p3**2*z)/(p1**2 + p3**2)), 0, (p1*p2*p3*z)/(p1**2 + p3**2)},
  388. {-((p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)), 0,
  389. -((p3**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)),
  390. -((p1*p2*p3*z)/(p1**2 + p3**2)),p3*z,-((p2*p3**2*z)/(p1**2 + p3**2)),
  391. -((p3**2*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z))), 0,
  392. (p1*p3*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z))},
  393. {0, 0, 0, 0, 0, 0, 0, 0, 0},
  394. {(p1**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2), 0,
  395. (p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2),
  396. (p1**2*p2*z)/(p1**2 + p3**2), -(p1*z), (p1*p2*p3*z)/(p1**2 + p3**2),
  397. (p1*p3*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z)), 0,
  398. -((p1**2*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z)))}};
  399. 2 2 2 2 2
  400. p1 *(p1 + p2 + p3 - s*z - z )
  401. c1 := {{----------------------------------,
  402. 2 2
  403. p1 + p3
  404. 0,
  405. 2 2 2 2
  406. p1*p3*(p1 + p2 + p3 - s*z - z )
  407. ------------------------------------,
  408. 2 2
  409. p1 + p3
  410. 2
  411. - p1 *p2*(s + z)
  412. -------------------,
  413. 2 2
  414. p1 + p3
  415. p1*(s + z),
  416. - p1*p2*p3*(s + z)
  417. ---------------------,
  418. 2 2
  419. p1 + p3
  420. 2 2 2
  421. - p1*p3*(p1 + p2 + p3 )
  422. ----------------------------,
  423. 2 2
  424. p1 + p3
  425. 0,
  426. 2 2 2 2
  427. p1 *(p1 + p2 + p3 )
  428. -----------------------},
  429. 2 2
  430. p1 + p3
  431. {0,0,0,0,0,0,0,0,0},
  432. 2 2 2 2
  433. p1*p3*(p1 + p2 + p3 - s*z - z )
  434. {------------------------------------,
  435. 2 2
  436. p1 + p3
  437. 0,
  438. 2 2 2 2 2
  439. p3 *(p1 + p2 + p3 - s*z - z )
  440. ----------------------------------,
  441. 2 2
  442. p1 + p3
  443. - p1*p2*p3*(s + z)
  444. ---------------------,
  445. 2 2
  446. p1 + p3
  447. p3*(s + z),
  448. 2
  449. - p2*p3 *(s + z)
  450. -------------------,
  451. 2 2
  452. p1 + p3
  453. 2 2 2 2
  454. - p3 *(p1 + p2 + p3 )
  455. --------------------------,
  456. 2 2
  457. p1 + p3
  458. 0,
  459. 2 2 2
  460. p1*p3*(p1 + p2 + p3 )
  461. -------------------------},
  462. 2 2
  463. p1 + p3
  464. 2
  465. - p1 *p2*(s + z)
  466. {-------------------,
  467. 2 2
  468. p1 + p3
  469. 0,
  470. - p1*p2*p3*(s + z)
  471. ---------------------,
  472. 2 2
  473. p1 + p3
  474. 2 2
  475. p1 *p2 *( - s - 2*z)
  476. ----------------------,
  477. 2 2
  478. z*(p1 + p3 )
  479. p1*p2*(s + 2*z)
  480. -----------------,
  481. z
  482. 2
  483. p1*p2 *p3*( - s - 2*z)
  484. ------------------------,
  485. 2 2
  486. z*(p1 + p3 )
  487. - p1*p2*p3*z
  488. ---------------,
  489. 2 2
  490. p1 + p3
  491. 0,
  492. 2
  493. p1 *p2*z
  494. -----------},
  495. 2 2
  496. p1 + p3
  497. {p1*(s + z),
  498. 0,
  499. p3*(s + z),
  500. p1*p2*(s + 2*z)
  501. -----------------,
  502. z
  503. 2 2 2 2
  504. - p1 *s - 2*p1 *z - p3 *s - 2*p3 *z
  505. --------------------------------------,
  506. z
  507. p2*p3*(s + 2*z)
  508. -----------------,
  509. z
  510. p3*z,
  511. 0,
  512. - p1*z},
  513. - p1*p2*p3*(s + z)
  514. {---------------------,
  515. 2 2
  516. p1 + p3
  517. 0,
  518. 2
  519. - p2*p3 *(s + z)
  520. -------------------,
  521. 2 2
  522. p1 + p3
  523. 2
  524. p1*p2 *p3*( - s - 2*z)
  525. ------------------------,
  526. 2 2
  527. z*(p1 + p3 )
  528. p2*p3*(s + 2*z)
  529. -----------------,
  530. z
  531. 2 2
  532. p2 *p3 *( - s - 2*z)
  533. ----------------------,
  534. 2 2
  535. z*(p1 + p3 )
  536. 2
  537. - p2*p3 *z
  538. -------------,
  539. 2 2
  540. p1 + p3
  541. 0,
  542. p1*p2*p3*z
  543. ------------},
  544. 2 2
  545. p1 + p3
  546. 2 2 2
  547. - p1*p3*(p1 + p2 + p3 )
  548. {----------------------------,
  549. 2 2
  550. p1 + p3
  551. 0,
  552. 2 2 2 2
  553. - p3 *(p1 + p2 + p3 )
  554. --------------------------,
  555. 2 2
  556. p1 + p3
  557. - p1*p2*p3*z
  558. ---------------,
  559. 2 2
  560. p1 + p3
  561. p3*z,
  562. 2
  563. - p2*p3 *z
  564. -------------,
  565. 2 2
  566. p1 + p3
  567. 2 2 2 2
  568. - p3 *z*(p1 + p2 + p3 )
  569. -------------------------------,
  570. 2 2 2 2
  571. p1 *s + p1 *z + p3 *s + p3 *z
  572. 0,
  573. 2 2 2
  574. p1*p3*z*(p1 + p2 + p3 )
  575. -------------------------------},
  576. 2 2 2 2
  577. p1 *s + p1 *z + p3 *s + p3 *z
  578. {0,0,0,0,0,0,0,0,0},
  579. 2 2 2 2
  580. p1 *(p1 + p2 + p3 )
  581. {-----------------------,
  582. 2 2
  583. p1 + p3
  584. 0,
  585. 2 2 2
  586. p1*p3*(p1 + p2 + p3 )
  587. -------------------------,
  588. 2 2
  589. p1 + p3
  590. 2
  591. p1 *p2*z
  592. -----------,
  593. 2 2
  594. p1 + p3
  595. - p1*z,
  596. p1*p2*p3*z
  597. ------------,
  598. 2 2
  599. p1 + p3
  600. 2 2 2
  601. p1*p3*z*(p1 + p2 + p3 )
  602. -------------------------------,
  603. 2 2 2 2
  604. p1 *s + p1 *z + p3 *s + p3 *z
  605. 0,
  606. 2 2 2 2
  607. - p1 *z*(p1 + p2 + p3 )
  608. -------------------------------}}
  609. 2 2 2 2
  610. p1 *s + p1 *z + p3 *s + p3 *z
  611. nullspace c1;
  612. {{p3,0, - p1,0,0,0,0,0,0},
  613. {0,1,0,0,0,0,0,0,0},
  614. {0,0,0,p3,0, - p1,0,0,0},
  615. 2 2
  616. {0,0,0,0,p2*p3,p1 + p3 ,0,0,0},
  617. {0,0,0,0,0,0,p1,0,p3},
  618. {0,0,0,0,0,0,0,1,0}}
  619. d1 := mat
  620. (((p1**2*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2), 0,
  621. (p1*p3*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2),
  622. -((p1**2*p2*(s + z))/(p1**2 + p3**2)), p1*(s + z),
  623. -((p1*p2*p3*(s + z))/(p1**2 + p3**2)),
  624. -((p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)), 0,
  625. (p1**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)),
  626. (0, 0, 0, 0, 0, 0, 0, 0, 0),
  627. ((p1*p3*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2), 0,
  628. (p3**2*(p1**2 + p2**2 + p3**2 - s*z - z**2))/(p1**2 + p3**2),
  629. -((p1*p2*p3*(s + z))/(p1**2 + p3**2)), p3*(s + z),
  630. -((p2*p3**2*(s + z))/(p1**2 + p3**2)),
  631. -((p3**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)), 0,
  632. (p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)),
  633. ( ((p1**2*p2*(s + z))/(p1**2 + p3**2)), 0,
  634. -((p1*p2*p3*(s + z))/(p1**2 + p3**2)),
  635. -((p1**2*p2**2*(s + 2*z))/((p1**2 + p3**2)*z)), (p1*p2*(s + 2*z))/z,
  636. -((p1*p2**2*p3*(s + 2*z))/((p1**2 + p3**2)*z)),
  637. -((p1*p2*p3*z)/(p1**2 + p3**2)), 0, (p1**2*p2*z)/(p1**2 + p3**2)),
  638. (p1*(s + z), 0, p3*(s + z), (p1*p2*(s + 2*z))/z,
  639. -(((p1**2 + p3**2)*(s + 2*z))/z),(p2*p3*(s + 2*z))/z,p3*z,0,-(p1*z)),
  640. (-((p1*p2*p3*(s + z))/(p1**2 + p3**2)), 0,
  641. -((p2*p3**2*(s + z))/(p1**2 + p3**2)),
  642. -((p1*p2**2*p3*(s + 2*z))/((p1**2 + p3**2)*z)), (p2*p3*(s + 2*z))/z,
  643. -((p2**2*p3**2*(s + 2*z))/((p1**2 + p3**2)*z)),
  644. -((p2*p3**2*z)/(p1**2 + p3**2)), 0, (p1*p2*p3*z)/(p1**2 + p3**2)),
  645. (-((p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)), 0,
  646. -((p3**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2)),
  647. -((p1*p2*p3*z)/(p1**2 + p3**2)),p3*z,-((p2*p3**2*z)/(p1**2 + p3**2)),
  648. -((p3**2*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z))), 0,
  649. (p1*p3*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z))),
  650. (0, 0, 0, 0, 0, 0, 0, 0, 0),
  651. ((p1**2*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2), 0,
  652. (p1*p3*(p1**2 + p2**2 + p3**2))/(p1**2 + p3**2),
  653. (p1**2*p2*z)/(p1**2 + p3**2), -(p1*z), (p1*p2*p3*z)/(p1**2 + p3**2),
  654. (p1*p3*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z)), 0,
  655. -((p1**2*(p1**2 + p2**2 + p3**2)*z)/((p1**2 + p3**2)*(s + z)))));
  656. 2 2 2 2 2
  657. p1 *(p1 + p2 + p3 - s*z - z )
  658. d1 := mat((----------------------------------,0,
  659. 2 2
  660. p1 + p3
  661. 2 2 2 2 2
  662. p1*p3*(p1 + p2 + p3 - s*z - z ) - p1 *p2*(s + z)
  663. ------------------------------------,-------------------,p1*(s + z),
  664. 2 2 2 2
  665. p1 + p3 p1 + p3
  666. 2 2 2
  667. - p1*p2*p3*(s + z) - p1*p3*(p1 + p2 + p3 )
  668. ---------------------,----------------------------,0,
  669. 2 2 2 2
  670. p1 + p3 p1 + p3
  671. 2 2 2 2
  672. p1 *(p1 + p2 + p3 )
  673. -----------------------),
  674. 2 2
  675. p1 + p3
  676. (0,0,0,0,0,0,0,0,0),
  677. 2 2 2 2
  678. p1*p3*(p1 + p2 + p3 - s*z - z )
  679. (------------------------------------,0,
  680. 2 2
  681. p1 + p3
  682. 2 2 2 2 2
  683. p3 *(p1 + p2 + p3 - s*z - z ) - p1*p2*p3*(s + z)
  684. ----------------------------------,---------------------,p3*(s + z),
  685. 2 2 2 2
  686. p1 + p3 p1 + p3
  687. 2 2 2 2 2
  688. - p2*p3 *(s + z) - p3 *(p1 + p2 + p3 )
  689. -------------------,--------------------------,0,
  690. 2 2 2 2
  691. p1 + p3 p1 + p3
  692. 2 2 2
  693. p1*p3*(p1 + p2 + p3 )
  694. -------------------------),
  695. 2 2
  696. p1 + p3
  697. 2 2 2
  698. p1 *p2*(s + z) - p1*p2*p3*(s + z) p1 *p2 *( - s - 2*z)
  699. (----------------,0,---------------------,----------------------,
  700. 2 2 2 2 2 2
  701. p1 + p3 p1 + p3 z*(p1 + p3 )
  702. 2
  703. p1*p2*(s + 2*z) p1*p2 *p3*( - s - 2*z) - p1*p2*p3*z
  704. -----------------,------------------------,---------------,0,
  705. z 2 2 2 2
  706. z*(p1 + p3 ) p1 + p3
  707. 2
  708. p1 *p2*z
  709. -----------),
  710. 2 2
  711. p1 + p3
  712. p1*p2*(s + 2*z)
  713. (p1*(s + z),0,p3*(s + z),-----------------,
  714. z
  715. 2 2 2 2
  716. - p1 *s - 2*p1 *z - p3 *s - 2*p3 *z p2*p3*(s + 2*z)
  717. --------------------------------------,-----------------,p3*z,0,
  718. z z
  719. - p1*z),
  720. 2 2
  721. - p1*p2*p3*(s + z) - p2*p3 *(s + z) p1*p2 *p3*( - s - 2*z)
  722. (---------------------,0,-------------------,------------------------,
  723. 2 2 2 2 2 2
  724. p1 + p3 p1 + p3 z*(p1 + p3 )
  725. 2 2 2
  726. p2*p3*(s + 2*z) p2 *p3 *( - s - 2*z) - p2*p3 *z p1*p2*p3*z
  727. -----------------,----------------------,-------------,0,------------
  728. z 2 2 2 2 2 2
  729. z*(p1 + p3 ) p1 + p3 p1 + p3
  730. ),
  731. 2 2 2 2 2 2 2
  732. - p1*p3*(p1 + p2 + p3 ) - p3 *(p1 + p2 + p3 )
  733. (----------------------------,0,--------------------------,
  734. 2 2 2 2
  735. p1 + p3 p1 + p3
  736. 2 2 2 2 2
  737. - p1*p2*p3*z - p2*p3 *z - p3 *z*(p1 + p2 + p3 )
  738. ---------------,p3*z,-------------,-------------------------------,0,
  739. 2 2 2 2 2 2 2 2
  740. p1 + p3 p1 + p3 p1 *s + p1 *z + p3 *s + p3 *z
  741. 2 2 2
  742. p1*p3*z*(p1 + p2 + p3 )
  743. -------------------------------),
  744. 2 2 2 2
  745. p1 *s + p1 *z + p3 *s + p3 *z
  746. (0,0,0,0,0,0,0,0,0),
  747. 2 2 2 2 2 2 2 2
  748. p1 *(p1 + p2 + p3 ) p1*p3*(p1 + p2 + p3 ) p1 *p2*z
  749. (-----------------------,0,-------------------------,-----------,
  750. 2 2 2 2 2 2
  751. p1 + p3 p1 + p3 p1 + p3
  752. 2 2 2
  753. p1*p2*p3*z p1*p3*z*(p1 + p2 + p3 )
  754. - p1*z,------------,-------------------------------,0,
  755. 2 2 2 2 2 2
  756. p1 + p3 p1 *s + p1 *z + p3 *s + p3 *z
  757. 2 2 2 2
  758. - p1 *z*(p1 + p2 + p3 )
  759. -------------------------------))
  760. 2 2 2 2
  761. p1 *s + p1 *z + p3 *s + p3 *z
  762. nullspace d1;
  763. {
  764. [0]
  765. [ ]
  766. [1]
  767. [ ]
  768. [0]
  769. [ ]
  770. [0]
  771. [ ]
  772. [0]
  773. [ ]
  774. [0]
  775. [ ]
  776. [0]
  777. [ ]
  778. [0]
  779. [ ]
  780. [0]
  781. ,
  782. [ 0 ]
  783. [ ]
  784. [ 0 ]
  785. [ ]
  786. [ 0 ]
  787. [ ]
  788. [ p3 ]
  789. [ ]
  790. [ 0 ]
  791. [ ]
  792. [ - p1]
  793. [ ]
  794. [ 0 ]
  795. [ ]
  796. [ 0 ]
  797. [ ]
  798. [ 0 ]
  799. ,
  800. [ 0 ]
  801. [ ]
  802. [ 0 ]
  803. [ ]
  804. [ 0 ]
  805. [ ]
  806. [ 0 ]
  807. [ ]
  808. [ p2*p3 ]
  809. [ ]
  810. [ 2 2]
  811. [p1 + p3 ]
  812. [ ]
  813. [ 0 ]
  814. [ ]
  815. [ 0 ]
  816. [ ]
  817. [ 0 ]
  818. ,
  819. [0 ]
  820. [ ]
  821. [0 ]
  822. [ ]
  823. [0 ]
  824. [ ]
  825. [0 ]
  826. [ ]
  827. [0 ]
  828. [ ]
  829. [0 ]
  830. [ ]
  831. [p1]
  832. [ ]
  833. [0 ]
  834. [ ]
  835. [p3]
  836. ,
  837. [0]
  838. [ ]
  839. [0]
  840. [ ]
  841. [0]
  842. [ ]
  843. [0]
  844. [ ]
  845. [0]
  846. [ ]
  847. [0]
  848. [ ]
  849. [0]
  850. [ ]
  851. [1]
  852. [ ]
  853. [0]
  854. }
  855. % The following example, by Kenton Yee, was discussed extensively by
  856. % the sci.math.symbolic newsgroup.
  857. m := mat((e^(-1), e^(-1), e^(-1), e^(-1), e^(-1), e^(-1), e^(-1), 0),
  858. (1, 1, 1, 1, 1, 1, 0, 1),(1, 1, 1, 1, 1, 0, 1, 1),
  859. (1, 1, 1, 1, 0, 1, 1, 1),(1, 1, 1, 0, 1, 1, 1, 1),
  860. (1, 1, 0, 1, 1, 1, 1, 1),(1, 0, 1, 1, 1, 1, 1, 1),
  861. (0, e, e, e, e, e, e, e));
  862. [ 1 1 1 1 1 1 1 ]
  863. [--- --- --- --- --- --- --- 0]
  864. [ e e e e e e e ]
  865. [ ]
  866. [ 1 1 1 1 1 1 0 1]
  867. [ ]
  868. [ 1 1 1 1 1 0 1 1]
  869. [ ]
  870. m := [ 1 1 1 1 0 1 1 1]
  871. [ ]
  872. [ 1 1 1 0 1 1 1 1]
  873. [ ]
  874. [ 1 1 0 1 1 1 1 1]
  875. [ ]
  876. [ 1 0 1 1 1 1 1 1]
  877. [ ]
  878. [ 0 e e e e e e e]
  879. eig := mateigen(m,x);
  880. eig := {{x - 1,
  881. 3,
  882. [ 0 ]
  883. [ ]
  884. [ - arbcomplex(20)]
  885. [ ]
  886. [ - arbcomplex(19)]
  887. [ ]
  888. [ - arbcomplex(18)]
  889. [ ]
  890. [ arbcomplex(18) ]
  891. [ ]
  892. [ arbcomplex(19) ]
  893. [ ]
  894. [ arbcomplex(20) ]
  895. [ ]
  896. [ 0 ]
  897. },
  898. {x + 1,
  899. 3,
  900. arbcomplex(23)
  901. mat((----------------),
  902. e
  903. (arbcomplex(22)),
  904. (arbcomplex(21)),
  905. (( - arbcomplex(23)*e - arbcomplex(23) - 2*arbcomplex(22)*e
  906. - 2*arbcomplex(21)*e)/(2*e)),
  907. (( - arbcomplex(23)*e - arbcomplex(23) - 2*arbcomplex(22)*e
  908. - 2*arbcomplex(21)*e)/(2*e)),
  909. (arbcomplex(21)),
  910. (arbcomplex(22)),
  911. (arbcomplex(23)))
  912. },
  913. 2 2
  914. { - e *x + e*x - 6*e*x + 7*e - x,
  915. 1,
  916. 8 7 7 6 6
  917. mat(((6*arbcomplex(24)*(e *x + 23*e *x - 7*e + 179*e *x - 119*e
  918. 5 5 4 4 3 3
  919. + 565*e *x - 581*e + 768*e *x - 890*e + 565*e *x - 581*e
  920. 2 2 3 8 7
  921. + 179*e *x - 119*e + 23*e*x - 7*e + x))/(e *(e *x + 30*e *x
  922. 7 6 6 5 5
  923. - 7*e + 333*e *x - 168*e + 1692*e *x - 1365*e
  924. 4 4 3 3 2
  925. + 4023*e *x - 4368*e + 4470*e *x - 5145*e + 2663*e *x
  926. 2
  927. - 2520*e + 576*e*x - 251*e + 36*x))),
  928. 9 8 8 7 7
  929. ((arbcomplex(24)*(e *x + 29*e *x - 7*e + 310*e *x - 161*e
  930. 6 6 5 5 4
  931. + 1520*e *x - 1246*e + 3577*e *x - 3836*e + 4283*e *x
  932. 4 3 3 2 2
  933. - 4795*e + 2988*e *x - 3065*e + 978*e *x - 672*e + 132*e*x
  934. 2 8 7 7 6 6
  935. - 42*e + 6*x))/(e *(e *x + 30*e *x - 7*e + 333*e *x - 168*e
  936. 5 5 4 4 3
  937. + 1692*e *x - 1365*e + 4023*e *x - 4368*e + 4470*e *x
  938. 3 2 2
  939. - 5145*e + 2663*e *x - 2520*e + 576*e*x - 251*e + 36*x)))
  940. ,
  941. 9 8 8 7 7
  942. ((arbcomplex(24)*(e *x + 29*e *x - 7*e + 310*e *x - 161*e
  943. 6 6 5 5 4
  944. + 1520*e *x - 1246*e + 3577*e *x - 3836*e + 4283*e *x
  945. 4 3 3 2 2
  946. - 4795*e + 2988*e *x - 3065*e + 978*e *x - 672*e + 132*e*x
  947. 2 8 7 7 6 6
  948. - 42*e + 6*x))/(e *(e *x + 30*e *x - 7*e + 333*e *x - 168*e
  949. 5 5 4 4 3
  950. + 1692*e *x - 1365*e + 4023*e *x - 4368*e + 4470*e *x
  951. 3 2 2
  952. - 5145*e + 2663*e *x - 2520*e + 576*e*x - 251*e + 36*x)))
  953. ,
  954. 9 8 8 7 7
  955. ((arbcomplex(24)*(e *x + 29*e *x - 7*e + 310*e *x - 161*e
  956. 6 6 5 5 4
  957. + 1520*e *x - 1246*e + 3577*e *x - 3836*e + 4283*e *x
  958. 4 3 3 2 2
  959. - 4795*e + 2988*e *x - 3065*e + 978*e *x - 672*e + 132*e*x
  960. 2 8 7 7 6 6
  961. - 42*e + 6*x))/(e *(e *x + 30*e *x - 7*e + 333*e *x - 168*e
  962. 5 5 4 4 3
  963. + 1692*e *x - 1365*e + 4023*e *x - 4368*e + 4470*e *x
  964. 3 2 2
  965. - 5145*e + 2663*e *x - 2520*e + 576*e*x - 251*e + 36*x)))
  966. ,
  967. 9 8 8 7 7
  968. ((arbcomplex(24)*(e *x + 29*e *x - 7*e + 310*e *x - 161*e
  969. 6 6 5 5 4
  970. + 1520*e *x - 1246*e + 3577*e *x - 3836*e + 4283*e *x
  971. 4 3 3 2 2
  972. - 4795*e + 2988*e *x - 3065*e + 978*e *x - 672*e + 132*e*x
  973. 2 8 7 7 6 6
  974. - 42*e + 6*x))/(e *(e *x + 30*e *x - 7*e + 333*e *x - 168*e
  975. 5 5 4 4 3
  976. + 1692*e *x - 1365*e + 4023*e *x - 4368*e + 4470*e *x
  977. 3 2 2
  978. - 5145*e + 2663*e *x - 2520*e + 576*e*x - 251*e + 36*x)))
  979. ,
  980. 9 8 8 7 7
  981. ((arbcomplex(24)*(e *x + 29*e *x - 7*e + 310*e *x - 161*e
  982. 6 6 5 5 4
  983. + 1520*e *x - 1246*e + 3577*e *x - 3836*e + 4283*e *x
  984. 4 3 3 2 2
  985. - 4795*e + 2988*e *x - 3065*e + 978*e *x - 672*e + 132*e*x
  986. 2 8 7 7 6 6
  987. - 42*e + 6*x))/(e *(e *x + 30*e *x - 7*e + 333*e *x - 168*e
  988. 5 5 4 4 3
  989. + 1692*e *x - 1365*e + 4023*e *x - 4368*e + 4470*e *x
  990. 3 2 2
  991. - 5145*e + 2663*e *x - 2520*e + 576*e*x - 251*e + 36*x)))
  992. ,
  993. 9 8 8 7 7
  994. ((arbcomplex(24)*(e *x + 29*e *x - 7*e + 310*e *x - 161*e
  995. 6 6 5 5 4
  996. + 1520*e *x - 1246*e + 3577*e *x - 3836*e + 4283*e *x
  997. 4 3 3 2 2
  998. - 4795*e + 2988*e *x - 3065*e + 978*e *x - 672*e + 132*e*x
  999. 2 8 7 7 6 6
  1000. - 42*e + 6*x))/(e *(e *x + 30*e *x - 7*e + 333*e *x - 168*e
  1001. 5 5 4 4 3
  1002. + 1692*e *x - 1365*e + 4023*e *x - 4368*e + 4470*e *x
  1003. 3 2 2
  1004. - 5145*e + 2663*e *x - 2520*e + 576*e*x - 251*e + 36*x)))
  1005. ,
  1006. (arbcomplex(24)))
  1007. }}
  1008. % Now check the eigenvectors and calculate the eigenvalues in the
  1009. % respective eigenspaces:
  1010. factor expt;
  1011. for each eispace in eig do
  1012. begin scalar eivaleq,eival,eivec;
  1013. eival := solve(first eispace,x);
  1014. for each soln in eival do
  1015. <<eival := rhs soln;
  1016. eivec := third eispace;
  1017. eivec := sub(soln,eivec);
  1018. write "eigenvalue = ", eival;
  1019. write "check of eigen equation: ",
  1020. m*eivec - eival*eivec>>
  1021. end;
  1022. eigenvalue = 1
  1023. check of eigen equation:
  1024. [0]
  1025. [ ]
  1026. [0]
  1027. [ ]
  1028. [0]
  1029. [ ]
  1030. [0]
  1031. [ ]
  1032. [0]
  1033. [ ]
  1034. [0]
  1035. [ ]
  1036. [0]
  1037. [ ]
  1038. [0]
  1039. eigenvalue = -1
  1040. check of eigen equation:
  1041. [0]
  1042. [ ]
  1043. [0]
  1044. [ ]
  1045. [0]
  1046. [ ]
  1047. [0]
  1048. [ ]
  1049. [0]
  1050. [ ]
  1051. [0]
  1052. [ ]
  1053. [0]
  1054. [ ]
  1055. [0]
  1056. 4 3 2 2
  1057. sqrt(e + 12*e + 10*e + 12*e + 1) + e + 6*e + 1
  1058. eigenvalue = ----------------------------------------------------
  1059. 2*e
  1060. check of eigen equation:
  1061. [0]
  1062. [ ]
  1063. [0]
  1064. [ ]
  1065. [0]
  1066. [ ]
  1067. [0]
  1068. [ ]
  1069. [0]
  1070. [ ]
  1071. [0]
  1072. [ ]
  1073. [0]
  1074. [ ]
  1075. [0]
  1076. 4 3 2 2
  1077. - sqrt(e + 12*e + 10*e + 12*e + 1) + e + 6*e + 1
  1078. eigenvalue = -------------------------------------------------------
  1079. 2*e
  1080. check of eigen equation:
  1081. [0]
  1082. [ ]
  1083. [0]
  1084. [ ]
  1085. [0]
  1086. [ ]
  1087. [0]
  1088. [ ]
  1089. [0]
  1090. [ ]
  1091. [0]
  1092. [ ]
  1093. [0]
  1094. [ ]
  1095. [0]
  1096. % For the special choice:
  1097. let e = -7 + sqrt 48;
  1098. % we get only 7 eigenvectors.
  1099. eig := mateigen(m,x);
  1100. eig := {{x + 1,
  1101. 4,
  1102. arbcomplex(27)
  1103. mat((----------------),
  1104. 4*sqrt(3) - 7
  1105. (arbcomplex(26)),
  1106. (arbcomplex(25)),
  1107. ((2*sqrt(3)
  1108. *( - arbcomplex(27) - 2*arbcomplex(26) - 2*arbcomplex(25))
  1109. + 3*arbcomplex(27) + 7*arbcomplex(26) + 7*arbcomplex(25))/(
  1110. 4*sqrt(3) - 7)),
  1111. ((2*sqrt(3)
  1112. *( - arbcomplex(27) - 2*arbcomplex(26) - 2*arbcomplex(25))
  1113. + 3*arbcomplex(27) + 7*arbcomplex(26) + 7*arbcomplex(25))/(
  1114. 4*sqrt(3) - 7)),
  1115. (arbcomplex(25)),
  1116. (arbcomplex(26)),
  1117. (arbcomplex(27)))
  1118. },
  1119. {x - 1,
  1120. 3,
  1121. [ 0 ]
  1122. [ ]
  1123. [ - arbcomplex(30)]
  1124. [ ]
  1125. [ - arbcomplex(29)]
  1126. [ ]
  1127. [ - arbcomplex(28)]
  1128. [ ]
  1129. [ arbcomplex(28) ]
  1130. [ ]
  1131. [ arbcomplex(29) ]
  1132. [ ]
  1133. [ arbcomplex(30) ]
  1134. [ ]
  1135. [ 0 ]
  1136. },
  1137. {x + 7,
  1138. 1,
  1139. [ arbcomplex(31) ]
  1140. [ ----------------- ]
  1141. [ 56*sqrt(3) - 97 ]
  1142. [ ]
  1143. [ - 14*sqrt(3)*arbcomplex(31) + 24*arbcomplex(31) ]
  1144. [--------------------------------------------------]
  1145. [ 168*sqrt(3) - 291 ]
  1146. [ ]
  1147. [ - 14*sqrt(3)*arbcomplex(31) + 24*arbcomplex(31) ]
  1148. [--------------------------------------------------]
  1149. [ 168*sqrt(3) - 291 ]
  1150. [ ]
  1151. [ - 14*sqrt(3)*arbcomplex(31) + 24*arbcomplex(31) ]
  1152. [--------------------------------------------------]
  1153. [ 168*sqrt(3) - 291 ]
  1154. [ ]
  1155. [ - 14*sqrt(3)*arbcomplex(31) + 24*arbcomplex(31) ]
  1156. [--------------------------------------------------]
  1157. [ 168*sqrt(3) - 291 ]
  1158. [ ]
  1159. [ - 14*sqrt(3)*arbcomplex(31) + 24*arbcomplex(31) ]
  1160. [--------------------------------------------------]
  1161. [ 168*sqrt(3) - 291 ]
  1162. [ ]
  1163. [ - 14*sqrt(3)*arbcomplex(31) + 24*arbcomplex(31) ]
  1164. [--------------------------------------------------]
  1165. [ 168*sqrt(3) - 291 ]
  1166. [ ]
  1167. [ arbcomplex(31) ]
  1168. }}
  1169. for each eispace in eig do
  1170. begin scalar eivaleq,eival,eivec;
  1171. eival := solve(first eispace,x);
  1172. for each soln in eival do
  1173. <<eival := rhs soln;
  1174. eivec := third eispace;
  1175. eivec := sub(soln,eivec);
  1176. write "eigenvalue = ", eival;
  1177. write "check of eigen equation: ",
  1178. m*eivec - eival*eivec>>
  1179. end;
  1180. eigenvalue = -1
  1181. check of eigen equation:
  1182. [0]
  1183. [ ]
  1184. [0]
  1185. [ ]
  1186. [0]
  1187. [ ]
  1188. [0]
  1189. [ ]
  1190. [0]
  1191. [ ]
  1192. [0]
  1193. [ ]
  1194. [0]
  1195. [ ]
  1196. [0]
  1197. eigenvalue = 1
  1198. check of eigen equation:
  1199. [0]
  1200. [ ]
  1201. [0]
  1202. [ ]
  1203. [0]
  1204. [ ]
  1205. [0]
  1206. [ ]
  1207. [0]
  1208. [ ]
  1209. [0]
  1210. [ ]
  1211. [0]
  1212. [ ]
  1213. [0]
  1214. eigenvalue = -7
  1215. check of eigen equation:
  1216. [0]
  1217. [ ]
  1218. [0]
  1219. [ ]
  1220. [0]
  1221. [ ]
  1222. [0]
  1223. [ ]
  1224. [0]
  1225. [ ]
  1226. [0]
  1227. [ ]
  1228. [0]
  1229. [ ]
  1230. [0]
  1231. % The same behaviour for this choice of e.
  1232. clear e;
  1233. let e = -7 - sqrt 48;
  1234. % we get only 7 eigenvectors.
  1235. eig := mateigen(m,x);
  1236. eig := {{x + 1,
  1237. 4,
  1238. - arbcomplex(34)
  1239. mat((-------------------),
  1240. 4*sqrt(3) + 7
  1241. (arbcomplex(33)),
  1242. (arbcomplex(32)),
  1243. ((2*sqrt(3)
  1244. *( - arbcomplex(34) - 2*arbcomplex(33) - 2*arbcomplex(32))
  1245. - 3*arbcomplex(34) - 7*arbcomplex(33) - 7*arbcomplex(32))/(
  1246. 4*sqrt(3) + 7)),
  1247. ((2*sqrt(3)
  1248. *( - arbcomplex(34) - 2*arbcomplex(33) - 2*arbcomplex(32))
  1249. - 3*arbcomplex(34) - 7*arbcomplex(33) - 7*arbcomplex(32))/(
  1250. 4*sqrt(3) + 7)),
  1251. (arbcomplex(32)),
  1252. (arbcomplex(33)),
  1253. (arbcomplex(34)))
  1254. },
  1255. {x - 1,
  1256. 3,
  1257. [ 0 ]
  1258. [ ]
  1259. [ - arbcomplex(37)]
  1260. [ ]
  1261. [ - arbcomplex(36)]
  1262. [ ]
  1263. [ - arbcomplex(35)]
  1264. [ ]
  1265. [ arbcomplex(35) ]
  1266. [ ]
  1267. [ arbcomplex(36) ]
  1268. [ ]
  1269. [ arbcomplex(37) ]
  1270. [ ]
  1271. [ 0 ]
  1272. },
  1273. {x + 7,
  1274. 1,
  1275. [ - arbcomplex(38) ]
  1276. [ ------------------- ]
  1277. [ 56*sqrt(3) + 97 ]
  1278. [ ]
  1279. [ - 14*sqrt(3)*arbcomplex(38) - 24*arbcomplex(38) ]
  1280. [--------------------------------------------------]
  1281. [ 168*sqrt(3) + 291 ]
  1282. [ ]
  1283. [ - 14*sqrt(3)*arbcomplex(38) - 24*arbcomplex(38) ]
  1284. [--------------------------------------------------]
  1285. [ 168*sqrt(3) + 291 ]
  1286. [ ]
  1287. [ - 14*sqrt(3)*arbcomplex(38) - 24*arbcomplex(38) ]
  1288. [--------------------------------------------------]
  1289. [ 168*sqrt(3) + 291 ]
  1290. [ ]
  1291. [ - 14*sqrt(3)*arbcomplex(38) - 24*arbcomplex(38) ]
  1292. [--------------------------------------------------]
  1293. [ 168*sqrt(3) + 291 ]
  1294. [ ]
  1295. [ - 14*sqrt(3)*arbcomplex(38) - 24*arbcomplex(38) ]
  1296. [--------------------------------------------------]
  1297. [ 168*sqrt(3) + 291 ]
  1298. [ ]
  1299. [ - 14*sqrt(3)*arbcomplex(38) - 24*arbcomplex(38) ]
  1300. [--------------------------------------------------]
  1301. [ 168*sqrt(3) + 291 ]
  1302. [ ]
  1303. [ arbcomplex(38) ]
  1304. }}
  1305. for each eispace in eig do
  1306. begin scalar eivaleq,eival,eivec;
  1307. eival := solve(first eispace,x);
  1308. for each soln in eival do
  1309. <<eival := rhs soln;
  1310. eivec := third eispace;
  1311. eivec := sub(soln,eivec);
  1312. write "eigenvalue = ", eival;
  1313. write "check of eigen equation: ",
  1314. m*eivec - eival*eivec>>
  1315. end;
  1316. eigenvalue = -1
  1317. check of eigen equation:
  1318. [0]
  1319. [ ]
  1320. [0]
  1321. [ ]
  1322. [0]
  1323. [ ]
  1324. [0]
  1325. [ ]
  1326. [0]
  1327. [ ]
  1328. [0]
  1329. [ ]
  1330. [0]
  1331. [ ]
  1332. [0]
  1333. eigenvalue = 1
  1334. check of eigen equation:
  1335. [0]
  1336. [ ]
  1337. [0]
  1338. [ ]
  1339. [0]
  1340. [ ]
  1341. [0]
  1342. [ ]
  1343. [0]
  1344. [ ]
  1345. [0]
  1346. [ ]
  1347. [0]
  1348. [ ]
  1349. [0]
  1350. eigenvalue = -7
  1351. check of eigen equation:
  1352. [0]
  1353. [ ]
  1354. [0]
  1355. [ ]
  1356. [0]
  1357. [ ]
  1358. [0]
  1359. [ ]
  1360. [0]
  1361. [ ]
  1362. [0]
  1363. [ ]
  1364. [0]
  1365. [ ]
  1366. [0]
  1367. % For this choice of values
  1368. clear e;
  1369. let e = 1;
  1370. % the eigenvalue 1 becomes 4-fold degenerate. However, we get a complete
  1371. % span of 8 eigenvectors.
  1372. eig := mateigen(m,x);
  1373. eig := {{x - 1,
  1374. 4,
  1375. [ - arbcomplex(42)]
  1376. [ ]
  1377. [ - arbcomplex(41)]
  1378. [ ]
  1379. [ - arbcomplex(40)]
  1380. [ ]
  1381. [ - arbcomplex(39)]
  1382. [ ]
  1383. [ arbcomplex(39) ]
  1384. [ ]
  1385. [ arbcomplex(40) ]
  1386. [ ]
  1387. [ arbcomplex(41) ]
  1388. [ ]
  1389. [ arbcomplex(42) ]
  1390. },
  1391. {x + 1,
  1392. 3,
  1393. [ arbcomplex(45) ]
  1394. [ ]
  1395. [ arbcomplex(44) ]
  1396. [ ]
  1397. [ arbcomplex(43) ]
  1398. [ ]
  1399. [ - (arbcomplex(45) + arbcomplex(44) + arbcomplex(43))]
  1400. [ ]
  1401. [ - (arbcomplex(45) + arbcomplex(44) + arbcomplex(43))]
  1402. [ ]
  1403. [ arbcomplex(43) ]
  1404. [ ]
  1405. [ arbcomplex(44) ]
  1406. [ ]
  1407. [ arbcomplex(45) ]
  1408. },
  1409. {x - 7,
  1410. 1,
  1411. [arbcomplex(46)]
  1412. [ ]
  1413. [arbcomplex(46)]
  1414. [ ]
  1415. [arbcomplex(46)]
  1416. [ ]
  1417. [arbcomplex(46)]
  1418. [ ]
  1419. [arbcomplex(46)]
  1420. [ ]
  1421. [arbcomplex(46)]
  1422. [ ]
  1423. [arbcomplex(46)]
  1424. [ ]
  1425. [arbcomplex(46)]
  1426. }}
  1427. for each eispace in eig do
  1428. begin scalar eivaleq,eival,eivec;
  1429. eival := solve(first eispace,x);
  1430. for each soln in eival do
  1431. <<eival := rhs soln;
  1432. eivec := third eispace;
  1433. eivec := sub(soln,eivec);
  1434. write "eigenvalue = ", eival;
  1435. write "check of eigen equation: ",
  1436. m*eivec - eival*eivec>>
  1437. end;
  1438. eigenvalue = 1
  1439. check of eigen equation:
  1440. [0]
  1441. [ ]
  1442. [0]
  1443. [ ]
  1444. [0]
  1445. [ ]
  1446. [0]
  1447. [ ]
  1448. [0]
  1449. [ ]
  1450. [0]
  1451. [ ]
  1452. [0]
  1453. [ ]
  1454. [0]
  1455. eigenvalue = -1
  1456. check of eigen equation:
  1457. [0]
  1458. [ ]
  1459. [0]
  1460. [ ]
  1461. [0]
  1462. [ ]
  1463. [0]
  1464. [ ]
  1465. [0]
  1466. [ ]
  1467. [0]
  1468. [ ]
  1469. [0]
  1470. [ ]
  1471. [0]
  1472. eigenvalue = 7
  1473. check of eigen equation:
  1474. [0]
  1475. [ ]
  1476. [0]
  1477. [ ]
  1478. [0]
  1479. [ ]
  1480. [0]
  1481. [ ]
  1482. [0]
  1483. [ ]
  1484. [0]
  1485. [ ]
  1486. [0]
  1487. [ ]
  1488. [0]
  1489. ma := mat((1,a),(0,b));
  1490. [1 a]
  1491. ma := [ ]
  1492. [0 b]
  1493. % case 1:
  1494. let a = 0;
  1495. mateigen(ma,x);
  1496. {{x - 1,1,
  1497. [arbcomplex(47)]
  1498. [ ]
  1499. [ 0 ]
  1500. },
  1501. { - b + x,1,
  1502. [ 0 ]
  1503. [ ]
  1504. [arbcomplex(48)]
  1505. }}
  1506. % case 2:
  1507. clear a;
  1508. let a = 0, b = 1;
  1509. mateigen(ma,x);
  1510. {{x - 1,2,
  1511. [arbcomplex(49)]
  1512. [ ]
  1513. [arbcomplex(50)]
  1514. }}
  1515. % case 3:
  1516. clear a,b;
  1517. mateigen(ma,x);
  1518. {{ - b + x,
  1519. 1,
  1520. [ arbcomplex(51)*a ]
  1521. [------------------]
  1522. [ b - 1 ]
  1523. [ ]
  1524. [ arbcomplex(51) ]
  1525. },
  1526. {x - 1,1,
  1527. [arbcomplex(52)]
  1528. [ ]
  1529. [ 0 ]
  1530. }}
  1531. % case 4:
  1532. let b = 1;
  1533. mateigen(ma,x);
  1534. {{x - 1,2,
  1535. [arbcomplex(53)]
  1536. [ ]
  1537. [ 0 ]
  1538. }}
  1539. % Example from H.G. Graebe:
  1540. m1:=mat((-sqrt(3)+1,2 ,3 ),
  1541. (2 ,-sqrt(3)+3,1 ),
  1542. (3 ,1 ,-sqrt(3)+2));
  1543. [ - sqrt(3) + 1 2 3 ]
  1544. [ ]
  1545. m1 := [ 2 - sqrt(3) + 3 1 ]
  1546. [ ]
  1547. [ 3 1 - sqrt(3) + 2]
  1548. nullspace m1;
  1549. {
  1550. [ 3*sqrt(3) - 7 ]
  1551. [ ]
  1552. [ sqrt(3) + 5 ]
  1553. [ ]
  1554. [ - 4*sqrt(3) + 2]
  1555. }
  1556. for each n in ws collect m1*n;
  1557. {
  1558. [0]
  1559. [ ]
  1560. [0]
  1561. [ ]
  1562. [0]
  1563. }
  1564. end;
  1565. (TIME: matrix 5070 5619)