8
Solving Ordinary Differential Equations
Differential equations constitute one of the most powerful mathematical tools to
understand and predict the behavior of dynamical systems in nature, engineering,
and society. A dynamical system is some system with some state, usually expressed
by a set of variables, that evolves in time. For example, an oscillating pendulum,
the spreading of a disease, and the weather are examples of dynamical systems. We
can use basic laws of physics, or plain intuition, to express mathematical rules that
govern the evolution of a system in time. These rules take the form of differential
equations.
You are probably well experienced with equations, at least equations like ax +
b = 0 and ax 2 + bx + c = 0, where a, b and c are constants. Such equations
are known as algebraic equations, and the unknowns are numbers. In a differential
equation, the unknown is a function, and a differential equation will usually involve
this function and one or more of its derivatives. When this function depends on a
single independent variable, the equation is called an ordinary differential equation
(ODE, plural: ODEs), which is different from a partial differential equation (PDE,
plural: PDEs), in which the function depends on several independent variables
(Chap. 9). As an example, f (x) = f (x) is a simple ODE (asking if there is
any function f such that it equals its derivative—you might remember that e x
© The Author(s) 2020
S. Linge, H. P. Langtangen, Programming for Computations - Python,
Texts in Computational Science and Engineering 15,
https://doi.org/10.1007/978-3-030-16877-3_8
203
Solving Ordinary Differential Equations
Differential equations constitute one of the most powerful mathematical tools to
understand and predict the behavior of dynamical systems in nature, engineering,
and society. A dynamical system is some system with some state, usually expressed
by a set of variables, that evolves in time. For example, an oscillating pendulum,
the spreading of a disease, and the weather are examples of dynamical systems. We
can use basic laws of physics, or plain intuition, to express mathematical rules that
govern the evolution of a system in time. These rules take the form of differential
equations.
You are probably well experienced with equations, at least equations like ax +
b = 0 and ax 2 + bx + c = 0, where a, b and c are constants. Such equations
are known as algebraic equations, and the unknowns are numbers. In a differential
equation, the unknown is a function, and a differential equation will usually involve
this function and one or more of its derivatives. When this function depends on a
single independent variable, the equation is called an ordinary differential equation
(ODE, plural: ODEs), which is different from a partial differential equation (PDE,
plural: PDEs), in which the function depends on several independent variables
(Chap. 9). As an example, f (x) = f (x) is a simple ODE (asking if there is
any function f such that it equals its derivative—you might remember that e x
© The Author(s) 2020
S. Linge, H. P. Langtangen, Programming for Computations - Python,
Texts in Computational Science and Engineering 15,
https://doi.org/10.1007/978-3-030-16877-3_8
203
