Solving circuit equations with matrices
لم يُترجم بعد؛ يُعرض باللغة الإنجليزية
عن هذا الدرس
Nodal analysis gives one KCL equation per node, and a matrix solves them all at once. Follow one circuit, current sources of 6 mA and 1 mA with R1 = 1 kΩ, R2 = 1 kΩ and R3 = 2 kΩ, from two KCL equations to G v = i. Read the conductance matrix straight off the circuit, see each row as a line, and solve it three ways: Cramer's rule, Gaussian elimination and the inverse. Then check the answer, v1 = 5 V and v2 = 4 V, with KCL and a power balance. It follows Nodal analysis, Mesh analysis and Supermeshes and choosing a method, and builds on the Hardware lessons on Ohm's law and series and parallel circuits.
Two unknown node voltages
Nodal analysis turns a circuit into equations. Pick a reference node, ground, at 0 V. The other two nodes have unknown voltages, v1 and v2, measured from ground. Two unknowns need two equations.
reference node ground, 0 V by choice
node 1 voltage v1 (unknown)
node 2 voltage v2 (unknown)
n non-reference nodes → n unknowns
→ n KCL equations
Once v1 and v2 are known, Ohm's law
gives every branch current.اقرأ الدرس خطوة بخطوة
Two unknown node voltages
Nodal analysis turns a circuit into equations. Pick a reference node, ground, at 0 V. The other two nodes have unknown voltages, v1 and v2, measured from ground. Two unknowns need two equations.
reference node ground, 0 V by choice node 1 voltage v1 (unknown) node 2 voltage v2 (unknown) n non-reference nodes → n unknowns → n KCL equations Once v1 and v2 are known, Ohm's law gives every branch current.KCL at node 1
KCL at node 1: current leaving through resistors equals source current entering. Leaving through R1 is v1/R1; through R2 it is (v1 − v2)/R2. So v1/1k + (v1 − v2)/1k = 6 mA.
KCL at node 1 (out through resistors = in) v1/R1 + (v1 − v2)/R2 = I1 v1/1k + (v1 − v2)/1k = 6 mA Ohm's law: a resistor's current is the voltage across it divided by R. Each current here is counted leaving node 1.KCL at node 2
Same rule at node 2. Leaving through R2 back toward node 1 is (v2 − v1)/R2; leaving through R3 is v2/R3. Source I2 brings 1 mA in. So (v2 − v1)/1k + v2/2k = 1 mA.
KCL at node 2 (v2 − v1)/R2 + v2/R3 = I2 (v2 − v1)/1k + v2/2k = 1 mA R2 appears in both equations: it is the only part joining node 1 to node 2.Use conductance G = 1/R
Conductance is G = 1/R, measured in siemens (S). Here G1 = 1 mS, G2 = 1 mS, G3 = 0.5 mS. Collect the v1 and v2 terms: 2v1 − v2 = 6 and −v1 + 1.5v2 = 1. Millisiemens times volts gives milliamps.
G = 1/R (1 kΩ ↔ 1 mS, 2 kΩ ↔ 0.5 mS) node 1: (G1 + G2)v1 − G2·v2 = I1 2v1 − 1v2 = 6 node 2: −G2·v1 + (G2 + G3)v2 = I2 −1v1 + 1.5v2 = 1 units: mS × V = mAWrite it as G v = i
Stack the two equations as a matrix: G v = i. Read G straight off the circuit. Each diagonal entry is the total conductance touching that node. Each off-diagonal entry is minus the conductance joining the two nodes, so G is symmetric.
G v = i [ 2 −1 ] [v1] [6] [−1 1.5 ] [v2] = [1] G11 = G1 + G2 = 2 mS (all at node 1) G22 = G2 + G3 = 1.5 mS (all at node 2) G12 = G21 = −G2 = −1 mS (joins them) i = source currents into each node (mA)Each row is a line
Each row is a straight line in the v1–v2 plane: every point on it satisfies one node's KCL. Only where the two lines cross are both nodes balanced. That crossing, v1 = 5 V and v2 = 4 V, is the answer.
row 1: 2v1 − v2 = 6 → v2 = 2v1 − 6 row 2: −v1 + 1.5v2 = 1 → v2 = (v1 + 1)/1.5 cross at (5, 4) Parallel lines (no crossing) would mean no single solution: Δ = 0.The determinant
The determinant Δ tells whether a single answer exists. For a 2×2 matrix, multiply the diagonal and subtract the other product: Δ = 2×1.5 − (−1)(−1) = 2 mS². Not zero, so the lines cross exactly once.
Δ = G11·G22 − G12·G21 = 2·1.5 − (−1)(−1) = 3 − 1 = 2 mS² Δ ≠ 0 one solution (lines cross) Δ = 0 none or infinitely many (parallel lines): the circuit is badly posed, e.g. a floating nodeCramer's rule
Cramer's rule: replace column k of G with i, take that determinant, divide by Δ. Δ1 = 6×1.5 − (−1)(1) = 10, so v1 = 10/2 = 5 V. Δ2 = 2×1 − (6)(−1) = 8, so v2 = 4 V.
Δ1 = | 6 −1 | = 6·1.5 − (−1)(1) = 10 | 1 1.5 | Δ2 = | 2 6 | = 2·1 − (6)(−1) = 8 |−1 1 | v1 = Δ1/Δ = 10/2 = 5 V v2 = Δ2/Δ = 8/2 = 4 VGaussian elimination
Gaussian elimination: add 0.5 × row 1 to row 2. The v1 term cancels, leaving 1·v2 = 4, so v2 = 4 V. The new row is a level line through the same crossing. Back-substitute: v1 = (6 + 4)/2 = 5 V.
row 2 ← row 2 + 0.5·row 1 [ 2 −1 ] [v1] [6] [ 0 1 ] [v2] = [4] back substitution v2 = 4/1 = 4 V v1 = (6 + v2)/2 = 5 V This is how computers solve thousands of nodes (LU factorisation).Check: KCL and power
Put the answer back. R1 carries 5 mA, R2 1 mA, R3 2 mA. Node 1: 6 in = 5 + 1 out. Node 2: 1 + 1 = 2. Sources supply 34 mW; resistors absorb 25 + 1 + 8 = 34 mW.
branch currents (Ohm's law) R1 v1/R1 = 5 mA R2 (v1 − v2)/R2 = 1 mA R3 v2/R3 = 2 mA residual G v − i = (0, 0) mA power (passive sign convention) I1 supplies 30 mW, I2 supplies 4 mW R1 25 + R2 1 + R3 8 = 34 mW absorbedThe inverse: new sources, same G
G depends only on the resistors. Invert it once and any source values give v = G⁻¹i at once. Raise I2 to 3 mA: v1 = 6 V, v2 = 6 V. Circuit simulators such as SPICE solve these matrix equations for thousands of nodes.
G⁻¹ = (1/Δ)[ G22 −G12 ] [ −G21 G11 ] = [ 0.75 0.5 ] kΩ [ 0.5 1 ] I2 = 3 mA: v1 = 0.75·6 + 0.5·3 = 6 V v2 = 0.5·6 + 1·3 = 6 V
أسئلة سريعة: 5
اختر إجابة واحدة لكل سؤال. يمكنك تغيير اختياراتك قبل التحقق منها.
01In the lesson's circuit, G = [2 −1; −1 1.5] mS. What is its determinant Δ?
Δ = G11·G22 − G12·G21 = 2×1.5 − (−1)(−1) = 3 − 1 = 2 mS². It is not zero, so the circuit has exactly one solution.
02R3 is changed from 2 kΩ to 1 kΩ, with R2 still 1 kΩ. What becomes the entry G22?
G22 is the total conductance touching node 2: G2 + G3 = 1/1k + 1/1k = 2 mS. The off-diagonal entries stay −G2 = −1 mS because R2 still joins the two nodes.
03With the same resistors, I2 is raised to 5 mA (I1 stays 6 mA). Using G⁻¹ = [0.75 0.5; 0.5 1] kΩ, what is v2?
v = G⁻¹i: v2 = 0.5×6 + 1×5 = 8 V (and v1 = 0.75×6 + 0.5×5 = 7 V). G did not change, so there is nothing new to solve.
04In Gaussian elimination on G v = i, which move is allowed without changing the solution?
Adding a multiple of one equation to another (both sides) keeps every solution, so the lines still cross at the same point. Swapping rows and scaling a row by a non-zero number are the other two allowed moves.
05A circuit's conductance matrix has determinant zero. What does that tell you?
Δ = 0 means the rows are not independent: the lines are parallel or the same, so there is no single solution. In a real circuit it usually means a node with no path to the reference, or a bad choice of equations.
المسرد
- Conductance (G)
- The reciprocal of resistance, G = 1/R, measured in siemens (S). 1 kΩ is 1 mS.
- Conductance matrix
- The matrix G in G v = i. Each diagonal entry is the total conductance at a node; each off-diagonal entry is minus the conductance joining two nodes.
- Node-voltage vector
- The list of unknown node voltages, v = (v1, v2, …), each measured from the reference node.
- Source vector
- The right-hand side i: the source current flowing into each node.
- Determinant (Δ)
- A number computed from a square matrix. For a 2×2 matrix it is the product of the diagonal minus the product of the other two entries. Zero means no single solution.
- Cramer's rule
- Solves for one unknown as a ratio of determinants: replace that unknown's column of G with i, take the determinant, divide by Δ.
- Gaussian elimination
- Adding multiples of rows to other rows until the matrix is triangular, then solving from the last row upward (back substitution).
- Inverse matrix (G⁻¹)
- The matrix that undoes G, so v = G⁻¹ i. It depends only on the resistors, so it answers for any source values.
الملاحظات والمصادر
- The figure is an ideal DC circuit: current sources of 6 mA and 1 mA, resistors of 1, 1 and 2 kΩ, and wires with no resistance. Every voltage, current, matrix entry and power shown is computed from these values by the lesson's model.
- Working in kΩ, mS, mA and V keeps the numbers small: 1 mS × 1 V = 1 mA, and 1 mA × 1 V = 1 mW.
- With voltage sources the plain G v = i form needs care (see supernodes); modified nodal analysis adds the source currents as extra unknowns and is what SPICE uses.
- Cramer's rule is handy by hand for 2×2 and 3×3 systems. For larger ones it is far slower than elimination, which is why calculators and simulators use elimination (LU factorisation).
- Wikipedia, Nodal analysis (matrix form G v = i)
- Wikipedia, Cramer's rule
- Wikipedia, Gaussian elimination
- Wikipedia, SPICE (modified nodal analysis, sparse-matrix solution)
- Alexander & Sadiku, Fundamentals of Electric Circuits (7th ed.), ch. 3 Methods of Analysis and appendix A Simultaneous Equations and Matrix Inversion
- MIT OpenCourseWare 6.002 Circuits and Electronics, lecture 2: Basic circuit analysis method
- IEEE Std 315-1975, graphic symbols for electrical diagrams
اختبار يتاح بعد الخطوة الأخيرة.