0
$\begingroup$

Consider the following DDE:

$ f''(x)+ f(x+ 1) = 0.$

For $ x \gg 1$, this DDE should approximately reduce to that of a simple harmonic oscillator: $f''(x)+f(x) \approx 0$. Suppose that for some physical reason I require $f(x) = \sin{x}$ for large $x$ and then use this as a ``history'' for the above DDE. I am then interested to see what $f(x)$ is in the vicinity of $x=0$.

The problem is that (not surprisingly) depending on where I set the history condition (when using NDSolve), I get a different answer for $f(x)$ near $x=0$. Any suggestions for how to properly handle this?

$\endgroup$
  • $\begingroup$ Plase read Math Stackexchange question 2765086 "Writing the recursive as explicit" and its answers for ideas. Also see [MSE question 2245492] (math.stackexchange.com/q/2245492) "Continuous recursive iteration" for $\,f'(x)=f(x-1).$ $\endgroup$ – Somos Jan 2 at 2:06
  • $\begingroup$ Thanks Somos, but my question is how to use NDSolve to handle this problem. $\endgroup$ – Sina Jan 2 at 2:22
  • $\begingroup$ Ah, yes. I should have mentioned that I don't think NDSolve[] is going to help. $\endgroup$ – Somos Jan 2 at 2:34
  • $\begingroup$ In the documentation of NDSolveValue I found an example which might help(NDSolveValue[{x'[t] == x[t] (x[t - Pi] - x'[t - 1]), x[t /; t <= 0] == Cos[t]}, x, {t, 0, 8}]): Instead of initial conditions try f[t /; t >= 0] == Sin[t] $\endgroup$ – Ulrich Neumann Jan 2 at 9:34
  • $\begingroup$ That is what I meant by ``history''; in fact that is the only way NDSolve can integrate a DDE. Still if you set up the history at t>=0 and integrate from zero, you will get a different answer from a history at t>=1 which is integrated from t=1. And that is my problem, because how close to infinity is close enough? how do I know I can trust the result. $\endgroup$ – Sina Jan 2 at 12:46
0
$\begingroup$
sol = NDSolve[{f''[x] + f[x + 1] == 0, f[x /; x >= 0] == Sin[x]}, f, {x, 0, 8Pi}][[1]]
Plot[{Evaluate[f[x] /. sol], Sin[x]}, {x, 0, 8 Pi}]
$\endgroup$
  • $\begingroup$ For the case x /; x >= 0 NDSolve returns Sin[x] as result. Varying the lower limit for x (x /; x >= x0 ) shows, that the initial values change and increase depending on x0. $\endgroup$ – Ulrich Neumann Jan 2 at 10:15
0
$\begingroup$

Assuming an asymptotic 2Pi-periodic solution f[t]==s Sin[t]+ c Cos[t] the ode can be integrated:

first integration:

gl1 = f'[x] - f'[0] == Integrate[f[1 + u], {u, 0, x}] /. f -> (c Cos[#]+ s Sin[#] &)
gl1/. x->2Pi (* 2Piperiodic boundary conditions*)
(* True*)

second integration

gl2 = f[x] - f[0] - f'[0] x ==Integrate[f[1 + u], {v, 0, x}, {u, 0, v}] /.f -> (c Cos[#] + s Sin[#] &)
sol=Solve[gl2 /. x -> 2 Pi, s][[1]]
(*{s -> (c Sin[1])/(1 + Cos[1])}*)

Asymptotic solution:

fasy=(c Cos[#] + s Sin[#] )& /. sol /.c->1;
fasy[x]
(*Cos[x] + (Sin[1] Sin[x])/(1 + Cos[1])*)

The initial values evalute to

{fasy[0], Derivative[1][fasy][0]}
(*{1, Sin[1]/(1 + Cos[1])}*)
$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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