$$\require{cancel}$$

# 10: Numerical Integration of ODEs

$$\newcommand{\vecs}{\overset { \rightharpoonup} {\mathbf{#1}} }$$ $$\newcommand{\vecd}{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$

This article describes the numerical methods for solving the initial-value problem, which is a standard type of problem appearing in many fields of physics. Suppose we have a system whose state at time $$t$$ is described by a vector $$\vec{y}(t)$$, which obeys the first-order ordinary differential equation (ODE) for the form:

$\frac{d\vec{y}}{dt} = \vec{F}\Big(\vec{y}(t), t\Big).$

Here, $$\vec{F}$$ is some given vector-valued function, whose inputs are (i) the instantaneous state $$\vec{y}(t)$$ and (ii) the current time $$t$$. Then, given an initial time $$t_{0}$$ and an initial state $$\vec{y}(t_0)$$, the goal is to find $$\vec{y}(t)$$ for subsequent times.

Conceptually, the initial value problem is distinct from the problem of solving an ODE discussed in the article on finite-difference equations. There, we were given a pair of boundaries with certain boundary conditions, and the goal was to find the solution between the two boundaries. In this case, we are given the state at an initial time $$t_{0}$$, and our goal is to find $$\vec{y}(t)$$ for some set of future times $$t > t_0$$. This is sometimes referred to as "integrating" the ODE, because the solution has the form

$\vec{y}(t) = \vec{y}(t_0)\, +\, \int^t_{t_0} dt' \;\vec{F}\Big(\vec{y}(t'), t'\Big).$

However, unlike ordinary numerical integration (i.e., the computing of a definite integral), the value of the integrand is not known in advance, because of the dependence of $$\vec{F}$$ on the unknown $$\vec{y}(t)$$.

This page titled 10: Numerical Integration of ODEs is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Y. D. Chong via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.