<eigenDecomposition>
<eigenDecomposition> takes a square matrix supplied as a single
<math> child (or a reference to one). It produces no visible output of its own; instead it exposes the
results as the properties eigenvalues, eigenvectors, and numEigenvectors so they can be rendered, used in
computations, or referenced from other components. The returned eigenvectors are normalized to unit length, and
complex eigenvalues/eigenvectors are supported.
Attributes and Properties
Attributes for <eigenDecomposition>
Number display (5)
avoidScientificNotationboolean. Default value: false. Whether to render numbers in full decimal form rather than scientific notation.
displayDecimalsinteger. Default value: 2. Number of decimal places to display when rendering this number.
displayDigitsinteger. Default value: 3. Number of significant digits to display when rendering this number.
displaySmallAsZeronumber. Default value: 1e-14. Threshold below which numbers are displayed as zero.
padZerosboolean. Default value: false. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <eigenDecomposition name="e">
Number display (5)
$e.avoidScientificNotationboolean. Whether to render numbers in full decimal form rather than scientific notation.
$e.displayDecimalsinteger. Number of decimal places to display when rendering this number.
$e.displayDigitsinteger. Number of significant digits to display when rendering this number.
$e.displaySmallAsZeronumber. Threshold below which numbers are displayed as zero.
$e.padZerosboolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Other (7)
$e.disabledboolean. Whether this component is disabled and cannot be interacted with.
$e.eigenvalues[ number ]. The eigenvalues of the matrix.
$e.eigenvectors[ number ]. The eigenvectors of the matrix, as a 2D array (one column per eigenvalue).
$e.fixedboolean. Whether this component's value is fixed and cannot be modified.
$e.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$e.numEigenvectorsinteger. The number of eigenvectors found in the decomposition.
Common to all components (4)
$e.doenetMLtext. The DoenetML source code that produced this component.
$e.hideboolean. Whether to hide this component from the rendered output.
$e.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$e.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Eigenvalues and eigenvectors of a 2×2 matrix
The matrix is provided as a <math> child of <eigenDecomposition>. The eigenvalues and
eigenvectors properties are lists.
Example: Individual eigenvalues and eigenvectors
The list properties can also be indexed: eigenvalues[1], eigenvalues[2], … select individual eigenvalues, and
eigenvectors[1], eigenvectors[2], … select individual eigenvectors. Each indexed eigenvector is itself a
vector whose components can be accessed via .x, .y, (and .z for 3×3 matrices).
Example: Complex eigenvalues
The eigendecomposition handles complex eigenvalues/eigenvectors natively. The matrix above is a rotation-scaling matrix with eigenvalues and complex eigenvectors.
Example: Visualizing real eigenvectors in a phase plane
Because each eigenvector is exposed as a coordinate, it can be passed directly to a graphical component such as
<vector>. This makes <eigenDecomposition> useful for illustrating the eigenstructure of
a 2×2 system matrix in a phase plane.
Example: Using the decomposition with a user-input matrix
The matrix child can be a literal <math>, a reference, or any expression that evaluates to a square
matrix — including the value of a <matrixInput>. The numEigenvectors property reports
the number of eigenvectors found; it is 0 when the child cannot be interpreted as a square numeric matrix.
Property Examples
Property Example: eigenvalues
eigenvalues is the list of eigenvalues. It can be rendered as a list or accessed by index with
eigenvalues[i].
Property Example: eigenvectors
eigenvectors is a 2-D array (one row per eigenvector). Each eigenvector is normalized to unit length; access
an individual eigenvector with eigenvectors[1], eigenvectors[2], … and its components with .x, .y, .z.