In fact this method is like measuring resistance with an okmmeter between points A and B of the network.

FWIW here is my interpretation/translation of the Maxima code:

nbrs=: 1 3 5 7&{@,
swz=:0,.~0,.0,~0,]

resistornw=: 4 :0
'h w'=.x
'al bl'=. (+w&*)~/"1 y
d =.(*=/~@i.@#) #&> ix=.,3 3 <@(<:#~0~:])@nbrs;. _3 swz 1+i.h,w
r=. 1 al }zv=.0$~h*w
A=. %. r (al)} d + _1:`[`]}&zv&>ix
bl { A +/ .* 1 bl }zv
)

Your example is calculated like:

   2 2 resistornw  0 0,:1 1
1

Or as David pointed out:

   % +/ % +/"(1) 1 1 ,:1 1
1



On 08-01-13 17:24, Raul Miller wrote:
I'm a bit confused by the maxima solution.  For example, A is both a
specific node and it's also a 10 by 10 matrix.  Similar for B.  I can
assume that the matrix values are something like potential
contribution from the named node.  But...  k looks like the 10 10 #.
of an index pair (with a bit of off-by-one since the maxima solution
is using 1 based indices) except it's used as an index into A and B.
And... so maybe A and B are really representing logically different
kinds of data in different parts of their structure?  But what is the
logical structure then.

... anyways, the purpose of some of this code is not clear to me.


--
Met vriendelijke groet,
@@i = Arie Groeneveld

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to