Difference between revisions of "ApCoCoA-1:Num.EigenValuesAndAllVectors"

From ApCoCoAWiki
m (removed types (none defined))
m (replaced <quotes> tag by real quotes)
 
(32 intermediate revisions by 9 users not shown)
Line 1: Line 1:
   <command>
+
   {{Version|1}}
     <title>Numerical.EigenValuesAndAllVectors</title>
+
<command>
     <short_description>Eigenvalues and left and right eigenvectors of a matrix</short_description>
+
     <title>Num.EigenValuesAndAllVectors</title>
 +
     <short_description>Computes eigenvalues and left and right eigenvectors of a matrix.</short_description>
 
<syntax>
 
<syntax>
$numerical.EigenValues(A:Matrix):List
+
Num.EigenValuesAndAllVectors(A:MAT):[B:MAT, C:MAT, D:MAT, E:MAT , F:MAT]
 
</syntax>
 
</syntax>
 
     <description>
 
     <description>
This function returns a List of three matrices, containing numerical approximation to A's eigenvalues and right and left eigenvectors.  
+
<em>Please note:</em> The function(s) explained on this page is/are using the <em>ApCoCoAServer</em>. You will have to start the ApCoCoAServer in order to use it/them.
Therefore the input matrix A has to be rectangular!
+
<par/>
It is implemented in the ApCoCoA server, so you need a running server. It was not implemented in version 0.99.4 or previous. Also please keep in mind this method is based on blas/Lapack's eigenvalue solver and uses floating point arithmetic. This is not an exact, algebraic method!
+
This function returns a list of five matrices, containing numerical approximation of the eigenvalues of the matrix <tt>A</tt> and right and left eigenvectors.  
The output contains first of a matrix B, where the number of rows contains one of A's eigenvalues. The first column contains the eigenvalue's real part, the second the imaginary.
+
 
The second element of the list is a matrix of the size of A, containing A's left hand eigenvectors, while the third element in the list is a matrix containing the right hand eigenvectors.
+
<itemize>
 +
<item>@param <em>A</em> A quadratic matrix with rational entries.</item>
 +
<item>@return The output is a list of five matrices <tt>[B:MAT, C:MAT, D:MAT, E:MAT, F:MAT]</tt>. The first matrix <tt>B</tt> contains the complex eigenvalues of the matrix <tt>A</tt>, i.e. the first entry of a column is the real part and the second entry of the same column is the imaginary part of the eigenvalue. The matrices <tt>C</tt> and <tt>D</tt> represent the right eigenvectors of <tt>A</tt>, i.e. the <tt>j</tt>-th column of <tt>C</tt> contains the real part of the right eigenvector corresponding to eigenvalue <tt>j</tt> and the <tt>j</tt>-th column of D contains the imaginary part of the same right eigenvector corresponding to eigenvalue <tt>j</tt>. The matrices <tt>E</tt> and <tt>F</tt> store the left eigenvectors analogue to <tt>C</tt> and <tt>D</tt>.</item>
 +
</itemize>
 +
 
 +
 
 
<example>
 
<example>
 
A:=Mat([[1,2,7,18],[2,4,9,12],[23,8,9,10],[7,5,3,2]]);  
 
A:=Mat([[1,2,7,18],[2,4,9,12],[23,8,9,10],[7,5,3,2]]);  
Numerical.EigenValuesAndAllVectors(A);
+
Dec(Num.EigenValuesAndAllVectors(A),3);
-- CoCoAServer: computing Cpu Time = 0.0031
+
-- CoCoAServer: computing Cpu Time = 0.016
 
-------------------------------
 
-------------------------------
 
[Mat([
 
[Mat([
   [2038617447977453/70368744177664, 1593056728295919/4503599627370496, 0, 1717983664400761/562949953421312],
+
   ["28.970", "-13.677", "0.353", "0.353"],
   [-3850002255576293/281474976710656, 1593056728295919/4503599627370496, 0, -1717983664400761/562949953421312]
+
   ["0", "0", "3.051", "-3.051"]
 
]), Mat([
 
]), Mat([
   [-4846625556027553/9007199254740992, -675715895173401/1125899906842624, 6285574018989927/36028797018963968, -7024364631742823/18014398509481984],
+
   ["0.538", "-0.600", "0.389", "0.389"],
   [-5611119929071853/18014398509481984, -8025389267782659/36028797018963968, -630161806301403/4503599627370496, 7963794620848619/18014398509481984],
+
   ["0.311", "-0.222", "-0.442", "-0.442"],
   [-3851121972702563/9007199254740992, 6293666352540409/36028797018963968, -2394868378529203/9007199254740992, -1824257157284653/36028797018963968],
+
   ["0.427", "0.174", "0.050", "0.050"],
   [-5910799605047357/9007199254740992, 6738448111784605/9007199254740992, 6552680769135833/9007199254740992, 0]
+
   ["0.656", "0.748", "0", "0"]
 
]), Mat([
 
]), Mat([
   [-7110239176083849/18014398509481984, -5241040126502889/9007199254740992, -569232410323621/18014398509481984, 4695168387448581/18014398509481984],
+
   ["0", "0", "-0.174", "0.174"],
   [-7846388397589843/18014398509481984, -3981313256671163/9007199254740992, -2719422585742633/9007199254740992, -4930385173711605/9007199254740992],
+
  ["0", "0", "0.139", "-0.139"],
   [-3437594604471165/4503599627370496, 2800381393796867/4503599627370496, 6128985174171139/9007199254740992, 0],
+
  ["0", "0", "0.265", "-0.265"],
   [-1207381852306067/4503599627370496, 634514467740541/2251799813685248, -2469130937097749/9007199254740992, 6644460631770309/144115188075855872]
+
  ["0", "0", "-0.727", "0.727"]
 +
]), Mat([
 +
   ["0.394", "-0.581", "0.260", "0.260"],
 +
  ["0.435", "-0.442", "-0.547", "-0.547"],
 +
   ["0.763", "0.621", "0", "0"],
 +
  ["0.268", "0.281", "0.046", "0.046"]
 +
]), Mat([
 +
  ["0", "0", "-0.031", "0.031"],
 +
  ["0", "0", "-0.301", "0.301"],
 +
   ["0", "0", "0.680", "-0.680"],
 +
  ["0", "0", "-0.274", "0.274"]
 
])]
 
])]
 
