I am trying to redo the method given in
which is very nice, to my equation
2 + 2 u'[x2]^2 + u[x2] u''[x2]
where x2=[-1.,1.]
and u[-1.]=u[1.]=1/10
. I copyed the steps and change the pamareters, obviously. My code in this case is
Manipulate[eq = 2 + 2 u'[x2]^2 + u[x2] u''[x2] == 0;
ic = {u[-1] == ic0, u[1] == ic1};
sol = First@NDSolve[Flatten[{eq, ic}], u[x2], {x2, -1, to}];
Plot[u[x2] /. sol, {x2, -1, to}, Frame -> True, PlotRange -> All,
ImagePadding -> 50,
FrameLabel -> {{u[x2], None}, {x2,
Style[Row[{"solution to ",
2 + 2 Derivative[1][u][x2]^2 +
u[x2] (u^\[Prime]\[Prime])[x2] == 0}], 12]}},
GridLines -> Automatic,
GridLinesStyle -> Directive[LightGray, Thickness[.001]]], {{to, 1,
"to?"}, 0, 1, .01, ImageSize -> Tiny,
Appearance -> "Labeled"}, {{ic0, 1/10, "u(x20)"}, 0, 1, .01,
ImageSize -> Tiny, Appearance -> "Labeled"}, {{ic1, 1/10, "u(x21)"},
0, 1, .01, ImageSize -> Tiny, Appearance -> "Labeled"}]
As a result, I get
Power::infy: Infinite expression 1/0. encountered.
Power::infy: Infinite expression 1/0.^2 encountered.
Power::infy: Infinite expression 1/0. encountered.
General::stop: Further output of Power::infy will be suppressed during this calculation.
Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered.
Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered.
NDSolve::ndnum: Encountered non-numerical value for a derivative at x2 == -1..
and
ReplaceAll::reps: {2+2 (u^[Prime])[-0.999959]^2+u[-0.999959] (u^[Prime][Prime])[-0.999959]==0,u[-1]==1/10,u1==1/10} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
ReplaceAll::reps: {2. +2. (u^[Prime])[-0.999959]^2+u[-0.999959] (u^[Prime][Prime])[-0.999959]==0.,u[-1.]==0.1,u[1.]==0.1} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
ReplaceAll::reps: {2+2 (u^[Prime])[-0.959143]^2+u[-0.959143] (u^[Prime][Prime])[-0.959143]==0,u[-1]==1/10,u1==1/10} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
General::stop: Further output of ReplaceAll::reps will be suppressed during this calculation.
I ask the same question giving my whole code and parameters in
where you can see that u[-1.]=u[1.]=1/100
, but thats not the main point.
Quiet
in the code, and it look it only hides the message not eliminate the1/0
singularity. I think the problem is that the range ofx2
passes through0
, but I dont know how to modify that because that range is required. $\endgroup$