1. Ordinary Differential Equations (ODE)#

An Ordinary Differential Equation (ODE) is an equation which contains the derivatives of a function e.g., \(y(t)\), of a single independent variable \(t\). ODEs occur in many different applications so it is important that we are able to solve them. Simple ODEs can be solved using analytical methods such as integration and Laplace transforms, however, the vast majority of ODEs used in the real world cannot be solved using analytical methods which is why we need a numerical approach.

Definition 1.1 (Ordinary Differential Equation)

An Ordinary Differential Equation (ODE) is an equation of the form

\[ y^{(n)}(t) = f(t, y(t), y'(t), y''(t), \ldots, y^{(n-1)}(t)), \]

where \(t\) is an independent variable, \(y(t)\) is some function of \(t\), \(y^{(n)}(t)\) is the \(n\)-th derivative of \(y(t)\) and \(f\) is some function of \(t\), \(y(t)\) and its derivatives.

These notes will write \(y(t)\) as \(y\) from now on for convenience. The solution of an ODE is the function \(y(t)\) that satisfies the ODE over the domain of \(t\). For example, consider the following ODE

(1.1)#\[y' = y, \]

where \(t \in \mathbb{R}\). Rewriting this using Leibniz notation and integrating both sides we have

\[\begin{split} \begin{align*} \frac{\mathrm{d} y}{\mathrm{d} t} & = y \\ \frac{\mathrm{d} y}{y} &= \mathrm{d} t \\ \int \frac{1}{y} \mathrm{d} y &= \int 1 \mathrm{d} t \\ \ln (y) + c_1 &= t + c_2 \\ \ln (y) &= t + c_1 + c_2, \\ \end{align*} \end{split}\]

where \(c_1\) and \(c_1\) are some constants. Let \(c = c_1 + c_2\) then

\[ \begin{align*} y &= e^{t + c}, \end{align*} \]

The solution can be verified by differentiating \(y\) and check that it satisfies the original ODE. This solution has been plotted for various values of the constant \(c\) in Fig. 1.1. Note that there are an infinite number of solutions since \(c\) can be any value.

../_images/b1a6ba8bb8b43cc0da6dfb3948ff751bb20603fadda6cf248a2138ee3ed6f0f1.png

Fig. 1.1 Plots of some of the possible solution to the ODE \(y' = y\).#

However, if we know that the value of the solution \(y\) for some \(t\) then we can calculate \(c\). For example, if the solution to the ODE in equation (1.1) is known to be \(y(0) = \alpha\) then

\[\begin{split} \begin{align*} \alpha &= e^{0 + c} = e^c \\ \therefore c &= \ln(\alpha) \end{align*} \end{split}\]

so the ODE has the solution

\[ \begin{align*} y &= e^{t + \ln(\alpha)}. \end{align*} \]

Different values of \(\alpha\) in the initial solution \(y(0)=\alpha\) give different unique solutions to the ODE. Problems of this type are known as initial value problems.

Definition 1.2 (Initial value problem)

An Initial Value Problem (IVP) is an ODE where the initial solution at the lower boundary of the domain is known. For example,

\[ \begin{align*} y' = f(t,y), \qquad t\in [t_{\min}, t_{\max}], \qquad y(a) = \alpha. \end{align*} \]

Here a first-order ODE \(y'=f(t,y)\) is defined over the domain \(t\in [t_{\min} , t_{\max}]\) and the initial solution \(y(t_{\min})\) is the known value \(\alpha\).

For most real world practical applications initial value problems cannot be solved using analytical methods so instead we use numerical methods to approximate the solution. These notes will cover a common class of numerical methods used to solve initial value problems called Runge-Kutta methods.