Error when using sympy to solve the Geodesic Equations

46 Views Asked by At

I was playing around with General Theory of Relativity, and I was nearly done. But when I use sympy.dsolve to solve the geodesic equations, I always reports "NotImplementedError". My code look like this:

from gravipy.tensorial import *
from sympy import *

t, r, theta, phi = symbols('t, r, theta, phi')
tau = Symbol('tau')
coord = [s(tau) for s in symbols('t, r, theta, phi', cls=Function)]
chi = Coordinates('chi', [t, r, theta, phi])
M = Symbol('M')
Metric = diag(-(1 - 2 * M / r), 1 / (1 - 2 * M / r), r ** 2,
              r ** 2 * sin(theta) ** 2)
g = MetricTensor('g', chi, Metric)
pprint(g(All, All))
christoffel = Christoffel('gamma', g)
geodesics = Geodesic('geodesics', g, tau)
set_ = []
for i, j in zip(tuple(geodesics(All)), coord):
    pprint(solve(i, Derivative(j, (tau, 2)), dict=True)[0])
    set_.append(Eq(Derivative(j, (tau, 2)), solve(i, Derivative(j, (tau, 2)), dict=True)[0][Derivative(j, (tau, 2))]))

pprint(dsolve(set_))

Does anyone knows how to solve this problem?

0

There are 0 best solutions below