Linear Algebra

5.2 Diagonalization of Matrices

Imron Rosyadi

Diagonalization of Matrices: Simplifying Systems in ECE

Why Diagonalization?

Diagonalization is a powerful technique in Linear Algebra that simplifies complex matrix operations.

It involves transforming a matrix into a special diagonal form.

Benefits:

  • Simplifies computations: Especially for matrix powers.
  • Reveals system behavior: Eigenvalues and eigenvectors provide insights into dynamics.
  • Decouples systems: Transforms coupled systems into independent ones, easing analysis.

Core Idea:

Imagine viewing a complex system from a “better” perspective. Diagonalization finds this perspective (a new basis) where the system’s behavior becomes much simpler.

This “simpler” form is a diagonal matrix, where non-diagonal elements are zero.

Note

In ECE, diagonalization is crucial for analyzing:

  • Control Systems
  • Signal Processing
  • Circuit Analysis
  • Vibration Analysis

Similarity Transformations

A square matrix \(B\) is similar to \(A\) if there exists an invertible matrix \(P\) such that:

\[ B = P^{-1}AP \]

This transformation, \(A \to P^{-1}AP\), is called a similarity transformation.

Intuition:

A similarity transformation is like changing the coordinate system in which a linear transformation (represented by matrix \(A\)) is viewed. The matrix \(P\) acts as a “change of basis” matrix.

  • \(P\): Transforms vectors from the new basis to the standard basis.
  • \(P^{-1}\): Transforms vectors from the standard basis to the new basis.

Tip

Similarity transformations preserve fundamental properties of the matrix, even though the matrix elements might change.

Similarity Transformations

Diagram: Change of Basis

flowchart LR
    subgraph Standard Basis
        X_std["Vector X"] --> A_std["A (Standard Basis)"]
    end

    subgraph New Basis
        X_new["Vector X'"] --> A_new["D (New Basis)"]
    end

    X_std -- "P^{-1}" --> X_new
    X_new -- "P" --> X_std

    A_std -- "P^{-1} (Change of Basis)" --> D["D = P^{-1}AP"]
    D -- "P (Change of Basis)" --> A_std

Similarity Invariants

Properties preserved under similarity transformations are called similarity invariants.

These are crucial because they tell us what fundamental aspects of a linear transformation remain the same, regardless of the chosen basis.

Key Invariants:

  • Determinant: \(\operatorname{det}(B) = \operatorname{det}(A)\)
  • Trace: \(\operatorname{tr}(B) = \operatorname{tr}(A)\)
  • Rank: \(\operatorname{rank}(B) = \operatorname{rank}(A)\)
  • Nullity: \(\operatorname{nullity}(B) = \operatorname{nullity}(A)\)
  • Characteristic Polynomial: \(p_B(\lambda) = p_A(\lambda)\)
  • Eigenvalues: \(A\) and \(P^{-1}AP\) have the same eigenvalues.

Important

If two matrices are similar, they share these fundamental characteristics.

Similarity Invariants

Interactive Example:

Enter a matrix \(A\) and an invertible matrix \(P\). Observe how key invariants remain the same for \(A\) and \(P^{-1}AP\).

What is a Diagonalizable Matrix?

A square matrix \(A\) is diagonalizable if it is similar to some diagonal matrix \(D\).

That is, if there exists an invertible matrix \(P\) such that:

\[ D = P^{-1}AP \]

In this case, the matrix \(P\) is said to diagonalize \(A\).

Why Diagonal?

Diagonal matrices are the simplest form of matrices. Their properties are immediately apparent:

  • Eigenvalues are the diagonal entries.
  • Determinant is the product of diagonal entries.
  • Powers are simply powers of the diagonal entries (e.g., \(D^k\) has \(\lambda_i^k\) on its diagonal).

The Goal:

Find \(P\) such that \(P^{-1}AP = D\).

This means we are looking for a basis (formed by the columns of \(P\)) where the linear transformation represented by \(A\) acts simply by scaling each basis vector.

The scaling factors are the eigenvalues on the diagonal of \(D\).

