How to calculate simple Euler-Lagrange Equations with xTensor

1,313 views
Skip to first unread message

Jan Oliver Oelerich

unread,
Jan 22, 2012, 11:16:24 AM1/22/12
to xa...@googlegroups.com
Hi, I am trying to find the equations of motion of a free particle in curved space-time. 
Theoretically, one simply has to apply the variational principle to the Lagrangian; I already got this far:

L = Sqrt[g[-a, -b] ParamD[p][x[a]] ParamD[p][x[b]]]

Where p is some parameter and x is my contravariant vector. 
I want to end up with the equations of motions;

ParamD[p][ParamD[p][x[c]]] + ChristoffelCD[-a,-b,c] ParamD[p][x[b]] ParamD[p][x[a]] = 0

The thing is, that I don't really understand how to use VarD in my case. I have a metric g defined on a manifold M, and the usual stuff.

What would I do to come to the Euler-Lagrange equations?

Edu Serna

unread,
Jan 23, 2012, 8:54:48 AM1/23/12
to xAct Tensor Computer Algebra
I am not sure xAct is well suited to this task as you need to
integrate by parts and make some assumptions about end points to get
the EOM, I think there was another package out there more suited for
these things?
Sorry if this is nonesense.

Edu Serna

unread,
Jan 23, 2012, 9:03:34 AM1/23/12
to xAct Tensor Computer Algebra
I am not sure xAct is well suited to this task as you need to
integrate by parts and make some assumptions about end points to get
the EOM, I think there was another package out there more suited for
these things?
Sorry if this is nonesense.

On 22 ene, 17:16, Jan Oliver Oelerich <janoli...@gmail.com> wrote:

Edu Serna

unread,
Jan 23, 2012, 9:16:01 AM1/23/12
to xAct Tensor Computer Algebra
I am not sure xAct is well suited to this task as you need to
integrate by parts and make some assumptions about end points to get
the EOM, I think there was another package out there more suited for
these things?
Sorry if this is nonesense.

On 22 ene, 17:16, Jan Oliver Oelerich <janoli...@gmail.com> wrote:

Leo Stein

unread,
Jan 23, 2012, 10:38:21 AM1/23/12
to xa...@googlegroups.com
Hi Jan,
Perhaps surprisingly, it's easier to get a field equation than what
you're after (ask if you need an example for how to get xAct to
calculate field equations from a Lagrangian).
xAct is happy to give field equations with VarD, but that is not
appropriate here.

Mainly, what you think of as x[a] is not a field (it has support over
a 1-dimensional submanifold of your manifold) and it's also not
actually a vector (it is a collection of coordinates in some chart).
So DefTensor[ x[a], ... ] is actually not the right mathematical
structure for your question.

Some of the right structures do exist in xAct, but it doesn't look
like the play well with VarD.

The correct structure would be to have a one-dimensional manifold
(call it T since it measures coordinate time or proper time along the
world line) and a mapping gamma: T -> M which gives the trajectory of
the world line gamma in M. Using DefMapping[ gamma, {T, M} ] you
automatically get the tensor Tangentgamma[-A, a] where A is an index
in T. Then the appropriate Lagrangian is

L = Sqrt[ -g[-a,-b] (ddt[A] Tangentgamma[-A,a]) (ddt[B] Tangentgamma[-B,a]) ]

where ddt[A] is a vector on T.

However, there isn't really any more progress that can be made with
xAct, since it's not set up to do variational derivatives where what
you are varying is a *map*. (Or at least ... I don't see a way to get
it to do what you want).

Cheers
Leo

Message has been deleted

Jan Oliver Oelerich

unread,
Jan 24, 2012, 1:22:30 PM1/24/12
to xa...@googlegroups.com
Dear all three of you,

First of all: Thank you very much for the help. The background is: We have to solve some general relativity stuff using computer algebra software, and since I chose Mathematica, the best free tensor algebra package I could find was xTensor (and xCoba). When I understand your answers correctly, xAct is not suited very well to calculate geodesics on some manifold? I must say, Leo, I am not familiar enough with all this stuff to really understand what you are saying; x not being a tensor and so on. 

I tried Angelos code, even though I don't really know how perturbations work in this field, but it seems that it doesn't work well together with ParamD[..][..]. At least VarD fails...

The task was in general to verify the Euler-Lagrange equations 

ParamD[p][ParamD[p][x[c]]] + ChristoffelCD[-a,-b,c] ParamD[p][x[b]] ParamD[p][x[a]] = 0

I attached my current notebook where you can see where it fails.
Geodesics.nb

jo...@xact.es

unread,
Jan 25, 2012, 3:38:28 AM1/25/12
to xa...@googlegroups.com
Hi Jan Oliver,

As already pointed out by Edu and Leo, xTensor is not well oriented
towards this problem because xTensor works with fields on the whole
manifold, and not with values of that field at a given point. And that is
what you need, fields at the particle point. The technical name of this is
"field along a map" (the embedding map mentioned by Leo), and xTensor does
not support those natively.

However, with enough tweaking xTensor can do anything. I attach a notebook
in which the geodesic equation is derived. Essentially the idea is to
teach xTensor what variational derivatives are with a parametric
derivative and what the parametric derivative of the metric is. Note that
I use OverDot instead of ParamD for simplicity.

Cheers,
Jose.

GeodesicEquation.nb
Reply all
Reply to author
Forward
0 new messages