DifferentialGeometry/Tensor/EnergyMomentumTensor - Maple Help

Tensor[EnergyMomentumTensor] - find the energy-momentum tensor for various matter fields

Tensor[MatterFieldEquations] - find the field equations for various matter fields

Tensor[DivergenceIdentities] - check the divergence identities for the energy-momentum tensor field for various matter fields

Calling Sequences

EnergyMomentumTensor(FieldType, g, F1, F2, ...)

MatterFieldEquations(FieldType, g, F1, F2, ...)

DivergenceIdentities(FieldType, g, F1, F2, ... , T, E1, E2,...)

Parameters

FieldType  - a string, one of "DiracWeyl", "Dust", "Electromagnetic", "PerfectFluid", "Scalar", "NMCScalar"

g          - a metric tensor

F1, F2,..  - scalars, tensors or spinors, defining the fields needed for the field theory designated by FieldType

T          - a rank 2 tensor (the energy-momentum tensor)

E1, E2,..  - scalars, tensors or spinors, defining the field equations for the field theory designated by FieldType

Description

 • The energy momentum tensor is a symmetric, rank-2 contravariant tensor $T$ which determines the right-hand side of the Einstein field equations.
 • If FieldType = "DiracWeyl", then the additional arguments for EnergyMomentumTensor are: a solder form (compatible with the metric $g$), a rank 1 covariant spinor $\mathrm{ψ}$, and the complex conjugate $\stackrel{‾}{\mathrm{ψ}}$.
 • If FieldType = "Dust", then the additional arguments for EnergyMomentumTensor are: a vector field $U$, a scalar $\mathrm{μ}$ (energy density).
 • If FieldType = "Electromagnetic", then the additional arguments are either: a 1-form $A$ (the electromagnetic 4-potential), or a skew-symmetric rank 2 tensor $F$ (the field strength tensor).
 • If FieldType = "PerfectFluid", then the additional arguments for EnergyMomentumTensor are: a vector field $U$, and scalars $\mathrm{μ}$ (energy density) and $p$ (pressure).
 • If FieldType = "Scalar", then the additional argument for EnergyMomentumTensor is a scalar $\mathrm{φ}$.
 • If FieldType = "NMCScalar", then the additional argument for EnergyMomentumTensor is a non-minimally coupled scalar $\mathrm{φ}$.
 • See the Details help page for the explicit formulas used to calculate the various energy-momentum tensors, the matter field equations and the divergence identities.
 • These commands are part of the DifferentialGeometry:-Tensor: package, and so can be used in the form EnergyMomentumTensor(...), MatterFieldEquations(...), DivergenceIdentities(...) only after executing the commands with(DifferentialGeometry); with(Tensor); in that order. They can always be used in the long form DifferentialGeometry:-Tensor:-EnergyMomentumTensor, DifferentialGeometry:-Tensor-MatterFieldEquations, DifferentialGeometry:-Tensor:-DivergenceIdentities.

Examples

 > $\mathrm{with}\left(\mathrm{DifferentialGeometry}\right):$$\mathrm{with}\left(\mathrm{Tools}\right):$$\mathrm{with}\left(\mathrm{Tensor}\right):$

Example 1. "DiracWeyl"

First create a vector bundle $N$ with base coordinates $\left(t,x,y,z\right)$ and fiber coordinates $\left(\mathrm{z1},\mathrm{z2},\mathrm{w1},\mathrm{w2}\right)$.

 > $\mathrm{DGsetup}\left(\left[t,x,y,z\right],\left[\mathrm{z1},\mathrm{z2},\mathrm{w1},\mathrm{w2}\right],N\right)$
 ${\mathrm{frame name: N}}$ (2.1)

Define a metric of signature $\left(1,-1,-1,-1\right)$ and an orthonormal tetrad.

 N > $\mathrm{g1}≔\mathrm{evalDG}\left({x}^{4}\mathrm{dt}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dt}-\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dx}-\mathrm{dy}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dy}-\mathrm{dz}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dz}\right)$
 ${\mathrm{g1}}{≔}{{x}}^{{4}}{}{\mathrm{dt}}{}{\mathrm{dt}}{-}{\mathrm{dx}}{}{\mathrm{dx}}{-}{\mathrm{dy}}{}{\mathrm{dy}}{-}{\mathrm{dz}}{}{\mathrm{dz}}$ (2.2)
 N > $\mathrm{OTetrad}≔\mathrm{evalDG}\left(\left[\frac{1}{{x}^{2}}\mathrm{D_t},\mathrm{D_x},\mathrm{D_y},\mathrm{D_z}\right]\right)$
 ${\mathrm{OTetrad}}{≔}\left[\frac{{1}}{{{x}}^{{2}}}{}{\mathrm{D_t}}{,}{\mathrm{D_x}}{,}{\mathrm{D_y}}{,}{\mathrm{D_z}}\right]$ (2.3)

Calculate the solder form.

 N > $\mathrm{σ1}≔\mathrm{SolderForm}\left(\mathrm{OTetrad}\right)$
 ${\mathrm{σ1}}{≔}\frac{{{x}}^{{2}}{}\sqrt{{2}}}{{2}}{}{\mathrm{dt}}{}{\mathrm{D_z1}}{}{\mathrm{D_w1}}{+}\frac{{{x}}^{{2}}{}\sqrt{{2}}}{{2}}{}{\mathrm{dt}}{}{\mathrm{D_z2}}{}{\mathrm{D_w2}}{+}\frac{\sqrt{{2}}}{{2}}{}{\mathrm{dx}}{}{\mathrm{D_z1}}{}{\mathrm{D_w2}}{+}\frac{\sqrt{{2}}}{{2}}{}{\mathrm{dx}}{}{\mathrm{D_z2}}{}{\mathrm{D_w1}}{-}\frac{{I}}{{2}}{}\sqrt{{2}}{}{\mathrm{dy}}{}{\mathrm{D_z1}}{}{\mathrm{D_w2}}{+}\frac{{I}}{{2}}{}\sqrt{{2}}{}{\mathrm{dy}}{}{\mathrm{D_z2}}{}{\mathrm{D_w1}}{+}\frac{\sqrt{{2}}}{{2}}{}{\mathrm{dz}}{}{\mathrm{D_z1}}{}{\mathrm{D_w1}}{-}\frac{\sqrt{{2}}}{{2}}{}{\mathrm{dz}}{}{\mathrm{D_z2}}{}{\mathrm{D_w2}}$ (2.4)

