Section 1.16 Shooting Method
Assuming that there is a solution to
\begin{equation*}
x''=f(t,x,x')\,,\;x(t_0)=x_0\,,\;x(t_1)=x_1\,,
\end{equation*}
the shooting method's idea is using IVP to find better and better approximations of the value of \(x'(t_0)\) that produces a solution \(x(t)\) s.t. \(x(t_1)=x_1\text{.}\)
Clearly indeed by assigning values \(v\) to \(x'(t_0)\) we obtain a function \(F(v)\) defined as the value of \(x(t_1)\) when \(x'(t_0)=v\text{.}\) The shooting method consists exaclty in applying some numerical method, such as the Newton method, to solve the equation \(F(v)=x_1\text{,}\) namely to find the initial value of \(x'(t)\) such that the point arrives at \(x_1\) at \(t=t_1\text{.}\) Subsection 1.16.1 The Linear Case
A particularly simple case it the linear one. Recall the following theorem:Theorem 1.16.1.
The space of solutions of a linear ODE
\begin{equation*}
x' = Ax,\,x(t_b)=x_b,\,x\in\Bbb R^n
\end{equation*}
is itself a linear space. Moreover, the map that sends an initial condition \(x_b\) to the corresponding solution is a linear map.
\begin{equation*}
x_b\mapsto x(t) = e^{A(t-t_b)}x_b.
\end{equation*}
In particular, this means that for linear BVP
\begin{equation*}
\ddot x = a(t) \dot x + b(t) x +c(t),\,x(t_b) = x_b,\, x(t_e)=x_e,
\end{equation*}
the function \(F(v)\) is itself linear, namely
\begin{equation*}
F(v) = \alpha v+\beta.
\end{equation*}
Hence it is enough to solve numerically two IVP in order to solve the BVP. For instance, say that \(F(0) = q_0\) and \(F(1) = q_1\text{.}\) Then \(\beta = q_0\) and \(\alpha = q_1-q_0\text{,}\) so that the solution to
\begin{equation*}
F(v) = x_e
\;\;\mbox{ is }\;\;
v = \frac{x_e-q_0}{q_1-q_0}.
\end{equation*}
Example. Consider our good old IVP
\begin{equation*}
\dot x = -x\cos t,\,x(0)=1,\,
\end{equation*}
whose solution is \(x(t)=e^{-\sin t}\text{.}\) Since we need a 2nd order ODE, we will rather consider the ODE given by its "first prolongation", namely
\begin{equation*}
\ddot x = -\dot x\cos t+x\sin t.
\end{equation*}
For the BVP problem, we will use the usual initial value \(x(0)=1\) and \(x(15\pi/2)=e^{-\sin\frac{15\pi}{2}}=e\text{.}\) The code below applies the method illustrade above to solve this BVP.