Description Usage Arguments Author(s) References See Also Examples
Given a k-form phi and a vector v, the contraction phi_v of phi and v is a k-1-form with
ommitted; see PDF
if k>1; we specify phi_v=phi(v) if k=1.
Function contract_elementary() is a low-level helper function
that translates elementary k-forms with coefficient 1 (in the form
of an integer vector corresponding to one row of an index matrix) into
its contraction with v.
| 1 2 | contract(K,v,lose=TRUE)
contract_elementary(o,v)
 | 
| K | A k-form | 
| o | Integer-valued vector corresponding to one row of an index matrix | 
| lose | Boolean, with default  | 
| v | A vector; in function  | 
Robin K. S. Hankin
Steven H. Weintraub 2014. “Differential forms: theory and practice”, Elsevier (contractions defined in Definition 2.2.23 in chapter 2, page 77).
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | contract(as.kform(1:5),1:8)
contract(as.kform(1),3)   # 0-form
## Now some verification:
o <- rform(2,k=5,n=9,coeffs=runif(2))
V <- matrix(rnorm(45),ncol=5)
jj <- c(
   as.function(o)(V),
   as.function(contract(o,V[,1,drop=TRUE]))(V[,-1]), # scalar
   as.function(contract(o,V[,1:2]))(V[,-(1:2),drop=FALSE]),
   as.function(contract(o,V[,1:3]))(V[,-(1:3),drop=FALSE]),
   as.function(contract(o,V[,1:4]))(V[,-(1:4),drop=FALSE]),
   as.function(contract(o,V[,1:5],lose=FALSE))(V[,-(1:5),drop=FALSE])
)
max(jj) - min(jj) # zero to numerical precision
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.