stokes-package {stokes} | R Documentation |
The Exterior Calculus
Description
Provides functionality for working with tensors, alternating forms, wedge products, Stokes's theorem, and related concepts from the exterior calculus. Uses 'disordR' discipline (Hankin, 2022, <doi:10.48550/ARXIV.2210.03856>). The canonical reference would be M. Spivak (1965, ISBN:0-8053-9021-9) "Calculus on Manifolds". To cite the package in publications please use Hankin (2022) <doi:10.48550/ARXIV.2210.17008>.
Details
The DESCRIPTION file:
Package: | stokes |
Type: | Package |
Title: | The Exterior Calculus |
Version: | 1.2-1 |
Depends: | R (>= 3.5.0) |
Suggests: | knitr, Deriv, testthat, markdown, rmarkdown, quadform, magrittr, covr |
VignetteBuilder: | knitr |
Imports: | permutations (>= 1.1-2), partitions, methods, disordR (>= 0.9-7), spray (>= 1.0-25) |
Authors@R: | person( given=c("Robin", "K. S."), family="Hankin", role = c("aut","cre"), email="hankin.robin@gmail.com", comment = c(ORCID = "0000-0001-5982-0415")) |
Maintainer: | Robin K. S. Hankin <hankin.robin@gmail.com> |
Description: | Provides functionality for working with tensors, alternating forms, wedge products, Stokes's theorem, and related concepts from the exterior calculus. Uses 'disordR' discipline (Hankin, 2022, <doi:10.48550/ARXIV.2210.03856>). The canonical reference would be M. Spivak (1965, ISBN:0-8053-9021-9) "Calculus on Manifolds". To cite the package in publications please use Hankin (2022) <doi:10.48550/ARXIV.2210.17008>. |
License: | GPL-2 |
LazyData: | yes |
URL: | https://github.com/RobinHankin/stokes |
BugReports: | https://github.com/RobinHankin/stokes/issues |
Author: | Robin K. S. Hankin [aut, cre] (<https://orcid.org/0000-0001-5982-0415>) |
Index of help topics:
Alt Alternating multilinear forms Ops.kform Arithmetic Ops Group Methods for 'kform' and 'ktensor' objects as.1form Coerce vectors to 1-forms coeffs Extract and manipulate coefficients consolidate Various low-level helper functions contract Contractions of k-forms dovs Dimension of the underlying vector space dx Elementary forms in three-dimensional space ex Basis vectors in three-dimensional space hodge Hodge star operator inner Inner product operator issmall Is a form zero to within numerical precision? keep Keep or drop variables kform k-forms kinner Inner product of two kforms ktensor k-tensors print.stokes Print methods for k-tensors and k-forms rform Random kforms and ktensors scalar Scalars and losing attributes stokes-package The Exterior Calculus summary.stokes Summaries of tensors and alternating forms symbolic Symbolic form tensorprod Tensor products of k-tensors transform Linear transforms of k-forms vector_cross_product The Vector cross product volume The volume element wedge Wedge products zap Zap small values in k-forms and k-tensors zero Zero tensors and zero forms
Generally in the package, arguments that are k
-forms are
denoted K
, k
-tensors by U
, and spray objects by
S
. Multilinear maps (which may be either k
-forms or
k
-tensors) are denoted by M
.
Author(s)
Robin K. S. Hankin [aut, cre] (<https://orcid.org/0000-0001-5982-0415>)
Maintainer: Robin K. S. Hankin <hankin.robin@gmail.com>
References
M. Spivak 1971. Calculus on manifolds, Addison-Wesley.
R. K. S. Hankin 2022. “Disordered vectors in R: introducing the disordR package.” https://arxiv.org/abs/2210.03856.
R. K. S. Hankin 2022. “Sparse arrays in R: the spray package. https://arxiv.org/abs/2210.03856.”
See Also
Examples
## Some k-tensors:
U1 <- as.ktensor(matrix(1:15,5,3))
U2 <- as.ktensor(cbind(1:3,2:4),1:3)
## Coerce a tensor to functional form, here mapping V^3 -> R (here V=R^15):
as.function(U1)(matrix(rnorm(45),15,3))
## Tensor product is tensorprod() or %X%:
U1 %X% U2
## A k-form is an alternating k-tensor:
K1 <- as.kform(cbind(1:5,2:6),rnorm(5))
K2 <- kform_general(3:6,2,1:6)
K3 <- rform(9,3,9,runif(9))
## The distributive law is true
(K1 + K2) ^ K3 == K1 ^ K3 + K2 ^ K3 # TRUE to numerical precision
## Wedge product is associative (non-trivial):
(K1 ^ K2) ^ K3
K1 ^ (K2 ^ K3)
## k-forms can be coerced to a function and wedge product:
f <- as.function(K1 ^ K2 ^ K3)
## E is a a random point in V^k:
E <- matrix(rnorm(63),9,7)
## f() is alternating:
f(E)
f(E[,7:1])
## The package blurs the distinction between symbolic and numeric computing:
dx <- as.kform(1)
dy <- as.kform(2)
dz <- as.kform(3)
dx ^ dy ^ dz
K3 ^ dx ^ dy ^ dz