Below is an ODE with BC define as x[R]=0, x'[0]=0, x'[R]=0 and parameter n
. The ODE is stiff at certain data, and I need to see the behavior of x’ and x for given parameters. I appreciate any help.
c = -0.7177;
r1 = 0.8;
r2 = 125;
R = 1.29;
f[r_] := Piecewise[{{0, 0 <= r <= r1}, {900/(1 - r1^3),
r1 < r <= 1}, {0, 1 < r <= R}}]
ps = ParametricNDSolveValue[{x''[r] + (1/r) x'[r] ==
c n Exp[-x[r]] + f[r], x'[0] == 0, x[0] == x0}, {x, x'}, {r, 0,
R}, {x0,n}, Method -> "StiffnessSwitching"]
ff = FindRoot[{Last[ps[x0,n]][R] == 0, First[ps[x0,n]][R] == 0}, {x0, -2}]