Define a rank 1-spinor field $\mathrm{ψ1}$ and its complex conjugate.

 N > $\mathrm{ψ1}≔\mathrm{evalDG}\left(h\left(x\right)\mathrm{dz1}-f\left(x\right)\mathrm{dz2}\right)$
 ${\mathrm{ψ1}}{≔}{h}{}\left({x}\right){}{\mathrm{dz1}}{-}{f}{}\left({x}\right){}{\mathrm{dz2}}$ (2.5)
 N > $\mathrm{barpsi1}≔\mathrm{evalDG}\left(h\left(x\right)\mathrm{dw1}-f\left(x\right)\mathrm{dw2}\right)$
 ${\mathrm{barpsi1}}{≔}{h}{}\left({x}\right){}{\mathrm{dw1}}{-}{f}{}\left({x}\right){}{\mathrm{dw2}}$ (2.6)

Calculate the Dirac-Weyl energy momentum tensor $T$.

 N > $\mathrm{T1}≔\mathrm{EnergyMomentumTensor}\left("DiracWeyl",\mathrm{g1},\mathrm{σ1},\mathrm{ψ1},\mathrm{barpsi1}\right)$
 ${\mathrm{T1}}{≔}{-}\frac{\sqrt{{2}}{}\left({{f}{}\left({x}\right)}^{{2}}{-}{{h}{}\left({x}\right)}^{{2}}\right)}{{{x}}^{{3}}}{}{\mathrm{D_t}}{}{\mathrm{D_y}}{+}\sqrt{{2}}{}\left({-}{h}{}\left({x}\right){}{f}{\prime }{}\left({x}\right){+}{f}{}\left({x}\right){}{h}{\prime }{}\left({x}\right)\right){}{\mathrm{D_x}}{}{\mathrm{D_y}}{-}\frac{\sqrt{{2}}{}\left({{f}{}\left({x}\right)}^{{2}}{-}{{h}{}\left({x}\right)}^{{2}}\right)}{{{x}}^{{3}}}{}{\mathrm{D_y}}{}{\mathrm{D_t}}{+}\sqrt{{2}}{}\left({-}{h}{}\left({x}\right){}{f}{\prime }{}\left({x}\right){+}{f}{}\left({x}\right){}{h}{\prime }{}\left({x}\right)\right){}{\mathrm{D_y}}{}{\mathrm{D_x}}$ (2.7)

Evaluate the Dirac-Weyl field equations $\mathrm{E1}$ for the given spinor field $\mathrm{ψ}$.

 N > $\mathrm{E1}≔\mathrm{MatterFieldEquations}\left("DiracWeyl",\mathrm{g1},\mathrm{σ1},\mathrm{ψ1},\mathrm{barpsi1}\right)$
 ${\mathrm{E1}}{≔}\frac{\frac{{I}}{{2}}{}\sqrt{{2}}{}\left({f}{\prime }{}\left({x}\right){}{x}{+}{f}{}\left({x}\right)\right)}{{x}}{}{\mathrm{D_w1}}{-}\frac{\frac{{I}}{{2}}{}\sqrt{{2}}{}\left({h}{\prime }{}\left({x}\right){}{x}{+}{h}{}\left({x}\right)\right)}{{x}}{}{\mathrm{D_w2}}{,}{-}\frac{\frac{{I}}{{2}}{}\sqrt{{2}}{}\left({f}{\prime }{}\left({x}\right){}{x}{+}{f}{}\left({x}\right)\right)}{{x}}{}{\mathrm{D_z1}}{+}\frac{\frac{{I}}{{2}}{}\sqrt{{2}}{}\left({h}{\prime }{}\left({x}\right){}{x}{+}{h}{}\left({x}\right)\right)}{{x}}{}{\mathrm{D_z2}}$ (2.8)

Check the divergence identity for the dust energy momentum tensor $T$. The LHS is the covariant divergence of the energy momentum tensor and the RHS is a combination of the field equations.

 N > $\mathrm{Div1},\mathrm{RHS1}≔\mathrm{DivergenceIdentities}\left("DiracWeyl",\mathrm{g1},\mathrm{σ1},\mathrm{ψ1},\mathrm{barpsi1},\mathrm{T1},\mathrm{E1}\right)$
 ${\mathrm{Div1}}{,}{\mathrm{RHS1}}{≔}\frac{\sqrt{{2}}{}\left({-}{x}{}{h}{}\left({x}\right){}{f}{″}{}\left({x}\right){+}{x}{}{f}{}\left({x}\right){}{h}{″}{}\left({x}\right){+}{2}{}{f}{}\left({x}\right){}{h}{\prime }{}\left({x}\right){-}{2}{}{h}{}\left({x}\right){}{f}{\prime }{}\left({x}\right)\right)}{{x}}{}{\mathrm{D_y}}{,}\frac{\sqrt{{2}}{}\left({-}{x}{}{h}{}\left({x}\right){}{f}{″}{}\left({x}\right){+}{x}{}{f}{}\left({x}\right){}{h}{″}{}\left({x}\right){+}{2}{}{f}{}\left({x}\right){}{h}{\prime }{}\left({x}\right){-}{2}{}{h}{}\left({x}\right){}{f}{\prime }{}\left({x}\right)\right)}{{x}}{}{\mathrm{D_y}}$ (2.9)
 N > $\mathrm{Div1}-\mathrm{RHS1}$
 ${0}$ (2.10)

