I am trying to solve a non-linear second order boundary value problem in a finite interval. The differential equation is $$y”-frac{a}{b}y-frac{u_n}{b}y^3-frac{ge_0}{b}x=0,$$ with $xin(0,L)$, along with the boundary conditions, $$y'(0)-frac{o}{b}y(0)=0,qquad y'(L)+frac{l}{b}y(L)=frac{ge_0L}{b}.$$

In the code attached below, with the chosen parameters, the solution is regular and shows up until $a=1.2$. On using $a=1.3$ and beyond, I get the error “At x == 0.99505895226764`, step size is effectively zero; singularity or stiff system suspected.”

I am changing the input right after $z$ in Plot(Evaluate…

Working:

```
ClearAll;
Clear(Derivative)
fneeonnd(z_?NumericQ, a_?NumericQ, b_?NumericQ, o_?NumericQ,
l_?NumericQ, g_?NumericQ, L_?NumericQ, c_?NumericQ, u_?NumericQ,
un_?NumericQ, eo_?NumericQ) := (
ss = NDSolve({y''(x) - (a/b)*y(x) - (un/b)*(y(x))^3 - (g*eo/b)*x ==
0, y'(0) - (o/b)*y(0) == 0, y'(L) + (l/b)*y(L) == (g*eo*L/b)},
y, {x, 0, L}
, Method -> "StiffnessSwitching", WorkingPrecision -> 100);
y(z) /. ss)
Plot(Evaluate(
fneeonnd(z, 1.2, 0.05, 0.1, 0.1, 0.5, 1, 0.1, 0.1, 0.4, 1)), {z, 0,
1}, PlotStyle -> {Thickness(0.007)}, BaseStyle -> {FontSize -> 20},
Frame -> {True}, FrameLabel -> {"z", (Eta)},
FrameStyle -> {{Black, Directive(Thick)}, {Black,
Directive(Thick)}, {Black, Directive(Thick)}, {Black,
Directive(Thick)}})
```

NOT Working:

```
ClearAll;
Clear(Derivative)
fneeonnd(z_?NumericQ, a_?NumericQ, b_?NumericQ, o_?NumericQ,
l_?NumericQ, g_?NumericQ, L_?NumericQ, c_?NumericQ, u_?NumericQ,
un_?NumericQ, eo_?NumericQ) := (
ss = NDSolve({y''(x) - (a/b)*y(x) - (un/b)*(y(x))^3 - (g*eo/b)*x ==
0, y'(0) - (o/b)*y(0) == 0, y'(L) + (l/b)*y(L) == (g*eo*L/b)},
y, {x, 0, L}
, Method -> "StiffnessSwitching", WorkingPrecision -> 100);
y(z) /. ss)
Plot(Evaluate(
fneeonnd(z, 1.3, 0.05, 0.1, 0.1, 0.5, 1, 0.1, 0.1, 0.4, 1)), {z, 0,
1}, PlotStyle -> {Thickness(0.007)}, BaseStyle -> {FontSize -> 20},
Frame -> {True}, FrameLabel -> {"z", (Eta)},
FrameStyle -> {{Black, Directive(Thick)}, {Black,
Directive(Thick)}, {Black, Directive(Thick)}, {Black,
Directive(Thick)}})
```