# 1.2 Discretizing ODEs

## 1.2.2 An example of first order ODE

Ordinary differential equations (ODEs) occur throughout science and engineering.

## Free Fall Example

A model for the velocity $$u(t)$$ of a spherical object falling freely through the atmosphere can be derived by applying Newton's Law. Specifically,

 $m_ p u_ t = m_ p g - D(u) \label{equ:freefall}$ (1.4)

where $$m_ p$$ is the mass of the particle, $$g$$ is the gravity, $$D$$ is the aerodynamic drag acting on the particle, and $$u_ t$$ denotes the derivative of $$u(t)$$ with respect to time $$t$$. For low speeds, this drag can be modeled as (recall Unified fluids),

 $$\displaystyle D$$ $$\displaystyle =$$ $$\displaystyle \frac{1}{2}\rho _ g \pi a^2 u^2 C_ D(Re) \label{equ:freefall_ drag}$$ (1.5) $$\displaystyle Re$$ $$\displaystyle =$$ $$\displaystyle \frac{2 \rho _ g u a}{\mu _ g} \label{equ:freefall_ Re}$$ (1.6) $$\displaystyle C_ D$$ $$\displaystyle =$$ $$\displaystyle \frac{24}{Re} + \frac{6}{1 + \sqrt {Re}} + 0.4 \label{equ:freefall_ CD}$$ (1.7)

where $$\rho _ g$$ and $$\mu _ g$$ are the density and dynamic viscosity of the atmosphere, $$a$$ is the sphere radius, $$Re$$ is the Reynolds number for the sphere, and $$C_ D$$ is the drag coefficient. To complete the problem specification, an initial condition is required on the velocity. For example, at time $$t=0$$, let $$u(0) = u_0$$. By solving Equation 1.4 with this initial condition, the velocity at any time $$u(t)$$ can be found.

## General ODEs

A general ODE is typically written in the form,

 $u_ t(t) = f(u(t),t), \label{equ:ODE_ nonlinear}$ (1.8)

where $$f(u(t),t)$$ is the forcing function that results in the evolution of $$u(t)$$ in time. When $$f(u(t),t)$$ depends on $$u(t)$$ in a nonlinear manner, then the ODE is called a nonlinear ODE. Note that in these notes, where clarity permits, we will omit the arguments of functions.

For the example defined by Equation 1.4, the forcing function is,

 $f(u,t) = g - \frac{1}{m_ p} D(u)$ (1.9)

From the definition of $$D(u)$$, $$f(u,t)$$ is nonlinear in $$u$$. Note also that in this example, $$f$$ does not depend on $$t$$ directly, rather $$f(u(t),t) = f(u(t))$$.

## Linear ODEs

Although the use of numerical integration is most important for nonlinear ODE's (since analytic solutions rarely exist), the study of numerical methods applied to linear ODE's is often quite helpful in understanding the behavior for nonlinear problems. The general form for a single, linear ODE, is

 $u_ t = \lambda (t) u(t) + g(t), \label{equ:ODE_ linear}$ (1.10)

where $$\lambda (t)$$ is independent of $$u$$. When $$\lambda (t)$$ is a constant, the ODE is referred to as a linear ODE with constant coefficients.

In many situations, the linear ODE is derived by linearizing a nonlinear ODE about a constant state. Specifically, define the dependent state $$u(t)$$ as a sum of $$u_0$$ and a perturbation, $$\tilde{u}(t)$$,

 $u(t) = u_0 + \tilde{u}(t). \label{equ:perturbation}$ (1.11)

A linearized equation for the evolution of $$\tilde{u}(t)$$ can be derived by substitution of this into Equation 1.8:

 $$\displaystyle u_ t$$ $$\displaystyle =$$ $$\displaystyle f(u(t),t),$$ (1.12) $$\displaystyle \tilde{u}_ t$$ $$\displaystyle =$$ $$\displaystyle f(u_0 + \tilde{u}(t),t)$$ (1.13) $$\displaystyle \tilde{u}_ t$$ $$\displaystyle =$$ $$\displaystyle f(u_0, 0) + \left.\frac{\partial f}{\partial u}\right|_{u_0,0}\tilde{u}(t) + \left.\frac{\partial f}{\partial t}\right|_{u_0,0}t + O(t^2, \tilde{u} t, \tilde{u}^2).$$ (1.14)

Note that the last equation is obtained using Taylor series. Thus, when $$t$$ and $$\tilde{u}$$ are small, the perturbation satisfies the linear equation,

 $\tilde{u}_ t \approx f(u_0, 0) + \left.\frac{\partial f}{\partial u}\right|_{u_0,0}\tilde{u}(t) + \left.\frac{\partial f}{\partial t}\right|_{u_0,0}t \label{equ:ODE_ linearized}$ (1.15)

Comparing Equation 1.10 to 1.15, we see that in this example,

 $$\displaystyle \lambda (t)$$ $$\displaystyle =$$ $$\displaystyle \left.\frac{\partial f}{\partial u}\right|_{u_0,0},$$ (1.16) $$\displaystyle g(t)$$ $$\displaystyle =$$ $$\displaystyle f(u_0, 0) + \left.\frac{\partial f}{\partial t}\right|_{u_0,0}t$$ (1.17)

For the falling sphere problem, a linear ODE can be derived by linearizing about the initial velocity $$u_0$$. As shown above, this requires the calculation of $${\partial f}/{\partial u}$$ and $${\partial f}/{\partial t}$$. For the sphere,

 $\frac{\partial f}{\partial u} = \frac{\partial }{\partial u}\left[ g - \frac{1}{m_ p} D(u(t))\right] = -\frac{1}{m_ p}\frac{\partial D}{\partial u}$ (1.18)

The value of $${\partial D}/{\partial u}$$ is

 $$\displaystyle \frac{\partial D}{\partial u}$$ $$\displaystyle =$$ $$\displaystyle \frac{\partial }{\partial u}\left[ \frac{1}{2}\rho _ g \pi a^2 u^2 C_ D(Re) \right],$$ (1.19) $$\displaystyle =$$ $$\displaystyle \rho _ g \pi a^2 u C_ D(Re) + \frac{1}{2}\rho _ g \pi a^2 u^2 \frac{\partial C_ D}{\partial Re}\frac{\partial Re}{\partial u},$$ (1.20)

and $${\partial C_ D}/{\partial Re}$$ and $${\partial Re}/{\partial u}$$ can be found from their definitions. Also, since $$f$$ does not directly depend on $$t$$ for this problem, $${\partial f}/{\partial t} = 0.$$