We note that $f\left(x\right)=h\left(x\right)=\frac{1}{x}$ is a solution of the Dirac-Weyl field equations:

 N > $\mathrm{map}\left(\mathrm{DGsimplify},\mathrm{eval}\left(\left[\mathrm{E1}\right],\left[f\left(x\right)=\frac{1}{x},h\left(x\right)=\frac{1}{x}\right]\right)\right)$
 $\left[{0}{}{\mathrm{D_z1}}{,}{0}{}{\mathrm{D_z1}}\right]$ (2.11)

The covariant divergence of the energy momentum tensor vanishes on this solution:

 N > $\mathrm{DGsimplify}\left(\mathrm{eval}\left(\mathrm{Div1},\left[f\left(x\right)=\frac{1}{x},h\left(x\right)=\frac{1}{x}\right]\right)\right)$
 ${0}{}{\mathrm{D_t}}$ (2.12)

Example 2. "Dust"

First create a manifold $M$ with base coordinates $\left(t,x,y,z\right)$:

 N > $\mathrm{DGsetup}\left(\left[t,x,y,z\right],M\right)$
 ${\mathrm{frame name: M}}$ (2.13)

Define a metric.

 M > $\mathrm{g2}≔\mathrm{evalDG}\left(\mathrm{dt}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dt}-{t}^{2}\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dx}-\mathrm{dy}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dy}-\mathrm{dz}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dz}\right)$
 ${\mathrm{g2}}{≔}{\mathrm{dt}}{}{\mathrm{dt}}{-}{{t}}^{{2}}{}{\mathrm{dx}}{}{\mathrm{dx}}{-}{\mathrm{dy}}{}{\mathrm{dy}}{-}{\mathrm{dz}}{}{\mathrm{dz}}$ (2.14)

Define the normalized 4-vector representing the 4-velocity of the dust.

 M > $\mathrm{u2}≔\mathrm{evalDG}\left(\mathrm{cosh}\left(f\left(t\right)\right)\mathrm{D_t}-\frac{\mathrm{sinh}\left(f\left(t\right)\right)}{t}\mathrm{D_x}\right)$
 ${\mathrm{u2}}{≔}{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){}{\mathrm{D_t}}{-}\frac{{\mathrm{sinh}}{}\left({f}{}\left({t}\right)\right)}{{t}}{}{\mathrm{D_x}}$ (2.15)
 M > $\mathrm{TensorInnerProduct}\left(\mathrm{g2},\mathrm{u2},\mathrm{u2}\right)$
 ${1}$ (2.16)

Define the energy density.

 M > $\mathrm{μ2}≔h\left(t\right)$
 ${\mathrm{μ2}}{≔}{h}{}\left({t}\right)$ (2.17)

Calculate the dust energy- momentum tensor $\mathrm{T2}$.

 M > $\mathrm{T2}≔\mathrm{EnergyMomentumTensor}\left("Dust",\mathrm{g2},\mathrm{u2},\mathrm{μ2}\right)$
 ${\mathrm{T2}}{≔}{h}{}\left({t}\right){}{{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right)}^{{2}}{}{\mathrm{D_t}}{}{\mathrm{D_t}}{-}\frac{{h}{}\left({t}\right){}{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){}{\mathrm{sinh}}{}\left({f}{}\left({t}\right)\right)}{{t}}{}{\mathrm{D_t}}{}{\mathrm{D_x}}{-}\frac{{h}{}\left({t}\right){}{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){}{\mathrm{sinh}}{}\left({f}{}\left({t}\right)\right)}{{t}}{}{\mathrm{D_x}}{}{\mathrm{D_t}}{+}\frac{{h}{}\left({t}\right){}\left({{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right)}^{{2}}{-}{1}\right)}{{{t}}^{{2}}}{}{\mathrm{D_x}}{}{\mathrm{D_x}}$ (2.18)

Evaluate the dust field equations $\mathrm{E2}$ for the given $\mathrm{u2}$ and $\mathrm{μ2}$.

 M > $\mathrm{E2}≔\mathrm{MatterFieldEquations}\left("Dust",\mathrm{g2},\mathrm{u2},\mathrm{μ2}\right)$
 ${\mathrm{E2}}{≔}\frac{{h}{}\left({t}\right){}{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){+}\stackrel{{\mathbf{.}}}{{h}}{}\left({t}\right){}{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){}{t}{+}{h}{}\left({t}\right){}{\mathrm{sinh}}{}\left({f}{}\left({t}\right)\right){}\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){}{t}}{{t}}{,}\frac{{{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right)}^{{2}}{-}{1}{+}{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){}{\mathrm{sinh}}{}\left({f}{}\left({t}\right)\right){}\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){}{t}}{{t}}{}{\mathrm{D_t}}{-}\frac{{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){}\left({\mathrm{sinh}}{}\left({f}{}\left({t}\right)\right){+}{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){}\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){}{t}\right)}{{{t}}^{{2}}}{}{\mathrm{D_x}}$ (2.19)

Check that the following values for $f\left(t\right)$ and solve the dust field equations.

 M > $\mathrm{Soln}≔\left[h\left(t\right)=\frac{\mathrm{_C2}}{{\left(1+{t}^{2}{\mathrm{_C1}}^{2}\right)}^{\frac{1}{2}}},f\left(t\right)=\mathrm{arcsinh}\left(\frac{1}{t\mathrm{_C1}}\right)\right]$
 ${\mathrm{Soln}}{≔}\left[{h}{}\left({t}\right){=}\frac{{\mathrm{_C2}}}{\sqrt{{1}{+}{{t}}^{{2}}{}{{\mathrm{_C1}}}^{{2}}}}{,}{f}{}\left({t}\right){=}{\mathrm{arcsinh}}{}\left(\frac{{1}}{{t}{}{\mathrm{_C1}}}\right)\right]$ (2.20)
 M > $\mathrm{simplify}\left(\mathrm{eval}\left(\left[\mathrm{E2}\right],\mathrm{Soln}\right),\mathrm{symbolic}\right)$
 $\left[{0}{,}{0}{}{\mathrm{D_t}}{+}{0}{}{\mathrm{D_x}}\right]$ (2.21)

