Chapter 5 – Initial-Value Problems for
Ordinary Differential Equations
Per-Olof Persson
persson@berkeley.edu
Department of Mathematics
University of California, Berkeley
Math 128A Numerical Analysis
A function \(f(t,y)\) is said to satisfy a Lipschitz condition in the variable \(y\) on a set \(D\subset \mathbb{R}^2\) if a constant \(L>0\) exists with \[ \begin{aligned} |f(t,y_1)-f(t,y_2)|\le L |y_1-y_2|, \end{aligned} \] whenever \((t,y_1),(t,y_2)\in D\). The constant \(L\) is called a Lipschitz constant for \(f\).
A set \(D\subset \mathbb{R}^2\) is said to be convex if whenever \((t_1,y_1)\) and \((t_2,y_2)\) belong to \(D\) and \(\lambda\) is in \([0,1]\), the point \(((1-\lambda)t_1+\lambda t_2,(1-\lambda)y_1+\lambda y_2)\) also belongs to \(D\).
Suppose \(f(t,y)\) is defined on a convex set \(D\subset \mathbb{R}^2\). If a constant \(L>0\) exists with \[ \begin{aligned} \left|\frac{\partial f}{\partial y}(t,y)\right|\le L,\quad \text{for all }(t,y)\in D, \end{aligned} \] then \(f\) satisfies a Lipschitz condition on \(D\) in the variable \(y\) with Lipschitz constant \(L\).
Suppose that \(D=\{(t,y)\ |\ a\le t \le b, -\infty < y < \infty \}\) and that \(f(t,y)\) is continuous on \(D\). If \(f\) satisfies a Lipschitz condition on \(D\) in the variable \(y\), then the initial-value problem \[ \begin{aligned} y'(t)=f(t,y),\quad a\le t\le b,\quad y(a)=\alpha, \end{aligned} \] has a unique solution \(y(t)\) for \(a\le t\le b\).
The initial-value problem \[ \begin{aligned} \frac{dy}{dt} = f(t,y),\quad a\le t\le b,\quad y(a)=\alpha, \end{aligned} \] is said to be a well-posed problem if:
Suppose \(D=\{(t,y)\ |\ a\le t \le b\text{ and }-\infty<y<\infty\}\). If \(f\) is continuous and satisfies a Lipschitz condition in the variable \(y\) on the set \(D\), then the initial-value problem \[ \begin{aligned} \frac{dy}{dt} = f(t,y),\quad a\le t\le b,\quad y(a)=\alpha \end{aligned} \] is well-posed.
Suppose a well-posed initial-value problem is given: \[ \begin{aligned} \frac{dy}{dt} = f(t,y),\quad a\le t \le b,\quad y(a)=\alpha \end{aligned} \] Distribute mesh points equally throughout \([a,b]\): \[ \begin{aligned} t_i=a+ih,\quad\text{for each }i=0,1,2,\ldots,N. \end{aligned} \] The step size \(h=(b-a)/N = t_{i+1}-t_i\).
Use Taylor’s Theorem for \(y(t)\): \[ \begin{aligned} y(t_{i+1}) = y(t_i) + (t_{i+1}-t_i)y'(t_i) +\frac{(t_{i+1}-t_i)^2}{2}y''(\xi_i) \end{aligned} \] for \(\xi_i\in(t_i,t_{i+1})\). Since \(h=t_{i+1}-t_i\) and \(y'(t_i)=f(t_i,y(t_i))\), \[ \begin{aligned} y(t_{i+1}) = y(t_i) + h f(t_i,y(t_i)) + \frac{h^2}{2}y''(\xi_i). \end{aligned} \] Neglecting the remainder term gives Euler’s method for \(w_i\approx y(t_i)\): \[ \begin{aligned} w_0&=\alpha \\ w_{i+1} &= w_i + h f(t_i,w_i),\qquad i=0,1,\ldots,N-1 \end{aligned} \] The well-posedness implies that \[ \begin{aligned} f(t_i,w_i) \approx y'(t_i) = f(t_i,y(t_i)) \end{aligned} \]
Suppose \(f\) is continuous and satisfies a Lipschitz condition with constant \(L\) on \[ \begin{aligned} D = \{(t,y)\ |\ a\le t \le b, -\infty<y<\infty \} \end{aligned} \] and that a constant \(M\) exists with \[ \begin{aligned} |y''(t)|\le M,\quad \text{for all }t\in[a,b]. \end{aligned} \] Let \(y(t)\) denote the unique solution to the initial-value problem \[ \begin{aligned} y'=f(t,y),\quad a\le t \le b,\quad y(a)=\alpha, \end{aligned} \] and \(w_0,w_1,\ldots,w_n\) as in Euler’s method. Then \[ \begin{aligned} |y(t_i)-w_i|\le \frac{hM}{2L}\left[ e^{L(t_i-a)}-1\right]. \end{aligned} \]
The difference method \[ \begin{aligned} w_0 &= \alpha \\ w_{i+1} &= w_i + h\phi(t_i,w_i) \end{aligned} \] has local truncation error \[ \begin{aligned} \tau_{i+1}(h) = \frac{y_{i+1}-(y_i+h\phi(t_i,y_i))}{h} = \frac{y_{i+1}-y_i}{h} - \phi(t_i,y_i), \end{aligned} \] for each \(i=0,1,\ldots,N-1\).
Consider initial-value problem \[ \begin{aligned} y'=f(t,y),\quad a\le t \le b,\quad y(a)=\alpha. \end{aligned} \] Expand \(y(t)\) in \(n\)th Taylor polynomial about \(t_i\), evaluated at \(t_{i+1}\): \[ \begin{aligned} y(t_{i+1}) &= y(t_i)+hy'(t_i)+\frac{h^2}{2}y''(t_i) + \cdots \\ &+\frac{h^n}{n!}y^{(n)}(t_i) + \frac{h^{n+1}}{(n+1)!} y^{(n+1)}(\xi_i) \\ &= y(t_i) + hf(t_i,y(t_i)) + \frac{h^2}{2}f'(t_i,y(t_i)) + \cdots \\ &+ \frac{h^n}{n!}f^{(n-1)}(t_i,y(t_i))+ \frac{h^{n+1}}{(n+1)!}f^{(n)}(\xi_i,y(\xi_i)) \end{aligned} \] for some \(\xi_i\in (t_i,t_{i+1})\). Delete remainder term to obtain the Taylor method of order \(n\).
\[ \begin{aligned} w_0 &= \alpha \\ w_{i+1} &= w_i + h T^{(n)} (t_i,w_i),\qquad i=0,1,\ldots,N-1 \end{aligned} \] where \[ \begin{aligned} T^{(n)}(t_i,w_i) &=f(t_i,w_i) + \frac{h}{2} f'(t_i,w_i) + \cdots + \frac{h^{(n-1)}}{n!} f^{(n-1)}(t_i,w_i) \end{aligned} \]
If Taylor’s method of order \(n\) is used to approximate the solution to \[ \begin{aligned} y'(t) = f(t,y(t)),\quad a\le t\le b,\quad y(a)=\alpha, \end{aligned} \] with step size \(h\) and if \(y\in C^{n+1}[a,b]\), then the local truncation error is \(O(h^n)\).
Suppose \(f(t,y)\) and partial derivatives up to order \(n+1\) continuous on \(D=\{(t,y)\ |\ a\le t \le b, c\le y \le d\}\), let \((t_0,y_0)\in D\). For \((t,y)\in D\), there is \(\xi\in[t,t_0]\) and \(\mu\in[y,y_0]\) with \[ \begin{aligned} f(t,y) &= P_n(t,y)+ R_n(t,y) \\ P_n(t,y) &=f(t_0,y_0) + \left[(t-t_0)\frac{\partial f}{\partial t} (t_0,y_0) + (y-y_0)\frac{\partial f}{\partial y}(t_0,y_0)\right] \\ &+\left[\frac{(t-t_0)^2}{2} \frac{\partial^2 f}{\partial t^2}(t_0,y_0) +(t-t_0)(y-y_0)\frac{\partial^2 f}{\partial t\partial y} (t_0,y_0)\right. \\ &+\left.\frac{(y-y_0)^2}{2} \frac{\partial^2 f}{\partial y^2} (t_0,y_0)\right] + \cdots \\ &+ \left[ \frac{1}{n!} \sum_{j=0}^n \binom{n}{j} (t-t_0)^{n-j} (y-y_0)^j \frac{\partial^n f}{\partial t^{n-j}\partial y^j}(t_0,y_0)\right] \end{aligned} \]
(cont’d) \[ \begin{aligned} R_n(t,y) &= \frac{1}{(n+1)!} \sum_{j=0}^{n+1} \binom{n+1}{j} (t-t_0)^{n+1-j} (y-y_0)^j \cdot \\ &\cdot\frac{\partial^{n+1} f}{\partial t^{n+1-j}\partial y^j}(\xi,\mu) \end{aligned} \] \(P_n(t,y)\) is the \(n\)th Taylor polynomial in two variables.
\[ \begin{aligned} w_0 &= \alpha, \\ w_{i+1} &= w_i + hf\left(t+\frac{h}{2}, w_i+\frac{h}{2}f(t_i,w_i)\right),\qquad i=0,1,\ldots,N-1 \end{aligned} \] Local truncation error of order two.
\[ \begin{aligned} w_0 &= \alpha \\ k_1 &= hf(t_i,w_i) \\ k_2 &= hf\left(t_i+\frac{h}{2},w_i+\frac{1}{2}k_1\right) \\ k_3 &=hf\left(t_i+\frac{h}{2},w_i+\frac{1}{2}k_2\right) \\ k_4 &= hf(t_{i+1},w_i+k_3) \\ w_{i+1} &= w_i +\frac{1}{6}(k_1+2k_2+2k_3+k_4) \end{aligned} \] Local truncation error \(O(h^4)\)
function [t, w] = rk4(f, a, b, alpha, N)
% Solve ODE y'(t) = f(t, y(t)) using Runge-Kutta 4.
h = (b-a) / N;
t = (a:h:b)';
w = zeros(N+1, length(alpha));
w(1,:) = alpha(:)';
for i = 1:N
k1 = h*f(t(i), w(i,:));
k2 = h*f(t(i) + h/2, w(i,:) + k1/2);
k3 = h*f(t(i) + h/2, w(i,:) + k2/2);
k4 = h*f(t(i) + h, w(i,:) + k3);
w(i+1,:) = w(i,:) + (k1 + 2*k2 + 2*k3 + k4)/6;
end
An \(m\)-step multistep method for solving the initial-value problem \[ \begin{aligned} y'=f(t,y),\quad a\le t \le b,\quad y(a)=\alpha, \end{aligned} \] has a difference equation for approximate \(w_{i+1}\) at \(t_{i+1}\): \[ \begin{aligned} w_{i+1} &= a_{m-1}w_i + a_{m-2}w_{i-1} + \cdots + a_0w_{i+1-m} \\ &+ h[b_m f(t_{i+1},w_{i+1}) + b_{m-1} f(t_i,w_i) + \cdots \\ &+ b_0 f(t_{i+1-m},w_{i+1-m})], \end{aligned} \] where \(h=(b-a)/N\), and starting values are specified: \[ \begin{aligned} w_0=\alpha,\quad w_1=\alpha_1,\quad \ldots,\quad w_{m-1}=\alpha_{m-1} \end{aligned} \] Explicit method if \(b_m=0\), implicit method if \(b_m\ne 0\).
\[ \begin{aligned} w_0 &= \alpha, \quad w_1 = \alpha_1, \quad w_2=\alpha_2, \quad w_3=\alpha_3, \\ w_{i+1} &= w_i + \frac{h}{24}[55 f(t_i,w_i) - 59 f(t_{i-1},w_{i-1}) \\ & \qquad\qquad\ \ \ +37 f(t_{i-2},w_{i-2}) - 9 f(t_{i-3},w_{i-3})] \end{aligned} \]
\[ \begin{aligned} w_0 &= \alpha, \quad w_1 = \alpha_1, \quad w_2=\alpha_2, \\ w_{i+1} &= w_i + \frac{h}{24}[9 f(t_{i+1},w_{i+1}) + 19 f(t_i,w_i) \\ & \qquad\qquad\ \ \ -5 f(t_{i-1},w_{i-1}) + f(t_{i-2},w_{i-2})] \end{aligned} \]
Integrate the initial-value problem \[ \begin{aligned} y'=f(t,y),\quad a\le t \le b,\quad y(a)=\alpha \end{aligned} \] over \([t_i,t_{i+1}]\): \[ \begin{aligned} y(t_{i+1}) = y(t_i) + \int_{t_i}^{t_{i+1}} f(t,y(t))\,dt \end{aligned} \] Replace \(f\) by polynomial \(P(t)\) interpolating \((t_0,w_0),\ldots,(t_i,w_i)\), and approximate \(y(t_i)\approx w_i\): \[ \begin{aligned} y(t_{i+1}) \approx w_i + \int_{t_i}^{t_{i+1}} P(t)\,dt \end{aligned} \]
Adams-Bashforth explicit \(m\)-step: Newton backward-difference polynomial through \((t_i,f(t_i,y(t_i))),\ldots,(t_{i+1-m},f(t_{i+1-m},y(t_{i+1-m})))\). \[ \begin{aligned} \int_{t_i}^{t_{i+1}} f(t,y(t))\,dt &\approx \int_{t_i}^{t_{i+1}} \sum_{k=0}^{m-1} (-1)^k \binom{-s}{k} \nabla^k f(t_i,y(t_i))\,dt \\ &=\sum_{k=0}^{m-1} \nabla^k f(t_i,y(t_i)) h (-1)^k \int_0^1 \binom{-s}{k}\,ds \end{aligned} \]
\[ \begin{array}{c|cccccc} k & 0 & 1 & 2 & 3 & 4 & 5 \\ \hline (-1)^k\int_0^1 \binom{-s}{k}\,ds & 1 & \frac12 & \frac{5}{12} & \frac{3}{8} & \frac{251}{720} & \frac{95}{288} \end{array} \]
The method is: \[ \begin{aligned} w_0 &= \alpha,\quad w_1=\alpha_1, \quad w_2=\alpha_2, \\ w_{i+1} &= w_i + \frac{h}{12} [ 23 f(t_i,w_i) -16 f(t_{i-1},w_{i-1}) +5 f(t_{i-2},w_{i-2})] \end{aligned} \]
If \(y(t)\) solves \[ \begin{aligned} y'=f(t,y),\quad a\le t\le b,\quad y(a)=\alpha, \end{aligned} \] and \[ \begin{aligned} w_{i+1} =& a_{m-1}w_i + \cdots + a_0 w_{i+1-m} \\ & + h[b_m f(t_{i+1},w_{i+1}) + \cdots + b_0 f(t_{i+1-m},w_{i+1-m})], \end{aligned} \] the local truncation error is \[ \begin{aligned} \tau_{i+1}(h) =& \frac{y(t_{i+1})-a_{m-1}y(t_i) - \cdots - a_0 y(t_{i+1-m})} {h} \\ & - [b_m f(t_{i+1},y(t_{i+1})) + \cdots + b_0 f(t_{i+1-m},y(t_{i+1-m}))]. \end{aligned} \]
An \(m\)th-order system of first-order initial-value problems has the form \[ \begin{aligned} \frac{du_1}{dt}(t) &= f_1(t,u_1,u_2,\ldots,u_m), \\ \frac{du_2}{dt}(t) &= f_2(t,u_1,u_2,\ldots,u_m), \\ & \vdots \\ \frac{du_m}{dt}(t) &= f_m(t,u_1,u_2,\ldots,u_m), \end{aligned} \] for \(a\le t \le b\), with the initial conditions \[ \begin{aligned} u_1(a)=\alpha_1, u_2(a)=\alpha_2,\ldots,u_m(a)=\alpha_m. \end{aligned} \]
The function \(f(t,y_1,\ldots,y_m)\), defined on the set \[ \begin{aligned} D=\{(t,u_1,\ldots,u_m)\ |\ a\le t \le b, -\infty<u_i<\infty, i=1,2,\ldots,m\} \end{aligned} \] is said to satisfy a Lipschitz condition on \(D\) in the variables \(u_1,u_2,\ldots,u_m\) if a constant \(L>0\) exists with \[ \begin{aligned} |f(t,u_1,\ldots,u_m)-f(t,z_1,\ldots,z_m)| \le L\sum_{j=1}^m |u_j-z_j|, \end{aligned} \] for all \((t,u_1,\ldots,u_m)\) and \((t,z_1,\ldots,z_m)\) in \(D\).
Suppose \[ \begin{aligned} D=\{(t,u_1,\ldots,u_m)\ |\ a\le t \le b, -\infty<u_i<\infty, i=1,2,\ldots,m\} \end{aligned} \] and let \(f_i(t,u_1,\ldots,u_m)\), for each \(i=1,2,\ldots,m\), be continuous on \(D\) and satisfy a Lipschitz condition there. The system of first-order differential equations \[ \begin{aligned} \frac{du_k}{dt}(t) = f_k(t,u_1,\ldots,u_m),\quad u_k(a)=\alpha_k,\quad k=1,\ldots,m \end{aligned} \] has a unique solution \(u_1(t),\ldots,u_m(t)\) for \(a\le t \le b\).
Numerical methods for systems of first-order differential equations are vector-valued generalizations of methods for single equations.
\[ \begin{aligned} \mathbf{w}_0 &= \mathbf{\alpha} \\ \mathbf{k}_1 &= h \mathbf{f}(t_i,\mathbf{w}_i) \\ \mathbf{k}_2 &= h \mathbf{f}(t_i+\frac{h}{2},\mathbf{w}_i+\frac12 \mathbf{k}_1) \\ \mathbf{k}_3 &= h \mathbf{f}(t_i+\frac{h}{2},\mathbf{w}_i+\frac12 \mathbf{k}_2) \\ \mathbf{k}_4 &= h \mathbf{f}(t_{i+1},\mathbf{w}_i+\mathbf{k}_3) \\ \mathbf{w}_{i+1} &= \mathbf{w}_i + \frac16 (\mathbf{k}_1 + 2\mathbf{k}_2 + 2\mathbf{k}_3 + \mathbf{k}_4) \end{aligned} \] where \(\mathbf{w}_i=(w_{i,1},\ldots,w_{i,m})\) is the vector of unknowns.
A one-step difference-equation with local truncation error \(\tau_i(h)\) is said to be consistent if \[ \begin{aligned} \lim_{h\rightarrow 0} \max_{1\le i \le N} |\tau_i(h)| = 0 \end{aligned} \]
A one-step difference equation is said to be convergent if \[ \begin{aligned} \lim_{h\rightarrow 0} \max_{1\le i \le N} | w_i - y(t_i) | = 0, \end{aligned} \] where \(y_i=y(t_i)\) is the exact solution and \(w_i\) the approximation.
Suppose the initial-value problem \(y'=f(t,y)\), \(a\le t \le b\), \(\quad y(a)=\alpha\) is approximated by a one-step difference method in the form \(w_0=\alpha\), \(w_{i+1}=w_i + h \phi(t_i,w_i,h)\). Suppose also that \(h_0>0\) exists and \(\phi(t,w,h)\) is continuous with a Lipschitz condition in \(w\) with constant \(L\) on \(D\), then: \[ \begin{aligned} D=\{(t,w,h)\ |\ a\le t \le b, -\infty<w<\infty, 0\le h\le h_0 \}. \end{aligned} \]
Let \(\lambda_1,\ldots,\lambda_m\) denote the roots of the characteristic equation \[ \begin{aligned} P(\lambda) = \lambda^m - a_{m-1}\lambda^{m-1} - \cdots - a_1\lambda - a_0 = 0 \end{aligned} \] associated with the multistep method \[ \begin{aligned} w_{i+1} =& a_{m-1}w_i + a_{m-2}w_{i-1} + \cdots + a_0 w_{i+1-m} \\ &+ hF(t_i,h,w_{i+1},w_i,\ldots,w_{i+1-m}). \end{aligned} \] If \(|\lambda_i|\le 1\) and all roots with absolute value 1 are simple, the method is said to satisfy the root condition.
A multistep method \[ \begin{aligned} w_{i+1}=&a_{m-1}w_i + a_{m-2}w_{i-1} + \cdots + a_0 w_{i+1-m} \\ &+h F(t_i,h,w_{i+1},w_i,\ldots,w_{i+1-m}) \end{aligned} \] is stable if and and only if it satisfies the root condition. If it is also consistent, then it is stable if and only if it is convergent.
Apply a multistep method to the test equation: \[ \begin{aligned} w_{j+1} =& a_{m-1}w_j + \cdots + a_0 w_{j+1-m} \\ &+h\lambda(b_mw_{j+1} + b_{m-1} w_j + \cdots + b_0 w_{j+1-m}) \end{aligned} \] or \[ \begin{aligned} (1-h\lambda b_m)w_{j+1} - (a_{m-1}+h\lambda b_{m-1}) w_j - \cdots - (a_0 + h\lambda b_0) w_{j+1-m} = 0 \end{aligned} \] Let \(\beta_1,\ldots,\beta_m\) be the zeros of the characteristic polynomial \[ \begin{aligned} Q(z,h\lambda) = (1-h\lambda b_m)z^m - (a_{m-1}+h\lambda b_{m-1}) z^{m-1} -\cdots - (a_0+h\lambda b_0) \end{aligned} \] Then \(c_1,\ldots,c_m\) exist with \[ \begin{aligned} w_j = \sum_{k=1}^m c_k (\beta_k)^j \end{aligned} \] and \(|\beta_k|<1\) is required for stability.
The region \(R\) of absolute stability for a one-step method is \(R=\{ h\lambda\in\mathcal{C}\ | \ |Q(h\lambda)|<1\}\), and for a multistep method, it is \(R= \{h\lambda\in\mathcal{C}\ |\ |\beta_k|<1,\text{ for all zeros }\beta_k\text{ of }Q(z,h\lambda)\}\).
A numerical method is said to be A-stable if its region \(R\) of absolute stability contains the entire left half-plane.