Note

Diagonalization provides a “canonical form” for certain matrices, revealing their intrinsic properties.

Theorem 5.2.1: The Diagonalization Condition

This theorem provides the fundamental condition for a matrix to be diagonalizable.

Theorem 5.2.1

If \(A\) is an \(n \times n\) matrix, the following statements are equivalent:

  1. \(A\) is diagonalizable.
  2. \(A\) has \(n\) linearly independent eigenvectors.

Key Insight:

  • If \(A\) has \(n\) linearly independent eigenvectors, these vectors can form the columns of the matrix \(P\).
  • The diagonal entries of \(D\) will be the eigenvalues corresponding to these eigenvectors.

So, to diagonalize \(A\), we need to find its eigenvalues and a set of \(n\) linearly independent eigenvectors.

Proof Intuition:

From \(P^{-1}AP = D\), we can write \(AP = PD\).

If \(P = [\mathbf{p}_1 \ \mathbf{p}_2 \ \dots \ \mathbf{p}_n]\) and \(D = \operatorname{diag}(\lambda_1, \lambda_2, \dots, \lambda_n)\), then:

\[ A[\mathbf{p}_1 \ \dots \ \mathbf{p}_n] = [\lambda_1\mathbf{p}_1 \ \dots \ \lambda_n\mathbf{p}_n] \]

This implies \(A\mathbf{p}_i = \lambda_i\mathbf{p}_i\) for each column \(\mathbf{p}_i\).

Thus, the columns of \(P\) are eigenvectors, and the diagonal entries of \(D\) are their corresponding eigenvalues.

Since \(P\) must be invertible, its columns (\(\mathbf{p}_i\)) must be linearly independent.

When is a Matrix Diagonalizable? (Theorem 5.2.2)

While Theorem 5.2.1 gives the necessary and sufficient condition, Theorem 5.2.2 provides a simpler, often quicker, way to check for diagonalizability in many cases.

Theorem 5.2.2

  1. If \(\lambda_1, \ldots, \lambda_k\) are distinct eigenvalues of a matrix \(A\), and if \(\mathbf{v}_1, \ldots, \mathbf{v}_k\) are corresponding eigenvectors, then \(\{\mathbf{v}_1, \ldots, \mathbf{v}_k\}\) is a linearly independent set.

  2. An \(n \times n\) matrix with \(n\) distinct eigenvalues is diagonalizable.

Implication of (b):

If an \(n \times n\) matrix has \(n\) different eigenvalues, then it is automatically diagonalizable!

You don’t even need to find the eigenvectors to know it’s diagonalizable.

This is a very common scenario in many ECE applications.

Example:

Consider a \(3 \times 3\) matrix \(A\) with eigenvalues \(\lambda_1=1\), \(\lambda_2=2\), \(\lambda_3=3\).

Since all three eigenvalues are distinct, \(A\) is guaranteed to be diagonalizable.

\[ A = \left[ \begin{array}{ccc}0 & 1 & 0 \\ 0 & 0 & 1 \\ 4 & -17 & 8 \end{array} \right] \]

This matrix has three distinct eigenvalues: \(\lambda = 4\), \(\lambda = 2 + \sqrt{3}\), and \(\lambda = 2 - \sqrt{3}\).

Therefore, \(A\) is diagonalizable.

Procedure for Diagonalizing an \(n \times n\) Matrix

If a matrix \(A\) is diagonalizable, here’s how to find \(P\) and \(D\):

Step 1: Find Eigenvalues

Calculate the characteristic equation \(\operatorname{det}(\lambda I - A) = 0\) and solve for the eigenvalues \(\lambda_1, \lambda_2, \ldots, \lambda_n\).

Step 2: Find Basis for Each Eigenspace

For each eigenvalue \(\lambda_i\), find a basis for the eigenspace \(E_{\lambda_i} = \operatorname{null}(\lambda_i I - A)\).

The goal is to find \(n\) linearly independent eigenvectors in total.

Procedure for Diagonalizing an \(n \times n\) Matrix

