This is an incomplete answer, but perhaps you can combine it with the answer of @MichaelSeifert. It is more manual in a way, but perhaps allows you to understand where the numerical issues come from. So this being a linear homogeneous equation, for all $s,t>0$ there is a $4 \times 4$ matrix $P(s,t)$ such that for all solutions of the ODE one has
$$
\begin{pmatrix}
\psi(s) \\
\psi'(s) \\
\psi''(s) \\
\psi'''(s)
\end{pmatrix}
\;=\;
P(s,t)\begin{pmatrix}
\psi(t) \\
\psi'(t) \\
\psi''(t) \\
\psi'''(t)
\end{pmatrix}
$$
and I am calling this $P$ for propagator. One can construct this matrix numerically in Mathematica as follows (not sure if there is a more direct command, I simply call NDSolve
a few times):
eqn=r^5 (((300 I)/r^5-3/r^4) \[Psi][r]+(-(45/r^6)+3/r^3) Derivative[1][\[Psi]][r]+(21/r^5-3/r^2) Derivative[2][\[Psi]][r]+(-(3/r^4)+2/r) Derivative[3][\[Psi]][r]+Derivative[4][\[Psi]][r])==0;
sol[s_,t_][vec0_]:={\[Psi][s],\[Psi]'[s],\[Psi]''[s],\[Psi]'''[s]}/.First[NDSolve[Join[{eqn},Thread[{\[Psi][t],\[Psi]'[t],\[Psi]''[t],\[Psi]'''[t]}==vec0]],\[Psi],{r,t,s},AccuracyGoal->12,PrecisionGoal->12]];
P[s_,t_]:=Transpose[Map[sol[s,t],IdentityMatrix[4]]];
For example, P[1/2,2]
evaluates to:
{{-0.500673-4.04689 I,-0.600881+2.27858 I,0.550522 -0.884086 I,-0.370662+0.327502 I},
{8.81853 +5.23293 I,-3.71234-5.23891 I,1.09816 +2.77047 I,-0.221186-1.33511 I},
{-28.4567+24.5997 I,18.2139 -8.63023 I,-7.76148+0.821715 I,3.56598 +1.28922 I},
{-89.7965-85.4907 I,2.74802 +85.5374 I,8.55136 -49.2012 I,-3.68842+24.3657 I}}
I have not checked this carefully. Note that the exact propagator satisfies $P(s,t)P(t,u) = P(s,u)$ for all $s,t,u>0$ and one can check for various values of $s,t,u>0$ that the numerically constructed $P(s,t)$ satisfies this more or less, try P[1/2,2].P[2,1/2]
for example. If you need more precision, you can adjust the settings, but there are of course limits with 64 bit numbers at least.
Now With[{eps=10^(-2),inf=10^2}, P[eps,inf]]
evaluates to:
{{144.35 +656.623 I,4760.13 -49174.1 I,-854332.+2.53709*10^6 I,5.3008*10^7-1.07601*10^8 I},
{-82.0461+17.4275 I,6130.6 +637.386 I,-315763.-108830. I,1.3377*10^7+6.70836*10^6 I},
{-8195.79+1631.87 I,609936. +71291.1 I,-3.13188*10^7-1.12433*10^7 I,1.32413*10^9+6.85308*10^8 I},
{3484.19 -28965.3 I,-898781.+1.94636*10^6 I,7.13089*10^7-9.17075*10^7 I,-3.71148*10^9+3.64932*10^9 I}}
This will certainly contain significant numerical errors. This matrix is very ill-conditioned, its singular values are {5.41708*10^9,150.532,0.0015424,2.38302*10^-8}
. It is of course a mathematical fact that the true propagator $P(s,t)$ exists and is invertible for all $s,t>0$.
Anyhow, in principle, this matrix gives you 4 linear homogeneous equations relating the solution and its first three derivatives at eps
and at inf
. You could solve this together with the (approximate) equations smallrBC
and largerBC
in the answer of @MichaelSeifert, that is just linear algebra and can easily be analyzed. The question is whether you find any choices of eps
and inf
and of the solver settings where all errors are under control: the numerical errors in the propagator, and the approximations involved in smallrBC
and largerBC
.
Two possible improvements:
- You could improve the approximations on the $r$-intervals $(0,\text{eps}]$ and $[\text{inf},\infty)$ say write down more terms of a converging expansion of the solution and so on, perhaps
AsymptoticDSolveValue
can help you here (I did not know about this command!). If you have good expansions, then you do not have to make eps
quite so small and you do not have to make inf
quite so big.
- You could improve the conditioning of the differential equations itself. The known leading asymptotic behaviour (on either side) can be used to change to other variables where the conditioning is good.
Hope this helps.
NDSolve
needs four boundary(initial) condition? What is:i
in:300 i
a parameter? $\endgroup$homogeneousPart[f_]:=-3/r^4*f+3/r^3*D[f,r]-3/r^2*D[f,{r,2}]+2/r*D[f,{r,3}]+D[f,{r,4}]
and check that it has the four solutionsMap[homogeneousPart,{1/r,r,r*Log[r],r^3}]//Simplify
. Btw, please provide Mathematica expressions. $\endgroup$