Maxima Function
ctaylor ()
The ctaylor
function truncates its argument by converting
it to a Taylor-series using taylor
, and then calling
ratdisrep
. This has the combined effect of dropping terms
higher order in the expansion variable ctayvar
. The order
of terms that should be dropped is defined by ctaypov
; the
point around which the series expansion is carried out is specified
in ctaypt
.
As an example, consider a simple metric that is a perturbation of the Minkowski metric. Without further restrictions, even a diagonal metric produces expressions for the Einstein tensor that are far too complex:
(%i1) load(ctensor); (%o1) /share/tensor/ctensor.mac (%i2) ratfac:true; (%o2) true (%i3) derivabbrev:true; (%o3) true (%i4) ct_coords:[t,r,theta,phi]; (%o4) [t, r, theta, phi] (%i5) lg:matrix([-1,0,0,0],[0,1,0,0],[0,0,r^2,0], [0,0,0,r^2*sin(theta)^2]); [ - 1 0 0 0 ] [ ] [ 0 1 0 0 ] [ ] (%o5) [ 2 ] [ 0 0 r 0 ] [ ] [ 2 2 ] [ 0 0 0 r sin (theta) ] (%i6) h:matrix([h11,0,0,0],[0,h22,0,0],[0,0,h33,0],[0,0,0,h44]); [ h11 0 0 0 ] [ ] [ 0 h22 0 0 ] (%o6) [ ] [ 0 0 h33 0 ] [ ] [ 0 0 0 h44 ] (%i7) depends(l,r); (%o7) [l(r)] (%i8) lg:lg+l*h; [ h11 l - 1 0 0 0 ] [ ] [ 0 h22 l + 1 0 0 ] [ ] (%o8) [ 2 ] [ 0 0 r + h33 l 0 ] [ ] [ 2 2 ] [ 0 0 0 r sin (theta) + h44 l ] (%i9) cmetric(false); (%o9) done (%i10) einstein(false); (%o10) done (%i11) ntermst(ein); [[1, 1], 62] [[1, 2], 0] [[1, 3], 0] [[1, 4], 0] [[2, 1], 0] [[2, 2], 24] [[2, 3], 0] [[2, 4], 0] [[3, 1], 0] [[3, 2], 0] [[3, 3], 46] [[3, 4], 0] [[4, 1], 0] [[4, 2], 0] [[4, 3], 0] [[4, 4], 46] (%o12) done
However, if we recompute this example as an approximation that is
linear in the variable l
, we get much simpler expressions:
(%i14) ctayswitch:true; (%o14) true (%i15) ctayvar:l; (%o15) l (%i16) ctaypov:1; (%o16) 1 (%i17) ctaypt:0; (%o17) 0 (%i18) christof(false); (%o18) done (%i19) ricci(false); (%o19) done (%i20) einstein(false); (%o20) done (%i21) ntermst(ein); [[1, 1], 6] [[1, 2], 0] [[1, 3], 0] [[1, 4], 0] [[2, 1], 0] [[2, 2], 13] [[2, 3], 2] [[2, 4], 0] [[3, 1], 0] [[3, 2], 2] [[3, 3], 9] [[3, 4], 0] [[4, 1], 0] [[4, 2], 0] [[4, 3], 0] [[4, 4], 9] (%o21) done (%i22) ratsimp(ein[1,1]); 2 2 4 2 2 (%o22) - (((h11 h22 - h11 ) (l ) r - 2 h33 l r ) sin (theta) r r r 2 2 4 2 - 2 h44 l r - h33 h44 (l ) )/(4 r sin (theta)) r r r
This capability can be useful, for instance, when working in the weak field limit far from a gravitational source.