Check the divergence identity for the dust energy-momentum tensor $\mathrm{T2}$. The LHS is the covariant divergence of the energy-momentum tensor and the RHS is a combination of the field equations.

 M > $\mathrm{Div2},\mathrm{RHS2}≔\mathrm{DivergenceIdentities}\left("Dust",\mathrm{g2},\mathrm{u2},\mathrm{μ2},\mathrm{T2},\mathrm{E2}\right)$
 ${\mathrm{Div2}}{,}{\mathrm{RHS2}}{≔}\frac{{2}{}{h}{}\left({t}\right){}{{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right)}^{{2}}{-}{h}{}\left({t}\right){+}\stackrel{{\mathbf{.}}}{{h}}{}\left({t}\right){}{t}{}{{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right)}^{{2}}{+}{2}{}{h}{}\left({t}\right){}{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){}{\mathrm{sinh}}{}\left({f}{}\left({t}\right)\right){}\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){}{t}}{{t}}{}{\mathrm{D_t}}{-}\frac{{2}{}{h}{}\left({t}\right){}{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){}{\mathrm{sinh}}{}\left({f}{}\left({t}\right)\right){+}\stackrel{{\mathbf{.}}}{{h}}{}\left({t}\right){}{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){}{\mathrm{sinh}}{}\left({f}{}\left({t}\right)\right){}{t}{+}{2}{}{h}{}\left({t}\right){}{{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right)}^{{2}}{}\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){}{t}{-}{h}{}\left({t}\right){}\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){}{t}}{{{t}}^{{2}}}{}{\mathrm{D_x}}{,}\frac{{2}{}{h}{}\left({t}\right){}{{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right)}^{{2}}{-}{h}{}\left({t}\right){+}\stackrel{{\mathbf{.}}}{{h}}{}\left({t}\right){}{t}{}{{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right)}^{{2}}{+}{2}{}{h}{}\left({t}\right){}{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){}{\mathrm{sinh}}{}\left({f}{}\left({t}\right)\right){}\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){}{t}}{{t}}{}{\mathrm{D_t}}{-}\frac{{2}{}{h}{}\left({t}\right){}{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){}{\mathrm{sinh}}{}\left({f}{}\left({t}\right)\right){+}\stackrel{{\mathbf{.}}}{{h}}{}\left({t}\right){}{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right){}{\mathrm{sinh}}{}\left({f}{}\left({t}\right)\right){}{t}{+}{2}{}{h}{}\left({t}\right){}{{\mathrm{cosh}}{}\left({f}{}\left({t}\right)\right)}^{{2}}{}\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){}{t}{-}{h}{}\left({t}\right){}\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){}{t}}{{{t}}^{{2}}}{}{\mathrm{D_x}}$ (2.22)
 M > $\mathrm{Div2}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&minus\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{RHS2}$
 ${0}{}{\mathrm{D_t}}$ (2.23)

Example 3. "Electromagnetic"

First create a manifold $M$ with base coordinates $\left(t,x,y,z\right)$.

 M > $\mathrm{DGsetup}\left(\left[t,x,y,z\right],M\right)$
 ${\mathrm{frame name: M}}$ (2.24)

Define a metric.

 M > $\mathrm{g3}≔\mathrm{evalDG}\left({x}^{2}\mathrm{dt}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dt}-\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dx}-\mathrm{dy}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dy}-\mathrm{dz}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dz}\right)$
 ${\mathrm{g3}}{≔}{{x}}^{{2}}{}{\mathrm{dt}}{}{\mathrm{dt}}{-}{\mathrm{dx}}{}{\mathrm{dx}}{-}{\mathrm{dy}}{}{\mathrm{dy}}{-}{\mathrm{dz}}{}{\mathrm{dz}}$ (2.25)

Define an electromagnetic 4-potential $\mathrm{A3}$.

 M > $\mathrm{A3}≔\mathrm{evalDG}\left(\mathrm{f1}\left(x\right)\mathrm{dt}+\mathrm{f2}\left(x\right)\mathrm{dy}\right)$
 ${\mathrm{A3}}{≔}{\mathrm{f1}}{}\left({x}\right){}{\mathrm{dt}}{+}{\mathrm{f2}}{}\left({x}\right){}{\mathrm{dy}}$ (2.26)

Calculate the electromagnetic energy-momentum tensor $\mathrm{T3}$.

 M > $\mathrm{T3}≔\mathrm{EnergyMomentumTensor}\left("Electromagnetic",\mathrm{g3},\mathrm{A3}\right)$
 ${\mathrm{T3}}{≔}{-}\frac{{{\mathrm{f2}}{\prime }{}\left({x}\right)}^{{2}}{}{{x}}^{{2}}{+}{{\mathrm{f1}}{\prime }{}\left({x}\right)}^{{2}}}{{2}{}{{x}}^{{4}}}{}{\mathrm{D_t}}{}{\mathrm{D_t}}{+}\frac{{\mathrm{f1}}{\prime }{}\left({x}\right){}{\mathrm{f2}}{\prime }{}\left({x}\right)}{{{x}}^{{2}}}{}{\mathrm{D_t}}{}{\mathrm{D_y}}{+}\frac{{-}{{\mathrm{f2}}{\prime }{}\left({x}\right)}^{{2}}{}{{x}}^{{2}}{+}{{\mathrm{f1}}{\prime }{}\left({x}\right)}^{{2}}}{{2}{}{{x}}^{{2}}}{}{\mathrm{D_x}}{}{\mathrm{D_x}}{+}\frac{{\mathrm{f1}}{\prime }{}\left({x}\right){}{\mathrm{f2}}{\prime }{}\left({x}\right)}{{{x}}^{{2}}}{}{\mathrm{D_y}}{}{\mathrm{D_t}}{-}\frac{{{\mathrm{f2}}{\prime }{}\left({x}\right)}^{{2}}{}{{x}}^{{2}}{+}{{\mathrm{f1}}{\prime }{}\left({x}\right)}^{{2}}}{{2}{}{{x}}^{{2}}}{}{\mathrm{D_y}}{}{\mathrm{D_y}}{-}\frac{{-}{{\mathrm{f2}}{\prime }{}\left({x}\right)}^{{2}}{}{{x}}^{{2}}{+}{{\mathrm{f1}}{\prime }{}\left({x}\right)}^{{2}}}{{2}{}{{x}}^{{2}}}{}{\mathrm{D_z}}{}{\mathrm{D_z}}$ (2.27)