Step 3: Construct \(P\) and \(D\)

  • If you found \(n\) linearly independent eigenvectors \(\mathbf{p}_1, \mathbf{p}_2, \ldots, \mathbf{p}_n\), then \(A\) is diagonalizable.
  • Form \(P = [\mathbf{p}_1 \ \mathbf{p}_2 \ \dots \ \mathbf{p}_n]\).
  • Form \(D = \operatorname{diag}(\lambda_1, \lambda_2, \dots, \lambda_n)\), where each \(\lambda_i\) corresponds to \(\mathbf{p}_i\).

Step 4: Verify

Check that \(P^{-1}AP = D\).

Example 1: Finding a Matrix \(P\) That Diagonalizes \(A\)

Let’s diagonalize the matrix:

\[ A={\left[\begin{array}{l l l}{0}&{0}&{-2}\\ {1}&{2}&{1}\\ {1}&{0}&{3}\end{array}\right]} \]

Step 1 & 2: Eigenvalues & Eigenvectors

The characteristic equation is \((\lambda -1)(\lambda -2)^{2} = 0\). Eigenvalues are \(\lambda=1\) and \(\lambda=2\) (with algebraic multiplicity 2).

Bases for eigenspaces:

  • For \(\lambda=2\): \(\mathbf{p}_{1}={\left[\begin{array}{l}{-1}\\ {0}\\ {1}\end{array}\right]}\), \(\mathbf{p}_{2}={\left[\begin{array}{l}{0}\\ {1}\\ {0}\end{array}\right]}\)
  • For \(\lambda=1\): \(\mathbf{p}_{3}={\left[\begin{array}{l}{-2}\\ {1}\\ {1}\end{array}\right]}\)

We have three linearly independent eigenvectors for a \(3 \times 3\) matrix. Thus, \(A\) is diagonalizable!

Example 1: Finding a Matrix \(P\) That Diagonalizes \(A\)

Step 3: Construct \(P\) and \(D\)

Form \(P\) using these eigenvectors as columns:

\[ P={\left[\begin{array}{l l l}{-1}&{0}&{-2}\\ {0}&{1}&{1}\\ {1}&{0}&{1}\end{array}\right]} \]

Form \(D\) with corresponding eigenvalues on the diagonal:

\[ D={\left[\begin{array}{l l l}{2}&{0}&{0}\\ {0}&{2}&{0}\\ {0}&{0}&{1}\end{array}\right]} \]

Step 4: Verification (Interactive)

Let’s verify \(P^{-1}AP = D\) using Python.

Example 1: Finding a Matrix \(P\) That Diagonalizes \(A\)

Example 2: A Matrix That Is Not Diagonalizable

Not all matrices are diagonalizable. Consider this matrix:

\[ A = \left[ \begin{array}{rrr} 1 & 0 & 0 \\ 1 & 2 & 0 \\ -3 & 5 & 2 \end{array} \right] \]

Step 1: Find Eigenvalues

The characteristic polynomial of \(A\) is \((\lambda -1)(\lambda -2)^2 = 0\).

The distinct eigenvalues are \(\lambda = 1\) and \(\lambda = 2\).

Example 2: A Matrix That Is Not Diagonalizable

Step 2: Find Basis for Each Eigenspace

  • For \(\lambda = 1\): The eigenspace is 1-dimensional, with basis vector \(\mathbf{p}_1 = \left[ \begin{array}{c} \frac{1}{8} \\ -\frac{1}{8} \\ 1 \end{array} \right]\).
  • For \(\lambda = 2\): The eigenspace is also 1-dimensional, with basis vector \(\mathbf{p}_2 = \left[ \begin{array}{c} 0 \\ 0 \\ 1 \end{array} \right]\).

Conclusion:

Since \(A\) is a \(3 \times 3\) matrix, but we found only two linearly independent eigenvectors in total, \(A\) is not diagonalizable.

We need \(n=3\) linearly independent eigenvectors to diagonalize a \(3 \times 3\) matrix.

Warning

