Sie sind auf Seite 1von 16

> >

> >
Playing tensors with GRTensor
Available (free) at: http://www.grtensor.org
Load GRTensor
grtw();
Scalar invariant library.
Last modified 25 March 1997.
`Differential Invariants`
`Last modified Jan. 20, 1995`
`Basis/tetrad related object definitions`
`Last modified 23 January 2001`
`Last built 27 May, 1999`
`Last built 27 May, 1999`
Construct the metric on the go: use makeg
NOTE: GRTensor does not index coordinates as [x0, x1, x2, x3] but as [x1, x2, x3, x4] ---) It is
convenient to identify the timelike coordinate with x4 (the fourth coordinate)
We would like to start by calculating curvature tensors for the space-flat Robertson-Walker line
element

makeg(rw);

Makeg 2.0: GRTensor metric/basis entry utility

To quit makeg, type 'exit' at any prompt.

Do you wish to enter a 1) metric [g(dn,dn)],
makeg> makeg>
makeg> makeg>
makeg> makeg>
makeg> makeg>
makeg> makeg>
2) line element [ds],
3) non-holonomic basis [e(1)...e(n)], or
4) NP tetrad [l,n,m,mbar]?
2;
Enter coordinates as a LIST (eg. [t,r,theta,phi]):
[x,y,z,t];
Enter the line element using d[coord] to indicate differentials.
(for example, r^2*(d[theta]^2 + sin(theta)^2*d[phi]^2)
[Type 'exit' to quit makeg]
ds^2 =
A(t)^2*(d[x]^2+d[y]^2+d[z]^2)-d[t]^2;
If there are any complex valued coordinates, constants or
functions
for this spacetime, please enter them as a SET ( eg. { z, psi }
).
Complex quantities [default={}]:
;
{}

You may choose to 0) Use the metric WITHOUT saving it,
1) Save the metric as it is,
2) Correct an element of the metric,
3) Re-enter the metric,
4) Add/change constraint equations,
5) Add a text description, or
6) Abandon this metric and return to Maple.
1;
Information written to: `/grtiiOSX/metrics/:rw.mpl`
Do you wish to use this spacetime in the current session?
> >
> >
> >
makeg> makeg>
> >
> >
(1=yes [default], other=no):
;
1

