Shooting method

From HandWiki
Short description: Method for solving boundary value problems

In numerical analysis, the shooting method is a method for solving a boundary value problem by reducing it to an initial value problem. It involves finding solutions to the initial value problem for different initial conditions until one finds the solution that also satisfies the boundary conditions of the boundary value problem. In layman's terms, one "shoots" out trajectories in different directions from one boundary until one finds the trajectory that "hits" the other boundary condition.

Mathematical description

Suppose one wants to solve the boundary-value problem[math]\displaystyle{ y''(t) = f(t, y(t), y'(t)), \quad y(t_0) = y_0, \quad y(t_1) = y_1. }[/math]Let [math]\displaystyle{ y(t; a) }[/math] solve the initial-value problem[math]\displaystyle{ y''(t) = f(t, y(t), y'(t)), \quad y(t_0) = y_0, \quad y'(t_0) = a. }[/math]If [math]\displaystyle{ y(t_1; a) = y_1 }[/math], then [math]\displaystyle{ y(t; a) }[/math] is also a solution of the boundary-value problem.

The shooting method is the process of solving the initial value problem for many different values of [math]\displaystyle{ a }[/math] until one finds the solution [math]\displaystyle{ y(t; a) }[/math] that satisfies the desired boundary conditions. Typically, one does so numerically. The solution(s) correspond to root(s) of [math]\displaystyle{ F(a) = y(t_1; a) - y_1. }[/math]To systematically vary the shooting parameter [math]\displaystyle{ a }[/math] and find the root, one can employ standard root-finding algorithms like the bisection method or Newton's method.

Roots of [math]\displaystyle{ F }[/math] and solutions to the boundary value problem are equivalent. If [math]\displaystyle{ a }[/math] is a root of [math]\displaystyle{ F }[/math], then [math]\displaystyle{ y(t; a) }[/math] is a solution of the boundary value problem. Conversely, if the boundary value problem has a solution [math]\displaystyle{ y(t) }[/math], it is also the unique solution [math]\displaystyle{ y(t; a) }[/math] of the initial value problem where [math]\displaystyle{ a = y'(t_0) }[/math], so [math]\displaystyle{ a }[/math] is a root of [math]\displaystyle{ F }[/math].

Etymology and intuition

The term "shooting method" has its origin in artillery. An analogy for the shooting method is to

  • place a cannon at the position [math]\displaystyle{ y(t_0) = y_0 }[/math], then
  • vary the angle [math]\displaystyle{ a = y'(t_0) }[/math] of the cannon, then
  • fire the cannon until it hits the boundary value [math]\displaystyle{ y(t_1) = y_1 }[/math].

Between each shot, the direction of the cannon is adjusted based on the previous shot, so every shot hits closer than the previous one. The trajectory that "hits" the desired boundary value is the solution to the boundary value problem — hence the name "shooting method".

Linear shooting method

The boundary value problem is linear if f has the form [math]\displaystyle{ f(t, y(t), y'(t)) = p(t) y'(t) + q(t)y(t) + r(t). }[/math] In this case, the solution to the boundary value problem is usually given by: [math]\displaystyle{ y(t) = y_{(1)}(t) + \frac{y_{1}-y_{(1)}(t_1)}{y_{(2)}(t_1)} y_{(2)}(t) }[/math] where [math]\displaystyle{ y_{(1)}(t) }[/math] is the solution to the initial value problem: [math]\displaystyle{ y_{(1)}''(t) = p(t) y_{(1)}'(t) + q(t) y_{(1)}(t) + r(t),\quad y_{(1)}(t_0) = y_0, \quad y_{(1)}'(t_0) = 0, }[/math] and [math]\displaystyle{ y_{(2)}(t) }[/math] is the solution to the initial value problem: [math]\displaystyle{ y_{(2)}''(t) = p(t) y_{(2)}'(t) + q(t) y_{(2)}(t),\quad y_{(2)}(t_0) = 0, \quad y_{(2)}'(t_0) = 1. }[/math] See the proof for the precise condition under which this result holds.[1]

Examples

Standard boundary value problem

Figure 1. Trajectories w(t;s) for s = w'(0) equal to −7, −8, −10, −36, and −40. The point (1,1) is marked with a circle.

thumb|400px|Figure 2. The function F(s) = w(1;s) − 1.A boundary value problem is given as follows by Stoer and Bulirsch[2] (Section 7.3.1).

[math]\displaystyle{ w''(t) = \frac{3}{2} w^2(t), \quad w(0) = 4, \quad w(1) = 1 }[/math]

The initial value problem [math]\displaystyle{ w''(t) = \frac{3}{2} w^2(t), \quad w(0) = 4, \quad w'(0) = s }[/math] was solved for s = −1, −2, −3, ..., −100, and F(s) = w(1;s) − 1 plotted in the Figure 2. Inspecting the plot of F, we see that there are roots near −8 and −36. Some trajectories of w(t;s) are shown in the Figure 1.

Stoer and Bulirsch[2] state that there are two solutions, which can be found by algebraic methods.

These correspond to the initial conditions w′(0) = −8 and w′(0) = −35.9 (approximately).

Eigenvalue problem

Illustration of the shooting method for finding the ground state of the quantum harmonic oscillator
When searching for the ground state of the harmonic oscillator with energy [math]\displaystyle{ E_0 = 1/2 }[/math], the shooting method produces wavefunctions that diverge to infinity. Here, the correct wavefunction should have zero roots and go to zero at infinity, so it lies somewhere between the orange and green lines. The energy is therefore between [math]\displaystyle{ 0.495 }[/math] and [math]\displaystyle{ 0.500 }[/math] (with numerical accuracy).

The shooting method can also be used to solve eigenvalue problems. Consider the time-independent Schrödinger equation for the quantum harmonic oscillator [math]\displaystyle{ -\frac{1}{2} \psi_n''(x) + \frac{1}{2} x^2 \psi_n(x) = E_n \psi_n(x). }[/math] In quantum mechanics, one seeks normalizable wavefunctions [math]\displaystyle{ \psi_n(x) }[/math] and their corresponding energies subject to the boundary conditions [math]\displaystyle{ \psi_n(x \rightarrow +\infty) = \psi_n(x \rightarrow -\infty) = 0. }[/math]The problem can be solved analytically to find the energies [math]\displaystyle{ E_n = n + 1/2 }[/math] for [math]\displaystyle{ n = 0, 1, 2, \dots }[/math], but also serves as an excellent illustration of the shooting method. To apply it, first note some general properties of the Schrödinger equation:

  • If [math]\displaystyle{ \psi_n(x) }[/math] is an eigenfunction, so is [math]\displaystyle{ C \psi_n(x) }[/math] for any nonzero constant [math]\displaystyle{ C }[/math].
  • The [math]\displaystyle{ n }[/math]-th excited state [math]\displaystyle{ \psi_n(x) }[/math] has [math]\displaystyle{ n }[/math] roots where [math]\displaystyle{ \psi_n(x) = 0 }[/math].
  • For even [math]\displaystyle{ n }[/math], the [math]\displaystyle{ n }[/math]-th excited state [math]\displaystyle{ \psi_n(x) = \psi_n(-x) }[/math] is symmetric and nonzero at the origin.
  • For odd [math]\displaystyle{ n }[/math], the [math]\displaystyle{ n }[/math]-th excited state [math]\displaystyle{ \psi_n(x) = -\psi_n(-x) }[/math] is antisymmetric and thus zero at the origin.

To find the [math]\displaystyle{ n }[/math]-th excited state [math]\displaystyle{ \psi_n(x) }[/math] and its energy [math]\displaystyle{ E_n }[/math], the shooting method is then to:

  1. Guess some energy [math]\displaystyle{ E_n }[/math].
  2. Integrate the Schrödinger equation. For example, use the central finite difference[math]\displaystyle{ -\frac{1}{2} \frac{\psi^{i+1}_n - 2 \psi^i_n + \psi^{i-1}_n}{{\Delta x}^2} + \frac{1}{2} (x^i)^2 \psi^i_n = E_n \psi^i_n. }[/math]
    • If [math]\displaystyle{ n }[/math] is even, set [math]\displaystyle{ \psi_0 }[/math] to some arbitrary number (say [math]\displaystyle{ \psi^0_n = 1 }[/math] — the wavefunction can be normalized after integration anyway) and use the symmetric property to find all remaining [math]\displaystyle{ \psi_n^i }[/math].
    • If [math]\displaystyle{ n }[/math] is odd, set [math]\displaystyle{ \psi^0_n = 0 }[/math] and [math]\displaystyle{ \psi^1_n }[/math] to some arbitrary number (say [math]\displaystyle{ \psi^1_n = 1 }[/math] — the wavefunction can be normalized after integration anyway) and find all remaining [math]\displaystyle{ \psi_n^i }[/math].
  3. Count the roots of [math]\displaystyle{ \psi_n }[/math] and refine the guess for the energy [math]\displaystyle{ E_n }[/math].
    • If there are [math]\displaystyle{ n }[/math] or less roots, the guessed energy is too low, so increase it and repeat the process.
    • If there are more than [math]\displaystyle{ n }[/math] roots, the guessed energy is too high, so decrease it and repeat the process.

The energy-guessing can be done with the bisection method, and the process can be terminated when the energy difference is sufficiently small. Then one can take any energy in the interval to be the correct energy.

See also

Notes

  1. Mathews, John H.; Fink, Kurtis K. (2004). "9.8 Boundary Value Problems". Numerical methods using MATLAB (4th ed.). Upper Saddle River, N.J.: Pearson. ISBN 0-13-065248-2. http://math.fullerton.edu/mathews/n2003/shootingmethod/ShootingProof.pdf. 
  2. 2.0 2.1 Stoer, J. and Bulirsch, R. Introduction to Numerical Analysis. New York: Springer-Verlag, 1980.

References

External links