Hello again.
I now manged to force NDSolve to produce something which looks like a reasonable solution, albeit not without weird error messages, and not very accurately. I replaced the initial condition at y0=0 by an approximate initial condition at y0 > 0, equal to the two terms of the solution expansion into power
series of y. For this, the first y-derivative of the solution at y=0 is calculated separately by solving an appropriate two-point BVP by the shooting method (this takes a bit of time).
Unfortunately, when I start changing options in NDSolve, solving the pde fails with numerous error messages, and I cannot get solutions. I need to use exclusively non-adaptive methods, and fixed
y- and w-grids, so that I can perform an elementary convergence experiment by refining the grids. Sorry to say this guys, but it is incomprehensible for me why NDSolve does not allow one to perform such an experiment (as it seems). With this deficiency, it is just a fancy toy but not a scientific tool
for solving real-life problems. If anybody knows how to change my code (by setting appropriate options in NDSolve) so that I can test the convergence using fixed, uniform grids, and achieve 19-20 digits of accuracy, please help. My current code is included below. Please note that I am particularly interested in determining accurately the first w-derivative of the solution at w=0, which is plotted by the final commands in the code.
Leslaw
ClearAll;
(*-----------------------------------------------------*)
wmax=10;
(*-----------------------------------------------------*)
(* First order expansion term (in powers of y) for y>0 *)
(* psi[w,t]=Erf[w]+Psi1[w]*y + ... *)
wstep1=1/100;
difford1=25;
wprec1=80;
SS1[wm_,g0_,wp_]:=NDSolve[{psi1''[v]+2*v*psi1'[v]-4*psi1[v]==-4*Erf[v]*Erfc[v],psi1[0]==0,psi1'[0]==g0},psi1,{v,0,wm},WorkingPrecision->wp ,Method->{"FixedStep", Method->{"ImplicitRungeKutta","DifferenceOrder"->difford1}}, StartingStepSize->wstep1];
(* Assume the interval of g0 for the Brent method: 0.3 < g0 < 0.35 *)
(* Numerical solution for psi1 at wmax by the shooting method *)
psi1wmax[wm_,g0_?NumericQ,wp_]:=Module[{},sol1=SS1[wm,g0,wp];psi1[wm]/.sol1];
(* Determination of the gradient at w=0 that makes psi1wmax = 0 *)
g0acc1[wm_,g0min_,g0max_,wp_]:=Last[First[FindRoot[psi1wmax[wm,g0,wp]==0,{g0,g0min,g0max},Method->"Brent",WorkingPrecision->wp]]];
(* Calculation of the computed psi1 value for given w *)
Psi1[w_]:=First[(psi1[w]/.sol1)];
gradient0=g0acc1[wmax,30/100,35/100,wprec1]
Psi1[wmax]
Plot[Evaluate[Psi1[w]],{w,0,wmax},PlotRange->All]
(*----------------------------------------------------*)
(* Now pass to solving the pde *)
y0=10^-20;
ystep=1/10;
difford=2;
wprec=16;
(*-----------------------------------------------------*)
pde=D[psi[w,y],{w,2}]+2*w*D[psi[w,y],{w,1}]-4*y*(1-y)*D[psi[w,y],{y,1}]-4*y*(psi[w,y]^2-psi[w,y])==0;
pdesol=NDSolve[{pde,psi[w,y0]==Erf[w]+Psi1[w]*y0,psi[0,y]==0,psi[wmax,y]==Erf[wmax]},psi,{w,0,wmax},{y,y0,1}];
Plot3D[Evaluate[psi[w,y]/.pdesol],{w,0,wmax},{y,y0,1},PlotRange->All]
Psip[w_,y_]:=Evaluate[D[psi[w,y],{w,1}]/.pdesol]; (* First w-derivative *)
Psip[0,0]
Psip[0,1]
Plot[Psip[0,y],{y,y0,1},PlotRange->All]
Plot3D[Psip[w,y],{w,0,wmax},{y,y0,1},PlotRange->All]