# how to solve an ODE with boundary conditions $y(0)=y(\infty)$ by shooting method

how could I solve the linear differential equation $$-y''(x)+x^{3}y(x)=0$$ with the boundary conditions $y(0)=y(\infty)$ by the linear shooting method ?

If we had $y(0)=y(1)=0$ then the interval is finite however how can i deal with $y(\infty) =0$ ? i guess that we can get a large number $L \rightarrow 10^{6}$ and solve it $y(0)=y(L)=0$ however I do not know what is the best method to solve numerically my eigenvalue problem.

• Is this system even stable? I mean, does a limit exist? If it does, it must be $0$, in which case shooting makes sense only if $y(0) = 0$. – copper.hat Jul 23 '12 at 19:58
• I think I'm missing something. Either $y$ converges as $t \to \infty$ or it doesn't. If it does, then the limit must be $0$ (otherwise the ODE is not satisfied). If it doesn't, then $y(t)$ does not converge and the problem is ill defined. What will using a shooting method provide? – copper.hat Jul 23 '12 at 20:21
• @copper.hat Even though convergence is guaranteed (assuming well-posedness), a shooting method will enable one to estimate the initial value of the first derivative. In other words, the well-definedness of the problem is insufficient to actually compute the solution in the absence of an IVP definition. – Emily Jul 23 '12 at 20:59
• @EdGorcenski: Thanks for the reply. What do you mean by 'estimate the initial value of the first derivative'? Isn't that the only variable here? Its a linear system, so one computation with $y(0) = 0$ and $y'(1)$ will give, essentially, all solutions of interest (assuming $y(0) = y(\infty)$ is the constraint). So, I am missing what the shooting part is for. I think of shooting as 'aiming' an initial condition to 'hit' a 'target' (final condition). If the 'target' has a stable $y(\infty) = 0$, then the first derivative must also be $0$. Am I making sense or missing something major? – copper.hat Jul 23 '12 at 21:11
• @EdGorcenski: If I understand correctly, Jose has $y(0) = 0$ as an initial constraint. If I find a solution with $y'(0) = 1$ (and $y(0)=0$), then I have found, by linearity, the solution with $y'(0) = c$ by just multiplying by $c$. You still need to solve the ODE, but just once, as far as I can see? – copper.hat Jul 23 '12 at 21:19

## 2 Answers

First, it is not necessarily sufficient to choose a large number because it is large. Rather, you will want to choose a number $L$ such that $y''(L) \approx y'(L) \approx 0$. In some cases, it is sufficient to replace $\infty$ with something as small as $5$ (such as computing the boundary layer velocity profile over a flat plate). Other cases, you may need a number quite large. To estimate a sufficient value, make a guess for $y'(0)$, and integrate. Find an acceptable $L$ such that you achieve the desired error tolerance.

Second, assume you can find such an $L$. There are a number of ways to implement a shooting method. One way is to re-frame the problem as a "root finding" algorithm. First, you guess a value $c$ and let $y'(0)=c$. Then, integrate the ODE using whatever method suits your needs. Then, you compute the error $||y(L)-0|| = e$ and compute a new value of $c$. You can do this using Newton's method, for example, or via bisection.

• thanks a lot .. so i must find first a number L so $y''(L)\approx y'(L)\approx0$ by numerical methods and then once i have found it i solve the differential equation by linear shooting method – Jose Garcia Jul 23 '12 at 20:02
• I think this will not work because $y''$ does not go to zero as $x \to \infty$. Instead, the solution oscillates with increasing frequency and decreasing amplitude. By the Liouville-Green approximation (also known as WKB), we have $y \sim x^{-3/4} \cos(\tfrac23x^{5/2}+\phi)$ as $x \to \infty$. – Jitse Niesen Jul 24 '12 at 13:10
• @JitseNiesen Yes, after computing the solution for this particular problem, that appears to be the case. – Emily Jul 24 '12 at 14:15

One option would be to render the point $x=\infty$ finite by some coordinate transformation. This transformation will necessarily be singular, so you need to make sure you treat the singular point appropriately.

• for example $x= \frac{u}{u-1}$ but now the ode would have a singular point at $u=1$ how can i use shooting method to deal with it ? – Jose Garcia Jul 24 '12 at 8:25
• another possibility is to make the change of variable $x=uL$ so the new boundary value problem turns into $y(0)=0=y(1)$ – Jose Garcia Jul 24 '12 at 9:39