Even my grandma knows the answer to this one when all the resistors are the same. But what if they are not?
The classic problem in engineering physics (it’s always the physicists with this kind of nonsense ππ) goes something like this: What is the equivalent resistance across the body diagonal of a one-ohm resistor cube? This version is easy to solve because all the resistors have the same value, but recently I came across a version of the puzzle with a pesky resistor breaking the symmetry.
Let’s first consider the case where all the resistors have the same value. A practical way to solve this is to take advantage of the cube’s symmetry to identify nodes at the same electrical potential. From there, it is usually possible to redraw the circuit flattened into 2D in some clever way that makes the solution obvious.
Consider the case where the probes are placed across the body diagonal of a cube (not across the diagonal of a face). Since all the resistors are identical, if we look at the “Probe+” node, we can assume that the current splits equally into three parts, one through each resistor connected to that node. This means all nodes labeled “i+” are at what fancy people call equipotential (equi means equal; the same).
Finally, note that if we flip the cube or swap the probes, nothing changes because everything is symmetric. That means we get the same pattern from the perspective of the opposite node, “Probe-”.
For now, we draw these subcircuits with the three resistors twice. At this point, the connection between the two subcircuits is still missing, but by looking at the cube again we notice that each resistor connected to an “i+” node links to two resistors connected to “i-”. This means there are six resistors connecting the two sides together.
Redrawing the schematic in this simplified form makes it obvious that we can apply a parallel simplification followed by a series simplification, resulting in the equivalent resistance of the path.
This practical approach is very nice, but it relies on having good intuition about how electrical networks work, and more importantly, the mesh needs to be symmetric.
When the circuit has what I call a “pesky” resistor breaking the symmetry, the approach needs to change. We need a general solution. To do that, we start by labeling all the nodes and resistors.
Next, usingKirchhoff’s current law, which states that
i=1βnβIiβ=0or, in words:
The algebraic sum of currents in a network of conductors meeting at a point is zero.
we can create the nodal equations.
Here, it is useful to model the currents flowing into each node because that way all the equations follow the same pattern:
RbetweenNodesβVnodeββVneighborββAs an example, for node A:
There is no need to worry too much about the signs; you just need to be consistent when putting the equations together. Once the system is solved, the signs will sort themselves out.
Rinse and repeat on all other nodes and we get:
β©β¨β§βRaeβVaββVeββ+RadβVaββVdββ+RabβVaββVbββ=0(A)RabβVbββVaββ+RbfβVbββVfββ+RbcβVbββVcββ=0(B)RcbβVcββVbββ+RcgβVcββVgββ+RcdβVcββVdββ=0(C)RadβVdββVaββ+RdhβVdββVhββ+RdcβVdββVcββ=0(D)RefβVeββVfββ+RaeβVeββVaββ+RehβVeββVhββ=0(E)RfeβVfββVeββ+RfgβVfββVgββ+RfbβVfββVbββ=0(F)RfgβVgββVfββ+RghβVgββVhββ+RgcβVgββVcββ=0(G)RhdβVhββVdββ+RheβVhββVeββ+RghβVhββVgββ=0(H)βWith this set of equations, solving the cube for any combination of resistor values is no problem. For example, solving the opening puzzle of this post is as easy as:
#!/usr/bin/env python3
from numpy import array, linalg
R_ae = 0.75
resistor_network = array([
[1/R_ae + 2, -1, 0, -1, -1/R_ae, 0, 0, 0],
[-1, 3, -1, 0, 0, -1, 0, 0],
[0, -1, 3, -1, 0, 0, -1, 0],
[-1, 0, -1, 3, 0, 0, 0, -1],
[-1/R_ae, 0, 0, 0, 1/R_ae + 2, -1, 0, -1],
[0, -1, 0, 0, -1, 3, -1, 0],
[0, 0, -1, 0, 0, -1, 3, -1],
[0, 0, 0, -1, -1, 0, -1, 3],
])
currents = array([1, 0, 0, 0, 0, 0, -1, 0])
voltages = linalg.pinv(resistor_network) @ currents
R_equivalent = voltages[0] - voltages[6]
print(R_equivalent)
This code returns:
0.8023255813953489
Which is the equivalent resistance for this particular case.
One subtle detail: this system is singular. In Python, this is easy to handle by solving the system using the pseudoinverse method from the linalg package.
Using NumPy or any other numerical solver gets the job done, but it is not that hard to come up with a more elegant solution.
Since we already went through the trouble of writing down all the equations, we can go up a notch and useMaxima to find a symbolic solution.
/* ------------------------------------------------
Maxima code to solve the pesky resistor cube puzzle
Edi Liberato, eddie.liberatoe@gmail.com
created 20260601
------------------------------------------------ */
eq1 : (V_a - V_e) / R_ae + (V_a - V_d) / R + (V_a - V_b) / R;
eq2 : (V_b - V_a) / R + (V_b - V_f) / R + (V_b - V_c) / R;
eq3 : (V_c - V_b) / R + (V_c - V_g) / R + (V_c - V_d) / R;
eq4 : (V_d - V_a) / R + (V_d - V_h) / R + (V_d - V_c) / R;
eq5 : (V_e - V_f) / R + (V_e - V_a) / R_ae + (V_e - V_h) / R;
eq6 : (V_f - V_e) / R + (V_f - V_g) / R + (V_f - V_b) / R;
eq7 : (V_g - V_f) / R + (V_g - V_h) / R + (V_g - V_c) / R;
eq8 : (V_h - V_d) / R + (V_h - V_e) / R + (V_h - V_g) / R;
/* -----------------------------------------------------------------------------
In Maxima skiping the relevant nodal equations is mandatory to avoid singularity
In this example: V_a is the current source and V_g is the curren sink
----------------------------------------------------------------------------- */
sol : solve([eq2, eq3, eq4, eq5, eq6, eq8], [V_b, V_c, V_d, V_e, V_f, V_h]), V_a=1, V_g=0;
V_b : subst(first(sol), V_b);
V_d : subst(first(sol), V_d);
V_e : subst(first(sol), V_e);
V_a : 1;
I_ae : (V_a - V_e) / R_ae;
I_ad : (V_a - V_d) / R;
I_ab : (V_a - V_b) / R;
I_in : I_ae + I_ad + I_ab;
R_eq : 1/I_in;
print(ratsimp(R_eq));
vals : [R=1, R_ae=3/4];
final_sol : subst(vals, R_eq);
print(final_sol);
Running this gives us:
2
11 R R_ae + 9 R
ββββββββββββββββ
10 R_ae + 14 R
69
ββ
86
Since R=1, we can write the generic equation as:
Reqβ=10Raeβ+1411Raeβ+9βΒ Β Ξ©This lets us evaluate the opening problem easily. When Raeβ=43βΞ©, the exact solution is 69/86Β Ξ©.
That’s how engineer Thomas does it.