07-Nodal Analysis Text: 3.1 – 3.4 ECEGR 210 Electric Circuits I Overview • Introduction • Nodal Analysis • Nodal Analysis with Voltage Sources Dr. Louie 2 Introduction • Basic Circuit Laws Ohm’s Law Kirchhoff’s Voltage Law (KVL) Kirchhoff’s Current Law (KCL) • Now we seek to analyze any linear circuit systematically using Nodal analysis Mesh analysis Dr. Louie 3 Introduction • Express circuit as a system of linear equations • Solve linear equations Substitution Gaussian elimination Cramer’s Rule Numerical methods Others y11 y12 y 21 y22 y31 y32 y13 x1 b1 y23 x2 b2 y33 x3 b3 • Remember: for a unique solution there must be an equal number of independent equations as unknowns Dr. Louie 4 Introduction • Let X be a vector of variables to be solved for • Nodal Analysis: X: node voltages Y: conductances b: currents y11 y12 y 21 y22 y31 y32 • Mesh Analysis: X: loop currents Y: resistances b: voltages Dr. Louie y13 x1 b1 y23 x2 b2 y33 x3 b3 5 Nodal Analysis Steps to solve a circuit with N nodes 1. Assign a reference node 2. Assign a variable to the voltages at all nodes wrt the reference node (N-1 variables) 3. Apply KCL to each of the N-1 non-reference nodes to generate N-1 equations 4. Use Ohm’s Law to express currents as functions of node voltages 5. Solve resulting simultaneous equations Dr. Louie 6 Nodal Analysis • Let I1, I2, R1, R2, R3 be known (given) • Solve for the voltages at each node I2 R2 I1 R1 Dr. Louie R3 7 Step 1: Assign Reference Node • Recall: all voltage is a relative measure • Reference node is also known as ground In power systems it is actually the ground (earth) In electronics it could be the metallic chassis I2 Or arbitrary R2 I1 R1 R3 (usually the “bottom” of circuit) Dr. Louie 8 Step 2: Assign Variables to Nodes • There are two remaining nodes (variables) • Assign voltages and polarities wrt reference node • No need to write voltage across R2 Does not add an independent equation (no new information) I2 Can solve later as V1 – V2 I1 Dr. Louie + V1 - x R2 R1 x + R3 V2 - 9 Step 3: Apply KCL • KCL gives one equation per node (two equations) • I1 = I2 + i1 + i2 • I2 = i3 – i2 I2 i2 I1 i1 Dr. Louie i3 10 Step 4: Apply Ohm’s Law • Need to write i1, i2, i3 in terms of the node voltages • Remember sign convention • i1 = (V1 - 0)/R1 I2 • i2 = (V1 – V2)/R2 • i3 = (V2 - 0)/R3 V1 x I1 i2 i1 Dr. Louie x V2 i3 11 Step 5: Solve Equations • Recap two variables (V1, V2) two KCL equations • KCL equations use intermediate variables i1, i2, i3 I1 = I2 + i1 + i2 I2 = i3 – i2 • Use substitution to express KCL in terms of voltages i1 = (V1 - 0)/R1 i2 = (V1 – V2)/R2 i3 = (V2 - 0)/R3 Dr. Louie 12 Step 5: Solve Equations • Via substitution: I1 = I2 + V1/R1 + (V1 – V2)/R2 I2 = V2/R3 – (V1 – V2)/R2 • Can we solve this system of equations? • Yes! Two independent equations, two unknowns The rest is just math Dr. Louie 13 Step 5: Solve Equations • In matrix form I1 = I2 + V1/R1 + (V1 – V2)/R2 I2 = V2/R3 – (V1 – V2)/R2 1 1 R R2 1 1 R2 1 R2 V I I 1 1 2 1 1 V2 I2 R 3 R 2 • Many methods of solving linear equations Dr. Louie 14 Example • Let I1 = 10A I2 = 5A R1 = 6Ω R2 = 4Ω R3 = 2Ω I2 • Find all voltages I1 i2 i1 Dr. Louie i3 15 Example • Equations: I1 = I2 + V1/R1 + (V1 – V2)/R2 I2 = V2/R3 – (V1 – V2)/R2 • Using circuit values: 10 = 5 + V1/6 + (V1 – V2)/4 5 = V2/2 – (V1 – V2)/4 Dr. Louie 16 Example • Starting with the second equation 5x4 = [V2/2 – (V1 – V2)/4]x4 Yields 20 = 2V2 – (V1 – V2) = 3V2 – V1 Now the first equation: 10x12 = [5 + V1/6 + (V1 – V2)/4]x12 120=60 + 2V1+ 3V1 – 3V2 60 = 5V1 – 3V2 Dr. Louie 17 Example 20 = -V1 + 3V2 60 = 5V1 – 3V2 Solve using elimination • 20x5 = [-V1 + 3V2]x5 = 100 = -5V1 + 15V2 60 = 5V1 – 3V2 160 = 0 +12V2 Yields: • V2 = 13.333V • V1 = 20V Dr. Louie 18 Example • Solving in matrix form: 1 1 R R2 1 1 R2 1 1 6 4 1 4 1 R2 V I I 1 1 2 1 1 V2 I2 R 3 R 2 1 4 V1 5 1 1 V2 5 2 4 Can use Matlab, Gaussian elimination Cramer’s Rule, matrix inversion Dr. Louie 19 Solution by Matrix Inversion 1 1 6 4 1 4 1 4 V1 5 1 1 V2 5 2 4 G (matrix) V1 5 G V2 5 V1 20 1 5 G V 5 13.3 2 1 where G 1 3 1 1.67 For small matrices use “inv()” command in Matlab Dr. Louie 20 Nodal Analysis with Voltage Sources • Nodal analysis requires knowledge of current through elements • Recall that the current through a voltage source is not readily known • Example: Current through resistor is I = (Va – Vb)/R But what is the current through a voltage source? How is the “R” in the equation to be interpreted? V + - + - Dr. Louie 21 Nodal Analysis with Voltage Sources • If the voltage source is connected to the reference node, then it can be easily included in nodal analysis I2 i2 I1 i1 Dr. Louie + - V3 22 Nodal Analysis with Voltage Sources • Only one node with unknown voltage • I1 = I2 + V1/R1 + (V1 – V3)/R2 • Compare this to earlier example (2 eqns, 2 unknowns) I2 I1 + V1 - x R2 R1 Dr. Louie + - V3 23 Nodal Analysis with Voltage Sources • If voltage source not connected to reference: Move the reference so it is! (only works if there is one voltage source) Or Use Supernode concept Dr. Louie 24 Nodal Analysis with Voltage Sources I I - I + node - I + • Supernode: a closed surface containing a voltage source and its two nodes AND any elements in parallel with it Supernodes • Current into supernode = current out of supernode • Also applies to dependent voltage sources Dr. Louie 25 Nodal Analysis with Voltage Sources • Properties of a supernode Voltage source inside the supernode provides a constraint equation needed to solve for node voltages A supernode has no voltage of its own There is only one KCL equation for the supernode, but two unknown node voltages Additional equation is found from application of KVL Dr. Louie 26 Nodal Analysis with Voltage Sources • Find the node voltages 10W 2A 2W - + 2V 4W 7A assume reference is here Dr. Louie 27 Nodal Analysis with Voltage Sources • Make a supernode out of the voltage source • Write KCL for supernode 2 = i1 + i2 + 7 (only one equation since it is a supernode) 10W 2A 2W - + 2V i1 4W i2 7A assume reference is here Dr. Louie 28 Nodal Analysis with Voltage Sources • Write i1, i2 in terms of node voltage • i1 = (v1 – 0)/2 • i2 = (v2 – 0)/4 10W 2A 2W - + v1 2V i1 4W v2 i2 7A assume reference is here Dr. Louie 29 Nodal Analysis with Voltage Sources • Substitute into supernode KCL • 2 = i1 + i2 + 7 (supernode KCL) 2 = 0.5v1 + 0.25v2 + 7 (after substitution) 8 = 2v1 + v2 +28 (multiplying by 4) 10W 2A 2W - + v1 2V i14W Dr. Louie v2 i2 7A 30 Nodal Analysis with Voltage Sources • Apply KVL around loop -v1 + 2 + v2 = 0 (second equation) 10W 2A 2W - + v1 2V i14W Dr. Louie v2 i2 7A 31 Nodal Analysis with Voltage Sources • How many independent equations? 8 = 2v1 + v2 +28 -v1 + 2 + v2 = 0 • How many unknowns? v1, v2 10W 2A 2W - v1 2V + Solve! i14W Dr. Louie v2 i2 7A 32 Nodal Analysis with Voltage Sources • Solving… 8 = 2v1 + v1 - 2 +28 v1 = -5.333V v2 = -7.333V 10W 2A 2W - + v1 2V i14W Dr. Louie v2 i2 7A 33 Example • Find the node voltages in the circuit shown - + 10V 2W 2W 5A 4W Dr. Louie 8W 34 Example • 3 unknown voltages: V1, V2, V3 • Need three independent equations (that do not introduce new variables) 2W V1 - + 10V V2 2W 5A 4W Dr. Louie V3 8W 39 Example • Identify the supernode V1 - + 10V 2W V 2 2W 5A 4W Dr. Louie V3 8W 40 Example • Write KCL for the supernode i5 = i1+i4+i3 (supernode) • Write KCL for the other node 5+i4 = i5 (node 2) V1 4W - + 10V i4 2W V 2W i5 2 i1 5A i3 Dr. Louie V3 8W 41 Example i1 i3 i4 i5 = = = = (V1 (V3 (V1 (V2 – – – – 0)/4 0)/8 V2)/2 V3)/2 + V1 4W Dr. Louie - 10V • Express currents in terms of voltages i4 2W V 2W i5 2 i1 V3 5A i3 8W 42 Example • Have two equations • Need one more independent equation • Do KVL around top loop + KCL for node 2, supernode V1 4W - 10V i4 2W V 2W i5 2 i1 V3 5A i3 8W 10 = 2i4 + 2i5 Dr. Louie 43 Example • 5 + i4 = i5 (node 2) • i6 = i1 + i5 + i3 (supernode) i1 i3 i4 i5 = = = = (V1 (V3 (V1 (V2 – – – – 0)/4 = 0.25V1 0)/8 = 0.125V3 V2)/2 = 0.5V1 – 0.5V2 V3)/2 = 0.5V2 – 0.5V3 5 + 0.5V1 – 0.5V2 = 0.5V2 – 0.5V3 (solving node 2 eqn) 10 + V1 – V2 = V2 – V3 0.5V2 - 0.5V3 = 0.25V1 + 0.5V1 – 0.5V2 + 0.125V3 (supernode eqn) 4V2 - 4V3 = 2V4 + 4V1 – 4V2 + V3 10 = 2i4 + 2i5 (KVL of top loop) 10 = V1 – V2 + V2 – V3 Dr. Louie 44 Example 10 + V1 – V2 = V2 + V3 (node 2) 10 = -V1 + 2V2 + V3 (after rearranging) 4V2 - 4V3 = 2V1 + 4V1 – 4V2 - V3 (supernode) 0 = 6V1 -8V2 + 3V3 (after rearranging) 10 = V1 – V2 + V2 – V3 (KVL of top loop) 10 = V1 + 0V2– V3 (after Solving 1 2 V1 = 12.22V 6 8 V2 = 10V 1 0 V3= 2.22V rearranging) 1 V1 10 3 V2 0 1 V3 10 Dr. Louie 45 Example • Find Vx 2A 10W + Vx - Dr. Louie 20W 0.2Vx 46 Example • One node, write equation from KCL 2 =I1 + I2 + 0.2Vx • From Ohm’s Law I1 = Vx/10 I2 = Vx/20 • Solving: 2 = 0.1Vx + 0.05Vx + 0.2Vx Vx = 5.71V 2A 10W I1 + Vx - Dr. Louie 20W I2 0.2Vx 47