How to solve mesh-analysis problem?

This is a circuit I'm trying to solve using mesh-analysis. I thought I was solving it right but the answers tell me that I'm doing it wrong and I'm not sure why (only thing I know right now is that \$i3 = 1.375A, which was the only answer I was provided.

To solve for $$\i1, i2, i3\$$, I analyzed the top and bottom right mesh as the meshes to analyze. The equations I used to solve this are the following:

1. $$\Is = i1 + i2\$$ (based on current source)
2. $$\i1 + i3 = i4\$$
3. $$\50i1 + 100 (i1- i4) + 50(Is-i1) = 0\$$ (based on mesh analysis of top mesh)
4. $$\-5 + 100(i4-i1) + 100i4 = 0\$$ (based on the mesh analysis of bottom right mesh)

Did I set up my equations wrong or am I understanding something wrong? I would love to hear some guidance in solving this.

• In equation 3, you have written the equivalent of 0=50*i1-100*i3+50*i2. I believe i3 and i2 should be considered as having the same magnitude in this equation. Commented Aug 28, 2023 at 20:41

While you can, technically, set up things in mesh analysis (KVL) to use composite current equations, including definitions for $$\i_2\$$ and $$\i_3\$$ for example as part of your analysis process, it's not usually done that way. Instead, those are usually developed as a result at the end of the process. So let me explain, using your own diagram:

Usually, mesh is performed using the circular current loops I'm showing above in green. (I've chosen clockwise for all three loop currents.) I've labeled my mesh currents completely differently from your labels, so I can talk about your currents and mine without confusion. (I also was forced to label the voltage across $$\I_s\$$ as $$\V_x\$$, since you already have a $$\V_s\$$ on the schematic.)

Now, when you write that $$\I_s=i_1+i_2\$$ you are writing a nodal equation (KCL) and not a mesh equation (KVL.) You are right, so far as it goes. But this really isn't going to be much help, right now, if you are trying to perform a strictly mesh analysis.

For mesh purposes in the case I show above, you could write $$\I_s=I_b\$$ since they must be the same. (It's also true that $$\i_4=I_c\$$ and that $$\i_1=I_a\$$.)

Anyway, let's do the mesh analysis. I will start each equation from the lower-left corner and work clockwise around the loop:

\begin{align*} 0\:\text{V}-R_1\cdot I_a -R_3\cdot\left(I_a-I_c\right)-R_2\cdot\left(I_a-I_b\right)&=0\:\text{V} \\\\ 0\:\text{V}+V_x-R_2\cdot\left(I_b-I_a\right)-V_s&=0\:\text{V} \\\\ 0\:\text{V}+V_s -R_3\cdot\left(I_c-I_a\right)-R_4\cdot I_c&=0\:\text{V} \end{align*}

Now, that looks initially like three equations with four unknowns. But, in fact, you already know that $$\I_b=I_s\$$. So it's really just three equations with three unknowns.

Let's use freely available SymPy:

# the imports I have from my 'init.sage' file:
from sympy import *
from sympy.solvers import solve

ia,ib,ic,vs,vx,r1,r2,r3,r4 = symbols( 'ia,ib,ic,vs,vx,r1,r2,r3,r4', real=True )
e1 = Eq( 0 - r1*ia - r3*(ia-ic) - r2*(ia-ib), 0 )
e2 = Eq( 0 + vx - r2*(ib-ia) - vs, 0 )
e3 = Eq( 0 + vs - r3*(ic-ia) - r4*ic, 0 )
ans = solve( [e1, e2, e3], [vx, ia, ic] )
specific = { r1:50, r2:50, r3:100, r4:100, vs:5, ib:2 }
for item in ans: item, ans[item].subs(specific), ans[item].subs(specific).n()
(vx, 425/6, 70.8333333333333)
(ia, 41/60, 0.683333333333333)
(ic, 11/30, 0.366666666666667)


From the above, you can now work out the resistor currents (which are composed from the now-analyzed mesh currents) as $$\i_1=I_a\approx 683.3\:\text{mA}\$$, $$\i_2=I_b-I_a\approx 1.3167\:\text{A}\$$, $$\i_3=I_c-I_a\approx -316.7\:\text{mA}\$$, and $$\i_4=I_c\approx 366.7\:\text{mA}\$$.

In short, you work out the net device currents from the mesh currents after you figure those out, first.

Here's a Spice .OP run of the above so as to "trust, but verify":

• "to use composite currents"? Do you mean "component currents"? Commented Aug 29, 2023 at 2:44
• @RussellH To me, the word composite has the connotation (if not the explicit denotation) of a mixture of more than one thing. It implies two or more ingredients, to me. I mean to say that $i_2$ is composite, in the sense that it is composed of more than one mesh current. When I wrote that line at the outset, I was looking at the questioner's phrasing in #1 and #2 statements. I probably could have written more words, to be clearer. I just didn't as I was headed somewhere. But I'll add something that will hopefully spell it out better. Thanks for the note. Commented Aug 29, 2023 at 3:31
• @periblepsis may I suggest you add the the appropriate import to your sympy code? And perhaps standard Python style for spacing? Commented Aug 29, 2023 at 7:46
• @jonathanjo I use a startup file which likely has more than the minimum necessary imports. But sure. I can provide that. As far as standard Python style goes, the answer is no. There are at least two reasons: (1) I don't know what that means -- self-taught -- so I'm ignorant and can't comply even if I'd wanted to do so; and, (2) I use the spacing that specifically lays out the equation terms in separated form, which is more natural for a mathematician. So adding the imports is all I can do for you. Commented Aug 29, 2023 at 12:16
• The imports really help: now it runs. For what it's worth, PEP8 is pretty much what most people follow for style. I agree with you about x*(a-b), but your commas and extra spaces are unconventional. The software people have conventions, just the same as schematic diagrams, and for the same reasons. Commented Aug 29, 2023 at 15:29