Eig (General)
Shippingmatrix_eigGeneral (non-symmetric) eigen-decomposition with real+imag facade ports and unified complex arrays
Signature
Inputs
aSignal|Arrayrequired— A general (possibly non-symmetric) square 2-D matrix.
Outputs
eigenvalues_reVector— Real parts of the eigenvalues (legacy compat facade).eigenvalues_imVector— Imaginary parts of the eigenvalues (legacy compat facade).eigenvectors_reMatrix— Real parts of the eigenvectors (legacy compat facade).eigenvectors_imMatrix— Imaginary parts of the eigenvectors (legacy compat facade).eigenvaluesArray— Eigenvalues as a unified complex array (eps-collapses to real for a real spectrum).eigenvectorsArray— Eigenvectors as a unified complex array.
Description
Eig (General) computes the eigen-decomposition of a general (not necessarily symmetric) square matrix via MKL LAPACK, where eigenvalues and eigenvectors may be complex even for a real input (a rotation matrix, for example, has complex-conjugate eigenvalues).
It exposes six output ports. Four legacy real ports — eigenvalues_re, eigenvalues_im, eigenvectors_re, eigenvectors_im — form a compatibility facade so previously-saved .cap wirings keep working. Two unified complex Array ports — eigenvalues and eigenvectors — carry the spectrum as single complex arrays and are the recommended modern outputs; they automatically eps-collapse to real when the spectrum is real. All outputs are dimensionless.
When you know the matrix is symmetric, prefer matrix_eigh: it is faster, guarantees real results, and returns an orthonormal basis.
Mathematics
Examples
Complex eigenvalues of a rotation
The rotation has eigenvalues . On this node the legacy eigenvalues_im port reads , while the unified eigenvalues complex-array port reports two values each with magnitude .
Applications
- Stability analysis of non-symmetric state matrices (eigenvalues in the complex plane).
- Modal decomposition of general (damped, gyroscopic) dynamical systems.
- Spectral analysis where complex conjugate pairs encode oscillatory modes.
- Migrating older graphs that read separate real/imag eigen ports.
Neat
The four real re/im ports are a deliberate compatibility facade so old saved graphs never break, while #126's unified complex Array ports are the clean modern path.
The complex arrays eps-collapse to real automatically, so a genuinely real spectrum doesn't drag along a zero imaginary part downstream.
Known issues
For symmetric matrices this is slower and less accurate than matrix_eigh and may return tiny spurious imaginary parts — prefer eigh when symmetry holds.
Eigenvector scaling and phase are not unique for complex spectra, so vector columns may differ (by a unit-modulus factor) across runs.