# Circuit Theory/Mesh Analysis

Mesh analysis is done in the phasor domain.
The mesh analysis method reduces the number of equations and unknowns one is finding in a circuit.
Kirchhoff's method finds all currents and voltages. Mesh analysis only finds mesh (loop) currents.
Mesh analysis starts with the normal Kirchhoff loop equations:
    $\Delta _{k=1}^{n}{V}_{k}=0$
and solves terminal equations so that voltage is a function of current, and then substitutes into the loop voltage equation:
    $v=\Delta I*R$
    $v={\frac {\Delta I}{C*j\omega }}={\frac {\Delta I}{sC}}$
    $v=\Delta I*j\omega L=\Delta I*sL$
What is $\Delta I$? It is the difference (or addition) of possibly two mesh currents following through a device. It can be just one current if the device is not part of two meshes. Devices that are part of two meshes need the mesh currents added or subtracted (depending on direction).
    $\Delta I=I_{meshA}-I_{meshB}$
At first glance mesh analysis may seem trivial, but there are subtle differences to Kirchhoff's exposed when doing the problems:
Mesh currents can be in the same direction or different directions through the same device. They are not Kirchhoff's currents through individual devices. Without careful labeling of the mesh current directions on the planar circuit diagram, it is impossible to keep directions straight.
* Mesh currents are positive if they are in the same direction of the particular Kirchhoff loop equation being written, negative if they would cause a negative voltage.
* Mesh currents are typically CW and dictate the loop equation direction.
* Has to be done in the phasor domain so impedances between nodes can be computed.
* Can have too few equations requiring finding additional equations from "Super Meshes".
* Some problems can not be solved. Recognizing these is not trivial.

## Mesh currents

Mesh analysis works by arbitrarily assigning mesh currents in the non-trivial loops/meshes. Figure 1 labels the essential meshes with one, two, and three.
A mesh current may not correspond to any physically flowing current, but the physical currents are easily found from them. It is usual practice to have all the mesh currents loop in the same direction.

## Example

The circuit has 2 loops indicated on the diagram. Using KVL we get:
* Loop1: $0=9-1000I_{1}-3000(I_{1}-I_{2})$
* Loop2: $0=3000(I_{1}-I_{2})-2000I_{2}-2000I_{2}$
Simplifying we get the simultaneous equations:
    $0=9-4000I_{1}+3000I_{2}$
    $0=0+3000I_{1}-7000I_{2}$
Solving to get:
    $I_{1}=3.32mA$
    $I_{2}=1.42mA$

## Setting up the equations

Each mesh produces one equation. These equations are the sum of the voltage drops in a complete loop of the mesh current.For problems more general than those including current and voltage sources, the voltage drops will be the impedance of the electronic component multiplied by the mesh current in that loop.
If a voltage source is present within the mesh loop, the voltage at the source is either added or subtracted depending on if it is a voltage drop or a voltage rise in the direction of the mesh current. For a current source that is not contained between two meshes, the mesh current will take the positive or negative value of the current source depending on if the mesh current is in the same or opposite direction of the current source.The following is the same circuit from above with the equations needed to solve for all the currents in the circuit.
${\begin{cases}{\text{Mesh 1: }}I_{1}=I_{s}\\{\text{Mesh 2: }}-V_{s}+R_{1}(I_{2}-I_{1})+{\frac {1}{sc}}(I_{2}-I_{3})=0\\{\text{Mesh 3: }}{\frac {1}{sc}}(I_{3}-I_{2})+R_{2}(I_{3}-I_{1})+LsI_{3}=0\\\end{cases}}\,$

### Supermesh

A supermesh occurs when a current source is contained between two essential meshes. The circuit is first treated as if the current source is not there. This leads to one equation that incorporates two mesh currents. Once this equation is formed, an equation is needed that relates the two mesh currents with the current source. This will be an equation where the current source is equal to one of the mesh currents minus the other. The following is a simple example of dealing with a supermesh.
${\begin{cases}{\text{Mesh 1, 2: }}-V_{s}+R_{1}I_{1}+R_{2}I_{2}=0\\{\text{Current source: }}I_{s}=I_{2}-I_{1}\end{cases}}\,$