# Calculate the resistances of all the possible connections inside a N-terminals black box based on measurements between terminals

Although it would seem that this is not the right SE for this thread since it is about creating an algorithm, the problem is actually about finding a systematic approach to the simplification of arbitrarily large resistive circuits of a particular pattern.

At work, we have several shorts within a piece of equipment, but we don't know where. The equipment is a black box that cannot be open. I have taken my multimeter and populated a matrix of the resistances across each combination of the terminals available. Something like: As you know, these measurements are meaningless because of the cross coupling with other terminals. I want to know how the nets connect between each other - in other words I want to calculate the values of the resistances shown on the following equivalent circuit (example for N=4). simulate this circuit – Schematic created using CircuitLab

There are: $$\sum_{i=1}^{N-1}(i-1)$$ Measurements made and: $$\sum_{i=1}^{N-1}(i-1)$$ unknown resistances, therefore it is possible to solve the entire circuit based on the table shown above with the following algorithm:

1. For each measurement made Rij, where i and j are 0...N.
• Calculate the formula of the equivalent resistance of the circuit between terminals i and j in function of the "X" resistances. Simplify.
2. Rearrange to build the matrix [X] in: $$\left( \begin{array}{c} R_{1,2}\\ R_{1,3}\\ ...\\ R_{N-1,N}\\ \end{array} \right)= \mathbf{[X]}\left( \begin{array}{c} X_{1,2}\\ X_{1,3}\\ ...\\ X_{N-1,N}\\ \end{array} \right)$$
3. Solve using: $$\left( \begin{array}{c} X_{1,2}\\ X_{1,3}\\ ...\\ X_{N-1,N}\\ \end{array} \right)=\mathbf{[X]}^{-1}\left( \begin{array}{c} R_{1,2}\\ R_{1,3}\\ ...\\ R_{N-1,N}\\ \end{array} \right)$$

Steps 2 and 3 are easy, but I am having difficulty finding an algorithm to deal with the calculation of the equivalent resistance automatically. I can do up to 4 terminals easily (there is a Star/Delta transform to do for 4), but my system has 7 terminals and the manual method just is not good enough anymore, and I have tried it.

Kirchoff laws feel more suited to the automatic generation of the equations, but even though I think I can generate the node equations, I don't have a systematic way of generating the loop equations.

It is a very interesting and exciting problem to which the solution will be useful to many people in my opinion. Could someone help me to automate the calculation of the equivalent resistance (or solve it for N=7, after all it would also work for N<=7)?

• It looks like your formulation is already setup for N terminals, unless I'm missing something. If that's the case and a numerical solution is acceptable, any standard matrix solver should work, say LU decomposition, Gaussian elimination, etc. Jan 9, 2016 at 18:25
• If I had the X matrix populated, I wouldn't have any issue to solve it with Matlab. It's the circuit simplification step for which I'm struggling to find an algorithm. Jan 9, 2016 at 18:29
• I can see that it gets really tricky after 3 lines!!! Jan 9, 2016 at 18:42
• Indeed, it does unfortunately... Jan 9, 2016 at 18:57
• This article may be useful if you have access to IEEE (ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=1083633). It looks like you might need to figure out how to transform the network to a planar equivalent first though, which they indicate is done for the case of a complete 7-gon in this publication which I can't find online: worldcat.org/title/… Jan 29, 2016 at 21:50

Consider $N = 3$. The resistance $R_{12}$ would be $$R_{12} = X_{12} || (X_{13} + X_{23}) = \frac{X_{12} (X_{13} + X_{23})}{X_{12} + X_{23} + X_{13}}$$ This is a problem - your matrix multiplication can only make terms that look like $$R_{ij} = a X_{12} + b X_{13} + c X_{23}$$ where $a$, $b$, and $c$ are constants, so you can't write the first equation in matrix form. That means the method you've suggested won't work - you'll need to do this without linear algebra.