Skip to main content
6 of 6
added 4 characters in body

Extraction of array from NDSolve output

I have got a system of differential equations. The system has $4$ variables. I am trying to plot trajectory of a particle outside a Kerr Black Hole. I have used Mathematica to calculate all the $4$ differential equation and now I am using NDSolve to calculate the trajectory numerically. The code is

kerr = NDSolve[{
   eqnr[s] == 0, eqnt[s] == 0, eqnϕ[s] == 0, eqnθ[s] == 0,
   r[0] == 5, θ[0] == Pi/Pi^2, t[0] == 0, ϕ[0] == 0,
   r'[0] == 0.01, θ'[0] == 0.003, 
   t'[0] == 0.01, ϕ'[0] == 0.003
   },
  {r, θ, ϕ, t}, {s, 0, 2}]

Initial conditions are randomly set. What this code gives as output are 4 arrays of coordinate $r$, $\theta$, $\phi$ and $t$. Now I want to covert this output from cartesian to spherical coordinate system. I know there is a command for doing such a thing but that will not be helpful here as to use that I need to extract the array computed by NDSolve and then insert into the function and then plot the parametric plot.

So my questions are: (i) Is there a direct way to do that? (ii) else how can I extract the computed array of coordinates? (The array that are outputted is shown as in the attached image)

enter image description here