dx
, dy
, and
dz
in the stokes
packageTo cite the stokes
package in publications, please use
Hankin (2022). Convenience objects
dx
, dy
, and dz
, corresponding to
elementary differential forms, are discussed here (basis vectors e1, e2, e2 are discussed in
ex.Rmd
). Spivak (1965), in a
memorable passage, states:
Fields and forms
If f: ℝn → ℝ is differentiable, then Df(p) ∈ Λ1(ℝn). By a minor modification we therefore obtain a 1-form df, defined by
df(p)(vp) = Df(p)(v).
Let us consider in particular the 1-forms dπi 1. It is customary to let xi denote the function πi (on ℝ3 we often denote x1, x2, and x3 by x, y, and z) … Since dxi(p)(vp) = dπi(p)(vp) = Dπi(p)(v) = vi, we see that dx1(p), …, dxn(p) is just the dual basis to (e1)p, …, (en)p.
- Michael Spivak, 1969 (Calculus on Manifolds, Perseus books). Page 89
Spivak goes on to observe that every k-form ω can be written ω = ∑i1 < ⋯ < ikωi1, …ikdxi1 ∧ ⋯ ∧ dxik.
If working in ℝ3, we have
three elementary forms dx,
dy, and dz; in the package we have the
pre-defined objects dx
, dy
, and
dz
. These are convenient for reproducing textbook results.
We start with some illustrations of the package print method.
## An alternating linear map from V^1 to R with V=R^1:
## val
## 1 = 1
This is somewhat opaque and difficult to understand. It is easier to start with a more complicated example: take dx ∧ dy − 7dx ∧ dz + 3dy ∧ dz:
## An alternating linear map from V^2 to R with V=R^3:
## val
## 1 3 = -7
## 2 3 = 3
## 1 2 = 1
We see three rows for the three elementary components. Taking the row with coefficient −7 [which would be −7dx ∧ dz], this maps (ℝ3)2 to ℝ and we have
$$(-7\mathrm{d}x\wedge\mathrm{d}z)\left(\begin{pmatrix} u_1\\u_2\\u_3\end{pmatrix}, \begin{pmatrix}v_1\\v_2\\v_3\end{pmatrix}\right)= -7\det\begin{pmatrix}u_1&v_1\\u_3&v_3\end{pmatrix}$$
Armed with this familiar fact, we can interpret dx as a map from (ℝ3)1 to ℝ with
$$\mathrm{d}x\left(\begin{pmatrix} u_1\\u_2\\u_3\end{pmatrix} \right)= \det\begin{pmatrix}u_1\end{pmatrix}=u_1$$
or, in other words, dx picks out the first component of its vector (as the print method gives, albeit obscurely). This is easily shown in the package:
## [1] 113
We might want to verify that dx ∧ dy = −dy ∧ dx:
## [1] TRUE
The print method is configurable and can display kforms in symbolic
form. For working with dx dy dz
we may set option
kform_symbolic_print
to dx
:
Then the results of calculations are more natural:
## An alternating linear map from V^1 to R with V=R^1:
## + dx
## An alternating linear map from V^2 to R with V=R^3:
## + dx^dy +56 dy^dz
However, this setting can be confusing if we work with dxi, i > 3, for the print method runs out of alphabet:
## An alternating linear map from V^3 to R with V=R^7:
## +6 dy^dNA^dNA +5 dy^dNA^dNA -9 dNA^dNA^dNA +4 dx^dz^dNA +7 dx^dNA^dNA -3 dy^dz^dNA -8 dx^dNA^dNA +2 dx^dy^dNA + dx^dNA^dNA
Above, we see the use of NA
because there is no defined
symbol.
Function hodge()
returns the Hodge dual:
## An alternating linear map from V^1 to R with V=R^3:
## +13 dx + dz
Note that calling hodge(dx)
can be confusing:
## [1] 1
This returns a scalar because dx
is interpreted as a
one-form on one-dimensional space, which is a scalar form. One usually
wants the result in three dimensions:
## An alternating linear map from V^2 to R with V=R^3:
## + dy^dz
This is further discussed in the dovs
vignette.
It is possible to create these objects using package idiom:
## [1] TRUE
Spivak introduces the πi notation on page 11: “if π: ℝn → ℝn is the identity function, π(x) = x, then [its components are] πi(x) = xi; the function πi is called the ith projection function”↩︎