SamplePublisher`GrassmannCalculus`
GrassmannDiv |
|
| | ||||
Details and Options
Examples
(1)
Basic Examples
(1)
In[1]:=
<<GrassmannCalculus`
Set Cartesian coordinates.
In[2]:=
SetCoordinateVectorSpace |
The divergence of the position vector and a few other vector fields.
In[3]:=
GrassmannDiv |
e
x
e
y
e
z
Out[3]=
3
In[4]:=
GrassmannDiv |
x+y+z
e
x
e
y
e
z
2
x
2
y
2
z
Out[4]=
1
2
x
2
y
2
z
In[5]:=
GrassmannDiv |
yz-xz+xy
e
x
e
y
e
z
2
x
2
y
2
z
Out[5]=
-
2xyz
2
(++)
2
x
2
y
2
z
In spherical coordinates:
In[6]:=
SetActiveSpacePreferences |
PublicGrassmannAtlas |
In[7]:=
GrassmannDiv |
e
r
Out[7]=
3
A vector field is called incompressible if its divergence is zero. A field derived from a curl is always incompressible.
In[8]:=
GrassmannCurl |
e
θ
e
φ
GrassmannDiv |
Out[8]=
2+-Sin[θ]
e
φ
2Cos[θ]
e
r
r
e
θ
r
Out[8]=
0
The cross product of two gradient fields is also incompressible. We have to define the scalar fields.
In[9]:=
★★S |
Calculate two generic gradient vector fields.
In[10]:=
field1=
[f[r,θ,φ]]field2=
[g[r,θ,φ]]
GrassmannGrad |
GrassmannGrad |
Out[10]=
e
φ
(0,0,1)
f
r
e
θ
(0,1,0)
f
r
e
r
(1,0,0)
f
Out[10]=
e
φ
(0,0,1)
g
r
e
θ
(0,1,0)
g
r
e
r
(1,0,0)
g
This has a problem since the original writing.
Take their cross product and express in the orthonormal basis.
In[11]:=
step1=field1field2/.
//
//
;crossGradientField=step1/.
//Collect#,
,Simplify[#,CoordinateDomain]&&
G
OrthonormalToVector |
EvaluateCrossProducts |
ToMetricElements |
VectorToOrthonormal |
OrthonormalBasis |
Out[11]=
e
r
(0,0,1)
g
(0,1,0)
f
(0,0,1)
f
(0,1,0)
g
2
r
e
θ
(0,0,1)
g
(1,0,0)
f
(0,0,1)
f
(1,0,0)
g
r
e
φ
(0,1,0)
g
(1,0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