# Starting value problem

I am solving a system of non-linear ODEs but I get the error message:

Cannot find starting value for the variable f'

This is the code:

sol =
NDSolve[
{h'[t] == -2 f[t],
f''[t] == -(g[t])^2 + (f[t])^2 + f'[t] h[t],
g''[t] == 2 f[t] g[t] + h[t] g'[t],
p'[t] == 2 f[t] h[t] - 2 f'[t],
f[0] == h[0] == p[0] == 0, g[0] == 1,
f[Infinity] == 0, g[Infinity] == 0},
{f, h, g, p}, {t, 0, Infinity}]


• Are you not missing some initial conditions like that of first derivatives of f and g? May 3, 2018 at 14:24
• No ... These are the boundary conditions I have ... I have the exact numerical solution in my course textbook, but I am required to solve these equations numerically and compare the results May 3, 2018 at 14:28
• @Subho95 No the OP does not miss it. Even if yes, I tried to change the conditions for usual ones, say placing f'[0]==0 instead of the used f[Infinity] == 0. The outcome is invariable. @Muhammad, what system/version do you use? If I put the both conditions to f'[0] == 0, g'[0] == 0 everything starts working. May 3, 2018 at 14:29
• @Subho95 In the book, it is written that: To solve these equations numerically, you should start with correct guess values of f' and g' that makes f and g zero at infinity. May 3, 2018 at 14:30
• @Alexei Boulbitch I am using Mathematica 11.3 on win7 x64 May 3, 2018 at 14:31

EDITED:5.5.2018

This boundary conditions: f'[0] == 510/1000, g'[0] == -609/1000, I'm searched by brute-force and help with Maple 2018.

sol2 = With[{inf = 47},
NDSolve[{h'[t] == -2*f[t],
f''[t] == -(g[t])^2 + (f[t])^2 + f'[t]*h[t],
g''[t] == 2*f[t]*g[t] + h[t]*g'[t],
p'[t] == 2 f[t]*h[t] - 2 f'[t], f[0] == h[0] == p[0] == 0,
g[0] == 1, f[inf] == 0, g[inf] == 0}, {f, h, g, p}, {t, 0, inf},
Method -> {"BoundaryValues" -> {"Shooting",
"StartingInitialConditions" -> {f[0] == h[0] == p[0] == 0,
g[0] == 1, f'[0] == 510/1000, g'[0] == -609/1000}}},
WorkingPrecision -> 20, MaxSteps -> Infinity]];

Plot[Evaluate[{f[t], h[t], g[t], p[t]} /. sol2], {t, 0, 47},
PlotLegends -> {"f[t]", "h[t]", "g[t]", "p[t]"}, PlotRange -> All]


Check initial and boundary conditions at: t = 0

{f[t], h[t], g[t], p[t]} /. sol /. t -> 0
(* {{0.*10^-25, 0.*10^-30, 1.0000000000000000000, 0.*10^-25}} *)


at: t = 47

{f[t], h[t], g[t], p[t]} /. sol /. t -> 47
(* {{7.5261038817*10^-11, 0.00014222313818378259662, -1.53486450848720*10^-10,-1.0043080818308*10^-8}} *)

• Thank you very much. It works but only for inf = 6, and the problem is that I am required to compare my results with another solution that has numeric values at inf greater than 10. How can I work with inf = 15 for example? May 4, 2018 at 12:49
• Can you help please? @Mariusz Iwaniuk May 4, 2018 at 19:24