Calculator overview
Inputs and outputs
This summary comes from the calculator's published input and output contract.
Inputs
- Start vector component 3 (required)
-
Default 0 Range -1 to 1
About this input
Component 3 of the start vector, -1 to 1, for the 3 by 3 matrix only. Drag bead 3 of the start-vector panel.
- Symmetric entry s11 (required)
-
Default 2 Range -10 to 10
About this input
Entry s11 of the 3 by 3 symmetric matrix (row 1, column 1), -10 to 10. Drag its cell on the matrix board up or down. Used rounded to 2 decimals.
- Start vector component 2 (required)
-
Default 0 Range -1 to 1
About this input
Component 2 of the start vector, -1 to 1. Drag the start arrow (2 by 2) or bead 2 (3 by 3). The components cannot all be zero.
- Shift (required)
-
Default 0 Range -30 to 30
About this input
The shift for inverse iteration, -30 to 30: the method settles on the eigenvalue nearest the shift, and faster the closer it is. Drag the shift marker along the number line. Used only with Inverse.
- Start vector component 1 (required)
-
Default 1 Range -1 to 1
About this input
Component 1 of the start vector, -1 to 1: where the power and inverse methods begin. Drag the start arrow (2 by 2) or bead 1 (3 by 3). The components cannot all be zero.
- Symmetric entry s23 (= s32) (required)
-
Default -1 Range -10 to 10
About this input
Entry s23 of the 3 by 3 symmetric matrix (row 2, column 3), equal to s32, -10 to 10. Drag either cell on the matrix board; its mirror follows. Used rounded to 2 decimals.
- Symmetric entry s33 (required)
-
Default 2 Range -10 to 10
About this input
Entry s33 of the 3 by 3 symmetric matrix (row 3, column 3), -10 to 10. Drag its cell on the matrix board up or down. Used rounded to 2 decimals.
- Symmetric entry s22 (required)
-
Default 2 Range -10 to 10
About this input
Entry s22 of the 3 by 3 symmetric matrix (row 2, column 2), -10 to 10. Drag its cell on the matrix board up or down. Used rounded to 2 decimals.
- Symmetric entry s12 (= s21) (required)
-
Default -1 Range -10 to 10
About this input
Entry s12 of the 3 by 3 symmetric matrix (row 1, column 2), equal to s21, -10 to 10. Drag either cell on the matrix board; its mirror follows. Used rounded to 2 decimals.
- Symmetric entry s13 (= s31) (required)
-
Default 0 Range -10 to 10
About this input
Entry s13 of the 3 by 3 symmetric matrix (row 1, column 3), equal to s31, -10 to 10. Drag either cell on the matrix board; its mirror follows. Used rounded to 2 decimals.
- Your prediction: eigenvalue 2
-
When omitted Blank
Default Not set Range -30 to 30
About this input
Challenge 1 only: your prediction of the other eigenvalue, -30 to 30. Drag the second marker onto the number line; until you do, it is not yet predicted.
- Method (required)
-
Default Power Allowed Power, Inverse, QR
About this input
How the eigenvalues are found step by step: Power (multiply again and again), Inverse (inverse iteration with a shift) or QR (QR iteration, 3 by 3 symmetric only). Picked with the chip on the player.
- Your prediction: eigenvalue 1
-
When omitted Blank
Default Not set Range -30 to 30
About this input
Challenge 1 only: your prediction of one eigenvalue, -30 to 30. Drag a prediction marker onto the number line; until you do, it is not yet predicted. The two predictions may match the two eigenvalues in either order.
- Challenge (required)
-
Default 0 Range 0 to 5
About this input
Pick a challenge from 1 to 5, or 0 for none. A challenge sets its own matrix and settings and leaves one control to you.
- Tolerance (required)
-
Default 0.0001 Allowed 0.01, 0.001, 0.0001, 1E-06, 1E-08
About this input
How close two successive estimates must be to count as settled: 0.01, 0.001, 0.0001 (the default), 0.000001 or 0.00000001, relative to the size of the estimate (at least 1). QR counts as settled when every off-diagonal entry is this small relative to the size of the matrix.
- Entry d (row 2, column 2) (required)
-
Default 1.5 Range -10 to 10
About this input
Entry d of the 2 by 2 matrix (row 2, column 2), -10 to 10. The second column arrow is (b, d): drag its tip. Used rounded to 2 decimals.
- Matrix size (required)
-
Default 2 by 2 Allowed 2 by 2, 3 by 3 symmetric
About this input
The matrix to explore: 2 by 2 (any real entries) or 3 by 3 symmetric (each entry above the diagonal is mirrored below it). Picked with the chips above the stage.
- Entry c (row 2, column 1) (required)
-
Default 0.5 Range -10 to 10
About this input
Entry c of the 2 by 2 matrix (row 2, column 1), -10 to 10. The first column arrow is (a, c): drag its tip. Used rounded to 2 decimals.
- Entry a (row 1, column 1) (required)
-
Default 2 Range -10 to 10
About this input
Entry a of the 2 by 2 matrix (row 1, column 1), -10 to 10. The first column arrow is (a, c): drag its tip. Used rounded to 2 decimals.
- Entry b (row 1, column 2) (required)
-
Default 1 Range -10 to 10
About this input
Entry b of the 2 by 2 matrix (row 1, column 2), -10 to 10. The second column arrow is (b, d): drag its tip. Used rounded to 2 decimals.
Outputs
- Method result
-
No unit declared
About this output
How the selected method ended: Settled, not settled within its step limit, or the reason it cannot settle.
- Method estimate
-
No unit declared
About this output
The power or inverse method's eigenvalue estimate (the Rayleigh quotient) at the settled step, or at the last step when it did not settle. Blank for QR.
- Measured rate
-
No unit declared
About this output
The factor by which the error actually shrank: the middle value of up to the last 5 step-to-step error ratios of the run (blank with fewer than 2).
- Formula module versions
-
No unit declared
About this output
The versions of the calculation modules it uses.
- Model version
-
No unit declared
About this output
The version of this lab's model.
- Model Status
-
No unit declared
About this output
OK when the matrix and settings are valid and the selected method settles; CHECK with the reason when it cannot (complex eigenvalues, two eigenvalues of the same size with opposite signs, a start with no part along the wanted direction, or not within the tolerance in time); NOT VALID with the input to fix.
- Largest eigenpair residual
-
No unit declared
About this output
The largest leftover of A v minus lambda v over the eigenvectors shown: 0 up to rounding.
- Entry d used
-
No unit declared
About this output
Entry d as used: rounded to 2 decimals, or set by a challenge; blank with the 3 by 3 matrix.
- Entry c used
-
No unit declared
About this output
Entry c as used: rounded to 2 decimals, or set by a challenge; blank with the 3 by 3 matrix.
- Entry b used
-
No unit declared
About this output
Entry b as used: rounded to 2 decimals, or set by a challenge; blank with the 3 by 3 matrix.
- Trace
-
No unit declared
About this output
The sum of the diagonal entries. It always equals the sum of the eigenvalues.
- Matrix size used
-
No unit declared
About this output
The matrix size used (a challenge may set it).
- Matrix size (Frobenius norm)
-
No unit declared
About this output
The size of the matrix: the square root of the sum of the squares of all its entries.
- Predicted rate
-
No unit declared
About this output
The factor by which the error should shrink each step, from the exact eigenvalues: the next-largest size over the largest (power), the nearest distance from the shift over the next (inverse), or the slowest ratio of neighbouring sizes (QR).
- s13 used
-
No unit declared
About this output
Entry s13 as used: rounded to 2 decimals, or set by a challenge; blank with the 2 by 2 matrix.
- s12 used
-
No unit declared
About this output
Entry s12 as used: rounded to 2 decimals, or set by a challenge; blank with the 2 by 2 matrix.
- s11 used
-
No unit declared
About this output
Entry s11 as used: rounded to 2 decimals, or set by a challenge; blank with the 2 by 2 matrix.
- s33 used
-
No unit declared
About this output
Entry s33 as used: rounded to 2 decimals, or set by a challenge; blank with the 2 by 2 matrix.
- s23 used
-
No unit declared
About this output
Entry s23 as used: rounded to 2 decimals, or set by a challenge; blank with the 2 by 2 matrix.
- s22 used
-
No unit declared
About this output
Entry s22 as used: rounded to 2 decimals, or set by a challenge; blank with the 2 by 2 matrix.
- Steps to the tolerance
-
No unit declared
About this output
The first step at which the method counted as settled (blank when it did not settle).
- Shift used
-
No unit declared
About this output
The shift as used: rounded to 2 decimals; blank unless the method is Inverse.
- QR iteration, rows k = 0 to 30: the diagonal, the off-diagonal entries, the largest off-diagonal and the off-diagonal shades (0 to 1)
-
No unit declared
About this output
QR iteration step by step, from step 0 to 30 (QR only): the three diagonal entries, the three off-diagonal entries, the largest off-diagonal size, and a 0 to 1 shade for each off-diagonal entry (its size over the largest off-diagonal size of the whole run) that fades the board cells.
- QR diagonal error after 30 steps
-
No unit declared
About this output
QR only: the largest gap between the diagonal after 30 QR steps and the exact eigenvalues.
- Start component 3 used
-
No unit declared
About this output
Start component 3 as used: rounded to 2 decimals, or set by a challenge; blank with the 2 by 2 matrix.
- Start component 2 used
-
No unit declared
About this output
Start component 2 as used: rounded to 2 decimals, or set by a challenge.
- Start component 1 used
-
No unit declared
About this output
Start component 1 as used: rounded to 2 decimals, or set by a challenge.
- Entry a used
-
No unit declared
About this output
Entry a as used: rounded to 2 decimals, or set by a challenge; blank with the 3 by 3 matrix.
- Challenge score
-
No unit declared
About this output
100 when the selected challenge is met, else 0.
- Challenge: the value scored
-
No unit declared
About this output
The value the selected challenge scores: how far the image misses (challenges 2 and 3), the steps taken (challenge 4) or the size difference of the two eigenvalues (challenge 5); blank in challenge 1.
- Image of the challenge vector, 3
-
No unit declared
About this output
For the canvas in challenge 3: component 3 of where the matrix sends the challenge vector. Blank otherwise.
- Dominant eigenvalue
-
No unit declared
About this output
The eigenvalue of largest size, the one the power method approaches. Blank when two eigenvalues have the same size with opposite signs, or the eigenvalues are complex.
- Tolerance used
-
No unit declared
About this output
The tolerance used (a challenge may set it).
- Challenge result
-
No unit declared
About this output
No challenge selected, NOT MET or MET.
- Image of the challenge vector, 2
-
No unit declared
About this output
For the canvas in challenges 2 and 3: component 2 of where the matrix sends the challenge vector. Blank otherwise.
- Challenge vector, component 3
-
No unit declared
About this output
For the canvas in challenge 3: component 3 of the vector the challenge is about. Blank otherwise.
- Challenge vector, component 2
-
No unit declared
About this output
For the canvas in challenges 2 and 3: component 2 of the vector the challenge is about. Blank otherwise.
- Challenge vector, component 1
-
No unit declared
About this output
For the canvas in challenges 2 and 3: component 1 of the vector the challenge is about. Blank otherwise.
- Image of the challenge vector, 1
-
No unit declared
About this output
For the canvas in challenges 2 and 3: component 1 of where the matrix sends the challenge vector. Blank otherwise.
- Challenge goal
-
No unit declared
About this output
What the selected challenge asks.
- Challenge feedback
-
No unit declared
About this output
A hint while the selected challenge is not met (in challenge 1, first the prompt to predict), then the explanation once it is met.
- Eigen structure
-
No unit declared
About this output
What kind of eigenvalues the matrix has: different real ones, a repeated one (with a single direction, or with every direction an eigenvector), or a complex pair with no real direction that stays put.
- Method used
-
No unit declared
About this output
The method used (a challenge may set it).
- Power or inverse iteration, rows k = 0 to 40: the unit iterate, the Rayleigh quotient, its step change and the direction error
-
No unit declared
About this output
The power or inverse method step by step, from step 0 to 40 (20 for inverse): the step, the unit vector x1, x2, x3, the eigenvalue estimate, the change from the step before and the distance from the wanted eigenvector direction. Blank for QR and after the last step.
- Eigenvalue the shift targets
-
No unit declared
About this output
Inverse only: which eigenvalue (1, 2 or 3, in increasing order) is nearest the shift, the one inverse iteration finds.
- Determinant
-
No unit declared
About this output
The determinant of the matrix. It always equals the product of the eigenvalues.
- The Jacobi sweep: the pair rotated and the relative off-diagonal size after each of the 18 rotations
-
No unit declared
About this output
3 by 3 only: the 18 Jacobi rotations, each with its row and column pair and the off-diagonal size left after it, relative to the size of the matrix.
- Off-diagonal left after the sweep
-
No unit declared
About this output
3 by 3 only: the off-diagonal size left after the 18 Jacobi rotations, relative to the size of the matrix. Near 0 means the eigenvalues are accurate.
- Gershgorin intervals: each row's centre and the interval ends
-
No unit declared
About this output
One row per matrix row: the centre (the diagonal entry) and the low and high ends of its Gershgorin interval. Every real eigenvalue lies in at least one interval.
- Eigenvalue 2
-
No unit declared
About this output
The next eigenvalue in increasing order (the larger one for a 2 by 2 matrix).
- Eigenvalue 1
-
No unit declared
About this output
The smallest eigenvalue (by real part), found exactly: by the closed form for 2 by 2, by Jacobi rotations for 3 by 3.
- The eigenvalues (real part, imaginary part), the eigenvectors shown, their residuals and a note
-
No unit declared
About this output
One row per eigenvalue in increasing order: the eigenvalue (real part), the imaginary part, the unit eigenvector (v1, v2, v3; blank when every direction of a repeated eigenvalue works, or for a complex pair), the leftover A v minus lambda v, and a note (repeated, defective, complex or every direction).
- The eigshow sweep: 72 unit vectors x, their images A x, and the cross product that changes sign at an eigen direction
-
No unit declared
About this output
2 by 2 only: 72 unit vectors x around the circle in 5 degree steps, their images A x, and a cross value that changes sign where A x lines up with x, at the eigenvector directions.
- Imaginary part (complex pair)
-
No unit declared
About this output
For a complex pair, the size of the imaginary part: the eigenvalues are the real part plus or minus this times i. Blank for real eigenvalues.
- Eigenvalue 3
-
No unit declared
About this output
The largest eigenvalue of a 3 by 3 matrix (blank for 2 by 2).
LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.
Methodology
Purpose and model boundary
This lab finds the eigenvalues and eigenvectors of a small matrix and plays, step by step, three classic methods that find them. The matrix is either a 2 by 2 real matrix with any entries from -10 to 10, solved exactly by the closed form of its characteristic equation, or a 3 by 3 symmetric matrix, solved by 18 cyclic Jacobi rotations. The methods are the power method (up to 40 steps), inverse iteration with a shift (up to 20 steps) and, for the 3 by 3 matrix, unshifted QR iteration by Givens rotations (up to 30 steps). The model returns the eigenvalues in increasing order, the unit eigenvectors, what kind of eigenvalues the matrix has, the trace, the determinant, the Gershgorin intervals, every step of the selected method with its estimate, the step at which it settled, the predicted and measured rates of convergence, and, for the 2 by 2 matrix, a sweep of 72 unit vectors and their images. Five scored challenges go with it.
It is a lab for learning what eigenvalues and eigenvectors are and how they are computed: why the eigen directions are where a vector and its image line up, why close eigenvalues make the power method slow, why a complex pair never settles, and why a shift speeds inverse iteration. It is not a general eigenvalue solver. It handles only 2 by 2 matrices and 3 by 3 symmetric matrices with entries from -10 to 10, it uses every entry rounded to 2 decimals, and it shows no eigenvector for a complex pair.
The model is the calculation authority. The page sends the values you set to the model and draws only what it returns: the circle and its image, the eigenvector lines, the iterates, the eigenvalue dots and Gershgorin bars, the board during QR iteration and the mode panels all come from the model's own tables. The page computes no eigenvalue, eigenvector, iterate or rate itself.
Inputs and units
Every input is a pure number or a choice; the lab has no physical units. Every matrix entry, start component and the shift are used rounded to 2 decimals.
| Input | Meaning and unit |
|---|---|
| Matrix | 2 by 2 (default; any real entries) or 3 by 3 symmetric (each entry above the diagonal mirrored below it). |
| Method | Power (default), Inverse (inverse iteration with a shift) or QR (3 by 3 symmetric only). |
| Entries a, b, c and d | The 2 by 2 matrix [[a, b], [c, d]], each from -10 to 10 (defaults 2, 1, 0.5 and 1.5). The first column is (a, c) and the second (b, d). 2 by 2 only. |
| Entries s11, s22, s33, s12, s13 and s23 | The 3 by 3 symmetric matrix, each from -10 to 10 (defaults 2, 2, 2, -1, 0 and -1). 3 by 3 only. |
| Start vector, components 1 to 3 | Where the power and inverse methods begin, each from -1 to 1 (defaults 1, 0 and 0); they cannot all be zero after rounding. Component 3 is for the 3 by 3 matrix only. |
| Shift | σ, from -30 to 30 (default 0): inverse iteration settles on the eigenvalue nearest the shift. Inverse only. |
| Tolerance | 0.01, 0.001, 0.0001 (default), 0.000001 or 0.00000001: how close two successive estimates must be to count as settled. |
| Challenge number | 0 for free exploration, or 1 to 5 to load a challenge. |
| Your predictions of the two eigenvalues | Each blank (not yet predicted) or a number from -30 to 30: your answers for challenge 1. |
An input that does not apply (the 2 by 2 entries with the 3 by 3 matrix, the symmetric entries and the third start component with the 2 by 2 matrix, the shift unless the method is Inverse) is not checked or read; the model uses its default.
Where each input is set:
- On the canvas only: the matrix size (two chips above the stage) and the method (chips on the player; QR only for the 3 by 3 matrix); the 2 by 2 entries, by dragging the tips of the two column arrows; the 3 by 3 entries, by dragging a cell of the matrix board up or down (its mirror cell follows); the start vector, by dragging the start arrow (2 by 2) or three beads (3 by 3); the shift, by dragging its marker along the number line (Inverse only); and your predictions, two markers dragged onto the number line (challenge 1 only). None of these is in the input panel. At the Explore level the size and method chips are hidden: the lab stays 2 by 2 with the power method.
- In the input panel: the tolerance and the challenge number.
Governing relationships
Eigenvalues and eigenvectors. A vector v that is not zero is an eigenvector of A with eigenvalue λ when A·v = λ·v: the matrix only stretches it. The sum of the eigenvalues equals the trace and their product the determinant. With sN = max(1, ‖A‖_F), where ‖A‖_F is the square root of the sum of the squares of all entries, every small threshold below is relative to the size of the matrix.
The 2 by 2 closed form. For A = [[a, b], [c, d]] the model forms the trace τ = a + d, the determinant Δ = a·d - b·c, h = τ/2, m = (a - d)/2 and the discriminant disc = m² + b·c, which is never negative for a symmetric matrix. Then:
- Repeated, when |disc| ≤ 1×10⁻¹² · (m² + |b·c|): every direction is an eigenvector when |b| + |c| ≤ 1×10⁻¹² · (|a| + |d|), otherwise there is a single direction (a defective matrix). The eigenvalue is h.
- Two real eigenvalues, when disc > 0: the larger in size is λ_big = h ± √disc, with the sign of h (+ when h = 0), and the other is Δ/λ_big, so no digits cancel.
- A complex pair, otherwise: h ± i·√(-disc).
An eigenvector for a real eigenvalue λ is perpendicular to the larger row of A - λ·I, scaled to unit length. Its component of largest size is made positive (on a tie within one part in a billion, the first such component).
The 3 by 3 symmetric matrix: cyclic Jacobi. The model applies 18 plane rotations to A + 31·I, cycling the pairs (1, 2), (1, 3) and (2, 3) six times, and accumulates the rotations in V. A rotation on the pair (p, q) is skipped when |a_pq| ≤ 1×10⁻¹⁵ · √|a_pp·a_qq|; otherwise θ = (a_qq - a_pp)/(2·a_pq), t = sign(θ)/(|θ| + √(θ² + 1)), c = 1/√(t² + 1) and s = t·c, which zeroes a_pq. Adding 31 to the diagonal makes every diagonal entry at least 1, so no step can overflow, and it changes no rotation angle, so the rotations are those of A itself. The eigenvalues are the final diagonal less 31, sorted ascending, with any value within 1×10⁻¹³ · sN of 0 read as 0; the columns of V are the eigenvectors, with the same sign rule. Two eigenvalues within 1×10⁻⁹ · sN of each other are a repeated pair, and their eigenvectors are not shown, because every direction in their plane is one. If the off-diagonal size left after the 18 rotations is above 1×10⁻¹³ of the size of A + 31·I, the sweep has not settled.
Gershgorin intervals. For each row i, the interval centred on the diagonal entry a_ii with radius the sum of the sizes of the other entries in that row. Every real eigenvalue lies in at least one interval.
The power method. From the unit start x₀, each step forms y = A·x and the next unit vector x = y/‖y‖. The estimate is the Rayleigh quotient μ = xᵀ·A·x. If y points against x (y·x < -1×10⁻⁹ · ‖y‖) the next arrow is turned round, so a negative eigenvalue does not make the arrow flip each step; the sign of the eigenvalue is read from μ. The method settles at the first step k from 1 to 40 with |μ_k - μ_(k-1)| ≤ tol · max(1, |μ_k|). It approaches the eigenvalue of largest size, the dominant one, and the error shrinks each step by about the next-largest size over the largest.
Inverse iteration with a shift. The same steps with y = adj(A - σ·I)·x, where adj is the adjugate, so that y points along (A - σ·I)⁻¹·x without dividing by a determinant. It settles, within 20 steps, on the eigenvalue nearest the shift; the error shrinks each step by about the distance from the shift to that eigenvalue over the distance to the next nearest. A shift exactly on a simple eigenvalue finds its eigenvector at once.
What can stop a method, decided from the exact eigenvalues.
- A complex pair: no real direction stays put.
- No single dominant eigenvalue (power method): the smallest and largest eigenvalues have opposite signs and sizes within 1×10⁻⁹ · sN.
- A halfway shift (inverse iteration): the shift is equally far, within 1×10⁻⁹ · sN, from the two nearest distinct eigenvalues.
- No part along the wanted direction: the unit start's part along the target eigenvector is at most 1×10⁻⁹, so the method would settle on another eigenvalue. For a 2 by 2 matrix with two real eigenvalues this is the start lying along the other eigenvector.
- Start mapped to zero: a step gives ‖y‖ ≤ 1×10⁻¹² · sN (power) or ≤ 1×10⁻¹² · sM^(n-1) (inverse, with sM = max(1, ‖A - σ·I‖_F) and n the size).
Rates of convergence. The direction error at each step is the distance from the unit iterate to the target eigenvector direction (or plane). The measured rate is the middle value of up to the last 5 step-to-step ratios of that error, counting only ratios whose earlier error is above 1×10⁻⁸ and later error above 1×10⁻¹⁰; it is blank with fewer than 2 such ratios. The predicted rate comes from the exact eigenvalues: the largest size outside the dominant eigenvalue over the dominant size (power; 1 for a defective 2 by 2 matrix), the distance from the shift to the target over the distance to the next nearest eigenvalue (inverse), or the slowest ratio of neighbouring eigenvalue sizes (QR).
Unshifted QR iteration (3 by 3). Each step factors the matrix into Q·R with three Givens rotations, on the pairs (1, 2), (1, 3) and (2, 3), and forms the next matrix R·Q. A rotation on a pair whose entries are both at most 1×10⁻¹⁵⁰ in size is skipped. The off-diagonal entries shrink and the diagonal approaches the eigenvalues. QR iteration settles at the first step k from 0 to 30 at which every off-diagonal entry is at most tol · sN; an already diagonal matrix settles at step 0. Two eigenvalues of the same size and opposite signs cannot separate.
The sweep (2 by 2). 72 unit vectors x at 5-degree steps round the circle, each with its image A·x and the cross value x₁·(A·x)₂ - x₂·(A·x)₁, which changes sign where A·x lines up with x: at the eigenvector directions.
Residuals. For each eigenvector shown, the size of A·v - λ·v, read as 0 at rounding level.
Calculation sequence
- The model checks your values in the order of the status list under Errors and warnings, on the values entered, skipping inputs that do not apply.
- In a challenge it fixes the challenge's own matrix and settings, except the inputs that challenge leaves to you, and rounds every entry, start component and the shift to 2 decimals.
- It forms the active matrix, its size, trace, determinant and Gershgorin intervals.
- It finds the exact eigenvalues and eigenvectors: by the closed form for 2 by 2, by 18 Jacobi rotations for 3 by 3.
- From them it decides the dominant eigenvalue, the target of inverse iteration, whether the start has a part along the wanted direction, and the predicted rate.
- It runs the selected method row by row: the power method or inverse iteration with its estimate, step change and direction error, or QR iteration with its diagonal and off-diagonal entries.
- It reads the settling step, the estimate and the measured rate, and for the 2 by 2 matrix computes the sweep.
- It sets the status and, in a challenge, scores the challenge and withholds what that challenge keeps back.
Outputs and interpretation
- Eigenvalues 1 to 3, in increasing order (by real part), and for a complex pair the imaginary part: the eigenvalues are the real part plus or minus this times i. Eigenvalue 3 is for the 3 by 3 matrix only.
- Kind of eigenvalues: Two different real eigenvalues; One repeated eigenvalue with a single eigenvector direction; One repeated eigenvalue: every direction is an eigenvector; A complex pair: no real direction stays put; Three different eigenvalues; A repeated pair: every direction in their plane is an eigenvector; or All three equal: every direction is an eigenvector.
- Trace and determinant: always the sum and the product of the eigenvalues.
- Dominant eigenvalue: the one of largest size, which the power method approaches; blank for a complex pair or when two eigenvalues have the same size with opposite signs.
- Method status: Settled, Not settled in 40 (or 20, or 30) steps, or the reason it cannot settle: Complex eigenvalues, No single dominant eigenvalue, Start mapped to zero, No part along the dominant (or target) direction, Shift halfway, or Equal sizes cannot separate.
- Steps to the tolerance: the first step that counted as settled.
- Method estimate: the Rayleigh quotient at the settled step, or at the last step when the method did not settle or the start had no part along the wanted direction. Blank for QR.
- Inverse target: which eigenvalue, 1, 2 or 3 in increasing order, is nearest the shift.
- Predicted rate and measured rate of convergence.
- Matrix size (‖A‖_F), Jacobi off-diagonal size left after the 18 rotations (3 by 3), QR diagonal error (the largest gap between the diagonal after 30 QR steps and the exact eigenvalues, both sorted) and largest residual of the eigenvectors shown.
- Settings used: the matrix size, method, entries, start components, shift and tolerance in effect, as rounded or set by a challenge.
- Eigen table: one row per eigenvalue with its real and imaginary parts, its unit eigenvector, its residual and a note (repeated, defective, complex or every direction).
- Gershgorin table, iteration frames (step, unit vector, estimate, change from the step before and direction error), QR frames (step, the three diagonal and three off-diagonal entries, the largest off-diagonal size, and each off-diagonal entry's size over the largest of the run, used to fade the board), the sweep and the Jacobi table (each rotation's pair and the off-diagonal size left after it).
Reading the canvas: for the 2 by 2 matrix the plane shows the unit circle and its image under the matrix, the two column arrows, the start arrow and the eigenvector lines, with an arrow pair x and A·x that sweeps round the circle on its own player. The method's iterates step as arrows with the player. The number line shows the eigenvalues as dots (real parts), the Gershgorin intervals as bars, the shift marker and the Rayleigh quotient stepping with the frames. From the Experiment level the 3 by 3 matrix appears as a board, whose off-diagonal cells fade as QR iteration proceeds, with each eigenvector drawn as three beads on a line and the start vector as three draggable beads. No value is printed on the canvas.
What to take from the lab: the eigen directions are where a vector and its image line up, and the eigenvalues of a triangular matrix are its diagonal entries. The power method settles on the dominant eigenvalue at a rate set by the next-largest size over the largest, so close eigenvalues are slow; a complex pair never settles, because the arrow keeps turning; and two real eigenvalues of the same size with opposite signs make the arrow swing back and forth for ever. Inverse iteration finds the eigenvalue nearest the shift, faster the closer the shift. A start with no part along the wanted direction settles on another eigenvalue. QR iteration separates the eigenvalues of a symmetric matrix at a rate set by the ratios of neighbouring sizes.
Challenges
Each challenge loads its own matrix and settings (tolerance 0.0001, except 0.00000001 in challenge 4) and leaves only the controls it names to you. The model scores each one MET (100) or NOT MET (0) and gives a one-line hint while it is not met. Challenges 1, 2 and 5 are offered at every level, challenges 3 and 4 from the Experiment level.
- Predict the eigenvalues (introductory). The triangular matrix [[3, 1], [0, 2]]. Predict both eigenvalues by dragging the two markers onto the number line. Met when, in either order, each prediction lies within 0.05 of one of the two eigenvalues.
- Make (1, 2) an eigenvector (intermediate). Drag the column arrows so that (1, 2) becomes an eigenvector with eigenvalue 3: the matrix must send it to (3, 6). Met when it lands within 1×10⁻⁶ of (3, 6); the value scored is that distance.
- Tune a mode (introductory). A 3 by 3 symmetric matrix with s11 = 2, s22 = 3, s12 = -1, s13 = 0 and s23 = -1. Drag the bottom-right cell of the board until (1, 0, -1) is a mode of the matrix. Met when the residual of the best stretch of (1, 0, -1), ‖A·u - ρ·u‖/√2 with ρ = (u·A·u)/2, is at most 1×10⁻⁶; the value scored is that residual.
- Aim the shift (intermediate). The 3 by 3 matrix [[2, -1, 0], [-1, 2, -1], [0, -1, 2]] with inverse iteration from (1, 0, 0). Drag the shift so inverse iteration settles on the middle eigenvalue within 5 steps. Met when it settles, its target is the middle eigenvalue and it takes at most 5 steps; the value scored is the steps.
- Break the power method (intermediate). Drag the column arrows to break the power method: two real eigenvalues of the same size with opposite signs. Met when the 2 by 2 matrix has them; the status then reads CHECK by design. The value scored is the difference of the two sizes.
Challenge 1 holds back the answer until you predict: while either prediction is blank, the eigenvalues, the dominant eigenvalue, the estimate, the rates, the steps, the largest residual, the whole eigen table and the estimate and step-change columns of the frames are blank, and the eigenvalue dots and eigenvector lines are not drawn. The sweep, the trace and the determinant, the kind of eigenvalues and the Gershgorin intervals stay, and the challenge prompts you to drag both markers onto the number line. Once both are placed, everything shows, met or not. Until met, challenges 2 and 3 withhold the eigenvectors and their residuals, and challenge 4 withholds the eigenvalues, the dominant eigenvalue and the predicted rate; the Gershgorin intervals, the estimate, the target, the steps and the frames stay. Challenge 5 withholds nothing: the swinging arrow is the lesson.
Validation and status logic
The status reads the first match in the list under Errors and warnings: the NOT VALID checks on the values entered (only for the inputs that apply; the predictions change nothing outside challenge 1), then the Jacobi check for the 3 by 3 matrix, then only the CHECK items of the selected method, then OK. Items of a method that is not selected never raise the status. A challenge number that is not a whole number from 0 to 5 counts as no challenge. CHECK items apply inside challenges too: challenge 5 is met exactly when the power method cannot settle.
Assumptions and limitations
- 2 by 2 real matrices and 3 by 3 symmetric matrices only, entries from -10 to 10, used rounded to 2 decimals.
- At most 40 power steps, 20 inverse steps and 30 QR steps; the 3 by 3 eigensystem uses 18 Jacobi rotations.
- Dominance, complexity, a halfway shift and a missing part along the target are decided from the exact eigenvalues, never from the iterates. QR settling is read from the iterates.
- The measured rate is an estimate from at most 5 error ratios; it is blank with fewer than 2.
- Complex eigenvectors are not shown, and nor are the eigenvectors of a repeated eigenvalue whose every direction (or every direction in a plane) is an eigenvector.
- When the start has no part along the wanted direction, the later frames show rounding noise growing along the missing direction.
- Because every input sits on the 0.01 grid, the repeated, equal-size and halfway decisions sit well clear of rounding; a step change within about one part in a billion of the tolerance, or a value that close to a challenge band, may still fall either side of it.
Restrictions and non-computing states
Under NOT VALID every result and every table is blank except the challenge status (No challenge selected, or NOT MET with a challenge selected), a score of 0, and the goal and hint of a selected challenge.
The results of a method that is not selected are blank: the iteration frames under QR, the QR frames and the QR diagonal error under Power and Inverse, and the inverse target unless the method is Inverse. Eigenvalue 3 and the Jacobi results are blank for the 2 by 2 matrix, and the sweep for the 3 by 3 matrix. The frames after the last live step are blank when the start is mapped to zero. The estimate is blank when the method cannot settle for a complex pair, no dominant eigenvalue, a halfway shift or a start mapped to zero.
In challenges 1 to 4 the results listed under Challenges are held back until the challenge allows them.
Errors and warnings
The status messages, first match wins:
- NOT VALID: choose the matrix size from the list
- NOT VALID: choose the method from the list
- NOT VALID: QR iteration needs the 3 by 3 symmetric matrix; choose Power or Inverse for a 2 by 2 matrix
- NOT VALID: every matrix entry must be a number from −10 to 10: the entries in use only.
- NOT VALID: each start vector component must be a number from −1 to 1, and they cannot all be zero: zero after rounding to 2 decimals counts.
- NOT VALID: the shift must be a number from −30 to 30: Inverse only.
- NOT VALID: choose the tolerance from the list
- NOT VALID: the challenge number must be a whole number from 0 to 5, and each eigenvalue prediction blank or a number from −30 to 30
- CHECK: the eigenvalue sweep did not settle, so the eigenvalues and modes may be inaccurate: 3 by 3, the Jacobi rotations left too large an off-diagonal part.
- CHECK: the start vector is mapped to zero, so the power method stops; choose another start vector
- CHECK: the eigenvalues are complex, so no direction stays put and the power method cannot settle
- CHECK: two eigenvalues have the same size and opposite signs, so there is no single dominant eigenvalue and the power method cannot settle
- CHECK: the start vector has no part along the dominant direction, so the power method settles on another eigenvalue; choose another start vector
- CHECK: not within the tolerance in 40 steps; the power method is slow when the two largest eigenvalues are close in size or repeated
- CHECK: the eigenvalues are complex, so inverse iteration with a real shift cannot settle
- CHECK: the shift is halfway between two eigenvalues, so inverse iteration cannot pick one; move the shift
- CHECK: the start vector is mapped to zero (the shift sits on a repeated eigenvalue, or the start has no part left), so inverse iteration stops; move the shift or choose another start vector
- CHECK: the start vector has no part along the eigenvector nearest the shift, so inverse iteration settles on another eigenvalue; choose another start vector
- CHECK: not within the tolerance in 20 steps; move the shift closer to the eigenvalue you want
- CHECK: two eigenvalues have the same size and opposite signs, so QR iteration cannot separate them
- CHECK: not within the tolerance in 30 steps; eigenvalues close in size separate slowly
- OK
The power-method messages apply only with Power, the inverse-iteration messages only with Inverse, and the last two only with QR.
References
This laboratory is an educational model of the eigenvalues and eigenvectors of a 2 by 2 real matrix or a 3 by 3 symmetric matrix. A 2 by 2 matrix is solved exactly from its characteristic equation, whose discriminant decides between two real eigenvalues, a repeated one and a complex pair; the second root is found from the determinant so that no digits cancel. A 3 by 3 symmetric matrix is diagonalised by the cyclic Jacobi method, 18 plane rotations in 6 sweeps. Three iterative methods can be played step by step: the power method, inverse iteration with a shift, and unshifted QR iteration by Givens rotations for the 3 by 3 matrix, with the Rayleigh quotient as the eigenvalue estimate and the predicted and measured rates of convergence. A sweep turns a unit vector around the circle beside its image, so the eigenvector directions appear where the two line up, and Gershgorin intervals, the trace and the determinant check the answers.
Sources and further reading
- What eigenvalues and eigenvectors are: G. Strang, Introduction to Linear Algebra, 6th edition, Wellesley-Cambridge Press, 2023, section 6.1, Introduction to Eigenvalues. Author's book page
- The power method, inverse iteration and QR iteration, at an introductory level: R. L. Burden, J. D. Faires and A. M. Burden, Numerical Analysis, 10th edition, Cengage, 2016, chapter 9, Approximating Eigenvalues. Cengage
- Givens rotations, power iterations, the symmetric QR algorithm and the Jacobi method: G. H. Golub and C. F. Van Loan, Matrix Computations, 4th edition, Johns Hopkins University Press, 2013, section 5.1, Householder and Givens Transformations, section 7.3, Power Iterations, section 8.2, Power Iterations, section 8.3, The Symmetric QR Algorithm, and section 8.5, Jacobi Methods. Author's book page
- The discs, here intervals for a symmetric matrix, that must contain the eigenvalues: S. Gerschgorin, "Ueber die Abgrenzung der Eigenwerte einer Matrix", Bulletin de l'Academie des Sciences de l'URSS, VII serie, Classe des sciences mathematiques et naturelles, 1931, no. 6, pages 749-754. Math-Net.Ru
No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.
This laboratory is for learning. Its results hold only within its stated ranges; it handles only 2 by 2 matrices and 3 by 3 symmetric matrices, with entries from -10 to 10.
Found a problem, or have an idea?
Tell us if a result looks wrong, a label is unclear, or something is missing. We read every message.