| array.resistance {ResistorArray} | R Documentation |
Given two points on a regular lattice of electrical nodes joined by unit
resistors (as created by makefullmatrix()), returns the
resistance between the two points, or (optionally) the potentials of
each lattice point when unit current is fed into the first node, and the
second is earthed.
array.resistance(x.offset, y.offset, rows.of.resistors, cols.of.resistors, give.pots = FALSE)
x.offset |
Earthed node is at (0,0), second node is at
(x.offset, y.offset) |
y.offset |
Earthed node is at (0,0), second node is at
(x.offset, y.offset) |
rows.of.resistors |
Number of rows of resistors in the network (positive integer) |
cols.of.resistors |
Number of columns of resistors in the network (positive integer) |
give.pots |
Boolean, with TRUE meaning to return a matrix
of potentials of the electrical nodes, and FALSE meaning to
return the resistance between the origin and the current input node |
Note that the electrical network is effectively toroidal.
Robin K. S. Hankin
array.resistance
array
jj.approximate <- array.resistance(1,2,15,17,give=FALSE) jj.exact <- 4/pi-1/2 print(jj.exact - jj.approximate) persp(array.resistance(4,0,14,16,give=TRUE),theta=50,r=1e9,expand=0.6)
R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(ResistorArray)
> png(filename="images/array.resistance_%03d.png" ,width=480, height=480)
> ### Name: array.resistance
> ### Title: Resistance between two arbitrary points on a regular lattice of
> ### unit resistors
> ### Aliases: array.resistance
> ### Keywords: array
>
> ### ** Examples
>
> jj.approximate <- array.resistance(1,2,15,17,give=FALSE)
> jj.exact <- 4/pi-1/2
> print(jj.exact - jj.approximate)
[1] 0.01040859
>
> persp(array.resistance(4,0,14,16,give=TRUE),theta=50,r=1e9,expand=0.6)
>
>
>
> dev.off()
null device
1
>