I am considering a problem with two free boundaries. When I consider the equation:
ESG2[mL0_?NumberQ, mH0_?NumberQ] :=
Module[{mL = mL0, mH = mH0}, Clear[v, f, d];
f = v[m] /. (NDSolve[{v''[m] + v'[m] + v[m] + 0.01 mH == 0,
Derivative[1][v][0] == 0.6 , v[mH] == v[mL]*1.01},
v[m], {m, 0, mH},
Method -> {"Shooting",
"StartingInitialConditions" -> {v'[0] == 1, v[0] == 8}}][[
1]]);
dL = D[f, m] /. {m -> mL};
dH = D[f, m] /. {m -> mH}; {dL - 1/2, dH } ]
sol = FindRoot[ESG2[mL, mH], {{mL, .3}, {mH, 1}}]
Then the program solves it beautifully. However, apparently this is not the right syntax when the equation to solve specifies the value function evaluated in one of the free boundaries, namely:
ESG2[mL0_?NumberQ, mH0_?NumberQ] :=
Module[{mL = mL0, mH = mH0}, Clear[v, f, d];
f = v[m] /. (NDSolve[{v''[m] + v'[m]+ v[m] + v[mL] + 0.01 mH == 0,
Derivative[1][v][0] == 0.6 , v[mH] == v[mL]*1.01},
v[m], {m, 0, mH},
Method -> {"Shooting",
"StartingInitialConditions" -> {v'[0] == 1, v[0] == 8}}][[
1]]);
dL = D[f, m] /. {m -> mL};
dH = D[f, m] /. {m -> mH}; {dL - 1/2, dH } ]
sol = FindRoot[ESG2[mL, mH], {{mL, .3}, {mH, 1}}]
In this second case, the error message reads:
NDSolve`Shooting::idelay: -- Message text not found --
ReplaceAll::reps: {0.01 +v[0.3]+(v^\[Prime])[m]+(v^\[Prime]\[Prime])[m]==0,(v^\[Prime])[0]==0.6,v[1.]==1.01 v[0.3]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
Any suggestion of how to modify the syntax of the second problem to make it work is greatly appreciated!
NDSolve
seems to think that your ODE is a delay differential equation. Work around this withDSolveValue[{v''[m] + v'[m] + v[m] + c == 0, Derivative[1][v][0] == 6/10, v[mH] == v[mL]*101/100}, v[m], m] // FullSimplify
and then substitute forc
. $\endgroup$