“Since Newton, mankind has come to realise that the laws of physics are always expressed in the language of differential equations” – Steven Strogatz

In this section of the course we will learn how to solve ordinary differential equations. These are of vital importance to a physicist as they are at the base of classical and celestial mechanics via Newton’s equations. They are also used to model electrical circuits and radioactive decay, amongst other systems.

Broadly speaking, there are three ways to solve a differential equation: analytically, numerically (with a pre-existing function) or numerically (with a home-made function). Numerical approaches offer more flexibility but with the caveat that they are approximate and must be converged.

In this lesson we will use numerical approaches to solve ODE’s, with a strong focus on home-made numerical functions (rather than pre-made functions imported from a library). As such we will achieve a greater understanding of the underlying mathematics and approximations used - and it’s a great chance to practice our Python skills.

Before you begin

Please see the Setup page for more details.

Lesson outline

Topic Objective Quick test
Classifying differential equations What is the difference between an ODE and PDE?
How do I classify the different types of differential equations?
:ticket:
Radioactive decay How can I describe radioactive decay using a first-order ODE?
What are initial conditions and why are they important?
:trolleybus:
Euler’s method How do I use Euler’s method to solve a first-order ODE?
What does the term first-order accurate mean?
:blue_car:
The strange attractor How do I solve differential equations with more than one variable? :truck:
Runge-Kutta method How do I use the Runge-Kutta method for more accurate solutions?
What do the terms first-order accurate and second-order accurate mean?
:red_car:

Course resources

External resources

youtube: https://youtu.be/p_di4Zn4wz4

youtube: https://youtu.be/3d6DsjIBzJ4