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.
(Ordinary Differential Equation)
An Ordinary Differential Equation (ODE) is an equation of the form
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
where \(t \in \mathbb{R}\). Rewriting this using Leibniz notation and integrating both sides we have
where \(c_1\) and \(c_1\) are some constants. Let \(c = c_1 + c_2\) then
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.
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
so the ODE has the solution
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.
(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,
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.