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
![{\displaystyle y''(t)=f(t,y(t),y'(t)),\quad y(t_{0})=y_{0},\quad y(t_{1})=y_{1}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b1e9349befd09d81fabd23b48ac89f9cc7ad04b8)
Let
![{\displaystyle y(t;a)}](https://wikimedia.org/api/rest_v1/media/math/render/svg/6d260013db2de559224ade445482bf29a941fcd4)
solve the initial-value problem
![{\displaystyle y''(t)=f(t,y(t),y'(t)),\quad y(t_{0})=y_{0},\quad y'(t_{0})=a.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/68334dfdbbf15956473a696755f23b4a98b7b36f)
If
![{\displaystyle y(t_{1};a)=y_{1}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/81bbc538558a00e394d6f60b15a7926463935e71)
, then
![{\displaystyle y(t;a)}](https://wikimedia.org/api/rest_v1/media/math/render/svg/6d260013db2de559224ade445482bf29a941fcd4)
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
until one finds the solution
that satisfies the desired boundary conditions. Typically, one does so numerically. The solution(s) correspond to root(s) of
![{\displaystyle F(a)=y(t_{1};a)-y_{1}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/44f99cf9f0153b06257c3fe5db1c2d7ccc019d3e)
To systematically vary the shooting parameter
![a](https://wikimedia.org/api/rest_v1/media/math/render/svg/ffd2487510aa438433a2579450ab2b3d557e5edc)
and find the root, one can employ standard root-finding algorithms like the
bisection method or
Newton's method.
Roots of
and solutions to the boundary value problem are equivalent. If
is a root of
, then
is a solution of the boundary value problem. Conversely, if the boundary value problem has a solution
, it is also the unique solution
of the initial value problem where
, so
is a root of
.
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
, then
- vary the angle
of the cannon, then
- fire the cannon until it hits the boundary value
.
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
![f(t,y(t),y'(t))=p(t)y'(t)+q(t)y(t)+r(t).\,](https://wikimedia.org/api/rest_v1/media/math/render/svg/2b46a5f0b210191bcc1f1d9b60a14e1136e49832)
In this case, the solution to the boundary value problem is usually given by:
![y(t) = y_{(1)}(t)+\frac{y_{1}-y_{(1)}(t_1)}{y_{(2)}(t_1)}y_{(2)}(t)](https://wikimedia.org/api/rest_v1/media/math/render/svg/c537c4985f476b9a5b794b82b46c42a4ad5341aa)
where
is the solution to the initial value problem:
![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,](https://wikimedia.org/api/rest_v1/media/math/render/svg/ab954689b32a886b9e14d84a7d6fff4a99ed46b0)
and
is the solution to the initial value problem:
![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.](https://wikimedia.org/api/rest_v1/media/math/render/svg/b625d231230bf88c037438a36b130320618f285f)
See the proof for the precise condition under which this result holds.
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.
Figure 2. The function
F(
s) =
w(1;
s) − 1.
A boundary value problem is given as follows by Stoer and Bulirsch[1] (Section 7.3.1).
![w''(t)={\frac {3}{2}}w^{2},\quad w(0)=4,\quad w(1)=1](https://wikimedia.org/api/rest_v1/media/math/render/svg/3f8273fe760ebaa558dbf1801b7d90bcde23c2d3)
The initial value problem
![w''(t)={\frac {3}{2}}w^{2},\quad w(0)=4,\quad w'(0)=s](https://wikimedia.org/api/rest_v1/media/math/render/svg/8cd19afa750f96c8e5aa947d6f671e01f690523e)
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[1] 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[]
When searching for the ground state of the harmonic oscillator with energy
![{\displaystyle E_{0}=1/2}](https://wikimedia.org/api/rest_v1/media/math/render/svg/443444ec868a8855b2aa953e2d5b63cde7bc7bf4)
, 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
![{\displaystyle 0.495}](https://wikimedia.org/api/rest_v1/media/math/render/svg/937fa114ca8289353740e480694873e7f0307848)
and
![{\displaystyle 0.500}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8f82b841b9ad33ff7b1d9c482a703e6cfa9ca74c)
(with numerical accuracy).
The shooting method can also be used to solve eigenvalue problems. Consider the time-independent schrodinger equation for the quantum harmonic oscillator
![{\displaystyle -{\frac {1}{2}}\psi _{n}''(x)+{\frac {1}{2}}x^{2}\psi _{n}(x)=E_{n}\psi _{n}(x).}](https://wikimedia.org/api/rest_v1/media/math/render/svg/9f5122cae5a40d97da66b98340d0fe91b0324ae4)
In quantum mechanics, one seeks normalizable wavefunctions
![\psi _{n}(x)](https://wikimedia.org/api/rest_v1/media/math/render/svg/6c06a3b81927b2e45c3f68630083c5c2d9626d9e)
and their corresponding energies subject to the boundary conditions
![{\displaystyle \psi _{n}(x\rightarrow +\infty )=\psi _{n}(x\rightarrow -\infty )=0.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ab0183353fa02f771d5ca9cafe613d80ed90599e)
The problem can be solved analytically to find the energies
![{\displaystyle E_{n}=n+1/2}](https://wikimedia.org/api/rest_v1/media/math/render/svg/4e300594abb9925a948c75353cba8df740b89a8d)
for
![{\displaystyle n=0,1,2,\dots }](https://wikimedia.org/api/rest_v1/media/math/render/svg/99580445ed79706da85cff54455ccb3b168b7d8e)
, 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
is an eigenfunction, so is
for any nonzero constant
.
- The
-th excited state
has
roots where
.
- For even
, the
-th excited state
is symmetric and nonzero at the origin.
- For odd
, the
-th excited state
is antisymmetric and thus zero at the origin.
To find the
-th excited state
and its energy
, the shooting method is then to:
- Guess some energy
.
- Integrate the schrödinger equation. For example, use the central finite difference
![{\displaystyle -{\frac {1}{2}}{\frac {\psi _{n}^{i+1}-2\psi _{n}^{i}+\psi _{n}^{i-1}}{{\Delta x}^{2}}}+{\frac {1}{2}}(x^{i})^{2}\psi _{n}^{i}=E_{n}\psi _{n}^{i}.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/f305d073284461c15b45d203c5e49b614a3d7ef0)
- If
is even, set
to some arbitrary number (say
— the wavefunction can be normalized after integration anyway) and use the symmetric property to find all remaining
.
- If
is odd, set
and
to some arbitrary number (say
— the wavefunction can be normalized after integration anyway) and find all remaining
.
- Count the roots of
and refine the guess for the energy
.
- If there are
or less roots, the guessed energy is too low, so increase it and repeat the process.
- If there are more than
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[]
- ^ a b Stoer, J. and Bulirsch, R. Introduction to Numerical Analysis. New York: Springer-Verlag, 1980.
References[]
- Press, WH; Teukolsky, SA; Vetterling, WT; Flannery, BP (2007). "Section 18.1. The Shooting Method". Numerical Recipes: The Art of Scientific Computing (3rd ed.). New York: Cambridge University Press. ISBN 978-0-521-88068-8.
External links[]