# How to correctly solve this problem with ParametricNDSolveValue

I am solving Regge-Wheeler equations for electromagnetic perturbations of a Schwarzschild black hole. See this paper for Regge-Wheeler equation.

The differential equation that must be solved is of this type:

$$\dfrac{d^2A}{dt^2} - \left( 1-\dfrac{2M}{r} \right)\dfrac{d}{dr}\left[ \left( 1-\dfrac{2M}{r} \right) \dfrac{dA}{dr} \right] + \left(1-\dfrac{2M}{r} \right) \dfrac{l(l+1)}{r^2} A = 0$$

The idea is to solve first the static problem:

$$- \left( 1-\dfrac{2M}{r} \right)\dfrac{d}{dr}\left[ \left( 1-\dfrac{2M}{r} \right) \dfrac{dS}{dr} \right] + \left(1-\dfrac{2M}{r} \right) \dfrac{l(l+1)}{r^2} S = 0$$

with the boundary condition that $$S(2M)=0, S(\infty)=0$$ and to solve the dynamic problem with the initial conditions that $$\dfrac{dA}{dt}(0,r)=0, A(0,r)=S(r)$$

I can solve the static problem with ParametrcicNDSolveValue, but I cannot solve the dynamic problem because I don't know how to impose the second initial condition on $$A(t,R)$$.

I have compactified the infinite interval in $$r$$ with the change of variable $$r\rightarrow \dfrac{t+1}{1-t}$$, so my naive code looks like this:

sol = ParametricNDSolveValue[{-(1 - (2 M)/((t + 1)/(1 - t))) 1/
2 (t - 1)^3 D[S[t], {t, 2}] - (1 - (2 M)/((t + 1)/(1 - t))) (
2 M)/((t + 1)/(1 - t))^2 1/
2 D[S[t], t] + (1 - (2 M)/((t + 1)/(1 - t))) (
l (l + 1))/((t + 1)/(1 - t))^2 S[t] == 0, S[0.4] == 0, S[0.99] == 0}, S, {t, 0.4, 0.99}, l]

din = ParametricNDSolveValue[{D[
A[T, t], {T, 2}] - (1 - (2 M)/((t + 1)/(1 - t))) 1/
2 (t - 1)^3 D[A[T, t], {t, 2}] - (1 - (2 M)/((t + 1)/(1 - t))) (
2 M)/((t + 1)/(1 - t))^2 1/
2 D[A[T, t], t] + (1 - (2 M)/((t + 1)/(1 - t))) (
l (l + 1))/((t + 1)/(1 - t))^2 A[T, t] == 0,  Derivative[1, 0][A][0, t] == 0, A[0, t] == sol[l][t]}, A, {T, 0, 10}, l]


but Mathemartica complains that

No functions were specified for output from NDSolveValue

Where am I wrong? The value I used for the mass is $$M=1$$, $$l$$ is any integer larger than 2.

I use Mathematica 11.3 if needed.

• Please check you're code, the differential equations didn't evaluate. Commented Oct 11, 2020 at 9:34
• @UlrichNeumann Corrected, sorry for the errors. Commented Oct 11, 2020 at 9:48
• In the 2nd ode there is a part D[A[T, r], {T, 2}] which isn't transformed and should be expressed by t Commented Oct 11, 2020 at 9:54
• @UlrichNeumann Corrected that too, sorry Commented Oct 11, 2020 at 9:57
• The second ode in A[T,t] requires two arguments. Add , {t, 0.4, 0.99} in the second NDSolve ! Commented Oct 11, 2020 at 10:13

din = ParametricNDSolveValue[{D[A[T, t], {T, 2}] - (1 - (2 M)/((t + 1)/(1 - t))) 1/2 (t - 1)^3 D[A[T, t], {t,2}] - (1 - (2 M)/((t + 1)/(1 - t))) (2 M)/((t + 1)/(1 -t))^2 1/2 D[A[T, t],t] + (1 - (2 M)/((t + 1)/(1 - t))) (l (l +1))/((t + 1)/(1 - t))^2 A[T, t] == 0,Derivative[1, 0][A][0, t] == 0, A[0, t] == sol[l][t]}

Plot3D[din[3][T, t], {t, 0.4, 0.99}, {T, 0, 10}]