ApCoCoA-1:Num.SimDiag: Difference between revisions

From ApCoCoAWiki
No edit summary
m replaced <quotes> tag by real quotes
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
   <command>
   {{Version|1}}
<command>
     <title>Num.SimDiag</title>
     <title>Num.SimDiag</title>
     <short_description>Computes an approximate diagonalization of a set of matrices.</short_description>
     <short_description>Computes an approximate diagonalization of a set of matrices.</short_description>
<syntax>
<syntax>
Num.SimDiag(A:LSIT):[B:MAT, C:MAT]
Num.SimDiag(A:LIST, MaxIt:INT):[B:MAT, C:MAT]
</syntax>
</syntax>
     <description>
     <description>
Line 12: Line 13:
<itemize>
<itemize>
<item>@param <em>A</em> A list of quadratic matrices with rational entries.</item>
<item>@param <em>A</em> A list of quadratic matrices with rational entries.</item>
<item>@return The output is a list of two matrices <tt>[B:MAT, C:MAT]</tt>. The first matrix <tt>B</tt> contains the real almost eigenvectors of the matrices in <tt>A</tt>. The matrix <tt>C</tt> is the inverse of <tt>A</tt>.</item>
<item>@param <em>MaxIt</em> The maximum number of iterations.</item>
<item>@return The output is a list of two matrices <tt>[B:MAT, C:MAT]</tt>. The first matrix <tt>B</tt> contains the real almost eigenvectors of the matrices in <tt>A</tt>. The matrix <tt>C</tt> is the inverse of <tt>B</tt>.</item>
</itemize>
</itemize>


Line 25: Line 27:
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>],
   ["0.062", "0.016", "0.000", "0.006"],
   [<quote>0.021</quote>, <quote>0.030</quote>, <quote>-0.002</quote>, <quote>-0.000</quote>],
   ["0.021", "0.030", "-0.002", "-0.000"],
   [<quote>0.000</quote>, <quote>0.005</quote>, <quote>1.006</quote>, <quote>-0.035</quote>],
   ["0.000", "0.005", "1.006", "-0.035"],
   [<quote>-0.000</quote>, <quote>-0.000</quote>, <quote>-0.031</quote>, <quote>0.982</quote>]
   ["-0.000", "-0.000", "-0.031", "0.982"]
])
])
-------------------------------
-------------------------------
Mat([
Mat([
   [<quote>0.048</quote>, <quote>0.000</quote>, <quote>0.030</quote>, <quote>-0.005</quote>],
   ["0.048", "0.000", "0.030", "-0.005"],
   [<quote>0.000</quote>, <quote>0.991</quote>, <quote>-0.002</quote>, <quote>-0.021</quote>],
   ["0.000", "0.991", "-0.002", "-0.021"],
   [<quote>0.020</quote>, <quote>0.005</quote>, <quote>0.029</quote>, <quote>-0.000</quote>],
   ["0.020", "0.005", "0.029", "-0.000"],
   [<quote>0.000</quote>, <quote>-0.030</quote>, <quote>-0.000</quote>, <quote>0.982</quote>]
   ["0.000", "-0.030", "-0.000", "0.982"]
])
])
-----------------------------
</example>
</example>
     </description>
     </description>
     <seealso>
     <seealso>
       <see>Introduction to CoCoAServer</see>
       <see>ApCoCoA-1:Introduction to CoCoAServer|Introduction to CoCoAServer</see>
       <see>Num.QR</see>
       <see>ApCoCoA-1:Num.QR|Num.QR</see>
       <see>Num.SVD</see>
       <see>ApCoCoA-1:Num.SVD|Num.SVD</see>
       <see>Num.EigenValues</see>
       <see>ApCoCoA-1:Num.EigenValues|Num.EigenValues</see>
       <see>Num.EigenValuesAndVectors</see>
       <see>ApCoCoA-1:Num.EigenValuesAndVectors|Num.EigenValuesAndVectors</see>
       <see>Num.EigenValuesAndAllVectors</see>
       <see>ApCoCoA-1:Num.EigenValuesAndAllVectors|Num.EigenValuesAndAllVectors</see>
     </seealso>
     </seealso>
     <types>
     <types>
Line 56: Line 60:
     <key>num.simdiag</key>
     <key>num.simdiag</key>
     <key>numerical.simdiag</key>
     <key>numerical.simdiag</key>
     <wiki-category>Package_numerical</wiki-category>
     <wiki-category>ApCoCoA-1:Package_numerical</wiki-category>
   </command>
   </command>

Latest revision as of 13:48, 29 October 2020

This article is about a function from ApCoCoA-1.

Num.SimDiag

Computes an approximate diagonalization of a set of matrices.

Syntax

Num.SimDiag(A:LIST, MaxIt:INT):[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.

  • @param MaxIt The maximum number of iterations.

  • @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 B.


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([
  ["0.062", "0.016", "0.000", "0.006"],
  ["0.021", "0.030", "-0.002", "-0.000"],
  ["0.000", "0.005", "1.006", "-0.035"],
  ["-0.000", "-0.000", "-0.031", "0.982"]
])
-------------------------------
Mat([
  ["0.048", "0.000", "0.030", "-0.005"],
  ["0.000", "0.991", "-0.002", "-0.021"],
  ["0.020", "0.005", "0.029", "-0.000"],
  ["0.000", "-0.030", "-0.000", "0.982"]
])
-----------------------------

See also

Introduction to CoCoAServer

Num.QR

Num.SVD

Num.EigenValues

Num.EigenValuesAndVectors

Num.EigenValuesAndAllVectors