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}}$