-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
94 lines (58 loc) · 2.3 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
title: "The ResistorArray package: electrical properties of resistor arrays"
output:
github_document:
pandoc_args: --webtex
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
<img src="man/figures/ResistorArray.png" width = "150" align="right" />
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ResistorArray?color=green)](https://cran.r-project.org/package=ResistorArray)
![](https://cranlogs.r-pkg.org/badges/grand-total/ResistorArray?color=green)
![](https://cranlogs.r-pkg.org/badges/ResistorArray?color=green)
![](https://cranlogs.r-pkg.org/badges/last-week/ResistorArray?color=green)
[![Rdoc](https://www.rdocumentation.org/badges/version/ResistorArray)](http://www.rdocumentation.org/packages/ResistorArray)
```{r echo=FALSE, results="hide", message=FALSE}
library("ResistorArray")
```
[![saythanks](https://img.shields.io/badge/say-thanks-ff69b4.svg)](https://saythanks.io/to/RobinHankin)
----
# Overview
The `ResistorArray` package gives functionality for calculating
electrical properties of resistor networks. Any array of resistors
may be implemented and a number of special arrays are given as data.
For example, a skeleton cube has 8 nodes and a conductance matrix for
unit resistors along each edge is given by `cube()`:
```{r}
cube()
```
A common puzzle is to calculate the resistance of such a cube between
diagonally opposite corners, the answer being $1/3+1/6=1/3=5/6$ (the
trick being to observe that nodes equidistant from the corners are at
the same potential). This is easily reproduced in the package:
```{r}
resistance(cube(),1,7)
```
However, the trick does not work for general resistances but the
package has no problem:
```{r}
resistance(cube(1:12),1,7)
```
The package includes many other convenience functions; it is still
under development.
# Installation
To install the most recent stable version on CRAN, use
`install.packages()` at the R prompt:
```
R> install.packages("ResistorArray")
```
To install the current development version use `devtools`:
```
R> devtools::install_github("RobinHankin/ResistorArray")
```
And then to load the package use `library()`:
```{r,message=FALSE}
library("ResistorArray")
```
### Reference
R. K. S. Hankin 2006. "Resistor networks in R: introducing the
`ResistorArray` package". _R News_, 6(2),52-54