The existence of repeated eigenvalues does not automatically mean a matrix is not diagonalizable, but it does mean we need to check the dimension of the eigenspaces carefully.

Geometric and Algebraic Multiplicity

These concepts help us understand why some matrices with repeated eigenvalues are diagonalizable and others are not.

Algebraic Multiplicity (AM)

The number of times that \((\lambda - \lambda_0)\) appears as a factor in the characteristic polynomial of \(A\).

It’s the “count” of how many times an eigenvalue appears as a root.

Geometric Multiplicity (GM)

The dimension of the eigenspace corresponding to \(\lambda_0\). It’s the number of linearly independent eigenvectors associated with \(\lambda_0\).

Geometric and Algebraic Multiplicity

Theorem 5.2.4: Diagonalizability Criterion

  1. For every eigenvalue \(\lambda_0\) of \(A\), its geometric multiplicity is less than or equal to its algebraic multiplicity:

    \[ \operatorname{GM}(\lambda_0) \le \operatorname{AM}(\lambda_0) \]

  2. A is diagonalizable if and only if the geometric multiplicity of every eigenvalue is equal to its algebraic multiplicity.

    \[ \operatorname{GM}(\lambda_0) = \operatorname{AM}(\lambda_0) \quad \text{for all } \lambda_0 \]

Interactive: Multiplicities Check

Let’s use the matrices from previous examples to see their multiplicities.

Matrix A (Diagonalizable):

\[ A={\left[\begin{array}{l l l}{0}&{0}&{-2}\\ {1}&{2}&{1}\\ {1}&{0}&{3}\end{array}\right]} \] Expected: \(\lambda=1\) (AM=1, GM=1), \(\lambda=2\) (AM=2, GM=2)

Matrix B (Not Diagonalizable):

\[ B = \left[ \begin{array}{rrr} 1 & 0 & 0 \\ 1 & 2 & 0 \\ -3 & 5 & 2 \end{array} \right] \]

Expected: \(\lambda=1\) (AM=1, GM=1), \(\lambda=2\) (AM=2, GM=1)

Interactive: Multiplicities Check

Choose a Matrix:

ECE Application: Decoupling Systems

Many ECE systems are described by coupled differential equations, often represented in state-space form.

Diagonalization allows us to “decouple” these systems.

State-Space Representation:

A linear time-invariant system can be described by: \[ \dot{\mathbf{x}}(t) = A\mathbf{x}(t) + B\mathbf{u}(t) \] where \(\mathbf{x}\) is the state vector, \(\mathbf{u}\) is the input vector, and \(A\) is the system matrix.

If \(A\) is diagonalizable, we can define a new state vector \(\mathbf{z}(t) = P^{-1}\mathbf{x}(t)\).

Then \(\mathbf{x}(t) = P\mathbf{z}(t)\), and substituting into the state equation:

\[ P\dot{\mathbf{z}}(t) = AP\mathbf{z}(t) + B\mathbf{u}(t) \] \[ \dot{\mathbf{z}}(t) = P^{-1}AP\mathbf{z}(t) + P^{-1}B\mathbf{u}(t) \] \[ \dot{\mathbf{z}}(t) = D\mathbf{z}(t) + \tilde{B}\mathbf{u}(t) \] where \(D = P^{-1}AP\) and \(\tilde{B} = P^{-1}B\).

ECE Application: Decoupling Systems

Benefits of Decoupling:

The transformed system \(\dot{\mathbf{z}}(t) = D\mathbf{z}(t) + \tilde{B}\mathbf{u}(t)\) is much simpler:

  • Since \(D\) is diagonal, each state variable \(z_i\) evolves independently. \[ \dot{z}_i(t) = \lambda_i z_i(t) + \tilde{b}_i \mathbf{u}(t) \]
  • Easier Analysis: We can analyze each mode (eigenvalue) separately.
  • Simpler Control Design: Control strategies can be designed for each independent mode.
  • Modal Analysis: Eigenvalues \(\lambda_i\) represent the system’s natural modes (e.g., natural frequencies, damping ratios), and eigenvectors are the mode shapes.

