Matrix Decomposition (SVD)
Add a Matrix Decomposition (SVD) node () under Definitions > Variable Utilities (if Group by Type is active; otherwise, directly under Definitions) to define variables for a decomposition using SVD (singular value decomposition) of a square input matrix. You add it by right-clicking the Definitions node and choosing Variable Utilities > Matrix Decomposition (SVD) or by right-clicking the Variable Utilities node and choosing Matrix Decomposition (SVD).
You can also add a global Matrix Decomposition (SVD) under Global Definitions > Variable Utilities (if Group by Type is active; otherwise, directly under Global Definitions). In the global context, the Matrix Decomposition (SVD) node has no selection. The output singular values and vectors are defined globally but the SVD is done locally, for each point where the output variables are evaluated. The input matrix therefore does not have to depend only on constants and global variables. Its expressions will be evaluated at each evaluation point.
You can define a Label for the node, and a namespace for variables using the Name field. For the Geometric Entity Selection, see About Selecting Geometric Entities.
In addition, the Settings window for a Matrix Decomposition (SVD) node contains the following sections:
Input Matrix
Choose a Matrix format: Full (the default) or Symmetric. For a symmetric matrix, you only enter the upper-triangular part of the matrix. From the Matrix size list, choose a matrix size from 1-by-1 to 9-by-9 or choose User defined. The maximum User-defined size is 50. Then enter the matrix elements in the table below.
Output
The Matrix Decomposition (SVD) node can compute two different decompositions of the input matrix. The basic singular value decomposition (SVD)
splits the matrix as a product of a unitary matrix U (with left singular vectors as columns) a diagonal matrix Σ (with positive singular values on the diagonal), and the conjugate transpose of a unitary matrix V (with right singular vectors as columns). From the SVD, also a polar decomposition
can be computed, where R is a unitary rotation matrix and P is a positive definite stretch matrix.
The node always computes the singular values, which are made available as variables <name>.sigma<i>, where <name> is the namespace set in the Name field, and <i> is the singular value index, ordered from largest to smallest. The input matrix with names <name>.T<i><j>, as well as the matrix determinant <name>.detT are also always defined.
In addition, all the following checkboxes are selected by default to provide the corresponding matrices and vectors as output.
Select the Compute left singular vectors checkbox to compute the left singular vectors and define corresponding variables <name>.U<i><j>, where index <i> corresponds to rows in the input matrix and <j> are principal value indices.
Select the Compute right singular vectors checkbox to compute the right singular vectors and define corresponding variables <name>.V<i><j>, where index <i> corresponds to columns in the input matrix and <j> are principal value indices.
Select the Compute rotation matrix checkbox to compute the rotation matrix and define corresponding variables <name>.R<i><j>, where index <i> corresponds to rows in the input matrix and <j> corresponds to columns. When the rotation matrix size is 3-by-3, the rotation can also be evaluated as a rotation by an angle <name>.theta around a normalized rotation axis with components <name>.n<i>.
Select the Compute stretch matrix checkbox to compute the stretch matrix and define corresponding variables <name>.P<i><j>, where indices <i> and <j> corresponds to columns in the input matrix.
You can use individual components where variable expressions are allowed, but also evaluate complete vectors and matrices at once using a matrix evaluation node under Derived Values. For example, to evaluate the complete matrix of right singular vectors, select matdec1.V under Model > Component 1 > Definitions > Matrix Decomposition (SVD) 1 > Right singular vectors if the node has been defined as Matrix Decomposition (SVD) 1 with the name matdec1 in Component 1.