blank

DC circuit 3 loops

Analyze DC circuit with 3 loops.

simulator

One of the hosted version of CircuitJS1 is available on https://www.falstad.com/circuit/, where following code

$ 1 0.000005 0.7703437568215379 41 5 50 5e-11
v 80 176 80 80 0 0 40 6 0 0 0.5
r 80 80 240 80 0 1
r 240 80 240 176 0 1.5
r 240 176 80 176 0 2
r 240 176 400 176 0 2
v 400 176 400 80 0 0 40 12 0 0 0.5
r 80 176 80 288 0 16
v 400 288 80 288 0 0 40 16 0 0 0.5
r 240 80 400 80 0 1
w 400 288 400 176 0

will produce http://tinyurl.com/ytbrufmb with circuit diagram of

11.522121

where $\varepsilon_1 = 6 \ {\rm V}$, $\varepsilon_2 = 12 \ {\rm V}$, and $\varepsilon_3 = 16 \ {\rm V}$, respectively in CW direction from NW.

elements

Let us name the elements as follow

    a--R1--b--R2--c 
↑   |      |      |   ↑
I1  E1     R3     E2  I2
    |      |      |
    d--R4--e--R5--f
    |             |   
    R6            |  I6
    |             |  ↓ 
    g------E3-----h

according to the position of each element in previous figure.

Element$\varepsilon_1$$\varepsilon_2$$\varepsilon_3$$R_1$$R_2$$R_3$$R_4$$R_5$$R_6$
Value61216111.52212

equations from kcl

Current subscript is chosen to be the same as the resistor it is passing through.

equation from kvl

Loop begins from negative terminal of a battery.

equations reduction

Since there are only three unknowns use Equations (1)-(4) in Equations (5)-(6) so that it contains only $I_1$, $I_2$, and $I_6$.

new variables

To simplity a new and more compact variable is defined

$$\tag{11} R_{abc} = R_a + R_b + R_c. $$

Using this equation we can have from (8), (9), (10)

$$\tag{12} \begin{array}{c} R_{134} I_1 + R_3 I_2 - R_4 I_6 = \varepsilon_1,\newline R_3 I_1 + R_{235} I_2 + R_5 I_6 = \varepsilon_2,\newline -R_4 I_1 + R_5 I_2 + R_{456} I_6 = \varepsilon_3, \end{array} $$

which later can be presented in matrix form as follow

$$\tag{13} \left[ \begin{array}{ccc} R_{134} & R_3 & -R_4 \newline R_3 & R_{235} & R_5 \newline -R_4 & R_5 & R_{456} \end{array} \right] \left[ \begin{array}{c} I_1 \newline I_2 \newline I_6 \end{array} \right] = \left[ \begin{array}{c} \varepsilon_1 \newline \varepsilon_2 \newline \varepsilon_6 \end{array} \right]. $$

The last equation can be solved using invers matrix or iterative method for SLE.

matrices

From previous table, Equation (13) can be written with its elements value

$$\tag{14} \left[ \begin{array}{ccc} 4.5 & 1.5 & -2 \newline 1.5 & 4.5 & 2 \newline -2 & 2 & 16 \end{array} \right] \left[ \begin{array}{c} I_1 \newline I_2 \newline I_6 \end{array} \right] = \left[ \begin{array}{c} 6 \newline 12 \newline 16 \end{array} \right]. $$

It would be clearer if every matrix in above equation is uniquely named.

numpy

There is solve() function in NumPy to solve SLE.

import numpy as np

R = np.array(
  [
    [  4.5,  1.5,  -2],
    [  1.5,  4.5,   2],
    [ -2,    2,    16]
  ]
)

E = np.array(
  [
     6,
    12,
    16
  ]
)

I = np.linalg.solve(R,E)

print(I)

that is available on https://onecompiler.com/python/3zze7accv and with the result is as follow

[1.1 1.9 0.9]

which shows that $I_1 = 1.1 \ {\rm A}$, $I_2 = 1.9 \ {\rm A}$, and $I_6 = 0.9 \ {\rm A}$.

challenges

refs