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

From ApCoCoAWiki
Line 25: Line 25:
 
Dec(Result[2]*M1*Result[1],3);
 
Dec(Result[2]*M1*Result[1],3);
 
Dec(Result[2]*M2*Result[1],3);
 
Dec(Result[2]*M2*Result[1],3);
 +
  
 
Mat([
 
Mat([
   [<quote>0.062</quote>, <quote>0.016</quote>, <quote>0.000</quote>, <quote>0.006</quote>],
+
   [<quotes>0.062</quotes>, <quotes>0.016</quotes>, <quotes>0.000</quotes>, <quotes>0.006</quotes>],
   [<quote>0.021</quote>, <quote>0.030</quote>, <quote>-0.002</quote>, <quote>-0.000</quote>],
+
   [<quotes>0.021</quotes>, <quotes>0.030</quotes>, <quotes>-0.002</quotes>, <quotes>-0.000</quotes>],
   [<quote>0.000</quote>, <quote>0.005</quote>, <quote>1.006</quote>, <quote>-0.035</quote>],
+
   [<quotes>0.000</quotes>, <quotes>0.005</quotes>, <quotes>1.006</quotes>, <quotes>-0.035</quotes>],
   [<quote>-0.000</quote>, <quote>-0.000</quote>, <quote>-0.031</quote>, <quote>0.982</quote>]
+
   [<quotes>-0.000</quotes>, <quotes>-0.000</quotes>, <quotes>-0.031</quotes>, <quotes>0.982</quotes>]
 
])
 
])
 
-------------------------------
 
-------------------------------
 
Mat([
 
Mat([
   [<quote>0.048</quote>, <quote>0.000</quote>, <quote>0.030</quote>, <quote>-0.005</quote>],
+
   [<quotes>0.048</quotes>, <quotes>0.000</quotes>, <quotes>0.030</quotes>, <quotes>-0.005</quotes>],
   [<quote>0.000</quote>, <quote>0.991</quote>, <quote>-0.002</quote>, <quote>-0.021</quote>],
+
   [<quotes>0.000</quotes>, <quotes>0.991</quotes>, <quotes>-0.002</quotes>, <quotes>-0.021</quotes>],
   [<quote>0.020</quote>, <quote>0.005</quote>, <quote>0.029</quote>, <quote>-0.000</quote>],
+
   [<quotes>0.020</quotes>, <quotes>0.005</quotes>, <quotes>0.029</quotes>, <quotes>-0.000</quotes>],
   [<quote>0.000</quote>, <quote>-0.030</quote>, <quote>-0.000</quote>, <quote>0.982</quote>]
+
   [<quotes>0.000</quotes>, <quotes>-0.030</quotes>, <quotes>-0.000</quotes>, <quotes>0.982</quotes>]
 
])
 
])
 +
-----------------------------
 
</example>
 
</example>
 
     </description>
 
     </description>

Revision as of 13:49, 7 October 2010

Num.SimDiag

Computes an approximate diagonalization of a set of matrices.

Syntax

Num.SimDiag(A:LSIT):[B:MAT, C: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 two matrices, containing the approximate (almost) eigenvectors of the matrices in A and its inverse.

  • @param A A list of quadratic matrices with rational entries.

  • @return The output is a list of two matrices [B:MAT, C:MAT]. The first matrix B contains the real almost eigenvectors of the matrices in A. The matrix C is the inverse of A.


Example

M1 := Mat([[0, 0, -0.079, -0.018],[0, 0,  0.032, -0.012], [1, 0,  1.056, -0.012],[0, 1, -0.060,  1.025]]);
M2 := Mat([[0, -0.063, 0, -0.018],[1,  1.026, 0, -0.012], [0, 0, 0, -0.012], [0, 0, 1, 1.025]]);
M1 := Transposed(M1);
M2 := Transposed(M2);
Result := Num.SimDiag([M1,M2],10);

Dec(Result[2]*M1*Result[1],3);
Dec(Result[2]*M2*Result[1],3);


Mat([
  [<quotes>0.062</quotes>, <quotes>0.016</quotes>, <quotes>0.000</quotes>, <quotes>0.006</quotes>],
  [<quotes>0.021</quotes>, <quotes>0.030</quotes>, <quotes>-0.002</quotes>, <quotes>-0.000</quotes>],
  [<quotes>0.000</quotes>, <quotes>0.005</quotes>, <quotes>1.006</quotes>, <quotes>-0.035</quotes>],
  [<quotes>-0.000</quotes>, <quotes>-0.000</quotes>, <quotes>-0.031</quotes>, <quotes>0.982</quotes>]
])
-------------------------------
Mat([
  [<quotes>0.048</quotes>, <quotes>0.000</quotes>, <quotes>0.030</quotes>, <quotes>-0.005</quotes>],
  [<quotes>0.000</quotes>, <quotes>0.991</quotes>, <quotes>-0.002</quotes>, <quotes>-0.021</quotes>],
  [<quotes>0.020</quotes>, <quotes>0.005</quotes>, <quotes>0.029</quotes>, <quotes>-0.000</quotes>],
  [<quotes>0.000</quotes>, <quotes>-0.030</quotes>, <quotes>-0.000</quotes>, <quotes>0.982</quotes>]
])
-----------------------------

See also

Introduction to CoCoAServer

Num.QR

Num.SVD

Num.EigenValues

Num.EigenValuesAndVectors

Num.EigenValuesAndAllVectors