Note that the energy-momentum tensor can also be computed from the field strength tensor $F=\mathrm{dA}$.

 M > $\mathrm{F3}≔\mathrm{ExteriorDerivative}\left(\mathrm{A3}\right)$
 ${\mathrm{F3}}{≔}{-}{\mathrm{f1}}{\prime }{}\left({x}\right){}{\mathrm{dt}}{}{\bigwedge }{}{\mathrm{dx}}{+}{\mathrm{f2}}{\prime }{}\left({x}\right){}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dy}}$ (2.28)
 M > $\mathrm{EnergyMomentumTensor}\left("Electromagnetic",\mathrm{g3},\mathrm{F3}\right)$
 ${-}\frac{{{\mathrm{f2}}{\prime }{}\left({x}\right)}^{{2}}{}{{x}}^{{2}}{+}{{\mathrm{f1}}{\prime }{}\left({x}\right)}^{{2}}}{{2}{}{{x}}^{{4}}}{}{\mathrm{D_t}}{}{\mathrm{D_t}}{+}\frac{{\mathrm{f1}}{\prime }{}\left({x}\right){}{\mathrm{f2}}{\prime }{}\left({x}\right)}{{{x}}^{{2}}}{}{\mathrm{D_t}}{}{\mathrm{D_y}}{+}\frac{{-}{{\mathrm{f2}}{\prime }{}\left({x}\right)}^{{2}}{}{{x}}^{{2}}{+}{{\mathrm{f1}}{\prime }{}\left({x}\right)}^{{2}}}{{2}{}{{x}}^{{2}}}{}{\mathrm{D_x}}{}{\mathrm{D_x}}{+}\frac{{\mathrm{f1}}{\prime }{}\left({x}\right){}{\mathrm{f2}}{\prime }{}\left({x}\right)}{{{x}}^{{2}}}{}{\mathrm{D_y}}{}{\mathrm{D_t}}{-}\frac{{{\mathrm{f2}}{\prime }{}\left({x}\right)}^{{2}}{}{{x}}^{{2}}{+}{{\mathrm{f1}}{\prime }{}\left({x}\right)}^{{2}}}{{2}{}{{x}}^{{2}}}{}{\mathrm{D_y}}{}{\mathrm{D_y}}{-}\frac{{-}{{\mathrm{f2}}{\prime }{}\left({x}\right)}^{{2}}{}{{x}}^{{2}}{+}{{\mathrm{f1}}{\prime }{}\left({x}\right)}^{{2}}}{{2}{}{{x}}^{{2}}}{}{\mathrm{D_z}}{}{\mathrm{D_z}}$ (2.29)

Evaluate the electromagnetic field equations $\mathrm{E3}$ for the given 4-potential $A$.

 M > $\mathrm{E3}≔\mathrm{MatterFieldEquations}\left("Electromagnetic",\mathrm{g3},\mathrm{A3}\right)$
 ${\mathrm{E3}}{≔}{-}\frac{{\mathrm{f1}}{\prime }{}\left({x}\right){-}{\mathrm{f1}}{″}{}\left({x}\right){}{x}}{{{x}}^{{3}}}{}{\mathrm{D_t}}{-}\frac{{\mathrm{f2}}{″}{}\left({x}\right){}{x}{+}{\mathrm{f2}}{\prime }{}\left({x}\right)}{{x}}{}{\mathrm{D_y}}{,}{0}{}{\mathrm{dt}}{}{\bigwedge }{}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dy}}$ (2.30)

Note that the electromagnetic field equations $\mathrm{E3}$ can also be computed from the field strength tensor $F=\mathrm{dA}$.

 M > $\mathrm{MatterFieldEquations}\left("Electromagnetic",\mathrm{g3},\mathrm{F3}\right)$
 ${-}\frac{{\mathrm{f1}}{\prime }{}\left({x}\right){-}{\mathrm{f1}}{″}{}\left({x}\right){}{x}}{{{x}}^{{3}}}{}{\mathrm{D_t}}{-}\frac{{\mathrm{f2}}{″}{}\left({x}\right){}{x}{+}{\mathrm{f2}}{\prime }{}\left({x}\right)}{{x}}{}{\mathrm{D_y}}{,}{0}{}{\mathrm{dt}}{}{\bigwedge }{}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dy}}$ (2.31)

