get.resistance {ElectroGraph} | R Documentation |
Given a pair of nodes to act as source and sink, determine the resulting current flow.
compute.volts.symmetric (sociomatrix, src, snk, fidelities = NULL) compute.volts.asymmetric (sociomatrix, src, snk, fidelities = NULL) get.resistance (e.graph, sources, sinks)
sociomatrix |
An n-by-n sociomatrix. |
e.graph |
An electrograph object. |
src, snk |
Single values for the source and sink. |
sources, sinks |
Vectors of source and sink values. |
fidelities |
If set, allows for ties that are perceived to be less than ``friends''. (Use with caution – results have not been peer reviewed! |
Returns a list containing the following items:
resist.eq |
The equivalent resistance between the source and sink. |
voltages |
Each column contains the electric potential at each node given a source/sink pair. |
current.out |
The total current flowing into and out of each node given a source/sink pair. |
reference.mean |
As a check, computed mean of the sociomatrix. |
The ``compute'' functions are subsumed within get.resistance() and are given for diagnostic purposes. In general, the full execution of ``get.resistance'' is more reliable and faster; this is called in general form by ``electrograph.exam''.
Andrew C. Thomas <act@acthomas.ca>
latt <- cbind(rep(1:5,5),sort(rep(1:5,5))) latt.mat <- make.sociomatrix.from.lattice(latt)$sociomatrix print(compute.volts.symmetric(latt.mat,1,25)) latt.mat[24,25] <- 0 print(compute.volts.asymmetric(latt.mat,1,25)) print(compute.volts.asymmetric(latt.mat,25,1)) latt.e <- electrograph (latt.mat) print(get.resistance(latt.e,c(1,2,3),c(23,24,25)))