There is also wavelet method for BVP. It is an example with Haar wavelets. It takes 0.36 s to solve this problem with 64 colocation points:
ClearAll["Global`*"]
L = 10; A = 0; B = 1; J = 5; M =
2^J; dx = (B - A)/(2 M);
h1[x_] := Piecewise[{{1, A <= x <= B}, {0, True}}];
p1[x_, n_] := (1/n!)*(x - A)^n;
h[x_, k_, m_] :=
Piecewise[{{1,
Inequality[k/m, LessEqual, x, Less, (1 + 2*k)/(2*m)]}, {-1,
Inequality[(1 + 2*k)/(2*m), LessEqual, x, Less, (1 + k)/m]}}, 0];
p[x_, k_, m_, n_] :=
Piecewise[{{0, x < k/m}, {(-(k/m) + x)^n/n!,
Inequality[k/m, LessEqual, x,
Less, (1 + 2*k)/(2*m)]}, {((-(k/m) + x)^n -
2*(-((1 + 2*k)/(2*m)) + x)^n)/n!, (1 + 2*k)/(2*m) <=
x <= (1 + k)/
m}, {((-(k/m) + x)^n + (-((1 + k)/m) + x)^n -
2*(-((1 + 2*k)/(2*m)) + x)^n)/n!, x > (1 + k)/m}}, 0];
xl = Table[A + l dx, {l, 0, 2 M}]; xcol =
Table[(xl[[l - 1]] + xl[[l]])/2, {l, 2, 2 M + 1}];
f2[x_] :=
Sum[af[i, j] h[x, i, 2^j], {j, 0, J, 1}, {i, 0, 2^j - 1, 1}] +
a0 h1[x];
f1[x_] :=
Sum[af[i, j] p[x, i, 2^j, 1], {j, 0, J, 1}, {i, 0, 2^j - 1, 1}] +
a0 p1[x, 1] + f10;
f0[x_] :=
Sum[af[i, j] p[x, i, 2^j, 2], {j, 0, J, 1}, {i, 0, 2^j - 1, 1}] +
a0 p1[x, 2] + f10 x + f00;
bc1 = {f0[0] == 1};
bc2 = {f0[1] == 0};
var = Flatten[Table[{af[i, j]}, {j, 0, J, 1}, {i, 0, 2^j - 1, 1}]];
varM = Join[{a0, f10, f00}, var];
eqq[x_] := Sqrt[x] f2[x]/L^(3/2) - f0[x]^(3/2);
eq = Flatten[Table[{eqq[x] == 0}, {x, xcol}]];
eqM = Join[eq, bc1, bc2];
sol = FindRoot[eqM, Table[{varM[[i]], 0.1}, {i, Length[varM]}],
MaxIterations -> 1000]; lst =
Table[{L x, Evaluate[f0[x] /. sol]}, {x, 0, 1, .01}];
ListLinePlot[lst, PlotRange -> All]
Now we can compare with solution by xzczd psol[d /. drule][r]
, here we show difference f0[x]-psol[d /. drule][x]
And as we can see, combination of ParametricNDSolveValue[]
and FindRoot[]
is still good
NDSolve
works without any adjustion. So the underlying issue seems to be the backslide mentioned here: mathematica.stackexchange.com/a/130373/1871 $\endgroup$