I want to solve differential equation $$ \frac{y''[x]}{(1+y'[x]y'[x])^{3/2}} = -a -y[x]/ \sqrt{2} + x/ \sqrt{2} $$ subject to boundary condition $y(-1) = y(1) = 0$ for some value of $a$. $a$ is found from the condition $\int^{1}_{-1} y[x]\mathrm{d}x = M $ for a given $M$.
This equation arises when one needs to find the shape of a drop resting on a solid surface under gravity.
To start with numerical solution with NDSolve for a fixed value $a$ works fine.
asymSolNumGrav =
NDSolve[{yG''[x]/((1 + yG'[x] yG'[x]))^(3/2) == -2921/10000 -
yG[x]/Sqrt[2] + x /Sqrt[2], yG[-1] == 1/10000, yG[1] == 1/1000},
yG[x], {x, -1, 1}, Method -> {"StiffnessSwitching"},
AccuracyGoal -> 20]
Plot[yG[x] /. asymSolNumGrav, {x, -1, 1}, AspectRatio -> Automatic]
NIntegrate[yG[x] /. asymSolNumGrav[[1]], {x, -1, 1}]
this gives
Next, I tried to find $a$ given the integral constraint with parametric NDSolve as follows along the lines given in another thread Constraint of NDSolve with an integral of the solution
paraNDsol =
ParametricNDSolveValue[{yP''[x]/((1 + yP'[x] yP'[x]))^(3/2) == -a -
yP[x]/Sqrt[2] + x /Sqrt[2], yP[-1] == 1/1000, yP[1] == 1/1000},
yP, {x, -1, 1}, {a}, Method -> {"StiffnessSwitching"},
AccuracyGoal -> 20]
M[a_?NumericQ] := (NIntegrate[paraNDsol[a][x], {x, -1, 1}] - 0.2)^2
sol1 = NMinimize[{M[a], 1/10 < a < 99/100}, a]
{Plot[Evaluate[Table[paraNDsol[a][x], {a, 0.1, 1, .1}]], {x, -1, 1},
AspectRatio -> Automatic],
Plot[paraNDsol[a][x] /. Last[sol1], {x, -1, 1},
AspectRatio -> Automatic]}
This gives error
ParametricNDSolveValue::ndsz
NIntegrate::inumr
How can I get a smooth numerical solution with ParametricNDSolveValue in this case?



