“Inverse problem” for resistor network: finding applied voltages to produce desired currents

resistors

I am working with a large network of resistors. Here I will illustrate my question with a scaled-down version (5 resistors).

The current flow through the each of the 5 resistors is fully determined by the potentials at each of 6 nodes, or 5 nodes if I ground one.

schematic

simulate this circuit – Schematic created using CircuitLab

I would like to specify a set of currents \$[i_1, i_2, i_3, i_4, i_5]\$ and calculate the required voltages \$[v_1, v_2, v_3, v_4, v_5]\$ which generate these currents. Since I have five independent node voltages, I can find a combination of voltages that generates any desired combination of five currents – I am comfortable with this part.

I am interested in the case where I want to generate a set of currents \$[i_1 … i_5]\$, but I can only set some of the node voltages, say \$v_1, v_4,\$ and \$v_5\$. The other voltages (i.e., \$v_2\$ and \$v_3\$) are determined by the applied voltages and the arrangement of resistors.

Since I now only have three independent voltage sources, I can't generate any arbitrary combination of five currents – only a subset will be possible.

I have three questions:
(1) How can I determine whether my desired combination of currents is possible?
(2) If this combination of currents is possible, how do I calculate the combination of voltages I need to apply to \$v_1, v_4, v_5\$?
(3) If the combination of currents is not possible, what is the closest I can get, perhaps in a least-squares sense (or some other relevant measure)?

Best Answer

You have a system of 5 equations such as:

$$i_1 = \frac1R(V_1-V_2)$$

You can also determine the voltages that you cannot control from nodal analysis in terms of only the voltages that you can control and the resistances. Upon substitution of these equations into the system, you will have only three independent variables.

From here, use your favorite linear system solver (or do it by hand) to see if 1) a solution exists and 2) what such a solution is.

For question 3: you will want to use your favorite optimization package (or by hand) and define your objective function as the error (you mentioned least squares). Then solve the optimization problem for minimum error.