Ask Your Question
1

Differentiate vector field w.r.t a variable not defining the chart

asked 2021-10-29 14:18:25 +0100

keko gravatar image

updated 2022-08-30 11:41:16 +0100

FrédéricC gravatar image

I define a 3+1-dimensional manifold M:

n = 3
M = Manifold(1+n, 'M', structure='Lorentzian')

and a chart X with spherical coordinates t, r, th and ph.

X.<t,r,th,ph> = M.chart('t r:(0,+oo) th:(0,pi) ph:(0,2*pi)')

I define the following symbolic function Ne, which depends on r and a new variable, eps:

eps = var('eps')
Ne = function('Ne')(r,eps)

Now, I define a vector field, u, as:

u = M.vector_field('u')
u[0] = 2*Ne;  u[1] = Ne;  u[2] = 0;  u[3] = 0

At this point, I want to differentiate each term of u with respect to eps. However, when I write:

diff(u[0],eps)

I get:

ValueError: tuple.index(x): x not in tuple

However, I would expect to obtain:

2*diff(Ne(r, eps), eps)

I guess this is because I am differentiating a vector field from the manifold with respect to a variable (eps) which is not on the chart. In fact, if I differentiate with respect to $r$, then everything goes right. Is there a way I can fix this?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2021-10-29 14:47:57 +0100

rburing gravatar image

When you write u[0] you are getting a chart function object. The global diff function calls the derivative method on the object, and this one is only defined for coordinates of the chart.

What you can do is call the expr method on the chart function to get the underlying symbolic expression:

sage: diff(u[0].expr(), eps)
2*diff(Ne(r, eps), eps)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-10-29 14:18:25 +0100

Seen: 530 times

Last updated: Oct 29 '21