This may sound like a very trivial question, but I need to solve a differential equation as follows:
a := 3.24077*10^-20 (* km \[Rule] Mpc *)
b := 3.16888*10^-14 (* s \[Rule] MYear *)
c := a/b*(2.99792*10^5) (*Mpc/ MYear*)
\[HBar] := a^2/b (1.05457*10^-37)(*kgMpc^2/MYear*)
H0 := a/b*71 (*1/MYear*)
G := a^3/b^2*6.67398*10^-20 (*Mpc^3/(Kg*MYear^2)*)
\[CapitalOmega]M := 0.27
\[CapitalOmega]\[Gamma] := 8.24*10^-4
\[CapitalOmega]\[CapitalLambda] := 0.73
\[Lambda] := 1/a^2 1*10^-58(*1/Mpc^2*)
f := 1*10^-4
y := 10
\[Rho]pert[r_] := \[Rho]*(1 + f*Exp[-(r/y)^2]) // N
M2[r_] := 4 \[Pi]*Integrate[\[Rho]pert[r1]*(r1)^2, r1] /. r1 -> r
E2[r_] :=
1/2*((H[999]*r)/(c*(1000)))^2 - ((G *M2[r] (1000))/(
c^2 (r))) - (\[Lambda]*r^2)/(3 (1000)^2)
ScaleFactor2 =
NDSolve[SetPrecision[{(D[R2[r, t], t]) ==
Sqrt[(2*G*M2[r])/R2[r, t] + 2*c^2*E2[r] + (
2 c^2 \[Lambda]*R2[r, t]^2)/3], R2[r, 0] == r/1000}, 200],
R2, {r, 1, 20000}, {t, 1, 15000}, AccuracyGoal -> 2]
Rad2[r_, t_] := Evaluate[R2[r, t] /. ScaleFactor2]
RadPrime2[r_, t_] := D[Rad2[r1, t], r1] /. r1 -> r
Raddot2[r_, t_] := D[Rad2[r, t], t]
***chi = DSolve[(c Sqrt[1 + 2 E2[r]])/RadPrime2[r, t], r, t]***
I am looking for a solution for the differential equation chi, but would like an answer whose subject is the variable r that appears in RadPrime2[r,t]
. In other words, I am looking for the functional form of r(t)...
I apologise in advance if this seems really badly phrased and/or trivial, but I couldn't find anything in the literature that helped...