I am working on electromagnetic perturbations of regular black holes by solving the Regge-Wheeler equations. I have to solve a dynamic equation with the initial conditions that $dfrac{dA_3}{dt}Big|_{(0,t)}=0$ and $A_3(0,t)=S(t)$ where $S(t)$ is the solution to the static problem. Here is my code:

First some definitions

```
g = 1;
M = 1;
m(r_) := M r^3/(r^3 + 2 M g^2);
J(r_) := 10^-14/r^2;
mt(t_) := m((t + 1)/(1 - t))
Jt(t_) := J((t + 1)/(1 - t))
```

The solution of the static problem

```
sol = ParametricNDSolveValue({-(((t + 1)/(1 - t) - 2 mt(t))^2/((
t + 1)/(1 - t))^2) 1/2 (t - 1)^3 D(As(t), {t, 2}) +
1/2 (t - 1)^2 D(As(t),
t) (-7 g^4 (t + 1)/(1 - t) + 2^(1/4) g ((t + 1)/(1 - t))^4 +
3 mt(t) (4 g^4 - 2^(1/4) g ((t + 1)/(1 - t))^3) + (t + 1)/(
1 - t) (2 g^4 + 2^(1/4) g ((t + 1)/(1 - t))^3) ((*1/
2(t-1)^2D(mt(t),t)*)mt'(t))) (
2^(3/4) ((t + 1)/(1 - t) - 2 mt(t)))/(
2^(3/4) g^4 ((t + 1)/(1 - t))^3 + g ((t + 1)/(1 - t))^6) + (
9 l (l + 1) (g/((t + 1)/(1 - t)))^3 ((t + 1)/(1 - t) -
2 mt(t)))/((2^(1/4) + 2 g^3/((t + 1)/(1 - t))^3) ((t + 1)/(
1 - t))^3) As(t) == 4 Pi Jt(t), As(0.4) == 0,
As(0.99999) == 0}, As, {t, 0.4, 0.99999}, l,
WorkingPrecision -> 30)
```

The dynamic problem

```
din = ParametricNDSolveValue({D(
A3(T, t), {T,
2}) - ((t + 1)/(1 - t) - 2 mt(t))^2/((t + 1)/(1 - t))^2 1/
2 (t - 1)^3 D(A3(T, t), {t, 2}) +
1/2 (t - 1)^2 D(A3(T, t),
t) (-7 g^2 (t + 1)/(1 - t) + 2^(1/4) g ((t + 1)/(1 - t))^4 +
3 mt(t) (4 g^2 - 2^(1/4) g ((t + 1)/(1 - t))^3) + (t + 1)/(
1 - t) (2 g^4 + 2^(1/4) g ((t + 1)/(1 - t))^3) mt'(t)) (
2^(3/4) ((t + 1)/(1 - t) - 2 mt(t)))/(
2^(3/4) g^4 ((t + 1)/(1 - t))^3 + g ((t + 1)/(1 - t))^6) + (
9 l (l + 1) (g/((t + 1)/(1 - t)))^3 ((t + 1)/(1 - t) -
2 mt(t)))/((2^(1/4) + 2 g^3/((t + 1)/(1 - t))^3) ((t + 1)/(
1 - t))^3) A3(T, t) == 4 Pi Jt(t),
Derivative(1, 0)(A3)(0, t) == 0, A3(0, t) == sol(l)(t),
A3(T, 0.4) == 0, A3(T, 0.99999) == 0},
A3, {T, 0, 10}, {t, 0.4, 0.99999}, l,
Method -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid",
"MaxPoints" -> 50, "MinPoints" -> 50}})
```

I could get the static problem to work, but the dynamic keeps giving me problems: with the above code I get the warning:

Warning: scaled local spatial error estimate of 54549.16088776184

`at T = 10.`

in the direction of independent variable t is much greater

than the prescribed error tolerance. Grid spacing with 50 points may

be too large to achieve the desired accuracy or precision. A

singularity may have formed or a smaller grid spacing can be

specified using the MaxStepSize or MinPoints method options

I have tried to variate the `Minpoints`

and `MaxPoints`

options and I have also used `MaxStepSize`

, but I get different results every time: where a the solution grows with a set of parameters, it decreases with others and the warning never goes away.

How can I solve this problem?