Initializing: rw
makeg() completed.
NOTE: makeg generated a text-only metric file ---) let's see it
Calculate predefined tensors
We can access the help files for predefined basic objects and calculation/display routines
Vectors
------ V(up)
------ V(dn)
2X2 Tensors
--------- R(up,up)
--------- R(up,dn)
--------- R(dn,dn)
?grt_objects
?grcalc
?grdisplay
Inverse metric
grcalc(g(up,up));
grdisplay(_);
> >
> >
NOTE: The equivalent to % (previous output) is _
NOTE: Combine grcalc + grdisplay = grcalcd
Metric determinant
grcalcd(detg);
Christoffel symbols
grcalcd(Chr(up,dn,dn));
Created definition for Chr(up,dn,dn)
> >
Riemann tensor
grcalcd(R(up,dn,dn,dn));
Created definition for R(up,dn,dn,dn)
> >
> >
> >
> >
Ricci tensor
grcalcd(R(up,dn));
Created definition for R(up,dn)
Ricci scalar
grcalcd(Ricciscalar);
Ricci squared
grcalc(RicciSq);
grdisplay(_);
> >
> >
Einstein tensor
grcalcd(G(up,dn));
Created definition for G(up,dn)
Simplification with GRTensor
NOTE: GRTensor conducts global manipulations (applied on ALL components).
TASK: expand all components
gralter(R(up,dn));
Component simplification of a GRTensorII object:
(use ?name for help on a particular simplification routine)
Choose which routine to apply:
0) none
1) simplify() try all simplification techniques
2) simplify[trig] apply trig simplification
> >
gralter> gralter>
> >
3) simplify[power] simplify powers, exp and ln
4) simplify[hypergeom] simplify hypergeometric functions
5) simplify[radical] convert radicals,log,exp to canonical
form
6) expand()
7) factor()
8) normal()
9) sort()
10) simplify[sqrt,symbolic] allows sqrt(r^2) = r
11) simplify[trigsin] trig simp biased to sin
12) Apply constraint equations
13) Apply constraints repeatedly
14) other user specified routine
Number of routine to apply (followed by ;) >
6;
Applying routine expand to object R(up,dn)
grdisplay(_);
Compare with what Maple does using subs in one component
grcomponent(R(up,dn), [1,1]);
> >
> >
> >
> >
> >
> >
> >
R11:=%;
factor(R11);
subs( A(t)=t^(2/3), R11 );
eval(%);
NOTE: We have not lost the inicially defined R11
R11;
The most powerfull routine to manipulate objects in GRTensor is grmap
TASK: substitute particular form of A(t) in R(up,dn)
grmap(R(up,dn), subs, A(t)=t^(2/3), 'x');
Applying routine subs to R(up,dn)
grdisplay(_);
> >
> >
> >
> >
> >
> >
grcomponent(R(up,dn),[4,4]);
Transformation of GRTobjects into Maple objects
TASK:
Generate a 2X2 array whose components are those of R(up,dn)
RR:=array(1..4, 1..4, []):
for i from 1 to 4 do
for j from 1 to 4 do
RR[i,j]:=grcomponent(R(up,dn), [i,j]):
end do;
end do;
evalm(RR);
RR[1,1]; RR[4,4];
NOTE: The tensor R(up,dn) calculated with GRTensor (modified by grmap) is not lost
grdisplay(R(up,dn));
> >
> >
> >
> >
FORTUNATELY: There is no need to write this cycle: ----) The same result follows from grarray ...
now for G(up,dn)
Gmix:=grarray(G(up,dn));
Individual components of Gmix as subindices [i,j]
Gmix[1,1]; Gmix[4,4];
NOTE: Gmix has the most general form, we can generate special cases by substituting special values
of A(t)
Individual components treated one-by-one
eval(subs(A(t)=t^(1/2), Gmix[1,1]));
eval(subs(A(t)=t^(1/2), Gmix[2,2]));
> >
> >
> >
> >
> >
eval(subs(A(t)=t^(1/2), Gmix[3,3]));
eval(subs(A(t)=t^(1/2), Gmix[4,4]));
Assign names to the two different components
GmixNew11:=eval(subs(A(t)=t^(1/2), Gmix[1,1])); GmixNew44:=eval
(subs(A(t)=t^(1/2), Gmix[4,4]));
Globally to all components
Through single instructions:
subs( A(t)=t^(1/2), eval(Gmix));
G_mix_new:=map(eval,%);
> >
> >
> >
> >
> >
> >
> >
> >
G_mix_new[1,1]; G_mix_new[4,4];
Using a cycle.
GmixNew:=array(1..4,1..4,[]):
for i from 1 to 4 do
for j from 1 to 4 do
GmixNew[i,j]:=eval(subs( A(t)=t^(1/2), Gmix[i,j])):
end do;
end do;
GmixNew[1,1]; GmixNew[4,4];
i;j;
Using a cycle to assign names without subindices ( name12 instead of name[1,2])
for i from 1 to 4 do
for j from 1 to 4 do
GmixNew||i||j:=eval(subs( A(t)=t^(1/2), Gmix[i,j])):
end do;
end do;
GmixNew11; GmixNew44;
> >
> >
> >
> >
NOTE: By performing these substitutions we have not lost Gmix (even if assigning a name to the
modified array), nor the GRTensor object G(up,dn)
eval(Gmix); grdisplay(G(up,dn));
Simplifying appearance of functions and derivatives
It is unconfortable to be dragging A(t) and its derivatives. We can display aliases of functions, just A
instead of A(t), and derivatives as subindices. This can be done by applying autoAlias to each
component, or globally.
?autoAlias
> >
> >
> >
> >
> >
> >
> >
> >
one-by-one component
This is the way the [1,1] component appears
Gmix[1,1];
This is the effect of autoAlias
autoAlias(Gmix[1,1]);
Warning, alias or macro A[t] defined in terms of A
globally to all components (array)
map(autoAlias, Gmix);
NOTE: this is not just a pasive appearance of the functions, the derivatives remain active
%[4,4];
diff(%,t);
Globally to the GRTensor object
gralter(G(up,dn),autoAlias);
Component simplification of a GRTensorII object:
Applying routine autoAlias to object G(up,dn)
> >
> >
> >
grdisplay(_);

Das könnte Ihnen auch gefallen