Check the divergence identity for the electromagnetic energy-momentum tensor $\mathrm{T3}$. The LHS is the covariant divergence of the energy momentum tensor and the RHS is a combination of the matter field equations.

 M > $\mathrm{Div3},\mathrm{RHS3}≔\mathrm{DivergenceIdentities}\left("Electromagnetic",\mathrm{g3},\mathrm{A3},\mathrm{T3},\mathrm{E3}\left[1\right]\right)$
 ${\mathrm{Div3}}{,}{\mathrm{RHS3}}{≔}{-}\frac{{\mathrm{f2}}{\prime }{}\left({x}\right){}{{x}}^{{3}}{}{\mathrm{f2}}{″}{}\left({x}\right){-}{x}{}{\mathrm{f1}}{\prime }{}\left({x}\right){}{\mathrm{f1}}{″}{}\left({x}\right){+}{{\mathrm{f1}}{\prime }{}\left({x}\right)}^{{2}}{+}{{\mathrm{f2}}{\prime }{}\left({x}\right)}^{{2}}{}{{x}}^{{2}}}{{{x}}^{{3}}}{}{\mathrm{D_x}}{,}{-}\frac{{\mathrm{f2}}{\prime }{}\left({x}\right){}{{x}}^{{3}}{}{\mathrm{f2}}{″}{}\left({x}\right){-}{x}{}{\mathrm{f1}}{\prime }{}\left({x}\right){}{\mathrm{f1}}{″}{}\left({x}\right){+}{{\mathrm{f1}}{\prime }{}\left({x}\right)}^{{2}}{+}{{\mathrm{f2}}{\prime }{}\left({x}\right)}^{{2}}{}{{x}}^{{2}}}{{{x}}^{{3}}}{}{\mathrm{D_x}}$ (2.32)
 M > $\mathrm{Div3}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&minus\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{RHS3}$
 ${0}{}{\mathrm{D_t}}$ (2.33)

We note that is a solution of the electromagnetic field equations:

 M > $\mathrm{DGsimplify}\left(\mathrm{eval}\left(\mathrm{E3},\left[\mathrm{f1}\left(x\right)={x}^{2},\mathrm{f2}\left(x\right)=\mathrm{ln}\left(x\right)\right]\right)\right)$
 ${0}{}{\mathrm{D_t}}$ (2.34)

The covariant divergence of the energy-momentum tensor vanishes on this solution:

 M > $\mathrm{DGsimplify}\left(\mathrm{eval}\left(\mathrm{Div3},\left[\mathrm{f1}\left(x\right)={x}^{2},\mathrm{f2}\left(x\right)=\mathrm{ln}\left(x\right)\right]\right)\right)$
 ${0}{}{\mathrm{D_t}}$ (2.35)

Example 4. "PerfectFluid"

First create a manifold $M$ with base coordinates $\left(t,x,y,z\right)$:

 M > $\mathrm{DGsetup}\left(\left[t,x,y,z\right],M\right)$
 ${\mathrm{frame name: M}}$ (2.36)

Define a metric.

 M > $\mathrm{g4}≔\mathrm{evalDG}\left(\mathrm{dt}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dt}-{t}^{2}\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dx}-\mathrm{dy}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dy}-\mathrm{dz}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dz}\right)$
 ${\mathrm{g4}}{≔}{\mathrm{dt}}{}{\mathrm{dt}}{-}{{t}}^{{2}}{}{\mathrm{dx}}{}{\mathrm{dx}}{-}{\mathrm{dy}}{}{\mathrm{dy}}{-}{\mathrm{dz}}{}{\mathrm{dz}}$ (2.37)

Define the normalized 4-velocity.

 M > $\mathrm{u4}≔\mathrm{evalDG}\left(2\mathrm{D_t}+\frac{\mathrm{sqrt}\left(3\right)}{t}\mathrm{D_x}\right)$
 ${\mathrm{u4}}{≔}{2}{}{\mathrm{D_t}}{+}\frac{\sqrt{{3}}}{{t}}{}{\mathrm{D_x}}$ (2.38)
 M > $\mathrm{TensorInnerProduct}\left(\mathrm{g4},\mathrm{u4},\mathrm{u4}\right)$
 ${1}$ (2.39)

Define the energy density.

 M > $\mathrm{μ4}≔k\left(t\right)$
 ${\mathrm{μ4}}{≔}{k}{}\left({t}\right)$ (2.40)

Define the pressure.

 M > $\mathrm{p4}≔h\left(t\right)$
 ${\mathrm{p4}}{≔}{h}{}\left({t}\right)$ (2.41)

Calculate the perfect fluid energy-momentum tensor $\mathrm{T4}$.

 M > $\mathrm{T4}≔\mathrm{EnergyMomentumTensor}\left("PerfectFluid",\mathrm{g4},\mathrm{u4},\mathrm{μ4},\mathrm{p4}\right)$
 ${\mathrm{T4}}{≔}\left({5}{}{h}{}\left({t}\right){+}{4}{}{k}{}\left({t}\right)\right){}{\mathrm{D_t}}{}{\mathrm{D_t}}{+}\frac{{2}{}\left({k}{}\left({t}\right){+}{h}{}\left({t}\right)\right){}\sqrt{{3}}}{{t}}{}{\mathrm{D_t}}{}{\mathrm{D_x}}{+}\frac{{2}{}\left({k}{}\left({t}\right){+}{h}{}\left({t}\right)\right){}\sqrt{{3}}}{{t}}{}{\mathrm{D_x}}{}{\mathrm{D_t}}{+}\frac{{2}{}{h}{}\left({t}\right){+}{3}{}{k}{}\left({t}\right)}{{{t}}^{{2}}}{}{\mathrm{D_x}}{}{\mathrm{D_x}}{-}{h}{}\left({t}\right){}{\mathrm{D_y}}{}{\mathrm{D_y}}{-}{h}{}\left({t}\right){}{\mathrm{D_z}}{}{\mathrm{D_z}}$ (2.42)

Evaluate the fluid field equations $\mathrm{E4}$ for the given fluid.

 M > $\mathrm{E4}≔\mathrm{MatterFieldEquations}\left("PerfectFluid",\mathrm{g4},\mathrm{u4},\mathrm{μ4},\mathrm{p4}\right)$
 ${\mathrm{E4}}{≔}\frac{{7}{}{k}{}\left({t}\right){+}{7}{}{h}{}\left({t}\right){+}{5}{}\stackrel{{\mathbf{.}}}{{h}}{}\left({t}\right){}{t}{+}{4}{}{t}{}\stackrel{{\mathbf{.}}}{{k}}{}\left({t}\right)}{{t}}{}{\mathrm{D_t}}{+}\frac{{2}{}\sqrt{{3}}{}\left({2}{}{k}{}\left({t}\right){+}{2}{}{h}{}\left({t}\right){+}{t}{}\stackrel{{\mathbf{.}}}{{k}}{}\left({t}\right){+}\stackrel{{\mathbf{.}}}{{h}}{}\left({t}\right){}{t}\right)}{{{t}}^{{2}}}{}{\mathrm{D_x}}$ (2.43)