-------------------------------
 
-------------------------------
Line 34: Line 50:
 
     </description>
 
     </description>
 
     <seealso>
 
     <seealso>
       <see>Introduction to CoCoAServer</see>
+
       <see>ApCoCoA-1:Introduction to CoCoAServer|Introduction to CoCoAServer</see>
       <see>Numerical.QR5</see>
+
       <see>ApCoCoA-1:Num.QR|Num.QR</see>
       <see>Numerical.SVD</see>
+
       <see>ApCoCoA-1:Num.SVD|Num.SVD</see>
       <see>Numerical.EigenValues</see>
+
       <see>ApCoCoA-1:Num.EigenValues|Num.EigenValues</see>
       <see>Numerical.EigenValuesAndVectors</see>
+
       <see>ApCoCoA-1:Num.EigenValuesAndVectors|Num.EigenValuesAndVectors</see>
 
     </seealso>
 
     </seealso>
 +
    <types>
 +
      <type>apcocoaserver</type>
 +
      <type>matrix</type>
 +
    </types>
 +
    <key>EigenValuesAndAllVectors</key>
 +
    <key>Num.EigenValuesAndAllVectors</key>
 +
    <key>numerical.eigenvaluesandallvectors</key>
 +
    <wiki-category>ApCoCoA-1:Package_numerical</wiki-category>
 
   </command>
 
   </command>

Latest revision as of 13:47, 29 October 2020

This article is about a function from ApCoCoA-1.

Num.EigenValuesAndAllVectors

Computes eigenvalues and left and right eigenvectors of a matrix.

Syntax

Num.EigenValuesAndAllVectors(A:MAT):[B:MAT, C:MAT, D:MAT, E:MAT , F:MAT]

Description

Please note: The function(s) explained on this page is/are using the ApCoCoAServer. You will have to start the ApCoCoAServer in order to use it/them.

This function returns a list of five matrices, containing numerical approximation of the eigenvalues of the matrix A and right and left eigenvectors.

  • @param A A quadratic matrix with rational entries.

  • @return The output is a list of five matrices [B:MAT, C:MAT, D:MAT, E:MAT, F:MAT]. The first matrix B contains the complex eigenvalues of the matrix A, i.e. the first entry of a column is the real part and the second entry of the same column is the imaginary part of the eigenvalue. The matrices C and D represent the right eigenvectors of A, i.e. the j-th column of C contains the real part of the right eigenvector corresponding to eigenvalue j and the j-th column of D contains the imaginary part of the same right eigenvector corresponding to eigenvalue j. The matrices E and F store the left eigenvectors analogue to C and D.


Example

A:=Mat([[1,2,7,18],[2,4,9,12],[23,8,9,10],[7,5,3,2]]); 
Dec(Num.EigenValuesAndAllVectors(A),3);
-- CoCoAServer: computing Cpu Time = 0.016
-------------------------------
[Mat([
  ["28.970", "-13.677", "0.353", "0.353"],
  ["0", "0", "3.051", "-3.051"]
]), Mat([
  ["0.538", "-0.600", "0.389", "0.389"],
  ["0.311", "-0.222", "-0.442", "-0.442"],
  ["0.427", "0.174", "0.050", "0.050"],
  ["0.656", "0.748", "0", "0"]
]), Mat([
  ["0", "0", "-0.174", "0.174"],
  ["0", "0", "0.139", "-0.139"],
  ["0", "0", "0.265", "-0.265"],
  ["0", "0", "-0.727", "0.727"]
]), Mat([
  ["0.394", "-0.581", "0.260", "0.260"],
  ["0.435", "-0.442", "-0.547", "-0.547"],
  ["0.763", "0.621", "0", "0"],
  ["0.268", "0.281", "0.046", "0.046"]
]), Mat([
  ["0", "0", "-0.031", "0.031"],
  ["0", "0", "-0.301", "0.301"],
  ["0", "0", "0.680", "-0.680"],
  ["0", "0", "-0.274", "0.274"]
])]
-------------------------------

See also

Introduction to CoCoAServer

Num.QR

Num.SVD

Num.EigenValues

Num.EigenValuesAndVectors