I have a question please. I have an issue with my code while trying to solve an equation. Here it is :
sol = Block[{\[Epsilon] = $MachineEpsilon}, NDSolve[{Div[(f[x])*(1 - f[x])*Grad[(-2 f[x] + 4*f[x]^2) - Laplacian[f[x], {x, y, z}, "Spherical"], {x, y, z}, "Spherical"], {x, y, z}, "Spherical"] == \[Epsilon], f[1] == 0.6, f'[5] == \[Epsilon], f[5] == \[Epsilon],f'[\[Epsilon]]==\[Epsilon]}, f, {x, \[Epsilon], 5}]]
I get the following messages :
Power::infy: Infinite expression 1/0. encountered. >>
And others of the same type. The last one is
NDSolve::ndnum: Encountered non-numerical value for a derivative at x == 1.`. >>
I don't get why since I suppressed all the zeros from my boundaries and values.
I then tried, following (105714) :
xmax = 5
e = $MachineEpsilon
sol = ParametricNDSolve[{Div[(f[x])*(1 - f[x])*Grad[(-2 f[x] + 4*f[x]^3) - Laplacian[f[x], {x, y, z}, "Spherical"], {x, y, z}, "Spherical"], {x, y, z}, "Spherical"] == 0, f[1] == 0.6, f[xmax] == bc1, f'[e] == bc2, f'[xmax] == bc3}, f, {x, e, xmax}, {bc1, bc2, bc3}]
obj[bc1_?NumericQ, bc2_?NumericQ, bc3_?NumericQ] := sol[bc1, bc2, bc3][xmax]
solpc = FindRoot[obj[bc1, bc2, bc3] == 0, {{bc1, 0.1}, {bc2, 0.1}, {bc3, 0.1}}]
sols = f -> sol[bc1, bc2, bc3] /. solpc
Plot[Evaluate[f /. sols], {x, 0, 10}]
But I assume I made mistakes, since I get error messages from the line with solpc :
The function value...s not a list of numbers with dimensions {1} at {bc1,bc2,bc3} = \ {0.1,0.1,0.1}
Thx in advance !
"StartingInitialConditions". There are several problems similar to this one on the site, which you can find if you search for "StartingInitialConditions". – Michael E2 May 14 '18 at 11:45x == 5) is reached. The shooting method ofNDSolvefails in such a case. If ICs are hard to find, one might have to implement the shooting method manually. Here are some cases where I've used it: (91854), (105714), (124456), (167132) – Michael E2 May 14 '18 at 13:18