A7 · Lesson 11 · Inverses and transposes
Undoing a matrix, and flipping it
Inject a current into node 1 of a resistor network and measure the voltage at node 2. Now inject the same current into node 2 and measure at node 1. You get exactly the same voltage, every time, however lopsided the network. This is reciprocity, and it's a fact about matrices: a resistor network's conductance matrix equals its own transpose, and so does its inverse, which is the matrix that answers "inject here, measure there".
- The solid curve is the unit circle after matrix ; the dashed curve is the unit circle after .
- The green arrow is a vector moved by ; the dashed arrow is that result moved back by . It always lands on the start.
- Shrink the determinant toward zero. What happens to the inverse's ellipse?
Predict
A matrix squashes the plane flat, onto a line. Can any matrix undo it?
No. Squashing onto a line sends whole lines of points to single points, so information is lost. An inverse would have to send one point back to many, which no matrix can do. That's exactly when the determinant is zero, and the inverse's ellipse in the sim blows up as you approach it.
Name it
The inverse
is the matrix with : it undoes . It exists exactly when is square with nonzero determinant, which is the same as having nonzero pivots. For 2 × 2,
swap the diagonal, negate the off-diagonal, divide by the determinant. For bigger matrices, Gauss-Jordan elimination on turns it into .
Order reverses for products: . To undo "B then A", undo A first.
Don't invert to solve. Computing and then costs about three times as much as solving with LU, and is less accurate. Use the inverse as an idea, and solve in code.
The transpose
flips across its diagonal: , so rows become columns. Its rules:
A matrix with is symmetric. The inverse of a symmetric matrix is symmetric too.
Permutation matrices
A permutation matrix reorders rows: it's the identity with its rows shuffled. Undoing a shuffle is shuffling back, and .
Reciprocity
In nodal analysis (lesson 12), a resistor between nodes and puts in both entry and entry of the conductance matrix , so is symmetric. The node voltages are , and entry of is the voltage at per unit current injected at . Since is symmetric, swapping the two nodes gives the same answer.
Worked example
Invert .
Show the solution
- Determinant.
- Swap, negate, divide.
- Check the top-left entry of the product.
Answer the inverse is .
Worked example
Three 1 kΩ resistors: node 1 to ground, node 1 to node 2, node 2 to ground. Show reciprocity.
Show the solution
- Conductance matrix. In mS: with determinant 3.
- Invert it.
- Inject at each node. 1 mA into node 1 gives V; 1 mA into node 2 gives V.
- Why they match. The two off-diagonal entries are equal because is symmetric.
Answer 1 mA into either node gives V at the other, which is reciprocity.
Worked example
Invert , the from an elimination.
Show the solution
- What does. undoes the elimination steps, so redoes them: subtract 2 × row 1 from row 2, then 4 × row 1 and 3 × row 2 from row 3.
- Apply those steps to .
- The corner entry. It is not : the steps interact.
- Why keep . That's why , which stores the multipliers directly, is the convenient one to keep.
Answer has rows , and .
Check
What is the top-left entry of ?
Check
What is the top-right entry of ?
Check
What is ?
Check
What is ?
Check
Resistors: 1 kΩ from node 1 to ground, 1 kΩ from node 1 to node 2, 4 kΩ from node 2 to ground. Inject 1 mA into node 2. What is the voltage at node 1?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
Check
is a permutation matrix. What is ?
Check
Invert .
(a)
What is the top-left entry of ?
(b)
What is the top-right entry?
Check
Invert the rotation .
Step 1
Rotating back by undoes it. What is the top-right entry of ?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
And the bottom-left entry?
Explain why
In code, why do you solve with a solver instead of computing and multiplying?
Computing the full inverse takes about three times as many operations as an LU factorization, and then you still multiply by . It also loses more accuracy to rounding, because the inverse's entries can be large and cancel. A solver factors once and uses forward and back substitution, which is faster and more accurate. The inverse is a useful idea for reasoning, like reciprocity, but rarely the right thing to compute.
Practice
Keep practicing
7 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.