6.4. Constant symbols

It is important to discuss the concept of a constant in xTensor`. A scalar field c[] is a constant if it is defined on no manifold. However a nonscalar tensor field cannot be constant on the base manifold of its indices (actually xTensor` automatically defines the tensor to be a field on the base manifolds on its indices). On the other hand we have to use symbols denoting constants (as Newton's constant). We shall use the command DefConstantSymbol to define those constants.

DefConstantSymbol            Define a constant
UndefConstantSymbol            Undefine a constant
$ConstantSymbols            List of defined constants
ConstantSymbolQ                Check a constant symbol

Functions that operate with constants.

This defines a constant scalar field:

In[477]:=

DefTensor[const[], {}]

** DefTensor: Defining tensor const[] .

In[478]:=

? const

Global`const

Dagger[const]^=const
DependenciesOfTensor[const]^={}
Info[const]^={tensor,}
PrintAs[const]^=const
SlotsOfTensor[const]^={}
SymmetryGroupOfTensor[const]^=StrongGenSet[{},GenSet[]]
TensorID[const]^={}
xTensorQ[const]^=True

By default, it is not automatic to check that a derivative on an object living on a different manifold is zero because that is a slow process that could be internally happening too often.

In[479]:=

Cd[-a][const[]]

Out[479]=

▽_a^ const_^

In[480]:=

CheckZeroDerivative[%]

Out[480]=

0

We can automate it for a particular derivative (or for all):

In[481]:=

CheckZeroDerivativeStart[PD]

In[482]:=

PD[-a][const[]]

Out[482]=

0

In[483]:=

CheckZeroDerivativeStop[PD]

An arbitrary symbol is not understood by default as a constant. We must define it as a constant:

In[484]:=

Cd[-a][GNewton]

Out[484]=

▽_a^ GNewton

In[485]:=

DefConstantSymbol[GNewton]

** DefConstantSymbol: Defining constant symbol GNewton.

In[486]:=

Cd[-a][GNewton]

Out[486]=

0

In[487]:=

UndefConstantSymbol[GNewton]

** UndefConstantSymbol: Undefined constant symbol GNewton

In[488]:=

PD[-a][GNewton]

Out[488]=

∂_a^ GNewton


Created by Mathematica  (May 16, 2008) Valid XHTML 1.1!