We can use the dsolve command to find the energy density $k\left(t\right)$ and the pressure $h\left(t\right)$ which satisfy the field equations.

 M > $\mathrm{de}≔\mathrm{DGinfo}\left(\mathrm{E4},"CoefficientSet"\right)$
 ${\mathrm{de}}{≔}\left\{\frac{{7}{}{k}{}\left({t}\right){+}{7}{}{h}{}\left({t}\right){+}{5}{}\stackrel{{\mathbf{.}}}{{h}}{}\left({t}\right){}{t}{+}{4}{}{t}{}\stackrel{{\mathbf{.}}}{{k}}{}\left({t}\right)}{{t}}{,}\frac{{2}{}\sqrt{{3}}{}\left({2}{}{k}{}\left({t}\right){+}{2}{}{h}{}\left({t}\right){+}{t}{}\stackrel{{\mathbf{.}}}{{k}}{}\left({t}\right){+}\stackrel{{\mathbf{.}}}{{h}}{}\left({t}\right){}{t}\right)}{{{t}}^{{2}}}\right\}$ (2.44)
 M > $\mathrm{dsolve}\left(\mathrm{de}\right)$
 $\left\{{h}{}\left({t}\right){=}{\mathrm{_C1}}{+}\frac{{\mathrm{_C2}}}{{{t}}^{{2}}}{,}{k}{}\left({t}\right){=}{-}{\mathrm{_C1}}{-}\frac{{3}{}{\mathrm{_C2}}}{{{t}}^{{2}}}\right\}$ (2.45)

Example 5. "Scalar"

First create a manifold $M$ with base coordinates $\left(t,x,y,z\right)$.

 M > $\mathrm{DGsetup}\left(\left[t,x,y,z\right],M\right)$
 ${\mathrm{frame name: M}}$ (2.46)

Define a metric.

 M > $\mathrm{g5}≔\mathrm{evalDG}\left(\mathrm{dt}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dt}-{t}^{2}\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dx}-\mathrm{dy}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dy}-\mathrm{dz}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dz}\right)$
 ${\mathrm{g5}}{≔}{\mathrm{dt}}{}{\mathrm{dt}}{-}{{t}}^{{2}}{}{\mathrm{dx}}{}{\mathrm{dx}}{-}{\mathrm{dy}}{}{\mathrm{dy}}{-}{\mathrm{dz}}{}{\mathrm{dz}}$ (2.47)

Define a scalar field.

 M > $\mathrm{φ5}≔f\left(t\right)$
 ${\mathrm{φ5}}{≔}{f}{}\left({t}\right)$ (2.48)

Calculate the energy- momentum tensor $\mathrm{T5}$ for the scalar field $\mathrm{φ5}$.

 M > $\mathrm{T5}≔\mathrm{EnergyMomentumTensor}\left("Scalar",\mathrm{g5},\mathrm{φ5}\right)$
 ${\mathrm{T5}}{≔}{-}\left({-}\frac{{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right)}^{{2}}}{{2}}{+}\frac{{{\mathrm{_m}}}^{{2}}{}{{f}{}\left({t}\right)}^{{2}}}{{2}}\right){}{\mathrm{D_t}}{}{\mathrm{D_t}}{+}\frac{{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right)}^{{2}}{+}{{\mathrm{_m}}}^{{2}}{}{{f}{}\left({t}\right)}^{{2}}}{{2}{}{{t}}^{{2}}}{}{\mathrm{D_x}}{}{\mathrm{D_x}}{+}\left(\frac{{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right)}^{{2}}}{{2}}{+}\frac{{{\mathrm{_m}}}^{{2}}{}{{f}{}\left({t}\right)}^{{2}}}{{2}}\right){}{\mathrm{D_y}}{}{\mathrm{D_y}}{+}\left(\frac{{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right)}^{{2}}}{{2}}{+}\frac{{{\mathrm{_m}}}^{{2}}{}{{f}{}\left({t}\right)}^{{2}}}{{2}}\right){}{\mathrm{D_z}}{}{\mathrm{D_z}}$ (2.49)

Evaluate the matter field equations $\mathrm{E5}$ for the given scalar field $\mathrm{φ5}$.

 M > $\mathrm{E5}≔\mathrm{MatterFieldEquations}\left("Scalar",\mathrm{g5},\mathrm{φ5}\right)$
 ${\mathrm{E5}}{≔}\frac{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){+}\stackrel{{\mathbf{..}}}{{f}}{}\left({t}\right){}{t}}{{t}}{-}{{\mathrm{_m}}}^{{2}}{}{f}{}\left({t}\right)$ (2.50)

Check the divergence identity for the scalar energy-momentum tensor $\mathrm{T5}$. The LHS is the covariant divergence of the energy-momentum tensor and the RHS is a combination of the matter field equations.

 M > $\mathrm{Div5},\mathrm{RHS5}≔\mathrm{DivergenceIdentities}\left("Scalar",\mathrm{g5},\mathrm{φ5},\mathrm{T5},\mathrm{E5}\right)$
 ${\mathrm{Div5}}{,}{\mathrm{RHS5}}{≔}\frac{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){}\left(\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){+}\stackrel{{\mathbf{..}}}{{f}}{}\left({t}\right){}{t}{-}{t}{}{{\mathrm{_m}}}^{{2}}{}{f}{}\left({t}\right)\right)}{{t}}{}{\mathrm{D_t}}{,}\frac{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){}\left(\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){+}\stackrel{{\mathbf{..}}}{{f}}{}\left({t}\right){}{t}{-}{t}{}{{\mathrm{_m}}}^{{2}}{}{f}{}\left({t}\right)\right)}{{t}}{}{\mathrm{D_t}}$ (2.51)
 M > $\mathrm{Div5}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&minus\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{RHS5}$
 ${0}{}{\mathrm{D_t}}$ (2.52)

