Theory exercise 2

Fredrik Eikeland Fossan


Jan 31, 2019


Problem 1: Shooting method

In this problem we will look at the following ordinary differential equation (ODE): $$ \begin{align} \frac{d^2y}{dx^2} = -2\,\left(y\,\frac{dy}{dx}\right), \label{eq:ODE} \end{align} $$

with \( x \in [x_{min},x_{max}] \), and the following boundaries: $$ \begin{align} y\left(x_{\min}\right) = y\left(1\right) = 1 \qquad \text{and} \qquad y\left(x_{\max}\right) = y\left(2\right) = 0.5. \label{eq:BCs} \end{align} $$

a) With respect to problem \eqref{eq:ODE}-\eqref{eq:BCs}, state which is the order of the ODE, whether it is linear or nonlinear and whether it is an initial or a boundary value problem. Justify your statements.

b) show that: $$ \begin{align} y = \frac{1}{x}, \label{eq:ODE_sol} \end{align} $$

is a solution to problem \eqref{eq:ODE}-\eqref{eq:BCs}.

c) Describe the procedure/algorithm necessary for solving problem \eqref{eq:ODE}-\eqref{eq:BCs} using the shooting method.

d) Transform Eq. \eqref{eq:ODE} into a system of first order ODEs.

e) Define the boundary value error function \( \phi \).

f) Use \( s^0 = 0 \), and \( s^1 = -0.5 \) as the initial guesses to \( y'(1) \) and solve the corresponding initial value problems using Euler's method and with \( h=\Delta x = 1/3 \).

Hint.

$$ \begin{align*} &y\left(2;s^0 \right) = 1\,, \quad y^{\prime}\left(2;s^0 \right) = 0\\ &y\left(2;s^1 \right) = \frac{61}{81}\,, \quad y^{\prime}\left(2;s^1 \right) = -\frac{26}{729} \end{align*} $$

g) Evaluate \( \phi \left(s^0\right) \) and \( \phi \left(s^1\right) \) and use the secant method to find a new estimate, \( s^2 \).

Hint.

$$ \begin{align*} s^{2}=-\frac{81}{80} \end{align*} $$

h) Solve the initial value problem with \( y'(1)= s_2 \) using Euler's method and with \( h=\Delta x = 1/3 \). (Optional)

i) Given \( y\left(2;s^2 \right) = \frac{1559}{3200} \), estimate \( s_3 \) and compare with the correct value of \( y'(1) \).