ECE Application: Decoupling Systems

Diagram: Coupled vs. Decoupled Systems

G cluster_0 Coupled System (A) cluster_1 Decoupled System (D) x1 x₁ x1->x1 a₁₁ x2 x₂ x1->x2 a₂₁ x3 x₃ x1->x3 a₃₁ transform P⁻¹AP = D x1->transform x2->x1 a₁₂ x2->x2 a₂₂ x2->x3 a₃₂ x2->transform x3->x1 a₁₃ x3->x2 a₂₃ x3->x3 a₃₃ x3->transform z1 z₁ transform->z1 z2 z₂ transform->z2 z3 z₃ transform->z3 z1->z1 λ₁ z2->z2 λ₂ z3->z3 λ₃

Computing Powers of a Matrix (\(A^k\))

Computing high powers of a matrix \(A^k\) directly can be computationally intensive.

Diagonalization offers a highly efficient method.

The Formula:

If \(A\) is diagonalizable, \(P^{-1}AP = D\), which means \(A = PDP^{-1}\). Then, for any positive integer \(k\):

\[ A^k = (PDP^{-1})^k = (PDP^{-1})(PDP^{-1})\dots(PDP^{-1}) \] Since \(P^{-1}P = I\), intermediate terms cancel out: \[ A^k = PD (P^{-1}P) D (P^{-1}P) \dots (P^{-1}P) DP^{-1} = PD^kP^{-1} \] So, \[ A^k = P D^k P^{-1} = P \left[ \begin{array}{l l l l}{\lambda_{1}^{k}} & 0 & \dots & 0\\ 0 & {\lambda_{2}^{k}} & \dots & 0\\ \vdots & \vdots & & \vdots \\ 0 & 0 & \dots & {\lambda_{n}^{k}} \end{array} \right] P^{-1} \]

Computing Powers of a Matrix (\(A^k\))

Why is this efficient?

  • Raising a diagonal matrix \(D\) to the power \(k\) is trivial: just raise each diagonal entry to the power \(k\).
  • This avoids \(k-1\) matrix multiplications of \(A\) with itself, which is very costly for large \(k\).

Tip

This technique is vital in areas like Markov chains, difference equations, and simulating long-term system behavior.

Example 6: Powers of a Matrix (Interactive)

Let’s compute \(A^k\) for the matrix from Example 1 using diagonalization.

\[ A={\left[\begin{array}{l l l}{0}&{0}&{-2}\\ {1}&{2}&{1}\\ {1}&{0}&{3}\end{array}\right]} \]

We found \(P\) and \(D\): \[ P={\left[\begin{array}{l l l}{-1}&{0}&{-2}\\ {0}&{1}&{1}\\ {1}&{0}&{1}\end{array}\right]},\quad D={\left[\begin{array}{l l l}{2}&{0}&{0}\\ {0}&{2}&{0}\\ {0}&{0}&{1}\end{array}\right]} \]

Example 6: Powers of a Matrix (Interactive)

Choose Power \(k\):

Computed \(A^k\):

Summary & Key Takeaways

What We Covered:

  • Similarity Transformations: Changing basis while preserving core properties.
  • Diagonalizable Matrices: Matrices similar to a diagonal matrix (\(D=P^{-1}AP\)).
  • Key Condition: A matrix is diagonalizable iff it has \(n\) linearly independent eigenvectors.
  • Shortcut: \(n\) distinct eigenvalues guarantees diagonalizability.
  • Geometric vs. Algebraic Multiplicity: GM must equal AM for all eigenvalues for diagonalizability.

Summary & Key Takeaways

Why it Matters for ECE:

  • System Decoupling: Simplifies analysis and control of complex, coupled systems (e.g., state-space models).
  • Modal Analysis: Eigenvalues/eigenvectors reveal natural modes of behavior in circuits, signals, and control systems.
  • Efficient Computation: Drastically speeds up calculations of matrix powers, essential for simulations and long-term predictions.

Note

Diagonalization is a fundamental tool for understanding and manipulating linear systems in all areas of ECE.