Node voltages with dependent current source

This is the way I set up this problem:

v1-v2/5 + v1/5 = 2I0/20 Io/10 + (v2-30)/10 = v1-v2/5

Setting it up that way gives me a v1 of 28.8 and v2 of 7.8, which isn't correct. I'm supposed to be getting -15V for v1 and 0 for v2. What am I doing wrong?

• I do not understand what you have done. The v1 node equations is ( v1/5 + (v1 - v2)/5 - 2Io ) = 0 and for v2 node ( v2 - v1)/5 + (v2 + 30)/10 + 2Io = 0 . And Io = (v1 - v2)/5
– G36
Commented Aug 26 at 20:16
• artemis, Note that the 20 Ohm resistor is completely irrelevant. So if you have included it, then you are already wrong. Would you be willing to expand a little on your thinking process? Mine is solve([Eq(V2/5+V2/10+2*(V1-V2)/5, V1/5-30/10),Eq(V1/5+V1/5, 2*(V1-V2)/5 + V2/5)],[V1,V2]) which yields {V1: -15, V2: 0}. As expected. Commented Aug 26 at 22:55

You've not responded for days now, so I'm not expecting a response. But I'll see about helping others reading your writing.

First off, $$\R_2\$$ has a finite impednace while an ideal current source, $$\I_1\$$, has infinite impedance. As these are in series with each other and their impedances should be added, this means that the finite impedance of $$\R_2\$$ is completely irrelevant and may simply be shorted out and otherwise ignored.

The only impact of inserting $$\R_2\$$ is to impact the voltage of the node between $$\R_2\$$ and $$\I_1\$$, with respect to ground. And that node voltage really doesn't affect anything else.

So, unless you care about that unnamed node's voltage, the schematic can be simplified.

Further, it would likely help a little if you swapped $$\R_4\$$ and $$\V_1\$$. They are in series with each other. The nice thing about this is that then $$\V_1\$$ is immediately relative to ground since one end is then attached to ground. This also helps to simplify the analysis.

With these simplifications, and noting that I'm using lower-case for the nodes and upper-case for $$\V_1\$$ (so don't get confused by $$\v_1\$$ and $$\V_1\$$, as they are different things), then:

\begin{align*}\frac{v_1}{R_1}+\frac{v_1}{R_3}&=\frac{v_2}{R_3}+I_1\\\\\frac{v_2}{R_3}+\frac{v_2}{R_4}+I_1&=\frac{v_1}{R_3}+\frac{-V_1}{R_4}\\\\I_1&=2\cdot\frac{v_1-v_2}{R_3}\end{align*}

Substituting in for $$\I_1\$$:

\begin{align*}\frac{v_1}{R_1}+\frac{v_1}{R_3}&=\frac{v_2}{R_3}+2\cdot\frac{v_1-v_2}{R_3}\\\\\frac{v_2}{R_3}+\frac{v_2}{R_4}+2\cdot\frac{v_1-v_2}{R_3}&=\frac{v_1}{R_3}+\frac{-V_1}{R_4}\end{align*}

The above will readily find $$\v_1=-15\:\text{V}\$$ and $$\v_2=0\:\text{V}\$$. ($$\I_1=-6\:\text{A}\$$, also.)

for i, j in solve( [
....:     Eq( v1/R1 + v1/R3, v2/R3 + I1 ),
....:     Eq( v2/R3 + v2/R4 + I1, v1/R3 + (-V1)/R4 ),
....:     Eq( I1, 2*(v1-v2)/R3 )
....:     ], [
....:     v1,
....:     v2,
....:     I1
....:     ]).items(): i, j.subs( { R1:5, R3:5, R4:10, V1:30 })
....:
(v1, -15)
(v2, 0)
(I1, -6)


I honestly cannot say that I understood how you arrived at your equation. So you will have to read the above and read your own writing and tell me where things went wrong for you.

fuller answer without making the above modifications

Let's assume that you want to just analyze what's in front of you without making any simplifications, whatsoever. Then you will need to label more nodes and add some info about the current in $$\V_1\$$:

Then we have to expand the equations to get the same results showing above. (The addition of $$\V_2\$$ above is simply there to allow the $$\F_1\$$ device to operate on the branch current as you indicated in the schematic. $$\V_2\$$ is used to measure that current. Since $$\V_2=0\:\text{V}\$$ we can ignore it for KCL purposes below.)

\begin{align*}\frac{v_1}{R_1}+\frac{v_1}{R_2}+\frac{v_1}{R_3}&=\frac{v_3}{R_2}+\frac{v_2}{R_3} \\\\ \frac{v_2}{R_3}+I_1+I_{\text{V}_1}&=\frac{v_1}{R_3} \\\\ \frac{v_3}{R_2}&=\frac{v_1}{R_2}+I_1 \\\\ \frac{v_4}{R_4}&=I_{\text{V}_1} \\\\ I_1&=2\cdot\frac{v_1-v_2}{R_3} \\\\ v_4&=v_2+V_1\end{align*}

(Note also that I used $$\I_1\$$ per your schematic and not $$\F_1\$$ per the LTspice schematic. They are the same thing.)

We could substitute in for $$\I_1\$$. But let's not bother. This leaves us with six equations and six unknowns: $$\v_1\$$, $$\v_2\$$, $$\v_3\$$, $$\v_4\$$, $$\I_1\$$, and $$\I_{\text{V}_1}\$$.

The above solves out as $$\v_1=-15\:\text{V}\$$, $$\v_2=0\:\text{V}\$$, $$\v_3=-135\:\text{V}\$$, $$\v_4=30\:\text{V}\$$, $$\I_1=-6\:\text{A}\$$, and $$\I_{\text{V}_1}=3\:\text{A}\$$.

for i, j in solve( [
....:     Eq( v1/R1 + v1/R2 + v1/R3, v3/R2 + v2/R3) ,
....:     Eq( v2/R3 + I1 + IV1, v1/R3 ),
....:     Eq( v3/R2, v1/R2 + I1 ),
....:     Eq( v4/R4, IV1 ),
....:     Eq( I1, 2*(v1-v2)/R3 ),
....:     Eq( v4, v2 + V1 )
....:     ], [
....:     v1,
....:     v2,
....:     v3,
....:     v4,
....:     I1,
....:     IV1
....:     ] ).items(): i, j.subs( { R1:5, R2:20, R3:5, R4:10, V1:30 })
....:
(v1, -15)
(v2, 0)
(v3, -135)
(v4, 30)
(I1, -6)
(IV1, 3)


Same results where it counts. But a lot more information about the circuit. Note that this matches up with what LTspice reports in the above image.

For circuits where simplifications would take up a lot of extra time (there are some complicated circuits where the time spent trying to find ways to reduce them exceeds the time required to just write down equations) developing the skills to just brute-force the equations saves wear and tear. So knowing how to do what I just did above has its place.