# Discussion D2.4a September 2006 Chapter 2 Section 2-8

## Presentation on theme: "Discussion D2.4a September 2006 Chapter 2 Section 2-8"— Presentation transcript:

Discussion D2.4a September 2006 Chapter 2 Section 2-8
Mesh Analysis Discussion D2.4a September 2006 Chapter 2 Section 2-8

Mesh Analysis Mesh analysis applies KVL to find unknown currents.
It is only applicable to planar circuits (a circuit that can be drawn on a plane with no branches crossing each other). A mesh is a loop that does not contain any other loops. The current through a mesh is known as the mesh current. Assume for simplicity that the circuit contains only voltage sources.

Mesh Analysis Steps Assign mesh currents i1, i2, i3, … il, to the l meshes, Apply KVL to each of the l meshes and use Ohm’s law to express the voltages in terms of the mesh currents, Solve the l resulting simultaneous equations to find the mesh currents.

Example 7 4 10 Number of nodes, n = Number of loops, l =
Number of branches, b = 10

Example The l loop currents are i = [i1 i2 i3 i4]
The n-1 node voltages are vn = [vn1 vn2 vn3 vn4 vn5 vn6] The b branch currents are ib = [ib1 ib2 ib3 ib4 ib5 ib6 ib7 ib8 ib9 ib10]

Example We will solve mesh equations for the l loop currents
i = [i1 i2 i3 i4] Then we can calculate the b branch currents from

Example We can also solve for the n-1 node voltages from the loop currents (or branch currents)

Example Solving mesh equations for the l loop currents
i = [i1 i2 i3 i4] Apply KVL to each mesh Mesh 1: Mesh 2: Mesh 3: Mesh 4:

Mesh 1: Mesh 2: Mesh 3: Mesh 4: Express the voltage in terms of the mesh currents: Mesh 1: Mesh 2: Mesh 3: Mesh 4:

Mesh 1: Mesh 2: Mesh 3: Mesh 4: Mesh 1: Mesh 2: Mesh 3: Mesh 4:

Mesh 1: Mesh 2: Mesh 3: Mesh 4:

is an l x l symmetric resistance matrix
is a l x 1 vector of mesh currents is a l x 1 vector of voltages representing “known” voltages

Writing the Mesh Equations by Inspection
The matrix R is symmetric, Rkj = Rjk and all of the off-diagonal terms are negative or zero. The Rkk terms are the sum of all resistances in mesh k. The Rkj terms are the negative sum of the resistances common to BOTH mesh k and mesh j. The ki (the ith component of the vector k) = the algebraic sum of the independent voltages in mesh i, with voltage rises taken as positive.

MATLAB Solution of Mesh Equations

Test with numbers

Test with numbers

MATLAB Run

PSpice Simulation MATLAB:

Let's write a general MATLAB program to solve this problem
Inputs: Vs1, Vs2 Find all voltages and currents

function mesh1(r,Vs1,Vs2) % PowerPoint mesh-1 example % Discussion D2.4 % r is a 1 x 8 vector of resistances % Vs1 and Vs2 = the known dc voltage sources % mesh1(r,Vs1,Vs2) % R = [r(1)+r(5)+r(7) -r(7) -r(5) 0; -r(7) r(2)+r(6)+r(7) 0 -r(6); -r(5) 0 r(3)+r(5) 0; 0 -r(6) 0 r(4)+r(6)+r(8)] k = [Vs2; 0; -Vs1; Vs1] i = inv(R)*k vn = zeros(1,6); vn(1) = -i(3)*r(3); vn(2) = Vs2-i(3)*r(3); vn(3) = Vs1+(i(1)-i(2))*r(7); vn(4) = i(4)*(r(4)+r(8)); vn(5) = i(4)*r(8); vn(6) = Vs1; vn ib = zeros(1,10); ib(1) = -i(3); ib(2) = i(1); ib(3) = i(1); ib(4) = i(2); ib(5) = i(4); ib(6) = i(4); ib(7) = i(3)-i(1); ib(8) = i(2)-i(4); ib(9) = i(1)-i(2); ib(10) = i(3)-i(4); ib

MATLAB Run

What happens if we have independent current sources in the circuit?
Assume temporarily that the voltage across each current source is known and write the mesh equations in the same way we did for circuits with only independent voltage sources. Express the current of each independent current source in terms of the mesh currents and replace one of the mesh currents in the equations. Rewrite the equations with all unknown mesh currents and voltages on the left hand side of the equality and all known voltages on the r.h.s of the equality.

Example Write mesh equations by inspection.

MATLAB Run i1 A i2 A va V

PSpice Simulation va + - i2 i1 i1 MATLAB: i2 va

Let's write a general MATLAB program to solve this problem
Inputs: Find all voltages and currents Note that

Example The l loop currents are i = [i1 i2 i3]
The n-1 node voltages are vn = [vn1 vn2 vn3] The b branch currents are ib = [ib1 ib2 ib3 ib4 ib5 ib6]

Example We will solve mesh equations
for the loop currents and unknown voltage va iiv = [i1 i2 va] Then we can calculate the n-1 node voltages from

Example We can also calculate the b branch currents from

Expand matrix with

These can be written in matrix form as

function mesh2(r,Vs1,Is1) % PowerPoint mesh-2 example % Discussion D2.4 % r is a 1 x 4 vector of resistances % Vs1 is a known dc voltage source % Is1 is a known dc current source % mesh2(r,Vs1,Is1) R = [r(1)+r(3) -r(3) 0; -r(3) r(2)+r(3)+r(4) 0; -r(1) -r(2) 1] k = [Vs1-r(1)*Is1; -r(2)*Is1; (r(1)+r(2))*Is1] iiv = inv(R)*k i(1) = iiv(1); i(2) = iiv(2); i vn = zeros(1,3); vn(1) = Vs1; vn(2) = i(2)*r(4); vn(3) = (i(1)-i(2))*r(3); vn ib = zeros(1,6); ib(1) = i(1); ib(2) = -Is1; ib(3) = i(2); ib(4) = i(1)+Is1; ib(5) = -i(2)-Is1; ib(6) = i(1)-i(2); ib

Do same problem as before
mesh2(r,Vs1,Is1)

MATLAB Run