# Talk:Resistor mesh

After finishing this task you can move on to this. --Mwn3d 15:59, 21 August 2011 (UTC)

Heh that would have been easy had it not included the squirrel. By the way, do you know what's up with the SVG display? I've been trying to get it to work with no success. --Ledrug 16:26, 21 August 2011 (UTC)
FWIW I have had problems in the past with SVG files that contain text elements not displaying properly. A workaround is to convert the text to curves. It is apparently a problem with the sites SVG renderer. --Thundergnat 19:58, 21 August 2011 (UTC)
Eh that worked, great. --Ledrug 22:51, 21 August 2011 (UTC)
The arena in that link looks like somewhere where you'd plug in the special component from Explorers. Ah, an opportunity for a clever pop-culture reference missed… –Donal Fellows 19:37, 21 August 2011 (UTC)

Anyone? --Paddy3118 06:34, 28 August 2011 (UTC)

Link to a what? A number? --Ledrug 03:22, 29 August 2011 (UTC)

I was hoping for something other than `42` ;-) Maybe a link to something with an algorithm and its explanation? Thanks. --Paddy3118 07:26, 29 August 2011 (UTC)

A long, long time ago, I took the class that taught how to do this. I don't really remember, now. Not the most helpful of links; it teaches more theory than solving this task ought to require. --Michael Mol 11:44, 29 August 2011 (UTC)
The general idea is this: given a circuit and some input, what's the response of the system? For this particular problem, the input is two voltage values on nodes A and B, and the response is the voltage values on every other node. By Ohm's law, if two neighoring nodes have voltages $V_i$ and $V_j$ , then the current flowing from i to j is $(V_i - V_j)/R_{ij}$ where R is the resistance (=1 here). Given a set of voltages on the nodes, you can calculate net current flow out of each node; to be a valid solution, the total current out of each node must be zero unless the node is an electrode (i.e. given a fixed voltage as part of boundary condition). The C code gives A 1 volt and B -1 volt, calculates what voltage each other node has, then calculates the current I flowing out of A and into B (they must be equal); the resistance is again given by Ohm's law: R = 2/I.
Of course the interesting part is how to get the voltage values, and there are multiple ways to do it. The C code just give the circuit some arbitrary values initially, then at each iteration calculates how much voltage difference is needed on each node to locally sastisfy the current flow constraint on that node, and adds it onto the voltage. For this task it converges and pretty quickly at that. --Ledrug 15:45, 29 August 2011 (UTC)
Given the problem size, even Gauss pivoting will do. Now, for a larger circuit, you would simply use a sparse symmetric solver, and there are many good ones already written. Maybe conjugate gradient would be a nice starting point. See also Maxima solution for an exact value. At least it will help checking other methods ;-) Capra Hircus 11:11, 28 August 2012 (UTC)
The exact solver gives 455859137025721/283319837425200, or approximately 1.60899124 Ohm. I now added this problem to examples page. The solver uses repetitive star-mesh transform, and it can list all steps that it took. In this case it takes over a 1000 steps - certainly not something you'd want to do by hand. --Kirr (talk) 11:45, 14 November 2016 (UTC)