Example 6.  "NMCScalar"

First create a manifold $M$ with base coordinates $\left(t,x,y,z\right)$.

 M > $\mathrm{DGsetup}\left(\left[t,x,y,z\right],M\right)$
 ${\mathrm{frame name: M}}$ (2.53)

Define a metric.

 M > $\mathrm{g6}≔\mathrm{evalDG}\left(\mathrm{dt}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dt}-{t}^{2}\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dx}-\mathrm{dy}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dy}-\mathrm{dz}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dz}\right)$
 ${\mathrm{g6}}{≔}{\mathrm{dt}}{}{\mathrm{dt}}{-}{{t}}^{{2}}{}{\mathrm{dx}}{}{\mathrm{dx}}{-}{\mathrm{dy}}{}{\mathrm{dy}}{-}{\mathrm{dz}}{}{\mathrm{dz}}$ (2.54)

Define a scalar field

 M > $\mathrm{φ6}≔f\left(t\right)$
 ${\mathrm{φ6}}{≔}{f}{}\left({t}\right)$ (2.55)

Calculate the energy-momentum tensor $\mathrm{T6}$ for the non-minimally coupled scalar field $\mathrm{φ6}$.

 M > $\mathrm{T6}≔\mathrm{EnergyMomentumTensor}\left("NMCScalar",\mathrm{g6},\mathrm{φ6}\right)$
 ${\mathrm{T6}}{≔}\frac{{-}{{\mathrm{_m}}}^{{2}}{}{{f}{}\left({t}\right)}^{{2}}{}{t}{+}{4}{}{\mathrm{_ξ}}{}{f}{}\left({t}\right){}\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){+}{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right)}^{{2}}{}{t}}{{2}{}{t}}{}{\mathrm{D_t}}{}{\mathrm{D_t}}{-}\frac{{-}{{\mathrm{_m}}}^{{2}}{}{{f}{}\left({t}\right)}^{{2}}{+}{4}{}{\mathrm{_ξ}}{}{f}{}\left({t}\right){}\stackrel{{\mathbf{..}}}{{f}}{}\left({t}\right){+}{4}{}{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right)}^{{2}}{}{\mathrm{_ξ}}{-}{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right)}^{{2}}}{{2}{}{{t}}^{{2}}}{}{\mathrm{D_x}}{}{\mathrm{D_x}}{-}\frac{{-}{{\mathrm{_m}}}^{{2}}{}{{f}{}\left({t}\right)}^{{2}}{}{t}{+}{4}{}{\mathrm{_ξ}}{}{f}{}\left({t}\right){}\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){+}{4}{}{\mathrm{_ξ}}{}{f}{}\left({t}\right){}\stackrel{{\mathbf{..}}}{{f}}{}\left({t}\right){}{t}{+}{4}{}{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right)}^{{2}}{}{t}{}{\mathrm{_ξ}}{-}{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right)}^{{2}}{}{t}}{{2}{}{t}}{}{\mathrm{D_y}}{}{\mathrm{D_y}}{-}\frac{{-}{{\mathrm{_m}}}^{{2}}{}{{f}{}\left({t}\right)}^{{2}}{}{t}{+}{4}{}{\mathrm{_ξ}}{}{f}{}\left({t}\right){}\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){+}{4}{}{\mathrm{_ξ}}{}{f}{}\left({t}\right){}\stackrel{{\mathbf{..}}}{{f}}{}\left({t}\right){}{t}{+}{4}{}{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right)}^{{2}}{}{t}{}{\mathrm{_ξ}}{-}{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right)}^{{2}}{}{t}}{{2}{}{t}}{}{\mathrm{D_z}}{}{\mathrm{D_z}}$ (2.56)

Evaluate the matter field equations $\mathrm{E6}$ for the given scalar field $\mathrm{φ6}$.

 M > $\mathrm{E6}≔\mathrm{MatterFieldEquations}\left("NMCScalar",\mathrm{g6},\mathrm{φ6}\right)$
 ${\mathrm{E6}}{≔}\frac{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){+}\stackrel{{\mathbf{..}}}{{f}}{}\left({t}\right){}{t}}{{t}}{-}{{\mathrm{_m}}}^{{2}}{}{f}{}\left({t}\right)$ (2.57)

Check the divergence identity for the scalar energy-momentum tensor $\mathrm{T6}$. The LHS is the covariant divergence of the energy-momentum tensor and the RHS is a combination of the matter field equations.

 M > $\mathrm{Div6},\mathrm{RHS6}≔\mathrm{DivergenceIdentities}\left("Scalar",\mathrm{g6},\mathrm{φ6},\mathrm{T6},\mathrm{E6}\right)$
 ${\mathrm{Div6}}{,}{\mathrm{RHS6}}{≔}\frac{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){}\left(\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){+}\stackrel{{\mathbf{..}}}{{f}}{}\left({t}\right){}{t}{-}{t}{}{{\mathrm{_m}}}^{{2}}{}{f}{}\left({t}\right)\right)}{{t}}{}{\mathrm{D_t}}{,}\frac{\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){}\left(\stackrel{{\mathbf{.}}}{{f}}{}\left({t}\right){+}\stackrel{{\mathbf{..}}}{{f}}{}\left({t}\right){}{t}{-}{t}{}{{\mathrm{_m}}}^{{2}}{}{f}{}\left({t}\right)\right)}{{t}}{}{\mathrm{D_t}}$ (2.58)

 M > $\mathrm{Div6}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&minus\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{RHS6}$
 ${0}{}{\mathrm{D_t}}$ (2.59)