Systems of differential equations 1
Linear Systems
YouTube lecture recording from October 2020
The following YouTube video was recorded for the 2020 iteration of the course.
The material is still very similar:
Our aim is to solve systems of equations of the form:
for .
Let us first consider the simplest form: a linear system
Motivation
- Lotka-Volterra (predator-prey)
- SIR model (epidemics)
In order to understand these systems, we must first understand coupled linear systems.
Recap of eigenvalues
import sympy as sp A = sp.Matrix([[1, 1],[2, 0]]) A.eigenvals()
Recap of eigenvectors
A.eigenvects()
Recap of diagonalisation
Recall that, for a matrix with eigenvectors and , and eigenvalues and , we can write a matrix of eigenvectors: . Then:
(This is also true for general matrices.)
In our example,
Coupled ODEs
For coupled system of first order linear differential equations of the form
we have three methods of analysing them mathematically:
- Turn them into one second order equation (if we can solve second order!)
- Divide one by other, to get one equation independent of
- Perform matrix diagonalisation (extends to problems)
Example
Solve
Subject to
Method 1: Second order
We start with:
We can convert that into a second order equation:
Method 2: eliminate
We start with:
Then, dividing:
Method 3: diagonalisation
Let
then
where
Substitute
then
or
We can now introduce a new variable so that:
But now, because the matrix is diagonal, the system is no longer coupled.
The first equation only involves and the second only involves , so we can solve each one individually:
>
Finally, we can substitute and back in terms of and to find the solution to the original coupled system:
We have
Rearranging, we now have two equations relating and :
>
where and . Using our initial conditions, and we find and .
Finally, solving the simultaneous equations, we have a solution:
>
Summary
- Three methods to analytically solve systems of linear first order ODEs
- Best method depends on the system and what you need to ask about it
Introductory problems
Introductory problems 1
Find the general solution to the following system of ODEs:
Sketch the form of the solution in the plane, using arrows to indicate where the solution moves over time.
Introductory problems 2
Take the general decoupled linear system
- Integrate the two equations separately to solve for and in terms of .
- If you start at , , what happens to the solution over time?
- If you start at a general position , what happens to the solution as ?
- What if and are both negative?
- What if only one of or is negative? What if either or is negative?
- Either by eliminating from the original equations or by eliminating from your solutions to part 1., find a general solution of the system. (Why not try both methods?)
- Sketch this solution for
- .
Main problems
Main problems 1
By reformulating the following system as one first order equation (i.e eliminating ), find the general solution to:
Sketch the form of the solutions in the plane.
Main problems 2
Again by eliminating and reformulating the system as one first order equation, find the general solution to the following system of ODEs:
Sketch the form of the solutions in the plane.
Main problems 3
Find the eigenvalues and two independent eigenvectors and of the matrix
.
- Put the vectors and as the columns of a matrix . Find and show (by calculation) that is diagonal. What are the entries of this matrix? What do they correspond to?
- Find the general solution of the system .
- Find the particular solution subject to and .
- Sketch the trajectory (the coordinates over time) in the plane.
- Draw the eigenvectors and on the same figure.
- What happens as ?
- What about ?
- What is at a general point on the -axis?
Extension problems
Extension problems 1
The force on a damped harmonic oscillator is , where is a displacement, is a spring force constant, is the mass and is the strength of the damping.
- Use Newton's 2nd law of motion to write down an equation for the acceleration .
- Make the substitution to obtain a system of two first-order linear ODEs.