*This notebook contains an excerpt from the Python Programming and Numerical Methods - A Guide for Engineers and Scientists, the content is also available at Berkeley Python Numerical Methods.*

*The copyright of the book belongs to Elsevier. We also have this interactive book online for a better learning experience. The code is released under the MIT license. If you find this content useful, please consider supporting the work on Elsevier or Amazon!*

< 22.1 ODE Initial Value Problem Statement | Contents | 22.3 The Euler Method >

# Reduction of Order¶

Many numerical methods for solving initial value problems are designed specifically to solve first-order differential equations. To make these solvers useful for solving higher order differential equations, we must often **reduce the order** of the differential equation to first order. To reduce the order of a differential equation, consider a vector, \(S(t)\), which is the **state** of the system as a function of time. In general, the state of a system is a collection of all the dependent variables that are relevant to the behavior of the system. Recalling that the ODEs of interest in this book can be expressed as

for initial value problems, it is useful to take the state to be

Then the derivative of the state is

where \(S_i(t)\) is the \(i^{\mathrm{th}}\) element of \(S(t)\). With the state written in this way, \(\frac{dS(t)}{dt}\) can be written using only \(S(t)\) (i.e., no \(f(t)\)) or its derivatives. In particular, \(\frac{dS(t)}{dt} = {\mathcal{F}}(t,S(t))\), where \({\mathcal{F}}\) is a function that appropriately assembles the vector describing the derivative of the state. This equation is in the form of a first-order differential equation in \(S\). Essentially, what we have done is turn an \(n^{\mathrm{th}}\) order ODE into \(n\) first order ODEs that are **coupled** together, meaning they share the same terms.

**TRY IT!** Reduce the second order pendulum equation to first order, where

Taking the derivative of \(S(t)\) and substituting gives the correct expression.

It happens that this ODE can be written in matrix form:

ODEs that can be written in this way are said to be **linear ODEs**.

Although reducing the order of an ODE to first order results in an ODE with multiple variables, all the derivatives are still taken with respect to the same independent variable, \(t\). Therefore, the ordinariness of the differential equation is retained.

It is worth noting that the state can hold multiple dependent variables and their derivatives as long as the derivatives are with respect to the same independent variable.

**TRY IT!** A very simple model to describe the change in population of rabbits, \(r(t)\), and wolves, \(w(t)\), might be

and

The first ODE says that at each time step, the rabbit population multiplies by 4, but each wolf eats two of the rabbits. The second ODE says that at each time step, the population of wolves increases by the number of rabbits and wolves in the system. Write this system of differential equations as an equivalent differential equation in \(S(t)\) where

The following first-order ODE is equivalent to the pair of ODEs.

< 22.1 ODE Initial Value Problem Statement | Contents | 22.3 The Euler Method >