2
$\begingroup$

I have never solved numerically differential equations and in an optimal control problem I got this one that I cannot solve: $$1-f’(x)^2+f’(x)(x +1)+f’’(x)-f’’(x)f’(x)-f’’(x)f’(x)^2=f(x)$$ The initial conditions I have are the following: $$f(0)=0, f′(z)=−1$$ where $z$ is the first point at which $f′′(z)=0$ I hope what I wrote makes some sense. Thank you in advance for your help. This is a follow-up to sloppier version of this question I already posed: Nonlinear differential equation numerical solution+plot

$\endgroup$
9
  • 2
    $\begingroup$ You can't really solve this. How would you find the "first" point $z$ where $f''(x)$ is zero in order to use it for initial conditions on $f'(z)$? You'd need to know $f(z)$ first, but that needs to know $z$ first. But that is what you are solving for? $\endgroup$
    – Nasser
    Commented Apr 2, 2022 at 1:30
  • 1
    $\begingroup$ @Nasser I think that I am the reason that caused this confusion, because I wrote too quickly in the other post. Apologies for the mess and inconvenience to all. Just some comments: if you do asmpt=AsymptoticDSolveValue[{eqn}, f[x], {x, 0, 3}] // FullSimplify you get an answer. You can impose on that solution that for x=0 the answer goes to 0 and this is setting one of the constants of integration to zero. Then you can examine something like Solve[(D[asmpt, {x, 2}] /. C[1] -> 0) == 0] // Factor // FullSimplify // Apart to get three solutions. And then you can start experimenting. $\endgroup$
    – bmf
    Commented Apr 2, 2022 at 2:03
  • 1
    $\begingroup$ It's not very elegant and it is only at the level of the asymptotic expansion, but it might give some intuition for the full problem. $\endgroup$
    – bmf
    Commented Apr 2, 2022 at 2:04
  • 1
    $\begingroup$ It can't be solved by just brute-force trying a range of $f'(0)=k$ and checking the first time $f'(z)=-1$? $\endgroup$
    – josh
    Commented Apr 2, 2022 at 10:10
  • 1
    $\begingroup$ @Giuliosky: Ok, I'll try to set it up sometime today or tomorrow morning. $\endgroup$
    – josh
    Commented Apr 2, 2022 at 16:41

1 Answer 1

7
$\begingroup$

There appears to be no solution for the ODE system in the question. To begin, obtain an explicit expression for f''[x].

First@SolveValues[eq, f''[x]]
(* (1 - f[x] + f'[x] + x*f'[x] - f'[x]^2)/(-1 + f'[x] + f'[x]^2) *)

where eq is the ODE in the question. The ODE therefore becomes singular for values f'[x]

SolveValues[Denominator[%] == 0, f'[x]]
(* {1/2 (-1 - Sqrt[5]), 1/2 (-1 + Sqrt[5])} *)

Next, plot f'[x] for a range of f'[0] values, and superimpose on the plot the singular values just determined, as well as the desired f'[x] = -1.

funp = ParametricNDSolveValue[{eq, f[0] == 0, f'[0] == y}, f'[x], {x, 0, 10}, {y}]
Plot[Evaluate@Table[funp[y], {y, -3, 2, .2}], {x, 0, 6}, PlotRange -> {-4, 4}]
Plot[{-1, 1/2 (-1 - Sqrt[5]), 1/2 (-1 + Sqrt[5])}, {x, 0, 6}, 
    PlotStyle -> Directive[Black, Dashed]]
Show[%, %%]

enter image description here

Visibly, where f'[x] = -1, f''[x] is nowhere near zero.

$\endgroup$
2
  • $\begingroup$ Thank you for your answer! $\endgroup$
    – Giuliosky
    Commented Apr 3, 2022 at 3:10
  • $\begingroup$ @bbgodfrey: Supurb! Thank you. $\endgroup$
    – josh
    Commented Apr 3, 2022 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.