The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
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 vignette
ex.Rmd
).
Spivak (1965), in a memorable passage, states:
Fields and forms
If f:Rn⟶R is differentiable, then Df(p)∈Λ1(Rn). 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 R3 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 R3, 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 conceptualise dx
as “picking out” the x-component of a 3-vector and similarly
for dy
and dz
. Recall that dx:R3⟶R
and we have
dx(u1u2u3)=u1dy(u1u2u3)=u2dz(u1u2u3)=u3.
Noting that 1-forms are a vector space, we have in general
(a⋅dx+b⋅dy+c⋅dz)(u1u2u3)=au1+bu2+cu3
Numerically:
## [1] 2 5 702
As Spivak says, dx
, dy
and dz
are conjugate to e1,e2,e3 and
these are defined using function e()
. In this case it is
safer to pass n=3
to function e()
in order to
specify that we are working in R3.
## [1] 1 0 0
## [1] 0 1 0
## [1] 0 0 1
We will now verify numerically that dx
, dy
and dz
are indeed conjugate to e1,e2,e3, but to do this we will
define an orthonormal set of vectors u,v,w:
u <- e(1,3)
v <- e(2,3)
w <- e(3,3)
matrix(c(
as.function(dx)(u), as.function(dx)(v), as.function(dx)(w),
as.function(dy)(u), as.function(dy)(v), as.function(dy)(w),
as.function(dz)(u), as.function(dz)(v), as.function(dz)(w)
),3,3)
## [,1] [,2] [,3]
## [1,] 1 0 0
## [2,] 0 1 0
## [3,] 0 0 1
Above we see the conjugacy clearly [obtaining I3 as expected].
The elementary forms may be combined with a wedge product. We note that dx∧dy:(R3)2⟶R and, for example,
(dx∧dy)((u1u2u3),(v1v2v3))=det
and
(\mathrm{d}x\wedge\mathrm{d}y\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}, \begin{pmatrix}w_1\\w_2\\w_3\end{pmatrix} \right) = \det\begin{pmatrix}u_1&v_1&w_1\\u_2&v_2&w_2\\u_3&v_3&w_3\end{pmatrix}
Numerically:
## [1] -10
Above we see the package correctly giving \det\begin{pmatrix}2&4\\3&1\end{pmatrix}=2-12=-10.
Here I give 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 X=\mathrm{d}x\wedge\mathrm{d}y -7\mathrm{d}x\wedge\mathrm{d}z + 3\mathrm{d}y\wedge\mathrm{d}z:
## 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 that X
has three rows for the three elementary
components. Taking the row with coefficient -7 [which would be -7\mathrm{d}x\wedge\mathrm{d}z], this
maps \left(\mathbb{R}^3\right)^2 to
\mathbb{R} 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}
The other two rows would be
(3\mathrm{d}y\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) = 3\det\begin{pmatrix}u_2&v_2\\u_3&v_3\end{pmatrix}
and
(1\mathrm{d}x\wedge\mathrm{d}y)\left( \begin{pmatrix}u_1\\u_2\\u_3\end{pmatrix}, \begin{pmatrix}v_1\\v_2\\v_3\end{pmatrix} \right) = \det\begin{pmatrix}u_1&v_1\\u_2&v_2\end{pmatrix}
Thus form X would be, by linearity
X\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} +3\det\begin{pmatrix}u_2&v_2\\u_3&v_3\end{pmatrix} +\det\begin{pmatrix}u_1&v_1\\u_2&v_2\end{pmatrix}.
We might want to verify that \mathrm{d}x\wedge\mathrm{d}y=-\mathrm{d}y\wedge\mathrm{d}x:
## [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 \mathrm{d}x^i,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.
Package function d()
will create elementary one-forms
but it is easier to interpret the output if we restore the default print
method
## An alternating linear map from V^1 to R with V=R^8:
## val
## 8 = 1
Spivak introduces the \pi^i notation on page 11: “if \pi\colon\mathbb{R}^n\longrightarrow\mathbb{R}^n is the identity function, \pi(x)=x, then [its components are] \pi^i(x)=x^i; the function \pi^i is called the i^\mathrm{th} projection function”↩︎
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.