Learn R Programming

ResistorArray (version 1.0-7)

currents: Calculates currents in an arbitrary resistor array

Description

Calculates currents in an arbitrary resistor array

Usage

currents(L, earth.node, input.node)
currents.matrix(L, earth.node, input.node)

Arguments

L
Lagrangian conductance matrix
earth.node
Number of node that is earthed (that is, at a potential of zero)
input.node
Number of node that has current put into it (a notional one Amp)

Value

  • Function currents() returns a three column matrix, each row of which corresponds to an edge. The first two columns show the node numbers specifying the edge, and the third shows the current flowing along it.

    Function current.matrix() uses a different method to return a matrix of the same size as the conductance matrix L. Each element of the returned matrix shows the current flowing along the specified edge.

Details

The methods used by the two functions are different; see manpage for resistance() for further details on input args 2 and 3

Examples

Run this code
currents(cube(),1,7)
currents.matrix(cube(),1,7)

 #check above solution: print out the currents flowing into each node:
 zapsmall(apply(currents.matrix(cube(),1,7),1,sum))

Run the code above in your browser using DataLab