Uploaded by Voyage

Differential Equations: Introduction & Modeling

advertisement
Maths 260: Differential Equations
Today’s topic: Introduction to differential equations
◮ Reading for this lecture: Textbook (BDH) Section 1.1
◮ Suggested exercises: BDH Section 1.1
◮ Reading for next lecture: BDH Section 1.2
1/8
Differential Equations
◮ A differential equation relates a quantity, or function, to its
derivative(s).
2/8
Solutions to Differential Equations
A solution of a DE is any function that, when substituted for y in
the DE, satisfies the DE for all t.
A differential equation may have more than one solution.
3/8
Modelling with DEs
◮ Using knowledge about how a quantity changes to write down
a differential equation (or DE) is called modelling, and a DE
is a mathematical model.
◮ The goal of modelling is to use the DE model to predict
future values of the quantity being modelled.
4/8
Example 1: Single population, unlimited growth
Assumptions:
Population grows at a rate proportional to the size of the
population
Relevant quantities:
t = time
P
= size of population
k = proportionality constant
Model:
dP
= k P,
dt
for k > 0
5/8
Example 2: Single population, limited growth
Assumptions:
◮ If the population is small, the population grows at a rate
proportional to the size of the population
◮ If the population is too large, the population will decrease
Relevant quantities:
t = time
P
= size of population
k = growth rate coefficient for small population
N = maximum size of population before growth negative
Model?
6/8
Example 2: continued
Model:
dP
= k P × (something)
dt
‘something’ ≈ 1 if P is small and ‘something’ < 0 if P > N
For example:
dP
=kP
dt
P
1−
N
,
for k > 0 and N > 0
7/8
Important ideas from today:
◮ Many phenomena in the real world can be modelled with
differential equations. Maths 260 looks at methods for finding
out about solutions to these equations.
◮ We will use analytic, qualitative and numerical methods for
getting information about solutions to differential equations.
The main skill you will learn is how to pick and use
appropriate methods for each differential equation.
8/8
Maths 260: Differential Equations
Lecture 2: Separable differential equations,
Initial value problems
I Reading for this lecture: BDH Section 1.2
I Suggested exercises: BDH Section 1.2, #1, 3, 7, 15, 25
Revise integration by parts
I Reading for next lecture: BDH Sections 1.3 and 1.4
1 / 14
Example from last time
In the last lecture we saw a population model of the following form:
dP
P
=kP 1−
, for k > 0 and N > 0
dt
N
where
t = time
P = size of population
k = growth rate coefficient for small population
N = maximum size of population before growth negative
2 / 14
Some definitions
A DE is first order if it contains only first derivatives (not higher
derivatives).
A first order DE is said to be in standard form when it is written
as
dy
= f (t, y )
dt
where
I t is the independent variable, i.e., it does not depend on any
other variable.
I y is the dependent variable, i.e, it is a function of the
independent variable t. We write y (t).
I f is a function of two variables, t and y .
Exercise: What are the dependent and independent variables of
the population model we saw earlier?
3 / 14
Separable Equations
Calculating explicit solutions to a differential equation can be
difficult or even impossible, but there are some special cases where
we can apply a general method. Separable equations are one such
case.
A differential equation
dy
= f (t, y )
dt
is called separable if the function f can be written as
f (t, y ) = g (t) h(y )
for some functions g and h.
4 / 14
Solving Separable Equations
If h(y ) 6= 0, we can divide by h(y ) and the DE becomes:
1 dy
dy
= g (t) h(y ) ⇐⇒
= g (t),
dt
h(y ) dt
i.e.,
1
dy
= g (t)
h(y (t)) dt
Integrate with respect to t, if possible:
Z
Z
1
dy
dt = g (t) dt
h(y (t)) dt
By the chain rule, dy =
Z
1
dy =
h(y )
dy
dt, so
dt
Z
g (t) dt
If we can do these integrals we can get an expression for y (t), the
solution to the DE.
5 / 14
Example 1
Find solutions to the DE
dy
= t 3y
dt
6 / 14
Note that y (t) = 0 is a solution to the DE in Example 3 but is not
found by the method of separating variables because we assumed
that h(y ) = y 6= 0 at the beginning of the calculation.
We call such a solution a missing solution, because it is missing
from the family of solutions we find by separation of variables.
7 / 14
The following plot shows some of the family of solutions found by
separation of variables as well as the missing solution for this
example.
8 / 14
Example 2
dP
=kP
dt
P
1−
N
9 / 14
Example 2, continued
We find
P
= Ae kt
1 − P/N
where A is a non-zero constant. We can solve this in order to find
an explicit expression for P.
Are there any missing solutions?
10 / 14
Example 2, continued
We have found many solutions to our population model. But for a
real-life application like this, we need to know which solution to
choose!
11 / 14
Initial Value Problems
I An initial condition tells us the value of a solution to the DE
at a particular value of the independent variable.
I A DE with an initial condition is called an initial value
problem or IVP.
Example: Consider the initial value problem (IVP)
dy
2
= te t + 3,
dt
y (0) = −1.
The function
1 2
φg (t) = e t + 3t + c
2
is a solution to the differential equation for all values of c. What
choice of c satisfies the initial condition φg (0) = −1?
12 / 14
Example 2 as an Initial Value Problem
Suppose that N=1000, and that at t = 0, there are 500 animals.
What behaviour for this population of animals over time is
predicted by the model that we used earlier?
13 / 14
Important ideas from today:
I Independent and dependent variables.
I Separable equations.
I How to check for missing solutions.
I Initial value problems.
14 / 14
Maths 260: Differential Equations
Lecture 3: Slope fields, Euler’s method
Comparison of methods seen so far
I Reading for this lecture: BDH Sections 1.3 and 1.4
I Suggested exercises: BDH Section 1.3, #11, 13, 16
BDH Section 1.4, #7
I Reading for next lecture: BDH Section 1.5
1 / 17
Slope Fields – a method for qualitative analysis of DEs
Slope fields help us visualise the graph of a solution to a DE
without needing to find a formula for the solution first.
Assume y (t) is a solution to
dy
= f (t, y ).
dt
Then at the point t = t1 , y (t1 ) = y1 , the derivative is
dy
= f (t1 , y1 ),
dt
i.e., the slope of the solution at this point is f (t1 , y1 ).
We use this result to draw a slope field, which helps us sketch
solutions to the DE.
2 / 17
Drawing a slope field
1. For selected points in the (t, y )-plane (say at all points on an
evenly spaced grid) calculate f (t, y ).
2. For each point (t1 , y1 ) selected in Step 1, draw a short line
segment of slope f (t1 , y1 ) centred at the point (t1 , y1 ).
The resulting picture is called a slope field for the DE.
3 / 17
Example 1
Use the grid to draw the slope field for the DE
dy
=y −t
dt
1.5
1
0.5
0
ï0.5
ï1
ï1.5
ï1.5
ï1
ï0.5
0
0.5
1
1.5
4 / 17
Example 2
Draw the slope field for the DE
dy
= −y t
dt
3
2
1
0
ï1
ï2
ï3
ï3
ï2
ï1
0
1
2
3
5 / 17
Sketching solutions using the slope field
To sketch a solution to the IVP
dy
= f (t, y ),
dt
y (t0 ) = y0
1. For selected points in the (t, y )-plane calculate f (t, y ).
2. For each selected point (t1 , y1 ), draw a short line segment of
slope f (t1 , y1 ) centred at the point (t1 , y1 ).
3. Starting at the point (t0 , y0 ) draw a curve that follows the
slope field.
6 / 17
Example 3
Below is a slope field for the DE
dy
= t sin t
dt
Sketch solutions to this DE satisfying: (a) y (1) = 0
(b) y (0) = −1
7 / 17
Example 4
Below is a slope field for the DE
dy
=yt
dt
Sketch solutions to this DE satisfying: (a) y (1) = 0
(b) y (0) = −1
8 / 17
Two special cases: Case 1
dy
= f (t)
dt
the slope marks on each line of fixed t are parallel.
For differential equations of the form
Example 5:
dy
= cos t
dt
Graphs of different solutions are vertical translations of each other.
9 / 17
Two special cases: Case 2
dy
= f (y )
dt
the slope marks on each line of fixed y are parallel.
For differential equations of the form
Example 6:
dy
= cos y
dt
The horizontal translation of a solution curve is also a solution.
10 / 17
Euler’s method – a numerical method for analysis of DEs
We can obtain numbers and graphs that approximate solutions to
IVPs using a class of techniques called numerical methods.
Euler’s method is the simplest numerical method.
Main idea of Euler’s method: For the IVP
dy
= f (t, y ),
dt
y (t0 ) = y0
start at (t0 , y0 ) and take small steps, with the direction of each
step being the direction of the slope field at the start of that step.
11 / 17
Euler’s method — graphical illustration
12 / 17
More formally, given (t0 , y0 ) and a step size, h, we want to
calculate an approximation to y (t1 ), y (t2 ), y (t3 ), etc., where
t1 = t0 + h,
t2 = t1 + h = t0 + 2h, and so on.
The slope at (t0 , y0 ) is f (t0 , y0 ) so
y (t1 ) ≈ y1
y (t2 ) ≈ y2
..
.
= y0 + h f (t0 , y0 ),
= y1 + h f (t1 , y1 ),
y (tk+1 ) ≈ yk+1 = yk + h f (tk , yk )
for k = 0, 1, . . . , n.
13 / 17
Example 5
Use Euler’s method to approximate the solution of
dy
= y − 2t,
dt
y (0) = 1
at t = 0.5, t = 1.0, t = 1.5 and t = 2.0
Solution:
14 / 17
Example 5 continued
Compare your working with the solution sketched using the slope
field:
15 / 17
Comparison of methods seen so far
I Qualitative methods (e.g., slope fields)
Useful for understanding qualitative properties of solutions
(e.g., long-term behaviour), but do not give exact values of
solutions at particular times.
I Analytic methods (e.g., solving separable equations)
Exact formula for a solution of a DE. These methods only
work for some important special cases.
I Numerical methods (e.g., Euler’s method)
Approximate quantitative information about solutions, using
methods that can be automated (i.e., use a computer). We
obtain information about only one solution at a time, but this
can be misleading. It is usually possible to use more than one
method for any problem — the trick is picking the most
appropriate method(s).
16 / 17
Important ideas from today
I How to sketch slope fields.
I How to sketch solutions using slope fields.
I Euler’s method for numerically approximating solutions to an
IVP. (It is based on considering slope fields.)
I Comparison of methods seen so far.
17 / 17
Maths 260: Differential Equations
Lecture 4: Existence and uniqueness of solutions
I Reading for this lecture: BDH Section 1.5
I Suggested exercises: BDH Section 1.5, #1, 3, 5, 7, 15
I Reading for next lecture: BDH Section 1.6
1/1
Existence and Uniqueness of solutions
Most of the time, in the theory and examples we have studied so
far, we have been making two major assumptions: that the DEs we
study have solutions and that solutions to IVPs are unique.
I Does a differential equation always have a solution?
I Can an initial value problem have more than one solution?
On the whole we are safe in assuming that IVPs have unique
solutions. Today we shall see why.
2/1
Existence Theorem
Consider an initial value problem
dy
= f (t, y ),
dt
y (t0 ) = y0 .
If f (t, y ) is a continuous function at (t, y ) = (t0 , y0 ), then there is
a constant > 0 and a function y (t) defined for t in the interval
(t0 − , t0 + ), such that y (t) solves the IVP.
Note: The theorem guarantees a solution exists for a small interval
in t, but says nothing about existence for t outside this interval.
3/1
Example 1
dy
= 1 + y 2,
y (0) = 0
dt
Does the IVP have a solution? If so, for what values of t does the
solution exist?
Consider the IVP
4/1
Example 1, continued
If we solve the equation using separation of variables, we find:
Note that if an analytic technique finds a discontinuous function,
then we say that a given solution can only exist up until the
discontinuous point. If a function is not differentiable at a point,
then it certainly cannot satisfy the DE there!
5/1
Uniqueness Theorem
Consider an initial value problem
dy
= f (t, y ),
dt
y (t0 ) = y0 .
∂f
(t, y ) are continuous functions at
∂y
(t, y ) = (t0 , y0 ), then there is a constant > 0 and a function y (t)
defined for t in the interval (t0 − , t0 + ) such that y (t) is the
unique solution to the IVP on this interval.
If f (t, y ) and
Note: Both the Existence Theorem and the Uniqueness Theorem
are sufficient but not necessary conditions.
6/1
Example 1 revisited
dy
= 1 + y 2,
y (0) = 0
dt
Does the IVP have a unique solution?
Consider the IVP
7/1
Example 2
Does the IVP
√
dy
= y,
dt
y (2) = 0.
have a unique solution?
What about the IVP
√
dy
= y,
dt
y (0) = 2?
8/1
Example 3
For the IVP
dy
y2 − 1
= 2
,
dt
t + 2t
y (t0 ) = y0 ,
1. Find a value of t0 and a value of y0 so that the IVP has a
unique solution. Give a reason for your answer.
NOTE: Do not try to find an explicit solution to this DE to
answer this part of the question.
2. Find a value of t0 and a value of y0 so that the IVP has more
than one solution. For your choice of t0 and y0 write down
two functions that satisfy the DE.
9/1
Example 4: Using uniqueness
Note: If the conditions of the Uniqueness Theorem are satisfied,
different solutions cannot cross or meet in the (t, y )-plane.
For example, consider the DE:
dy
(1 + t)2
=
.
dt
(1 + y )2
φ(t) = t is a solution to this differential equation with the initial
condition y (0) = 0.
By the uniqueness theorem, the solution is unique for all y > 0.
This means that solutions in this part of the (t, y ) plane cannot
cross each other.
10 / 1
11 / 1
Important ideas from today:
dy
= f (t, y ),
y (t0 ) = y0
dt
I If f is continuous at (t0 , y0 ), a solution to the IVP exists,
at least for t near t0 .
∂f
I If
is also continuous at (t0 , y0 ), this solution is unique.
∂y
Consider the IVP
I Uniqueness ⇒ solutions cannot cross or touch in (t, y )-space.
12 / 1
Maths 260: Differential Equations
Lecture 5: The phase line
Classification of equilibria and linearisation
I Reading for this lecture: BDH Section 1.6
I Suggested exercises: BDH Section 1.6, #1, 3, 5, 7, 13,
15, 23, 25, 27, 29, 35, 37, 39
I Reading for next lecture: BDH Section 1.7
1/1
The phase line
Recall that the slope field for an autonomous differential equation,
i.e., an equation of the form
dy
= f (y ),
dt
has a special property — slope marks are parallel along horizontal
lines. In this case, there is clearly some redundancy in the slope
field information.
We sometimes replace the slope field by a phase line, which
summarises the information in the slope field.
2/1
Example 5
dy
= y (1 − y )
dt
What is the long-term behaviour of the solutions?
Consider the slope field for the DE
3/1
Equilibria
dy
= f (y ), we say that the differential
dt
equation has an equilibrium at a point y0 if f (y0 ) = 0.
For a differential equation
In that case, y (t) = y0 is a solution to the differential equation,
because:
4/1
Long-term behaviour of solutions
In cases where the Uniqueness Theorem applies, a solution that
tends to an equilibrium point does not reach the equilibrium point
in finite time. We write
y (t) → y0
as t → ∞
y (t) → y0
as t → −∞
or
In contrast, a solution that tends to +∞ or −∞ may reach ±∞ in
finite time, or may never reach ±∞. We cannot tell which case we
have from the phase line alone.
5/1
How to draw a phase line
To draw the phase line for an autonomous DE
dy
= f (y ),
dt
we need to know the positions of all equilibria, the intervals of y
where f (y ) > 0, and the intervals of y where f (y ) < 0.
If f is continuous, the sign of f can only change at y -values where
f (y ) = 0, i.e., at equilibria.
Thus, the positions of the equilibria and the behaviour of solutions
near each equilibrium is all we need to know to draw the phase line.
6/1
Example 6
For the DE
dy
= f (y ),
dt
where f (y ) has the graph shown below, sketch the phase line and
describe the long-term behaviour of solutions.
7/1
Example 7
Sketch the phase line for the DE
dy
= (y + 2)(1 − y ).
dt
Describe the long-term behaviour of solutions.
8/1
Example 8
Draw the phase line for a DE
dy
= f (y ),
dt
such that its solutions have the following properties:
I there are two equilibria, at y = 0 and y = 2;
I solutions started near y = 0 tend to y = 0 as t → ∞;
I solutions started near y = 2 always decrease.
9/1
Classification according to behaviour of nearby solutions
An equilibrium y (t) = a is called a sink if any solution with
initial condition sufficiently close to y = a moves towards y = a
as t increases.
An equilibrium y (t) = b is called a source if any solution with
initial condition sufficiently close to y = b moves away from y = b
as t increases.
(We say that nearby solutions diverge from y = b as t increases.)
An equilibrium that is neither a sink nor a source is called a node.
10 / 1
Example 9
Find all equilibria of the DE
dy
= f (y ),
dt
where f (y ) has the graph shown below, and determine their types.
11 / 1
Linearisation Theorem
Suppose that y0 is an equilibrium of the DE
dy
= f (y ),
dt
where f (y ) and
df
are both continuous functions of y .
dy
I If f 0 (y0 ) < 0 then y0 is a sink.
I If f 0 (y0 ) > 0 then y0 is a source.
I If f 0 (y0 ) = 0 or if f 0 (y0 ) does not exist then we need
additional information to determine the type of y0 .
In this case the equilibrium y0 may be a sink, a source, or a
node.
Here, f 0 (y0 ) means
df
evaluated at y = y0 .
dy
12 / 1
Example 10
Find all equilibria of the DE
dy
= y 2 (y − 2) (y + 2),
dt
and classify them using the linearisation theorem.
13 / 1
Nodes
Note that y = y0 is not necessarily a node in the case that
df
= 0.
dy y =y0
Example 7: Determine the type of equilibrium at y = 0 for the DE
dy
= y 3.
dt
14 / 1
Important ideas from today:
dy
= f (y )
dt
I The phase line shows the location of equilibria and gives
qualitative information about other solutions.
I An equilibrium y ∗ is classified as a sink, source, or node
depending on the behaviour of nearby solutions.
df
I Linearisation — the quantity f 0 (y ∗ ) =
dy y =y ∗
Analysis of an autonomous DE
often determines the type of an equilibrium y ∗ .
I We have learnt two methods for drawing phase lines:
dy
dy
> 0 and
< 0;
Graph of f : work out when
dt
dt
then sketch the phase line.
I Linearisation: determine the sign of f 0 (y ∗ ) for each y ∗ ;
then sketch the phase line.
I
I Linearisation can also be used in higher dimensions, that is,
for systems of DEs.
15 / 1
Maths 260: Differential Equations
Lecture 6: Parameters and Bifurcations
I Reading for this lecture: BDH Section 1.7
I Suggested exercises: #1, 3, 5, 15, 19
I Reading for next lecture: BDH Section 1.7
1 / 13
Parameters
A parameter in a differential equation is a quantity that:
I does not depend on either the independent or dependent
variables;
I can take different values depending on the system.
Example 1: The velocity v of a falling object is described by the
differential equation
dv
= −g
dt
where g is acceleration under gravity. The constant g is a
parameter that could take different values depending on what
planet you are on.
2 / 13
Example 2
Some parameters can be changed by people’s actions. For example,
suppose that the population of dodos on an island is modeled by
P
dP
= 0.4P 1 −
dt
1000
where P is the number of dodos, and t is the time in years.
Now suppose we allow hunting. If dodo hunting kills k dodos per
year, then we can model the population of dodos by
dP
P
= 0.4P 1 −
−k
dt
1000
Question: How much hunting can we allow before we risk having
the dodos become extinct?
3 / 13
Example 2, continued
P
dP
= 0.4P 1 −
−k
dt
1000
What is this parameter k doing to our equation?
Let’s draw the phase line for k = 0:
4 / 13
Example 2, continued
Suppose that there are initially 1000 dodos. What happens as we
increase k?
5 / 13
Example 2, continued
Something important happens at k = 100:
6 / 13
Bifurcations
A bifurcation occurs when a small change in parameter gives a
qualitative change in the behaviour of solutions.
We are particularly interested in changes to the long-term
behaviour of solutions.
In our dodo population example, we saw that small changes in the
value of k did not usually change the long-term behaviour of the
solutions very much.
But when we looked at k = 100, the long-term behaviour of
solutions suddenly changed very quickly! This indicates that there
was a bifurcation at k = 100.
7 / 13
Example 3
In this class, we will focus on autonomous equations that depend
on one parameter, i.e., equations of the form
dy
= fk (y ).
dt
For example, consider the DE
dy
= fk (y ) = k − y 2
dt
This is a one-parameter family of DEs: we get one DE for each
choice of the parameter k.
Draw the phase line when k = 1 and when k = −1.
8 / 13
Example 3 continued
We see that the qualitative behaviour of solutions changes between
k = −1 and k = 1. There must be a bifurcation at some value of
k in the interval (−1, 1).
To locate the value of k at which the bifurcation occurs, we find
and classify equilibria as a function of k.
A bifurcation occurs at the k value at which the number and/or
type of equilibrium solutions changes.
(Bifurcations in which the number and/or type of equilibrium
solutions changes will be the only types of bifurcations considered
in this class.)
Question: At what value of k did the bifurcation in this system
occur?
9 / 13
Example 4
Suppose f (y ) is given by the following graph:
If dy
dt = f (y ) − k, at how many values of k will there be
bifurcations?
10 / 13
When do bifurcations happen?
A bifurcation in which the number or type of equilibrium solutions
changes can only occur at k = k0 if
fk0 (y0 ) = 0
and
dfk0
(y0 ) = 0.
dy
Note: This is precisely when the linearisation theorem does not
work.
11 / 13
Example 5
Find the values of k at which the following differential equation
has bifurcations:
dy
= y (k − y )
dt
Sketch a phase line for a values of k that are:
I smaller than the bifurcation value,
I at the bifurcation value, and
I after the bifurcation value.
12 / 13
Important ideas from today:
I Parameters are quantities that do not change with the
dependent and independent variables, but that can vary
between systems.
I We can use parameters to look at how the behaviour of a
model changes as one aspect of the system that it is modeling
changes.
I Bifurcations happen when changing a parameter changes the
qualitative, long-term behaviour of solutions.
I The main type of bifurcation considered in this class is one in
which the number and/or type of equilibrium solutions
changes. These types of bifurcations can only occur if:
fk0 (y0 ) = 0
and
dfk0
(y0 ) = 0.
dy
13 / 13
Maths 260: Differential Equations
Lecture 6: Bifurcation Diagrams
I Reading for this lecture: BDH Section 1.7
I Suggested exercises: §1.7 #11, 13
I Reading for next lecture: BDH Section 1.8
1/1
Example 1: Recall from the previous lecture
Last week we investigated the qualitative behaviour of the
following parameter-dependent autonomous equation:
dy
= fk (y ) = k − y 2
dt
We drew phase lines when k = 1 and when k = −1:
We saw that there was a qualitative change, and noted that this
means that there must be a bifurcation somewhere in the region
−1 < k < 1.
2/1
Example 1, continued
One way to see where the bifurcation occurred is to solve for the
location of the equilibrium points in terms of k:
New idea: Plot the equilibrium points in the (k, y )-plane!
This sort of diagram is called a bifurcation diagram. We draw
phase lines on on the bifurcation diagram at selected values of k.
The diagram as a whole shows how the phase line changes as k
increases.
3/1
Procedure for drawing a bifurcation diagram
1. Solve for the equilibria in terms of k.
2. Draw k- and y -axes and label them.
3. Plot curves showing the position of equilibria as k varies.
4. Label any significant values of k and y , including bifurcation
values.
5. Sketch representative phase lines, including at least one for
each of k < k0 , k = k0 , and k > k0 , where k0 is a bifurcation
value.
4/1
Example 2
Draw the bifurcation diagram for the family of DEs
dy
= k y + 2y 2
dt
5/1
Example 3
Draw the bifurcation diagram for the family of DEs
dy
= k y − y3
dt
6/1
Example 4
Draw the bifurcation diagram for the family of DEs
dy
= (y − 1)(y 2 + k − 2)
dt
7/1
Example 5
Consider the following bifurcation diagram. At what values of k do
bifurcations occur? How do you know?
y
k1
k2
k3
k4
k5 k6
k7
k
8/1
Example 6
Suppose f (y ) is given by the following graph:
Sketch the bifurcation diagram for the family of DEs:
dy
= f (y ) − k
dt
9/1
Important ideas from today
I We learned how to draw bifurcation diagrams.
I A bifurcation diagram displays qualitative information about
the behaviour of a family of autonomous differential equations
as we vary a parameter.
I Bifurcation diagrams should include:
I
I
The locations of all equilibrium points.
Representative phase lines at values of k that are below, at,
and above each bifurcation point.
I When looking at a bifurcation diagram, we can locate
bifurcations by finding points where the number or type of
equilibrium points changes.
10 / 1
Maths 260: Differential Equations
Lecture 8: Linear equations
I Reading for this lecture: BDH Section 1.8
I Suggested exercises: BDH Section 1.8, #1, 3, 9, 11, 13, 15
I Reading for next lecture: BDH Section 1.9
1 / 19
Linear Differential Equations
A first-order DE is linear if it can be written in the form
dy
= a(t) y + b(t),
dt
where a(t) and b(t) are arbitrary functions of t.
The equation is linear, because the dependent variable y (and its
derivative) appears in the equation only to the first power.
2 / 19
Example 1
Which of the following equations are linear?
I
dy
= y cos t + t 2
dt
I y
dy
= t y2 + t y
dt
I
dP
= e t P + sin (t)
dt
I
dy
= t y (1 − y )
dt
I
dy
=ty
dt
3 / 19
Some terminology
A linear differential equation of the form
dy
= a(t) y + b(t),
dt
is said to be homogeneous or unforced if b(t) = 0 for all t.
Otherwise, the DE is nonhomogeneous or forced.
Note that a homogeneous linear equation is separable.
The DE is a constant-coefficient equation if a(t) is a constant, i.e.,
if the DE has the form
dy
= λ y + b(t),
dt
where λ is a constant.
4 / 19
The linearity principle
If yh (t) is a solution of the homogeneous DE
dy
= a(t) y ,
dt
then any constant multiple of yh (t) is also a solution, i.e., k yh (t)
will be a solution for all choices of k.
Note that y (t) = 0 is a solution to every homogeneous DE.
5 / 19
Example 2
The linear homogeneous equation
dy
= (− sin (t)) y
dt
has the solution y (t) = k e cos (t) for all choices of the constant k.
The slope field and some of these solutions (for various k) are:
6 / 19
The extended linearity principle
Consider the nonhomogeneous equation
dy
= a(t) y + b(t),
dt
and its associated homogeneous equation
dy
= a(t) y .
dt
If yh (t) is a solution of the homogeneous equation and yp (t) is a
solution of the nonhomogeneous equation then yh (t) + yp (t) is
also a solution of the nonhomogeneous equation.
If yp (t) and yq (t) are two solutions of the nonhomogeneous
equation then yp (t) − yq (t) is a solution to the homogeneous
equation.
7 / 19
The extended linearity principle
Consequence: if yh (t) is nonzero, then k yh (t) + yp (t) is a solution
to the nonhomogeneous equation for all choices of k, and every
solution of the nonhomogeneous equation can be written in this
form by picking a suitable value of k.
We call the one-parameter family of solutions
y (t) = k yh (t) + yp (t),
the general solution to the nonhomogeneous equation, because
every solution of the equation can be expressed in this form.
8 / 19
Example 3
Show that yp (t) = 15 t is a solution to the DE
dy
= (− sin (t)) y + 15 (1 + t sin (t)).
dt
Hence, write down the general solution.
9 / 19
Example 3 continued
The slope field and graphs of various solutions to the DE are
shown below.
10 / 19
Solving linear differential equations
We can now, in principle, solve linear DEs by the following
method:
I Find the general solution to the associated homogeneous DE.
I Find one particular solution to the nonhomogeneous DE.
I Obtain the general solution to the nonhomogeneous DE by
adding the general solution to the homogeneous DE and the
particular solution to the nonhomogeneous DE.
The first step is straightforward (use separation of variables) but
the second step can be hard — usually we just guess and hope to
be lucky.
11 / 19
Example 4
Consider the nonhomogenous DE
dy
= −3y − e t .
dt
The associated homogeneous equation is
the general solution y (t) = k e −3t .
dy
= −3y , which has
dt
We rewrite the nonhomogeneous equation as
dy
+ 3y = −e t
dt
and try to guess a solution.
We want a function yp (t) that, when we substitute it into the
left-hand side of the DE, produces −e t .
12 / 19
Example 4
We find the general solution to the nonhomogeneous DE is
y (t) = k e −3t − 14 e t ,
for arbitrary k. The slope field for the DE and various solutions are:
13 / 19
Example 5
Now consider the nonhomogeneous DE
dy
+ 3y = sin (2t)
dt
The general solution to the associated homogeneous equation is
again y (t) = k e −3t .
We want a function yp (t) that, when we substitute it into the
left-hand side of the DE, produces sin (2t).
14 / 19
Example 5 continued
The general solution to the nonhomogeneous DE is
3
2
y (t) = k e −3t +
sin (2t) −
cos (2t)
13
13
for arbitrary k. The slope field for the DE and various solutions are:
15 / 19
Example 6
Consider the nonhomogeneous DE
dy
+ 3y = e −3t .
dt
Now we want a function yp (t) that, when we substitute it into the
left-hand side of the DE, produces e −3t .
16 / 19
How to guess
The basic idea with guessing solutions is to try a function yp (t)
that has the form of the forcing term b(t).
I If b(t) is an exponential of the form b(t) = e c t , try
yp (t) = α e c t .
I If b(t) is a cosine or sine of the form b(t) = sin (c t) or
b(t) = cos (c t), try
yp (t) = α sin (c t) + β cos (c t).
I And so on....
If guessing does not produce a suitable yp (t), then we can try
solving by integrating factors (see next lecture) or other methods
(see later in course).
17 / 19
Important ideas from today
I A first order DE is linear if it can be written in the form
dy
= a(t) y + b(t),
dt
where a(t) and b(t) are arbitrary functions of t.
I We discussed the linearity and extended linearity principles.
I Homogeneous linear DEs are separable and we can find
solutions by separation of variables.
I We can find solutions to some nonhomogeneous linear DEs by
guessing the form of a solution and using substitution to
determine coefficients.
18 / 19
Maths 260: Differential Equations
Lecture 9: Linear equations again
I Reading for this lecture: BDH Section 1.9
I Suggested exercises: BDH Section 1.9, #1, 3, 9, 13
I Reading for next lecture: 1D modelling examples in
BDH Section 1.1 (pp. 2–12)
BDH Section 1.2 (pp. 29–33)
1 / 11
Recall from the previous lecture
In the last lecture, we learned that first-order linear differential
equations are equations of the form
dy
= a(t) y + b(t),
dt
We can solve homogeneous linear differential equations (that is,
equations with b(t) = 0) using separation of variables.
We can find the general solution yg (t) to a nonhomogeneous
linear differential equation by taking
yg (t) = yp (t) + yh (t)
where yh (t) is the general solution to the associated homogeneous
linear differential equation and yp (t) is a particular solution to the
nonhomogeneous equation.
2 / 11
Example 1
Find the general solution to
dy
− 3y = t
dt
3 / 11
Example 2
Find the general solution to
e −3t
dy
− 3e −3t y = te −3t
dt
4 / 11
A general method for finding solutions to linear DEs
First rewrite the DE as
dy
+ g (t) y = b(t),
dt
where g (t) = −a(t).
Multiply both sides of the DE by µ(t), which is an unknown,
nonzero function such that
dy
d
[µ(t) y ] = µ(t)
+ µ(t) g (t) y
dt
dt
The function µ(t) is called an integrating factor.
5 / 11
Method with integrating factor µ(t)
To find a solution to
dy
+ g (t) y = b(t),
dt
find the integrating factor
Z
g (t) dt
µ(t) = exp
Then the solution to the DE is
Z
1
y (t) =
µ(t) b(t) dt
µ(t)
Different choices of the constant of integration for µ(t) will give
(slightly) different integrating factors, but all choices are valid. We
usually pick the easiest, i.e., pick a zero constant of integration.
6 / 11
Example 3
Find a one-parameter family of solutions to
dy
y
= + t 4,
dt
t
t > 0.
7 / 11
Example 3 continued
We find the DE has a one-parameter family of solutions
y (t) =
t5
+ k t.
4
where k is an arbitrary constant. Some solutions are plotted below.
What happens at t = 0?
Why?
8 / 11
Example 4
Find a solution to the IVP
dy
= −2 y − 3 t,
dt
y (0) = 21 .
9 / 11
Example 5
Find a solution to the IVP
dy
= 1 + 2 y t,
dt
y (0) = 1.
10 / 11
Important ideas from today:
I Explicit solutions to linear DEs can sometimes be found. First
compute the integrating factor (if possible):
Z
g (t) dt ,
µ(t) = exp
where g (t) = −a(t).
Then the solution to the DE is
Z
1
y (t) =
µ(t) b(t) dt
µ(t)
11 / 11
Maths 260: Differential Equations
Lecture 10: A bunch more examples of linear equations.
I Reading for this lecture: Review BDH Sections 1.8 and 1.9
I Suggested exercises: BDH Section 1.9, #1, 3, 9, 13
I Reading for next lecture: BDH Sections 1.4, 7.1-7.4
1/6
Example 1
Find a solution to the ODE
dy
− 2y = cos(3t)
dt
y (0) = 1.
2/6
Example 2
Find a solution to the ODE
dy
+ y = 7e −t
dt
y (0) = 1.
3/6
Example 3
Compare the solution methods for
dy
+ 2y = 3t 2 + 2t − 1.
dt
4/6
Example 4
Compare the solution methods for
dv
+ 0.4v = 3 cos(2t).
dt
5/6
Example 5
Find a solution to the ODE
dy
= t 2y + t − 1
dt
6/6
Maths 260: Differential Equations
Lecture 11: Numerical methods revisited
Order and efficiency of numerical methods
I Reading for this lecture: BDH Sections 1.4, 7.1-7.4
I Suggested exercises: BDH Section 1.4, #12
BDH Section 7.1, #6
BDH Section 7.3, #6
I Next lecture: Systems. BDH Section 2.2
1 / 16
Euler’s Method
We discussed Euler’s Method in Lecture 4. The main idea for
Euler’s method is as follows.
To approximate the solution to the IVP
dy
= f (t, y ),
dt
y (t0 ) = y0 ,
using Euler’s method with step size h, we calculate approximations
y (t1 ) ≈ y1 , y (t2 ) ≈ y2 , etc., where
tk+1 = tk + h,
yk+1 = yk + h f (tk , yk ),
for k = 0, 1, . . .
2 / 16
Measuring error for Euler’s Method
dy
= t y,
y (0) = 1
dt
has the explicit solution y (t) = exp(t 2 /2) (how do we know?)
At t = 1 this solution has the value y (1) = exp(1/2) ≈ 1.648721.
Example 1: The IVP
No. of Steps
1
2
4
8
16
32
64
128
256
512
h
1.0
0.5
0.25
0.125
0.0625
0.03125
0.015625
0.0078125
0.00390625
0.001953125
y 1(h)
1.000000
1.250000
1.419434
1.524006
1.583386
1.615240
1.631767
1.640190
1.644442
1.646578
error
0.649
0.399
0.229
0.125
0.0653
0.0335
0.0170
0.00853
0.00428
0.00214
3 / 16
Improving Euler’s Method
Geometrically, Euler’s method amounts to following a tangent line,
instead of the (unknown) solution curve, from yk to the value we
accept for yk+1 .
I The direction of each step is determined by the slope at the
beginning of the step.
I Since the slope of the actual solution curve varies throughout
the interval from tk to tk+1 , the value of yk+1 calculated by
Euler’s method generally does not agree with the value on the
solution curve.
I We can obtain a more accurate method by adjusting the
direction of the step according to the slope field seen along an
Euler step.
4 / 16
Improved Euler’s method
To take one step of length h with Improved Euler’s method:
(a) Take an ordinary Euler step of length h. Calculate the slope at
the end of this step.
(b) Go back to the beginning of the step, take a step of length h
with slope being the average of the slope at the beginning of
the step and the slope calculated in (a).
The formulas for this method are
tk+1 = tk + h
yk+1 = yk + h2 (m1 + m2 )
where
m1 = f (tk , yk )
m2 = f (tk+1 , yk + h f (tk , yk ))
5 / 16
Illustration of Improved Euler’s method
6 / 16
Example 2
Use Improved Euler’s method with h = 0.5 to calculate an
approximation to the solution of the IVP
dy
= t y,
dt
y (0) = 1,
at t = 1.0.
7 / 16
Example 2 continued
Looking at the following results, we can see how changing the step
size in the Improved Euler’s method improves the solution.
No. of Steps
1
2
4
8
16
32
64
128
256
512
h
1.0
0.5
0.25
0.125
0.0625
0.03125
0.015625
0.0078125
0.00390625
0.001953125
y 1(h)
1.500000
1.617188
1.642286
1.647355
1.648415
1.648649
1.648704
1.648717
1.648720
1.648721
error
0.149
0.0315
0.00644
0.00137
0.000307
0.0000720
0.0000174
0.00000427
0.00000106
0.000000263
8 / 16
4th-order Runge-Kutta method (RK4)
RK4 is the most commonly used fixed-step-size numerical method
for IVPs.
This method evaluates the slope f (t, y ) four times within each
step. Starting at (tk , yk ) we calculate (tk+1 , yk+1 ) as follows:
tk+1 = tk + h
m1 = f (tk , yk )
m2 = f (tk + h2 , yk + h2 m1 )
m3 = f (tk + h2 , yk + h2 m2 )
m4 = f (tk + h, yk + h m3 )
yk+1 = yk +
h
(m1 + 2 m2 + 2 m3 + m4 )
6
9 / 16
Illustration of RK4
10 / 16
Example 2
Use RK4 to compute an approximation to the solution of the IVP
dy
= t y,
dt
y (0) = 1,
at t = 1.0.
Doing this by hand is tedious, but one can obtain the following
results.
No. of Steps
1
2
4
8
16
32
h
1.0
0.5
0.25
0.125
0.0625
0.03125
y 1(h)
1.645833
1.648528
1.648710
1.648721
1.648721
1.648721
error
0.00289
0.000194
0.0000115
0.000000660
0.0000000385
0.00000000230
11 / 16
Order of Numerical Methods
The order of a numerical method measures the change in error of a
numerical solution as the step size is decreased.
Comparing the approximations obtained by the various numerical
methods for the IVP in Example 1, we find:
I With Euler’s method the error is approximately halved if the
step size is halved, at least if h is sufficiently small.
I With Improved Euler’s method the error is multiplied by
approximately 14 = ( 12 )2 if the step size is halved, at least if h
is sufficiently small.
I With the RK4 method the error is multiplied by approximately
1 4
1
16 = ( 2 ) if the step size is halved, at least if h is sufficiently
small.
12 / 16
General result
It can be proved that
I Euler’s method is of order 1
I Improved Euler is of order 2
I Runge-Kutta 4 is of order 4
This result does not depend on the initial value problem being
solved. The result tells us about the behaviour of errors when the
step size gets very small.
13 / 16
Efficiency of numerical methods
I Higher-order methods take more work per step than Euler’s
method. However, they usually require fewer steps and less
total work to obtain an accurate answer.
I The most efficient method for a particular problem is the one
that gives the desired accuracy with the least amount of work.
I In estimating the amount of work required to use a certain
method, we only count the number of evaluations of f , i.e., of
the right-hand side of the DE. In comparison, additions and
multiplications required are negligible.
14 / 16
The numerical method used in dfield
The java applet dfield uses the so-called Dormand-Prince
numerical method by default.
We do not study this method in detail, but note that it
incorporates three improvements over RK4:
I It is a 5th-order method.
I A variable step size is used. The algorithm calculates the step
size to be used by estimating the error in each step. A large
error estimate will cause a smaller step size to be used.
I Some fitting (with splines) is performed to give smoother
solutions.
15 / 16
Important ideas from today:
I Numerical methods approximate solutions to IVPs.
I Euler’s method uses the slope at the beginning of each step.
Better methods adjust the direction of each step according to
the slope field seen along an Euler step.
I The error in a numerical approximation generally reduces if
the step size is decreased — but using smaller steps means
more work.
I The order of a numerical method tells us how fast the error
reduces if we reduce the step size.
I We learnt to estimate the order and efficiency of numerical
methods.
16 / 16
Maths 260: Differential Equations
Lecture 12: Introduction to systems of differential equations
Vector fields, direction fields and solutions
I Reading for this lecture: BDH Section 2.2
I Suggested exercises: BDH Section 2.2, #1,3, 9,11
I Reading for next lecture: BDH Section 2.3
1 / 18
Systems of First Order DEs
Sets of two or more DEs that together involve more than one
dependent variable are known as systems of DEs.
Example 2:

dx


= −2x + 3y ,
dt

 dy = −2y .
dt
Example: forced Van der Pol system


 dx = y ,
dt
dy


= x − x 3 − y + A sin(t).
dt
2 / 18
Example: Lorenz system
In 1963, Edward Lorenz (MIT) found chaotic behaviour in a DE
modelling the (simplified) weather:

dx


= 10 (y − x),



 dt
dy
= 28 x − y − x z,

dt




 dz = − 8 z + x y .
3
dt
3 / 18
Standard form and its solutions
We are mostly interested in systems of first order DEs. We write
these in standard form:

dx1


= f1 (t, x1 , x2 , . . . , xn ),


dt



 dx2

= f2 (t, x1 , x2 , . . . , xn ),
dt

..


.




dxn


= fn (t, x1 , x2 , . . . , xn ).
dt
Instead of
dxn
, we sometimes write ẋn .
dt
A solution to a system of n first-order equations is a set of n
functions that, together, satisfy the DE.
4 / 18
Writing a higher order ODE in standard form
The ODE
d 3x
d 2x
dx
+x =1
+ 2 +
3
dt
dt
dt
can be written in standard form.
5 / 18
Example 2 revisited
Determine which of the following pairs of functions is a solution to
the system from Example 1:

dx


= −2x + 3y ,
dt

 dy = −2y .
dt
I x1 (t) = −3t e −2t ,
y1 (t) = −e −2t ;
I x2 (t) =
3e −2t ,
y2 (t) = 0;
I x3 (t) =
3e −2t + t e −2t ,
y3 (t) = −e −2t .
6 / 18
Vector notation
Consider a system of two autonomous DEs:

dx


= f (x, y ),
dt

 dy = g (x, y ).
dt
We write
Y(t) =
x(t)
y (t)
,
V(Y) =
f (x, y )
g (x, y )
.
Then the system written in vector form is
dY
= V(Y).
dt
V(Y) is called a vector field, i.e., it is a function that assigns a
vector to each point of the (x, y )-plane.
7 / 18
Example 1 revisited
Write the system from Example 1 in vector notation:
ẋ = −2x + 3y ,
ẏ = −2y .
What do the solutions in vector notation look like?
8 / 18
Sketching vector fields for 2D autonomous systems
1. Select points Y0 in the (x, y )-plane (say, at all points on an
evenly spaced grid);
2. For each Y0 calculate V(Y0 );
3. Draw the vector V(Y0 ), with the base of the vector at Y0 and
with an arrow showing the direction of the vector.
The resulting picture in the (x, y )-plane is called the vector field
for the DE.
9 / 18
Example 2
Plot the vector field for the following DE.
ẋ =
y,
ẏ = −x.
x’=y
y’=−x
3
2
y
1
0
−1
−2
−3
−3
−2
−1
0
1
2
3
x
10 / 18
Length of vectors in a vector field
Problem: The vectors can cross, e.g., for the previous system:
Vector field with
selected vectors
Vector field with more
We can avoid these problems by scaling the vectors, e.g., such that
they all have the same (short) length (the direction field),
or such that their relative sizes are preserved (default in pplane)
11 / 18
Sketching solutions curves
We could plot solutions of a system of equations as functions of t.
For a system of two dependent variables, x and y , we could either
plot x(t) and y (t) separately or could plot the solution in the 3D
(t, x, y )-space.
For autonomous systems, we usually prefer to plot solutions in the
phase space, which is the space of dependent variables.
For the example above, the phase space is the (x, y )-plane.
12 / 18
Sketching solutions curves in phase space
We can use the vector field for a DE to help us visualise solutions
of the DE, just as slope fields gave us a way to visualise solutions
to DEs with one dependent variable.
Consider a system of DEs
dY
= F(Y),
dt
Y=
x(t)
y (t)
.
A solution is a vector of functions Φ(t) =
φ1 (t)
φ2 (t)
such that
dΦ
= F(Φ).
dt
As we vary t, the point (φ1 (t), φ2 (t)) will trace out a solution
curve in the (x, y )-plane that is parametrised by time.
13 / 18
Example 3
Sketch some solution curves in the vector field below for the DE
ẋ = 3x + y ,
ẏ = x − y .
14 / 18
Example 3 continued
What would these solutions look like if plotted with respect to t?
15 / 18
Example 4
Sketch some solution curves in the vector field below for the DE
ẋ = y ,
ẏ = sin (x).
16 / 18
More about phase space
I Phase space is the higher-dimensional equivalent of the phase
line seen in earlier lectures for DEs with one dependent
variable.
I Solution curves drawn in phase space do not show explicit
values of t, just how the dependent variables change as t
changes.
I It is common to draw an arrow on a solution curve to indicate
the flow direction along the solution curve as time increases.
I We can use the Java Applet pplane to plot numerical
approximations to solutions curves. Details of how the
numerical methods in pplane work will be covered in a later
lecture.
I A selection of representative solution curves plotted together
on the same phase space give a phase portrait of the DE.
17 / 18
Important ideas from today’s lecture:
I We learnt how to check whether a set of functions is a
solution to a given system of DEs or vector field.
I We introduced the phase space, which is the
higher-dimensional equivalent of the phase line, to help us
visualise our solutions.
I We plotted several representative solution curves together on
the same phase space to give us the phase portrait.
18 / 18
Maths 260: Differential Equations
Lecture 13: IVPs and Equilibrium solutions for systems
I Reading for this lecture: BDH Sections 2.2, 2.4
I Suggested exercises: BDH Section 2.2, #13–16, 21;
BDH Section 2.4 #1, 3
I Reading for next lecture: BDH Sections 2.5, 2.6
1/1
Initial value problems for systems of equations
An initial condition for the system
dY
= V(Y).
dt
specifies the values of all the dependent variables at some fixed
value of the independent variable, say at t = t0 .
A problem that specifies a DE together with an initial condition
Y(t0 ) = Y0 is called an initial value problem or IVP.
A solution that satisfies an initial condition Y(t0 ) = Y0 has a
solution curve that passes through the point Y0 in the phase space
at time t = t0 .
2/1
Example 1
The pair of functions
(x(t), y (t)) = (k1 e t , k2 e −2t )
is a solution to the system of equations
ẋ =
x,
ẏ = −2y .
for all choices of k1 and k2 .
Find k1 and k2 for the solution with x(0) = 1 and y (0) = 1.
Sketch x(t) and y (t) for this solution, and then sketch the solution
curve in the phase plane.
3/1
Example 1 continued
We plot the solution that satisfies x(0) = 1 and y (0) = 1
As a function of t:
In phase space:
3
3
2.5
2
2
1
y
1.5
1
1
0.5
0
0
0
2
0.5
1
1.5
t
2
2.5
3
3
3
2
1
0
x
1
2
3
4/1
Example 1 continued
Draw a phase portrait using the solutions with
3
I x(0) =
1,
y (0) = −1
I x(0) =
y (0) =
2
0,
1
1
I x(0) = −2,
1
I x(0) =
1,
0
y
y (0) =
y (0) =
0
1
2
3
3
2
1
0
x
1
2
3
5/1
Comparison with Java Applet pplane
6/1
Equilibrium solutions
The point Y0 is an equilibrium point for the system
dY
= V(Y).
dt
if V(Y0 ) = 0.
If Y0 is an equilibrium point, then the constant function
Y(t) = Y0 is a solution of the system.
7/1
Example 2
Find all equilibrium solutions for the system
ẋ = x + y ,
ẏ = y (2 − x).
8/1
Example 3: A Predator-Prey System
Suppose we want to model a population of moths. We let M be
the population of moths (in 10,000s to keep our numbers small)
and model the population as follows:
Ṁ = aM(1 − M/N)
But wait! These moths are also being eaten by bats! Let B be the
number of bats (in 100s), and add a term to the above equation:
Ṁ = aM(1 − M/N) − bMB
There will be more bats if there are more moths for them to eat.
But the bats will all die if there are no moths:
Ḃ = cMB − dB
In this model, a, b, c, d and N are as-yet-undetermined constants.
9/1
Example 3, continued
Let’s choose some specific constants, so we can study how the
system behaves.
Ṁ = M(1 − M/3) − MB
Ḃ = MB − B
What are the equilibria of this system?
10 / 1
Example 3, continued
x´ = x(1-x/3)-xy
3
y´ = xy-y
2.5
2
1.5
y
1
0.5
0
-0.5
-0.5
0
0.5
1
1.5
2
2.5
3
3.5
4
x
11 / 1
Solutions near equilibria
The solution curve for an equilibrium solution is just a single point
in the phase space, because none of the dependent variables
change with time.
Note that:
1. the slopes of line segments in a vector field vary a lot near an
equilibrium point;
2. solutions passing near an equilibrium point go very slowly,
because all components of the vector field get close to zero
near an equilibrium.
12 / 1
Example
2 revisited
ẋ
ẏ
= x + y,
= y (2 − x).
x´ = x+y
y´ = y(2-x)
4
3.5
3
2.5
2
1.5
1
0.5
y
0
-0.5
-1
-1.5
-2
-2.5
-3
-3.5
-4
-4
-3
-2
-1
0
1
2
3
4
5
6
7
8
x
13 / 1
Important ideas from today’s lecture
I An IVP for a system of DEs specifies an initial condition
Y(t0 ) = Y0 , that is a value for each of the dependent
variables for the same value of t.
I The point Y0 is an equilibrium point of a system of DEs if
V(Y0 ) = 0, in which case the constant function Y(t) = Y0 is
a solution of the system.
14 / 1
Maths 260: Differential Equations
Lecture 14: Numerical methods for systems
Existence and Uniqueness Theorem for systems
I Reading for this lecture: BDH Sections 2.5, 2.6
I Suggested exercises: BDH Section 2.5, #2;
BDH Section 2.6, #3-7
I Reading for next lecture: BDH Section 3.1, 3.2
1/1
Numerical Methods for Systems
Numerical methods used for first order equations can be
generalised to systems of first order equations.
Example: Euler’s Method for systems
Given the IVP

dx


= f (t, x, y ),
dt

 dy = g (t, x, y ),
dt
with x(t0 ) = x0 and y (t0 ) = y0 , then Euler’s Method calculates
the approximate solution at t1 = t0 + h to be
(
x(t1 ) ≈ x0 + h f (t0 , x0 , y0 ),
y (t1 ) ≈ y0 + h g (t0 , x0 , y0 ).
The process can be repeated to find an approximation after n steps.
2/1
Example 1
Use Euler’s method with h = 0.1 to calculate an approximate
solution at t = 0.2 to the IVP

dx


= t + y,
dt

 dy = x − y 2 .
dt
where x(0) = 1 and y (0) = 0.
The results in tabular form are:
n
0
1
2
tn
0
0.1
0.2
xn
yn
f (tn , xn , yn )
g (tn , xn , yn )
3/1
Vector Form of Euler’s Method
Write


y1 (t)
 y2 (t) 


Y(t) =  .  ,
 .. 


y1 (t0 )
 y2 (t0 ) 


Y0 = 
,
..


.
yn (t)
yn (t0 )
and


f1 (t, y1 , y2 , . . . , yn )
 f2 (t, y1 , y2 , . . . , yn ) 


F(t, Y) = 
.
..


.
fn (t, y1 , y2 , . . . , yn )
Then the Euler approximation to the solution of the IVP
dY
= F(t, Y), Y(t0 ) = Y0
dt
at t1 = t0 + h is
Y(t1 ) ≈ Y0 + h F(t0 , Y0 ).
4/1
Errors in numerical methods
It can be proved that Euler’s method for systems is first order,
i.e., the error in the ith component of Y is
| Ei (h) |≈ ki h
in the limit of small h, where ki is a constant.
Thus, halving the step size will approximately halve the error in the
estimated value of each component of Y.
Improved Euler and the 4th order Runge-Kutta methods also
generalise to systems, and are of order 2 and 4, respectively.
5/1
Practical issues in using numerical methods for systems
I As with single DEs, RK4 is a commonly used fixed step size
numerical method. It is easy to implement and of high order.
I With this method, it is important to check whether any given
step size is small enough to give good accuracy. An easy way
to do this is to halve the stepsize and repeat the computation
to see if it makes a difference to the answer.
Never trust numerical results blindly. All numerical methods can
give misleading results under some circumstances. Ask yourself if
the numerical results fit in with your intuition or with results you
have from other methods. If not, work out why not.
6/1
Existence and Uniqueness Theorem for systems
Consider the IVP
dY
= F(t, Y),
dt
Y(t0 ) = Y0
If F is continuous and has continuous first partial derivatives with
respect to all the dependent variables, then there is a constant
> 0 and a function Y(t) defined for t0 − < t < t0 + such that
Y(t) is a solution to the IVP.
For t in this interval, the solution is unique.
7/1
Example 2
Consider the forced Van der Pol system


 dx = y ,
dt
dy


= x − x 3 − y + A sin(t).
dt
Show that this system has a unique local solution everywhere in
the (x, y ) phase plane.
8/1
Interpretation of the E & U Theorem
I If a system of equations is ‘nice’ enough, an IVP is guaranteed
to have a unique solution.
I As a consequence, two different solutions cannot start at the
same time at the same point in phase space.
I For autonomous systems, two different solutions that start at
the same place in phase space but at different times will
correspond to the same solution curve (because the direction
field at each point will be the same, regardless of time).
This means that, for an autonomous system, solution curves
cannot meet or cross in phase space.
I No such guarantee exists for solution curves of
non-autonomous systems; solution curves for non-autonomous
systems frequently cross in phase space.
9/1
Example 3
The phase portrait below is for the DE
ẋ = y ,
ẏ = −2.5 + y + x 2 + x y .
6
4
2
y
0
−2
−4
−6
−6
−4
−2
0
x
2
4
6
10 / 1
Example 4
The phase portrait below is for the DE
ẋ = yx ,
ẏ = 1 − x.
x´ = x/y
y´ = 1-x
4
3.5
3
2.5
2
1.5
1
0.5
y
0
-0.5
-1
-1.5
-2
-2.5
-3
-3.5
-4
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
2.5
3
3.5
4
x
11 / 1
Important ideas from today’s lecture:
I Numerical methods can be generalised to work for systems of
DEs similarly to the way they work for single equations.
I ‘Nice’ IVPs have unique solutions.
I Solution curves for autonomous systems with continuous first
partial derivatives do not cross or meet in phase space.
12 / 1
Maths 260: Differential Equations
Lecture 15: Linear Systems
I Reading for this lecture: BDH Section 3.1, 3.2
I Suggested exercises:
BDH Section 3.1 #5, 7, 9, 24, 27, 29
BDH Section 3.2 #1, 5, 11, 13, 25
I Reading for next lecture:
BDH Section 3.3
1 / 25
Linear Systems
A linear system is a system of DEs where the dependent variables
only appear to the first power.
We are mostly interested in linear systems that can be written in
the form:
dx
= ax + by
dt
dy
= cx + dy
dt
where a, b, c, d are constants (and could be zero).
This is a constant coefficient linear system.
2 / 25
Matrix form
We can use vector and matrix notation to write a constant
coefficient linear system efficiently as
dY
= AY
dt
where Y is a vector and A is a matrix of constants:




x1
a11 a12 . . . a1m
 x2 
 a21 a22 . . . a2m 




Y= . 
A= .

 .. 
 ..

xm
am1 am2 . . .
amm
The number of dependent variables, m, is called the dimension of
the system
3 / 25
Example 1
Rewrite the system
dx
= 2x − z
dt
dy
= −x − z
dt
dz
=x +y
dt
in matrix form.
4 / 25
Example 2
Rewrite the system
ẋ = x,
ẏ = 2x − y
in matrix form.
5 / 25
Example 2, continued
The direction field and some solutions from pplane are shown
below.
x’=x
y’=2x−y
3
2
y
1
0
−1
−2
−3
−3
−2
−1
0
x
1
2
3
We can see an equilibrium point, some straight-line solution
curves, and some solution curves that are not straight lines.
6 / 25
Some properties of linear systems
In general, equilibrium solutions of
dY
= AY
dt
are values of Y = Y0 such that AY0 = 0.
A useful result: If det(A) 6= 0, then Y(t) = 0 is the only
equilibrium solution to
dY
= AY
dt
Why?
7 / 25
Example 2, again
Show that there is only one equilibrium solution to the system
dY
1 0
=
Y
2 −1
dt
8 / 25
Straight-line solutions in Example 2
We can show that
Y1 (t) =
et
et
and Y2 (t) =
0
e −t
are solutions of the system
dY
=
dt
1 0
2 −1
Y.
These are straight-line solutions, i.e., when these solutions are
plotted in the phase plane, they lie on straight lines through the
origin.
How do we know?
Can we always find straight-line solutions to a linear system?
9 / 25
Finding straight-line solutions
What conditions do we need, in order for a straight-line solution to
exist for a given problem?
10 / 25
Finding straight-line solutions
At a point (x0 , y0 ) on a straight-line solution, the vector field must
point either in the same direction as the vector from the origin to
(x0 , y0 ) or in the opposite direction.
This means
Av = λv
where v =
x0
y0
(1)
and λ is a real number.
I If λ > 0, the vector field points in same direction as v, i.e.,
away from the origin.
I If λ < 0, the vector field points in opposite direction to v, i.e.,
towards the origin.
A number λ that satisfies Equation (1) for non-zero v is called an
eigenvalue of A. The vector v is called an eigenvector with
corresponding eigenvalue λ.
11 / 25
Finding straight-line solutions, continued
Conversely, if v is an eigenvector of A with corresponding real
eigenvalue λ, then
Y(t) = e λt v
is a straight-line solution to
dY
= AY.
dt
As t varies, e λt just increases or decreases or remains constant
(depending on λ) and v is constant, so the solution curve for Y(t)
is a straight line.
12 / 25
Finding straight-line solutions
Therefore, to find a straight-line solution to the system of
equations
dY
= AY,
dt
we must find a real eigenvalue, λ, of A with corresponding
eigenvector v. Then
Y(t) = e λt v
will be a solution to the system with the corresponding solution
curve being a straight-line.
13 / 25
Example 2 again:
Find any straight-line solutions to
dY
1 0
=
Y.
2 −1
dt
14 / 25
Some useful linear algebra
If Y1 (t) and Y2 (t) are both solutions to
dY
= AY
dt
then so is
k1 Y1 (t) + k2 Y2 (t)
for any constants k1 and k2 .
The function
k1 Y1 (t) + k2 Y2 (t)
is called a linear combination of Y1 and Y2 .
15 / 25
Linear independence of vectors in the plane
Two vectors in the plane are linearly independent if neither vector
is a multiple of the other, i.e., if they do not both lie on the same
line through the origin.
1
2
e.g. v1 =
and v2 =
are linearly independent.
1
−1
e.g. v1 =
1
1
and v2 =
−2
−2
are linearly dependent.
16 / 25
Linear independence of vectors in the plane
If two vectors
x1
y1
x2
y
2
and
are linearly independent, then
x0
any other planar vector
can be written as a linear
y0
combination of these two vectors, i.e., there are constants k1 and
k2 such that
x1
x2
x0
k1
+ k2
=
y1
y2
y0
17 / 25
Linear independence of solutions to a 2D system
Some special linear algebra results apply to solutions of ODEs.
Consider the DE
dY
= AY
dt
where A is a 2 × 2 matrix.
If Y1 (t) and Y2 (t) are solutions and Y1 (0) and Y2 (0) are linearly
independent vectors, then Y1 (t) and Y2 (t) are linearly
independent vectors for all t.
In this case we say that Y1 (t) and Y2 (t) are linearly independent
solutions, and every solution to the system of DEs can be written
as
Y(t) = c1 Y1 (t) + c2 Y2 (t)
for appropriately chosen c1 and c2 .
18 / 25
Linear independence of vectors in higher dimensions
These results can be generalised to higher dimensions.
A set of vectors {v1 , v2 , . . . , vm } is linearly dependent if there are
constants c1 , c2 , . . . , cm (not all zero) such that
c1 v1 + c2 v2 + . . . + cm vm = 0
(2)
If all the constants ci are zero whenever equation (2) is satisfied,
the set of vectors is linearly independent.
Then, if Y1 (t), Y2 (t), . . . Yn (t) are solutions to a linear ODE and
Y1 (0), Y2 (0), . . . Yn (0) are linearly independent vectors, then
Y1 (t), Y2 (t), . . . Yn (t) are linearly independent vectors for all t.
In this case, we say Y1 (t), Y2 (t), . . . Yn (t) are linearly
independent solutions.
19 / 25
Solutions to higher dimensional systems of DEs
If Y1 (t), Y2 (t),..., Ym (t), are linearly independent solution vectors
to the system
dY
= AY
dt
where A is an m × m matrix, then the general solution to the
system is
Y(t) = c1 Y1 (t) + c2 Y2 (t) + · · · + cm Ym (t)
where c1 , c2 ,..., cm are arbitrary constants.
That is, every solution to the system can be written in this form by
appropriate choice of c1 , c2 ,..., cm .
20 / 25
Finding linearly independent solutions
Another useful result from linear algebra:
If a matrix A has n distinct eigenvalues λj then the eigenvectors vj
are linearly independent.
Hence, the straight-line solutions
Y1 (t) = e λ1 t v1 , Y2 (t) = e λ2 t v2 , . . . , Yn (t) = e λn t vn
are linearly independent at t = 0 and thus are linearly independent
solutions for all t.
21 / 25
Example 3:
Find three linearly independent solutions to
dY
= AY
dt
where


2 0
0
A =  3 −4 0  .
0 1 −2
Hence find the solution to the IVP


0
dY
= AY, Y(0) =  2  .
dt
0
22 / 25
Example 3:


2 0
0
A =  3 −4 0  .
0 1 −2
23 / 25
Grand summary
If A is an m × m matrix with real eigenvalues λ1 , ..., λk , with
corresponding eigenvectors v1 , ..., vk , then
Y1 = e λ1 t v1 , . . . , Yk = e λk t vk
are straight-line solutions of the system
dY
= AY.
dt
Furthermore, if all the λi are distinct and k = m (i.e., there are m
real and distinct eigenvalues of A), then the set {Y1 , ..., Yk } is
linearly independent and the general solution to the system is
Y(t) = c1 Y1 + ... + cm Ym .
24 / 25
Important ideas from today’s lecture:
I Straight-line solutions
I If Y1 (t) and Y2 (t) are both solutions to dY = AY,
dt
then so is k1 Y1 (t) + k2 Y2 (t) for any constants k1 and k2 .
I If λ1 , . . . , λm are distinct real eigenvalues of A with
corresponding eigenvectors v1 , . . . , vm , then
Y1 (t) = e λ1 t v1 , . . . , Ym (t) = e λm t vm
are straight-line solutions of the system
dY
= AY
dt
and the general solution is
Y(t) = c1 Y1 (t) + c2 Y2 (t) + . . . + cm Ym (t)
for constants c1 , c2 , . . . , cm .
25 / 25
Maths 260: Differential Equations
Lecture 16: Classification of equilibria in linear systems with
distinct real eigenvalues
I Reading for this lecture: BDH Section 3.3
I Suggested exercises: BDH Section 3.3 #1,5,9,11,19
I Reading for next lecture: BDH Section 3.5
1/1
Recall from the Previous Lecture
If A is an m × m matrix with real eigenvalues λ1 , ..., λk , with
corresponding eigenvectors v1 , ..., vk , then
Y 1 = e λ1 t v 1 , . . . , Y k = e λk t v k
are straight-line solutions of the system
dY
= AY.
dt
Furthermore, we can add these solutions together to find new
solutions of the form:
Y(t) = c1 Y1 + ... + ck Yk .
If k = m, then this linear combination is the general solution to
the system.
2/1
Linear Systems
This lecture looks at systems of the form
dY
= AY
dt
where A is a matrix with distinct real eigenvalues.
All such systems have an equilibrium at the origin.
This lecture will answer the question: What sorts of behaviour
can happen, in phase space, near the origin?
3/1
Example 1
Determine the behaviour of solutions to the system
dY
2 6
=
Y.
1 −3
dt
Sketch the phase portrait.
4/1
We find that the general solution is
6
1
3t
−4t
Y(t) = c1 e
+ c2 e
.
1
−1
5/1
To see the behaviour of solutions that are not straight-line
solutions, i.e., solutions with c1 6= 0 and c2 6= 0, note that as
t→∞
6
1
6
3t
−4t
3t
Y(t) = c1 e
+ c2 e
→ c1 e
1
−1
1
i.e., as t → ∞, these solutions behave like the straight-line solution
6
3t
c1 e
.
1
Similarly, as t → −∞, these solutions behave like the straight-line
solution
1
−4t
c2 e
.
−1
We use these observations to sketch the phase portrait.
6/1
Phase portrait for
dY
=
dt
2 6
1 −3
Y.
3
2
y
1
0
1
2
3
3
2
1
0
x
1
2
3
7/1
Direction field and some solutions from pplane
x’=2x+6y
y’=x−3y
y
2
1
0
−1
−2
−2
−1
0
x
1
2
8/1
Note that on solution curves for the straight-line solution
6
3t
Y1 (t) = c1 e
,
1
the arrows point away from the origin, because
Y1 (t) → 0 as t → −∞.
Similarly, arrows on the solution curves for the straight-line solution
1
−4t
Y2 (t) = c2 e
−1
point towards the origin, because Y2 (t) → 0 as t → ∞.
9/1
Saddles
Example 1 illustrates typical behaviour of solutions to a planar
linear system with one positive real eigenvalue and one negative
real eigenvalue.
A characteristic feature of the phase portrait is the presence of two
special lines (straight-line solutions):
I On one line, solutions tend to the origin as t → −∞.
I On the other line, solutions tend to the origin as t → ∞.
I All other solutions tend to ∞ as t → ±∞.
The equilibrium point at the origin in this type of system is called
a saddle.
10 / 1
Example 2:
Determine the behaviour of solutions to the system
dY
−4 −2
=
Y.
−1 −3
dt
11 / 1
The general solution is
Y(t) = c1 e
−5t
2
1
+ c2 e
−2t
1
−1
.
Note that
e −5t → 0 and e −2t → 0, as t → ∞,
and so all solutions tend to the origin as t increases.
12 / 1
Phase portrait for
dY
=
dt
3
−4 −2
−1 −3
Y.
2
y
1
0
1
2
3
3
2
1
0
x
1
2
3
13 / 1
Direction field and some solutions:
x’=−4x−2y
y’=−x−3y
2
y
1
0
−1
−2
−2
−1
0
x
1
2
This picture suggests that most solutions are tangent to the
straight-line solution
1
−2t
e
.
−1
14 / 1
We can prove this is the case, as follows.
The slope of a solution curve is
dy
dy /dt
=
dx
dx/dt
15 / 1
So, if c2 6= 0,
lim
t→∞
dy
dx
= −1.
Thus as t → ∞, all solutions tend to the origin and almost all are
tangent to the straight-line solution
1
−2t
e
.
−1
16 / 1
Sinks
In general, in a linear system with two real, negative eigenvalues λ1
and λ2 , with λ1 < λ2 < 0, all solutions tend to the origin as
t → ∞.
The equilibrium point in this type of system is called a sink.
Except for those solutions starting on the line of eigenvectors
corresponding to λ1 , all solutions are tangent at (0, 0) to the line
of eigenvectors corresponding to λ2 .
This means that almost all solutions are tangent to the eigenvector
corresponding to the slow eigenvalue, i.e., the eigenvalue closest to
zero.
17 / 1
Example 3
Determine the behaviour of solutions to the system
dY
4 2
=
Y.
1 3
dt
18 / 1
The general solution is
Y(t) = c1 e
5t
2
1
+ c2 e
2t
1
−1
As t → ∞, all non-zero solutions move away from the origin.
The equilibrium point in this case is called a source.
19 / 1
Direction field and some solutions:
x’= 4x+2y
y’= x+3y
2
y
1
0
−1
−2
−2
−1
0
x
1
2
This picture suggests that as t → −∞ most solutions are tangent
to the straight-line solution
1
2t
e
.
−1
20 / 1
We can prove this either:
I by the method used in Example 2, or
I by noting that this example corresponds to reversing time in
Example 2. Hence, the phase portrait is the same as in last
example but with direction of arrows reversed.
21 / 1
Sources
In general, in a linear system with two real, positive eigenvalues λ1
and λ2 , with 0 < λ1 < λ2 , all solutions tend away from the origin
as t → ∞.
Except for those solutions starting on the line of eigenvectors
corresponding to λ2 , then all solutions are tangent at (0, 0) to the
line of eigenvectors corresponding to the smaller eigenvalue λ1 .
This means that almost all solutions are tangent to the eigenvector
corresponding to the ‘slow’ eigenvalue, i.e., the eigenvalue closest
to zero. This is just as we found for the behaviour of solutions near
a sink.
22 / 1
Higher Dimensions
This classification of equilibria extends to higher dimensions in a
natural way.
For the system
dY
= AY
dt
Y(t) = 0 is always an equilibrium.
Assuming that all eigenvalues of A are real and distinct, then:
I If all eigenvalues of A are positive, Y(t) = 0 is a source.
I If all eigenvalues of A are negative, Y(t) = 0 is a sink.
I If at least one eigenvalue of A is negative and at least one
eigenvalue is positive, Y(t) = 0 is a saddle.
23 / 1
Important ideas from today’s lecture:
For the system
dY
= AY
dt
in the case that all eigenvalues of A are real and distinct:
I If all the eigenvalues are positive, Y(t) = 0 is a source.
All solutions tend to the origin as t → −∞.
I If all the eigenvalues are negative, Y(t) = 0 is a sink.
All solutions tend to the origin as t → ∞.
I If at least one eigenvalue is negative and at least one
eigenvalue is positive, Y(t) = 0 is a saddle.
Most solutions tend to ∞ as t → ±∞.
In the case of a sink or a source, solution curves are tangent at the
origin to the “slow” eigenvector, i.e., the eigenvector with
corresponding eigenvalue closest to zero.
24 / 1
Maths 260: Differential Equations
Lecture 17: Complex 1: Complex numbers
I Reading for this lecture:
“Some notes on complex numbers” (available on Canvas)
BDH Appendix C
1 / 19
Example 1
Consider the system
dY
=
dt
1 −2
2 1
Y.
Slope field and some solutions:
!
!
!"#$"%!&!#!!!2!y
!"y$"%!&!2!#!)!y
!
!
2
1.5
1
y
0.5
0
!0.5
!1
!1.5
!2
!2
!1.5
!1
!0.5
0
#
0.5
1
1.5
2
There are no straight-line solutions – What is going on?
2 / 19
Reminder on linear systems
dY
=
dt
a b
c d
Y.
with eigenvalues λ1 and λ2
3 / 19
!
!
!"#$"%!&!#!!!2!y
!"y$"%!&!2!#!)!y
!
!
2
1 −2
2 1
1.5
Y.
1
0.5
0
y
dY
=
dt
!0.5
!1
Test with pplane.jar
!1.5
!2
!2
!1.5
!1
!0.5
0
#
0.5
1
1.5
2
Calculate the eigenvalues:
A=
1 −2
2 1
4 / 19
We need the square root of a negative number! The matrix
doesn’t have any eigenvalues that are real numbers. That’s why
there are no straight-line solutions to the system of DEs.
However, we can still find eigenvalues that are complex numbers.
We can still calculate two eigenvalues provided we introduce a new
number:
√
i = −1
5 / 19
Example 2
Calculate
√
−25 and
q
− 16
9 .
So for the previous example, the two eigenvalues are:
6 / 19
Example 3
Find the solutions to x2 + 2x + 2 = 0.
We can use the quadratic formula to get two (possibly complex)
solutions to any quadratic equation
ax2 + bx + c = 0.
7 / 19
Fundamental Theorem of Algebra
More generally, we have the following result:
Every nth degree polynomial
an xn + an−1 xn−1 + ... + a1 x + a0 = 0
has n solutions. This means that the polynomial can be factorised:
an xn + an−1 xn−1 + ... + a1 x + a0
= an (x − x1 )(x − x2 )(x − x3 ) . . . (x − xn )
where x1 , x2 , . . . , xn are the roots of the equation.
Note that some of these xi may be repeated roots, and some may
be complex roots.
8 / 19
Complex numbers
Definition: A complex number is a number of the form
z = a + ib
where a and b are real and i2 = −1.
We can think of a complex number as a pair of real numbers (a, b).
Plotting this pair as a point in the plane gives us a geometric
interpretation of complex numbers - the Argand Diagram.
9 / 19
Definitions
For a complex number z = a + ib,
I The real part, written Re z, is a.
I The imaginary part, written Im z, is b.
I The complex conjugate is z̄ = a − ib.
I The modulus is |z| =
√
a2 + b2 =
√
z z̄.
10 / 19
Example 4: z = 2 − 3i, compute:
I z̄
I Re z
I Im z
Example 5: z = 6i + 1, compute:
I z̄
I Re z
I Im z
11 / 19
Arithmetic of Complex Numbers
Addition/Subtraction: Collect real and imaginary terms
(add/subtract the real and imaginary parts separately).
Example 6: (2 + 4i) + (3 − 2i)
Example 7: (−1 − 4i) − (4 + 3i)
12 / 19
Multiplication: Multiply out brackets and collect real and
imaginary terms, remembering that i2 = −1.
Example 8: (2 + 4i)(3 − 2i)
Example 9: (−1 − 4i)(4 + 3i)
13 / 19
Example 4 again: z = 2 − 3i, compute:
I z + z̄
I z z̄
I |z|
Example 5 again: z = 1 + 6i, compute:
I z + z̄
I z z̄
I |z|
14 / 19
Division: Multiply top and bottom by complex conjugate of
denominator, then collect real and imaginary terms.
Example 10:
2 + 4i
3 + 2i
Example 11:
−1 − 4i
4 − 3i
15 / 19
Polar Form
Another way of describing a complex number is to use
polar co-ordinates.
We write
z = a + ib = r(cos θ + i sin θ)
√
where a = r cos θ, b = r sin θ, r = a2 + b2 , θ = tan−1 (b/a)
We call r the modulus of z, denoted |z|, and we call θ the
argument of z, denoted arg z.
16 / 19
Example 12: Find the polar form of z = 1 + i, i.e., find the
modulus and argument of z.
Example 13: Find the polar form of z =
√
√
2 − i 2.
17 / 19
Example 14: Write the complex number with modulus 3 and
argument 3π/2 in rectangular form, i.e., in the form z = a + ib for
some a and b.
Example 15: Write the complex number with modulus 2 and
argument 3π/4 in rectangular form.
18 / 19
Important ideas from today’s lecture:
I Arithmetic of complex numbers - addition, subtraction,
multiplication, division
I Fundamental theorem of algebra: an nth order polynomial
always has n roots (if complex roots are counted)
I The Argand diagram
I Polar coordinates
19 / 19
Maths 260: Differential Equations
Lecture 19: Complex 2: Complex numbers
I Topics for today:
Complex 2: De Moivre’s formula
Derivatives of complex-valued functions
Euler’s formula
The exponential of a complex number
I Reading for this lecture:
Some notes on complex numbers
BDH Appendix C
1 / 16
Multiplication using polar form
Let
z1 = r1 (cos θ1 + i sin θ1 )
and
z2 = r2 (cos θ2 + i sin θ2 )
be any two complex numbers. Then
z1 z2 = r1 r2 (cos(θ1 + θ2 ) + i sin(θ1 + θ2 ))
Proof:
Hence, multiplying complex numbers in polar form corresponds to
taking the product of the moduli and the sum of the arguments.
2 / 16
Example 1: Calculate (cos θ + i sin θ)2
Example 2: Calculate (cos θ + i sin θ)3
3 / 16
de Moivre’s formula
Examples 1 and 2 give particular cases of de Moivre’s formula:
(cos(θ) + i sin(θ))n = cos(nθ) + i sin(nθ).
Example 3: Use de Moivre’s formula to express cos 2θ and sin 2θ
in terms of cos θ and sin θ.
4 / 16
Polar form and solving equations
Example 4: Find all solutions to the equation z 3 = 1.
z = 1 is obviously a solution. Any others? We expect three
solutions from the Fundamental Theorem of Algebra.
Write
z = r(cos θ + i sin θ),
where r = |z| > 0. Then
z 3 = r3 (cos 3θ + i sin 3θ)
and therefore
r3 (cos 3θ + i sin 3θ) = 1
So...
5 / 16
Note that we get only three distinct solutions because of the
periodicity of cosine and sine.
Plot the solutions in the Argand plane:
6 / 16
Example 5
Find all solutions to the equation z 3 = 1 + i.
7 / 16
Derivatives of complex valued functions
Suppose t is real and f (t) is a complex-valued function of t, i.e.
f (t) = u(t) + iv(t)
for some real-valued functions u and v.
Then, if u and v are differentiable with respect to t, we define the
derivative of f (t) to be
df
du
dv
=
+i
dt
dt
dt
Example 6:
Find the derivative of the function f (t) = cos(t) + i sin(t).
8 / 16
Properties of the function f (t) = cos(t) + i sin(t):
I f 0 (t) = if (t),
I f (0) = 1,
I f (t1 )f (t2 ) = f (t1 + t2 ).
Compare this to the function g(t) = eat , where a is real:
Properties of g(t):
I g 0 (t) =
I g(0) =
I g(t1 )g(t2 ) =
9 / 16
Euler’s formula
The similarities between the properties of f and g prompted Euler
to make the following definition:
Euler’s Formula:
eit = cos t + i sin t
10 / 16
Euler’s Formula and Polar form
Example 7: Rewrite z = 1 + i using the complex exponential.
In general, a complex number z = a + ib can be written in polar
form as
z = reiθ
√
where r = a2 + b2 and θ = tan−1 (b/a).
11 / 16
Arithmetic in exponential form
Now multiplication and division are easy.
Example 8: If z1 = 2eiπ/6 and z2 = −eiπ/4 , compute z1 z2 and
z1 /z2
12 / 16
Arithmetic in exponential form
We can easily calculate powers using complex exponentials.
Example 9: If z = 3eiπ/5 , find z 2 and z 5 .
13 / 16
Other properties of complex exponentials
We have: ex+iy = ex eiy = ex (cos y + i sin y)
Example 10: Calculate the real and imaginary parts of e(2+3i)t .
Example 11: Calculate the real and imaginary parts of e(−1−4i)t .
14 / 16
Derivatives in exponential form
If λ is a complex number then
d λt e
= λeλt .
dt
Proof:
15 / 16
Important ideas from today’s lecture:
I de Moivre’s formula
(cos(θ) + i sin(θ))n = cos(nθ) + i sin(nθ).
I Euler’s formula
eit = cos t + i sin t
I Derivatives of complex-valued functions
I The complex exponential
16 / 16
Maths 260: Differential Equations
Lecture 20: Complex 3: Complex eigenvalues and eigenvectors
I Reading for this lecture:
“Some notes on complex numbers”
BDH Appendix C
I Reading for next lecture:
BDH Section 3.4
1 / 12
Complex eigenvalues and eigenvectors
The procedure for finding complex eigenvalues and eigenvectors for
a matrix is the same as for real eigenvalues and eigenvectors but
the calculations can seem trickier because of the complex algebra.
Example
1 Find the eigenvalues and eigenvectors of the matrix
3 2
.
−2 3
2 / 12
For λ1 =
For λ2 =



00
v1 =  00 
00

00
v2 =  00 
00
3 / 12
Example 2 Find the eigenvalues and eigenvectors of the matrix


1 0
0
 0 2 −3  .
1 3
2
4 / 12
For λ1 =


00
v1 =  00 
00
For λ2 =
/λ3 =


 
0
0
v2 =  0  and v3 =  0 
0
0
5 / 12
Examples 1 and 2 illustrate two important points:
I If a matrix has only real components, then any complex
eigenvalues come in complex conjugate pairs.
I The corresponding eigenvectors come in complex conjugate
pairs also.
6 / 12
It is not always obvious when a vector with complex entries is a
constant multiple of another vector - but it is easy to check by
multiplication.
2i
Example 3: Show that
is an eigenvector of the matrix
−1
1 4
corresponding to the eigenvalue 1 + 2i.
−1 1
7 / 12
Example 4


3i
Show that  1  is an eigenvector of the matrix
0


1 9 1
 −1 1 1  corresponding to the eigenvalue 1 − 3i.
0 0 1
8 / 12
We often want to compute the real and imaginary parts of
complex-valued expressions.
Example 5:
Compute the real and imaginary parts of e(2−i)t
2+i
3
9 / 12
Example 6
Compute the real and imaginary parts of e(2+3i)t
1 − 3i
4i
10 / 12
Example 7


−i
Compute the real and imaginary parts of e−3t  3 
3i − 4
11 / 12
Important ideas from today’s lecture:
I Computing complex eigenvalues and eigenvectors
I If a matrix has only real entries, then any complex eigenvalues
come in complex conjugate pairs
I The corresponding eigenvectors come in complex conjugate
pairs too
I Separating real and imaginary parts of complex-valued
expressions
12 / 12
Maths 260: Differential Equations
Lecture 20: Linear systems with complex eigenvalues
I Reading for this lecture: BDH Section 3.4
I Suggested exercises:
BDH Section 3.4, #1, 3, 5, 7, 9, 11, 23
I Reading for next lecture: BDH Section 3.5
1 / 22
Example 1
Here is the slope field and some solutions for the system
dY
1 −2
=
Y
2 1
dt
x’=x−2y
y’=2x+y
2
1.5
1
y
0.5
0
−0.5
−1
−1.5
−2
−2
−1.5
−1
−0.5
0
x
0.5
1
1.5
2
Why does the phase portrait have no straight-line solutions?
2 / 22
In this example the eigenvalues are complex: 1 ± 2i
We saw in earlier lectures that straight-line solutions result from
real eigenvalues.
We found that
Y(t) = eλt v
is always a solution to
dY
= AY
dt
if λ is an eigenvalue of A with eigenvector v.
This is true even if λ is complex. However, the corresponding
solution curve will not be a straight line if λ is not real.
3 / 22
Example 1 again:
Find two linearly independent solutions of the system:
dY
1 −2
=
Y.
2 1
dt
How do we interpret a complex-valued solution? We would like a
real-valued solution.
4 / 22
Theorem:
Consider the system
dY
= AY
dt
If Y(t) is a complex-valued solution to the system, write
Y(t) = YR (t) + iYI (t)
where YR (t) and YI (t) are real-valued functions.
Then YR (t) and YI (t) are solutions to the system and are linearly
independent.
Proof:
5 / 22
Example 1 again:
Find two linearly independent real-valued solutions of the system:
dY
1 −2
=
Y
2 1
dt
and hence write down the general solution in terms of real-valued
functions.
6 / 22
Phase portraits
We see from the general solution that each component of Y(t)
oscillates between positive and negative values and that the
amplitude of each component grows exponentially.
The following figures show the phase portrait and components of
the solution to Example 1 with initial condition x(0) = 1, y (0) = 0.
x’=x−2y
y’=2x+y
20
2
15
1.5
10
1
0.5
y
x,y
5
0
0
−0.5
−5
−1
−10
−1.5
−2
−15
−4
−2
−1.5
−1
−0.5
0
x
0.5
1
1.5
2
−3
−2
−1
0
1
2
3
t
7 / 22
In Example 1, we found two linearly independent real-valued
solutions by taking the real and imaginary parts of the
complex-valued solution
1
(1+2i)t
e
−i
What if we instead used the real and imaginary parts of the other
complex-valued solution we found, i.e.,
(1−2i)t 1
e
?
i
8 / 22
We find that:
I The other complex-valued solution also gives us two
real-valued solutions.
I These solutions are just multiples of the real-valued solutions
already found, i.e., using the other complex-valued solution
gives no new information.
I Thus, we can form the general solution using the real and
imaginary parts of just one of the complex conjugate pair of
solutions.
9 / 22
In general...
Suppose A has complex eigenvalues λ1 = α + iβ and λ2 = α − iβ.
Then the system
dY
= AY
dt
has a solution of the form
Y(t) = e(α+iβ)t v1
where v1 is the eigenvector corresponding to eigenvalue λ1 .
Expanding the exponential yields
Y(t) = e(α+iβ)t v1 = e αt (cos(βt) + i sin(βt))v1
So the general solution is a combination of exponential and
trigonometrical terms. The qualitative behaviour of solutions
depends on α and β.
10 / 22
Phase portraits
When A is a 2 by 2 matrix, the trigonometric terms oscillate
between positive and negative values, with period 2π/β, and
solution curves spiral around the origin in the phase plane.
Case 1: If α > 0, then exp(αt) → ∞ as t → ∞ so solution curves
spiral away from the origin, and the equilibrium at the origin is
called a spiral source.
Typical phase portraits for a spiral source:
11 / 22
Phase portraits
Case 2: If α < 0, then exp(αt) → 0 as t → ∞ so solution curves
spiral into the origin, and the equilibrium at the origin is called a
spiral sink.
Typical phase portraits for a spiral sink:
12 / 22
Phase portraits
Case 3: If α = 0, then exp(αt) = 1 for all t and solutions are
periodic. Solution curves return to their initial point in the phase
plane and retrace the same curve over and over again. In this case,
the equilibrium at the origin is called a centre.
Typical phase portraits for a centre:
13 / 22
Example 1 again:
Sketch the phase portrait for the system
dY
1 −2
=
Y
2 1
dt
The eigenvalues are 1 ± 2i, i.e. α = 1, β = 2, and so the origin is a
spiral source.
14 / 22
Which direction?
To determine whether a spiral is clockwise or anticlockwise,
evaluate the vector field at a point.
For example, at (x, y ) = (0, 1) on the y -axis, the direction of the
solution through this point is given by
ẋ
0
−2
=A
=
ẏ
1
1
which is a vector pointing up and left.
This is not consistent with a clockwise spiral so solutions must
spiral around the origin in an anticlockwise direction.
15 / 22
Example 2
Sketch the phase portrait for the system
dY
−2 3
=
Y
−1 0
dt
16 / 22
Direction field and some solutions:
x’=−2x+3y
y’=−x
4
3
2
y
1
0
−1
−2
−3
−4
−4
−3
−2
−1
0
x
1
2
3
4
Exercise: Show that the general solution to the system, written in
terms of real-valued functions, is
√
√ √
√ √
√
−t cos 2t + √ 2 sin 2t
−t sin 2t − √2 cos 2t
Y(t) = c1 e
+c2 e
cos 2t
sin 2t
17 / 22
Example 3
Sketch the phase portrait for the system
dY
0 −3
=
Y
1 0
dt
18 / 22
Direction field and some solutions:
x’=−3y
y’=x
4
3
2
y
1
0
−1
−2
−3
−4
−4
−3
−2
−1
0
x
1
2
3
4
Exercise: Show that the general solution to the system, written in
terms of real-valued functions, is
√ √
3 cos √3t
3 sin 2t
√
√
√
Y(t) = c1
+ c2
3 sin 3t
− 3 cos 3t
19 / 22
Dependence of phase portrait on real and imaginary parts
of e-values
Notice that the 2 by 2 matrix
A=
α −β
β α
has eigenvalues α ± iβ.
Using pplane we can see how varying α and β in the equation
ẋ = αx − βy
ẏ = βx + αy
changes the phase portrait.
20 / 22
Important ideas from today
I If A is a matrix with an eigenvalue λ and corresponding
eigenvector v, then
Y(t) = eλt v
is a solution to
dY
= AY
dt
regardless of whether λ is real or complex.
I However, the corresponding solution curve will not be a
straight line if λ is complex.
21 / 22
I If A is a 2 by 2 matrix with eigenvalue λ = α + iβ with
β 6= 0, there are three possibilities:
1. If α > 0, the origin is a spiral source and solutions spiral away
from the origin as t increases.
2. If α < 0, the origin is a spiral sink and solutions spiral towards
the origin as t increases.
3. If α = 0, the origin is a centre and solutions are periodic,
forming closed curves around the origin.
I We determine the direction in which solutions spiral (i.e.
clockwise or anticlockwise) by examining the direction of the
solution through one point near the origin.
22 / 22
Maths 260: Differential Equations
Lecture 21: Linear systems with repeated/zero eigenvalues
I Reading for this lecture: BDH Section 3.5
Note that pages 317-324 show an alternative method to that
covered in this lecture.
I Suggested exercises: BDH Section 3.5, #1, 3, 5, 7, 11, 21
I Reading for next lecture: BDH Section 3.7
1 / 19
Linear systems with repeated eigenvalues
Example 1: Find the general solution for the system
dY
=
dt
2 0
Y
0 2
2 / 19
Phase portrait
x’=2x
y’=2y
4
3
2
y
1
0
−1
−2
−3
−4
−4
−3
−2
−1
0
x
1
2
3
4
Every non-zero solution is a straight-line solution.
3 / 19
Repeated eigenvalues with two eigenvectors
Example 1 illustrates a general situation.
I If matrix A has a repeated eigenvalue λ with two linearly
independent eigenvectors v1 and v2 , then
Y1 = eλt v1
and Y2 = eλt v2
are linearly independent straight line solutions.
I We construct a general solution from a linear combination of
these two solutions as usual:
Y(t) = c1 eλt v1 + c2 eλt v2
I Furthermore, if A is a 2 by 2 matrix, then every solution
except the equilibrium at the origin is a straight line solution.
4 / 19
I If λ > 0 then every non-zero solution tends to ∞ as t → ∞,
and the origin is a source.
I If λ < 0 then every non-zero solution tends to the origin as
t → ∞, and the origin is a sink.
5 / 19
What happens if we cannot find two linearly independent
eigenvectors?
Example 2: Investigate solutions to the system
dY
=
dt
−5 0
Y
8 −5
6 / 19
Phase portrait:
x’=−5x
y’=8x−5y
4
3
2
y
1
0
−1
−2
−3
−4
−4
−3
−2
−1
0
x
1
2
3
4
We see that the system has only one straight line solution.
We cannot write the general solution as a linear combination of
solutions of the form eλt v because we do not have enough such
solutions.
7 / 19
Finding a second solution
To find a second solution, we use the following result.
Theorem: Consider the system
dY
= AY
dt
where A has a repeated eigenvalue λ with just one linearly
independent eigenvector. Pick a specific eigenvector v1 for λ.
Then
Y1 = eλt v1
is a straight-line solution and
Y2 = eλt (tv1 + v2 )
is a second, linearly independent solution of the system, where v2
is a vector satisfying
(A − λI)v2 = v1 .
v2 is called a generalised eigenvector.
8 / 19
Proof:
9 / 19
We can use this second solution Y2 (t) to construct the general
solution for the previous example.
Example 2 again: Find the general solution to
dY
=
dt
−5 0
Y
8 −5
10 / 19
In the phase portrait shown earlier, we see that all solutions are
tangent at the origin to the direction of the straight-line solution.
This is always the case in a 2 by 2 system: when there is a
non-zero repeated eigenvalue with only one corresponding linearly
independent eigenvector, all solution curves in the phase plane are
tangent to the straight-line solution. The tangency is “one-sided”.
Exercise: prove this.
11 / 19
Important note:
There is some freedom when choosing a generalised eigenvector.
For example, in Example 2
1
v2 = 8
y2
is a generalised eigenvector for any choice of y2 .
However, a multiple of a generalised eigenvector is not usually a
generalised eigenvector. For example, in Example 2
1
v2 = k 8
y2
is not a generalised eigenvector unless k = 1.
Different choices of the generalised eigenvector all lead to the same
general solution. (Exercise: check this statement.)
12 / 19
Example 3
Sketch the phase portrait for the system
dY
2 −1
=
Y
1 0
dt
13 / 19
Phase portrait:
x’=2x−y
y’=x
4
3
2
y
1
0
−1
−2
−3
−4
−4
−3
−2
−1
0
x
1
2
3
4
14 / 19
Linear systems with zero eigenvalues
Example 4: Find the general solution to the system
dY
=
dt
−1 2
Y
2 −4
15 / 19
The general solution is
−5t
Y(t) = c1 e
If c1 = 0, then
1
2
+ c2
−2
1
2
Y(t) = c2
1
which is constant, so this is an equilibrium solution for all choices
of c2 .
This is a general result: all points on a line of eigenvectors
corresponding to a zero eigenvalue are equilibrium solutions.
16 / 19
If c1 6= 0, the first term in the general solution tends to zero as
t → ∞, i.e., the solution tends to the equilibrium
2
Y(t) = c2
1
1
.
−2
as t → ∞, along a line parallel to the vector
x’=−x+2y
y’=2x−4y
4
3
2
y
1
0
−1
−2
−3
−4
−4
−3
−2
−1
0
x
1
2
3
4
17 / 19
We get similar behaviour in other linear systems with a zero
eigenvalue, but details of the general solution and the phase
portrait may vary depending on the specific example.
Example 5: Sketch the phase portrait for the system
dY
=
dt
0 1
Y
0 4
18 / 19
Important ideas from today
I In linear systems with repeated non-zero eigenvalues, the
behaviour of solutions depends on the number of linearly
independent eigenvectors corresponding to the repeated
eigenvalue.
I For a 2 by 2 system, there are two possibilities:
I If there are two linearly independent eigenvectors, then every
solution except the equilibrium is a straight line solution.
I If there is only one independent eigenvector, then there is only
one straight line solution, and all non-equilibrium solutions are
tangent to that solution.
I In both cases the equilibrium is a sink if the eigenvalue is
negative and is a source if the eigenvalue is positive.
I In a linear system with a zero eigenvalue, all points on the
line(s) of eigenvectors corresponding to the zero eigenvalue
are equilibrium solutions. Other details of the phase portrait
depend on the specific system.
19 / 19
Maths 260: Differential Equations
Lecture 22: Overview of linear systems: The Trace-Determinant
plane and bifurcations in linear systems
▶ Reading for this lecture: BDH Section 3.7
▶ Suggested exercises: BDH Section 3.7, #3, 5, 7, 9
▶ Reading for next lecture: BDH Section 5.1
1 / 30
A useful result from linear algebra
In our examples today, the following result will be useful:
For any square matrix, A,
▶ det(A) = product of the eigenvalues of A
▶ trace(A) = sum of the eigenvalues of A
2 / 30
a b
.
c d
This is easy to see for a 2 × 2 matrix, A =
The characteristic equation is
λ2 − (a + d)λ + ad − bc = 0, i.e.,
λ2 − T λ + D = 0
where T is the trace of A and D is the determinant of A.
If the eigenvalues are λ1 and λ2 we can also write the
characteristic equation as
(λ − λ1 )(λ − λ2 ) = λ2 − (λ1 + λ2 )λ + λ1 λ2 = 0.
Comparing the two expressions, we see that T = λ1 + λ2 and
D = λ1 λ2 .
√
2
Also: The eigenvalues are λ1,2 = T ± T2 −4D
3 / 30
Example 1: Use the trace and determinant to find the eigenvalues
of the matrix
−3 −5
A=
1
3
4 / 30
If A is a 2 by 2 matrix, the signs of det(A), trace(A) and the
discriminant T 2 − 4D tell us a lot about the type of the
equilibrium at the origin for the system
dY
= AY
dt
This can be summarised using the Trace-Determinant plane:
5 / 30
Case D < 0
6 / 30
Case D > 0, T > 0 and T 2 − 4D > 0
7 / 30
Case D > 0, T < 0 and T 2 − 4D > 0
8 / 30
Case D > 0, T > 0 and T 2 − 4D < 0
9 / 30
Case D > 0, T < 0 and T 2 − 4D < 0
10 / 30
As a flow chart
Determinant
Remark: A source or sink
arising from real eigenvalues
is often called a node.
Note that this is a different
meaning of “node” than used
in earlier lectures.
E’values are real and
have opposite sign
Trace
Saddle
Source (unstable)
Discriminant
Real e’values
(Nodal) source
Sink (stable)
Discriminant
Complex e’values
Real e’values
Complex e’values
Spiral source
(Nodal) sink
Spiral sink
11 / 30
Linear systems: Bifurcations
A bifurcation is a qualitative change in behaviour. For linear
systems it is a change from one type of equilibrium to another, e.g.
a change from a saddle to a nodal source, or a nodal source to a
spiral source.
From the Trace-Determinant plane we see that bifurcations must
occur on the region boundaries: D = 0, T = 0 (with D > 0) and
T 2 − 4D = 0.
12 / 30
Example 2: Consider the one-parameter family of linear systems
dY
1 2
=
Y
a 0
dt
where a is a parameter.
Determine the type of equilibrium at the origin for all values
of a. Sketch the phase portrait for representative values of a.
13 / 30
We find that the eigenvalues of matrix A are
√
√
1 + 1 + 8a
1 − 1 + 8a
λ1 =
, λ2 =
2
2
and that:
D = −2a,
T = 1,
T 2 − 4D = 1 + 8a.
There are qualitatively distinct cases can occur, depending on a.
Bifurcation values of a:
▶ D = 0:
▶ T = 0 (with D > 0):
▶ T 2 − 4D = 0:
14 / 30
Case 1: If a < −1/8, then D > 0, T > 0 and T 2 − 4D < 0, and
so the origin is a spiral source.
(Complex eigenvalues with Re(λ1,2 ) = T /2 > 0).
15 / 30
Case 2: If −1/8 < a < 0, then D > 0, T > 0 and T 2 − 4D > 0,
and so the origin is a nodal source.
(Real eigenvalues with 0 < λ2 < λ1 ).
16 / 30
Case 3: If a > 0, then D < 0, and so the origin is a saddle.
(Real eigenvalues with λ2 < 0 < λ1 ).
17 / 30
At the bifurcation values of a
▶ If a = 0 (corresponding to D = 0),
1 2
A=
0 0
In this case, the eigenvalues of A are 0 and 1, with
eigenvectors
2
1
and
,
−1
0
respectively.
18 / 30
▶ If a = −1/8 (corresponding to T 2 − 4D = 0),
A=
1
− 81
2
0
In this case, the eigenvalues of A are 1/2 (twice) with just
4
one linearly independent eigenvector
.
−1
19 / 30
Representative phase portraits plotted with pplane:
3
3
2
2
1
1
0
0
−1
−1
−2
−2
−3
−3
−3
−2
−1
0
1
2
3
−3
−2
−1
a=1
0
1
2
3
a=0
3
2
1
0
−1
−2
−3
−3
−2
−1
0
1
2
3
a = −1/16
20 / 30
3
3
2
2
1
1
0
0
−1
−1
−2
−2
−3
−3
−3
−2
−1
0
1
2
3
−3
−2
−1
a = −1/16 (again)
0
1
2
3
a = −1/8
3
2
1
0
−1
−2
−3
−3
−2
−1
0
1
2
3
a = −1
21 / 30
As a curve in the Trace-Determinant plane
The equations D = −2a and T = 1 correspond to a parametric
curve in the Trace-Determinant plane (the parameter is a).
22 / 30
Example 3:
Consider the one-parameter family of linear systems
dY
0 −1
=
Y
1 a
dt
where a is a parameter.
Determine the type of equilibrium at the origin for all values of a.
Sketch the phase portrait for representative values of a.
23 / 30
▶ a < −2, e.g. a = −3
▶ −2 < a < 0, e.g. a = −1
24 / 30
▶ 0 < a < 2, e.g. a = 1
▶ 2 < a, e.g. a = 3
25 / 30
At bifurcation values of a:
▶ a = −2
▶ a=0
▶ a=2
26 / 30
Representative phase portraits plotted with pplane:
3
3
2
2
1
1
0
0
−1
−1
−2
−2
−3
−3
−3
−2
−1
0
1
2
3
−3
−2
−1
a = −3
0
1
2
3
2
3
a = −2
3
3
2
2
1
1
0
0
−1
−1
−2
−2
−3
−3
−3
−2
−1
0
a = −1
1
2
3
−3
−2
−1
0
1
a=0
27 / 30
3
3
2
2
1
1
0
0
−1
−1
−2
−2
−3
−3
−3
−2
−1
0
1
2
3
−3
−2
−1
a=0
0
1
2
3
1
2
3
a=1
3
3
2
2
1
1
0
0
−1
−1
−2
−2
−3
−3
−3
−2
−1
0
a=2
1
2
3
−3
−2
−1
0
a=3
28 / 30
As a curve in the Trace-Determinant plane
The equations D = 1 and T = a correspond to a parametric curve
in the Trace-Determinant plane (the parameter is a).
29 / 30
Important ideas from today
The trace and determinant completely determine the type of
equilibrium point at the origin.
From the last two examples we see how bifurcations occur as a
parameter is varied:
▶ a centre occurs as a spiral sink changes to a spiral source, or
vice versa;
▶ an improper node (i.e., two equal eigenvalues with only one
linearly independent eigenvector) occurs when a spiral sink (or
source) turns into a real sink (or source), or vice versa;
▶ a linear system with a zero eigenvalue occurs when a saddle
turns into a sink or source, or vice versa.
30 / 30
Maths 260: Differential Equations
Lecture 23: Non-linear systems
I Topics for today:
Non-linear systems: linearisation near equilibria
Classification of equilibria in nonlinear systems
I Reading for this lecture: BDH Section 5.1
I Suggested exercises: BDH Section 5.1, #1, 3, 7, 9, 11
I Reading for next lecture: BDH Section 5.2
1 / 24
Example 1:
Consider the following nonlinear system:
dx
=y
dt
1
dy
= x − x3 − y
dt
2
How do we get information about solutions?
2 / 24
Slope field and some solutions:
dx/dt = y
dy/dt = x − x3 − 0.5 y
1.5
1
y
0.5
0
−0.5
−1
−1.5
−2
−1.5
−1
−0.5
0
x
0.5
1
1.5
2
The equilibrium at the origin looks like a saddle in a linear system,
and the other equilibria look like spiral sinks.
3 / 24
An approximation
We can understand the saddle-like nature of (0, 0) if we
approximate the nonlinear system by a linear system.
For x, y very close to zero, x 3 is much smaller than x or y .
We can therefore ignore the x 3 term in the nonlinear system, and
approximate the nonlinear system near (0, 0) by the linear system
dx
= y,
dt
dy
1
= x − y,
dt
2
i.e.,
dY
= AY =
dt
0 1
1 − 12
Y,
x
Y=
.
y
The eigenvalues of matrix A are 0.78 and −1.28, so the
equilibrium at the origin of the linear system is a saddle.
4 / 24
Comparison
The following pictures show the slope field and solutions for the
linear system (on left) and an enlargement of the nonlinear system
near the origin (on right).
dx/dt = y
dy/dt = x − 0.5 y − x3
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0
y
y
dx/dt = y
dy/dt = x − 0.5 y
0
−0.1
−0.1
−0.2
−0.2
−0.3
−0.3
−0.4
−0.4
−0.5
−0.5
−0.5
0
x
0.5
−0.5
0
x
0.5
We see that the linear system is a good approximation to the
nonlinear system near the equilibrium, but is hopeless away from
the equilibrium (see the earlier phase portrait).
5 / 24
Linearisation
The procedure used above is called linearisation:
I Near an equilibrium, approximate the nonlinear system by an
appropriate linear system.
I For initial conditions near the equilibrium, solutions of the
nonlinear system stay close to solutions of the approximate
linear system, at least for some interval of time.
I Thus, the type of equilibrium at the origin in the linearised
system gives information about the type of the corresponding
equilibrium in the nonlinear system, as well as the direction
and speed of trajectories.
6 / 24
Example 1 again
Returning to the original system in Example 1, we now consider
the equilibria at (1, 0) and (−1, 0).
dx/dt = y
dy/dt = x − x3 − 0.5 y
1.5
1
y
0.5
0
−0.5
−1
−1.5
−2
−1.5
−1
−0.5
0
x
0.5
1
1.5
2
7 / 24
First shift to the origin
To approximate the behaviour near (1, 0) by a linear system, we
must first shift the equilibrium to the origin - because linear
systems usually only have an equilibrium at the origin.
We change the coordinates as follows:
Write u = x − 1, v = y , so the equilibrium (x, y ) = (1, 0) is now
at (u, v ) = (0, 0).
Then the system becomes:
du
=
dt
dv
=
dt
8 / 24
Ignore the small terms
For u and v small, −3u 2 and u 3 are very, very small. We ignore
these nonlinear terms and approximate the system by:
du 0
1
u
dt
=
1
dv
v
−2 − 2
dt
1 1√
Eigenvalues are − ±
31i.
4 4
So the equilibrium is a spiral sink in the linear approximation.
Direction of spiral?
9 / 24
Comparison
The following pictures illustrate the similarity between the phase
portrait for the linearised system (on the left) and the phase
portrait near the equilibrium at (1, 0) in the nonlinear system (on
the right).
dx/dt = y
dy/dt = x − 0.5 y − x3
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0
y
y
dx/dt = y
dy/dt = − 2 x − 0.5 y
0
−0.1
−0.1
−0.2
−0.2
−0.3
−0.3
−0.4
−0.4
−0.5
−0.5
−0.5
0
x
0.5
−1.5
−1
x
−0.5
Similar calculations give similar results for the equilibrium at
(−1, 0).
10 / 24
More generally...
If the system
dx
= f (x, y )
dt
dy
= g (x, y )
dt
has an equilibrium at (x0 , y0 ), we can construct a linear
approximation to the system, valid for x and y values near (x0 , y0 ),
as follows.
I First move the equilibrium to the origin: write u = x − x0 and
v = y − y0 . The nonlinear equations in the new coordinates
are:
dx
du
=
= f (x, y ) = f (x0 + u, y0 + v )
dt
dt
dv
dy
=
= g (x, y ) = g (x0 + u, y0 + v )
dt
dt
11 / 24
Do a Taylor expansion...
I Next use a Taylor expansion to rewrite f and g , because u
and v are small:
∂f
∂f
(x0 , y0 ) u+
(x0 , y0 ) v +h.o.t
f (x0 +u, y0 +v ) = f (x0 , y0 )+
∂x
∂y
∂g
∂g
g (x0 +u, y0 +v ) = g (x0 , y0 )+
(x0 , y0 ) u+
(x0 , y0 ) v +h.o.t
∂x
∂y
I Now, f (x0 , y0 ) = g (x0 , y0 ) = 0, so if we ignore the higher
order terms then we get an approximate linear system:
! du ∂f
∂f
(x
,
y
)
(x
,
y
)
u
0
0
0
0
∂x
∂y
dt
= ∂g
∂g
dv
v
dt
∂x (x0 , y0 ) ∂y (x0 , y0 )
12 / 24
The Jacobian matrix
I Thus, the behaviour of solutions to the nonlinear system near
the equilibrium (x0 , y0 ) can be approximated by the behaviour
of solutions in the linearised system:
! du ∂f
∂f
(x
,
y
)
(x
,
y
)
u
0
0
0
0
∂x
∂y
dt
= ∂g
∂g
dv
v
dt
∂x (x0 , y0 ) ∂y (x0 , y0 )
I The matrix of partial derivatives
J(x0 , y0 ) =
∂f
∂x (x0 , y0 )
∂g
∂x (x0 , y0 )
∂f
∂y (x0 , y0 )
∂g
∂y (x0 , y0 )
!
is called the Jacobian matrix, evaluated at (x0 , y0 ).
13 / 24
Example 1 again
dx
=y
dt
dy
1
= x − x3 − y
dt
2
J(x, y ) =
14 / 24
Equilibria of two-dimensional nonlinear systems
Consider the two-dimensional system
dx
= f (x, y )
dt
dy
= g (x, y )
dt
Suppose (x0 , y0 ) is an equilibrium point and let
J(x0 , y0 ) =
∂f
∂x (x0 , y0 )
∂g
∂x (x0 , y0 )
∂f
∂y (x0 , y0 )
∂g
∂y (x0 , y0 )
!
be the Jacobian matrix at (x0 , y0 ). Then...
15 / 24
I If the Jacobian matrix has one positive eigenvalue and one
negative eigenvalue, then the equilibrium point (x0 , y0 ) is a
saddle.
I If the Jacobian matrix has two real negative eigenvalues then
the equilibrium point (x0 , y0 ) is a nodal sink. If the
eigenvalues are complex with negative real parts then the
(x0 , y0 ) is a spiral sink.
I If the Jacobian matrix has two real positive eigenvalues then
the equilibrium point (x0 , y0 ) is a nodal source. If the
eigenvalues are complex with positive real parts then the
(x0 , y0 ) is a spiral source.
16 / 24
Classification of equilibria in nonlinear systems
For an equilibrium solution in a nonlinear system:
I The equilibrium is a (nonlinear) sink if all solutions that start
close to the equilibrium stay close to the equilibrium for all
time and tend to the equilibrium as t increases.
I The equilibrium is a (nonlinear) source if all solutions that
start close to the equilibrium move away from the equilibrium
as t increases.
I The equilibrium is a (nonlinear) saddle if there are curves of
solutions that tend towards the equilibrium as t increases and
curves of solutions that tend towards the equilibrium solution
as t decreases. All other solutions started near the equilibrium
move away from the equilibrium as t increases and decreases.
These are different definitions than those used for equilibria in
linear systems, but are consistent with those.
17 / 24
Example 2
Consider the system
dx
= x(1 + x 2 )
dt
dy
= 3y (1 − y − x)
dt
Find the equilibria and determine their types. For each equilibrium,
sketch a phase portrait showing the behaviour of solutions in the
associated linearised system.
18 / 24
Example 2
I J(x, y ) =
1 + 3x 2
0
−3y
3 − 6y − 3x
I J(0, 0) =
19 / 24
Example 2
I J(0, 1) =
20 / 24
Example 2
The phase portrait for the nonlinear system, drawn with pplane, is
given below.
dx/dt = x (1 + x2)
dy/dt = 3 y (1 − x − y)
2
1.5
y
1
0.5
0
−0.5
−1
−1
−0.5
0
x
0.5
1
Note the source at (0, 0) and the saddle at (0, 1) as predicted by
our calculations.
21 / 24
Example 3
Consider the system
dx
= −x + y
dt
dy
= x − y2
dt
Find the equilibria and determine their types. For each equilibrium,
sketch a phase portrait showing the behaviour of solutions in the
associated linearised system.
22 / 24
Example 3
I At (0, 0), associated linear system is dY
dt =
−1 1
Y.
1 0
I At (1, 1), associated linear system is dY
dt =
−1 1
Y.
1 −2
23 / 24
Important idea from today
I If a system of nonlinear equations
dx
= f (x, y ),
dt
dy
= g (x, y ),
dt
has an equilibrium at (x0 , y0 ), then the behaviour of solutions
near that equilibrium (usually) can be approximated by the
behaviour of solutions near the origin for the linearised system
! du ∂f
∂f
(x
,
y
)
(x
,
y
)
u
0
0
0
0
∂x
∂y
dt
= ∂g
.
∂g
dv
v
(x
,
y
)
(x
,
y
)
dt
∂x 0 0
∂y 0 0
24 / 24
Maths 260: Differential Equations
Lecture 24: More on classification of equilibria in nonlinear
systems
I Reading for this lecture: BDH Section 5.2
I Suggested exercises: BDH Section 5.2, #1, 5, 7, 9, 11
I Reading for next lecture: BDH Section 5.2
1 / 18
Result from the last lecture
To determine the type of an equilibrium in a nonlinear system, we
can sometimes use linearisation, i.e., we use a linear system to
approximate the behaviour of solutions near the equilibrium in the
nonlinear system.
For most systems, knowledge of the behaviour of solutions in the
linearised system is sufficient to determine the behaviour near the
corresponding equilibrium in the nonlinear system.
2 / 18
In particular, for the system
dY
= f (Y)
dt
with an equilibrium Y(t) = Y0 , construct the linearised system
dY
= J(Y0 )Y
dt
where J(Y0 ) is the Jacobian matrix of partial derivatives evaluated
at Y0 .
I If J(Y0 ) has no eigenvalues with zero real part, then the
equilibrium Y0 in the nonlinear system is of the same type
(e.g., saddle, source) as the equilibrium at the origin in the
linearised system.
Note that linearisation does not tell us anything about the
behaviour of solutions to a nonlinear system far from an
equilibrium.
3 / 18
Example 1
Find all equilibria and determine their types for the following
system:
dx
= 2x,
dt
dy
= y (1 − y ).
dt
For each equilibrium, sketch a phase portrait showing the behaviour
of solutions near the origin in the associated linear system.
4 / 18
Eigenvalues with zero real part
Unfortunately, linearisation does not always work.
In particular, if the Jacobian matrix has a zero eigenvalue or a
purely imaginary eigenvalue, then we cannot predict the
behaviour in the nonlinear system based on linearisation alone.
5 / 18
Example 2
Consider the system:
dx
= −x 3
dt
dy
= −y + y 2
dt
Equilibria:
Jacobian:
6 / 18
Example 2 continued
So at (0, 0) the Jacobian is:
The linearised system has the phase portrait:
7 / 18
Example 2 continued
At (0, 1), the Jacobian is:
The linearised system has the phase portrait:
8 / 18
Example 2: nonlinear phase portrait
However, the phase portrait for the nonlinear system is
3
x'=-x
2
y'=-y+y
1.5
y
1
Print
0.5
0
-0.5
Quit
-2
-1.5
-1
Cursor position: (2.52, -0.0765)
-0.5
0
x
0.5
1
1.5
2
9 / 18
I Notice that in this phase portrait, (0, 0) looks like a sink and
(0, 1) looks like a saddle.
I These results were not predicted by the corresponding
linearised systems.
I Linearisation does not work in these cases because of the zero
eigenvalues of the Jacobians.
x ' = - x3
y ' = - y + y2
1.5
y
1
Print
0.5
0
-0.5
Quit
-2
-1.5
-1
Cursor position: (2.52, -0.0765)
-0.5
0
x
0.5
1
1.5
2
10 / 18
Sketching phase portraits for nonlinear systems
We would like to be able to sketch the complete phase portrait for
a nonlinear system.
Linearisation gives us good information about the behaviour of
solutions near most equilibria. We can use numerics to fill in the
gaps — but it would be helpful to know in advance which regions
of the phase space to look at numerically.
In order to do this we can use nullclines.
11 / 18
Reminder - Nullclines
Consider a system
dx
= f (x, y ),
dt
dy
= g (x, y ).
dt
I The x-nullcline is the set of points (x, y ) where f (x, y ) = 0.
On the x-nullcline, dx
dt = 0, and the direction field is vertical,
pointing straight up or straight down.
I The y -nullcline is the set of points (x, y ) where g (x, y ) = 0.
On the y -nullcline, dy
dt = 0, and the direction field is
horizontal, pointing either left or right.
12 / 18
Reminder - Nullclines
Note that:
I At an intersection of an x-nullcline and a y -nullcline,
f (x, y ) = g (x, y ) = 0.
Therefore, a point of intersection between an x-nullcline and a
y -nullcline is an equilibrium solution.
I A nullcline is not necessarily a solution curve.
I A nullcline is not necessarily a straight line.
13 / 18
Example 3:
Use nullclines to sketch the phase portrait for the system
dx
=2−x −y
dt
dy
= x2 − y
dt
14 / 18
Example 3: Phase portrait from pplane:
x’=2−x−y
2
y’=x −y
6
5
4
y
3
2
1
0
−1
−2
−4
−3
−2
−1
0
x
1
2
3
4
15 / 18
Important ideas from today:
I To determine the type of an equilibrium that occurs in a
nonlinear system
dY
= f (Y)
dt
with an equilibrium Y(t) = Y0 , we can construct the
linearised system
dY
= J(Y0 )Y
dt
where J(Y0 ) is the Jacobian matrix of partial derivatives
evaluated at Y0 .
1. If in the linearised system the equilibrium at the origin is a
sink, source, or saddle, then Y0 is a sink, source, or saddle
(respectively) in the nonlinear system.
2. If the Jacobian matrix evaluated at the equilibrium has a zero
or purely imaginary eigenvalue, then we cannot predict the
behaviour near the equilibrium in the nonlinear system based
on linearisation alone.
16 / 18
Important ideas from today, continued:
I Linearisation gives information about the behaviour of
solutions near most equilibria, but is unhelpful far from those
equilibria.
I Nullclines can be used to help sketch the complete phase
portrait for a nonlinear system (including far from equilibria).
17 / 18
Maths 260: Differential Equations
Lecture 25: Sketching phase portraits for nonlinear systems
I Reading for this lecture: BDH Section 5.2
I Suggested exercises: BDH Section 5.2, #3, 13, 17, 19
I Reading for next lecture: BDH Section 2.1
1 / 18
Sketching phase portraits for nonlinear systems
We have learnt two methods for obtaining information about
solutions to nonlinear systems:
I Linearisation can give information about the behaviour of
solutions near an equilibrium solution.
I The method of nullclines gives information about where in the
phase plane solution curves are horizontal and where they are
vertical. From this we can deduce where in the phase plane
solutions move up, down, left or right.
We use both of these methods to sketch phase portraits for
nonlinear systems.
2 / 18
Outline of method
To sketch a phase portrait, it can be helpful to follow some or all
of the following steps.
1. Find all equilibria. Where possible, use linearisation to
determine their types (e.g., saddle, spiral source).
2. Draw the nullclines. Determine the direction of solutions in
the regions between nullclines. Determine the direction of
solutions on the nullclines.
3. Sketch some representative solution curves. Make sure the
solution curves you sketch go in the directions determined by
the nullclines and behave like the appropriate linearised system
near any equilibrium.
Note: nullclines are usually not solution curves, and are not always
straight lines.
3 / 18
Example 1:
Sketch the phase portrait for the system
dx
= x(x − 1)
dt
dy
= x2 − y
dt
Determine the long term behaviour of the solutions through
(x, y ) = (−1, 0), (0.8, 0) and (1, 3).
Step 1: Find equilibria:
4 / 18
Example 1
I Jacobian:
I Behaviour of solutions near (0, 0):
5 / 18
Example 1
I Behaviour of solutions near (1, 1):
6 / 18
Example 1: Nullclines
7 / 18
Example 1: Nullclines and phase portrait
3
2.5
2
1.5
1
0.5
0
−0.5
−1
−1.5
−2
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
3
8 / 18
Example 1
I Behaviour of solution through (−1, 0):
I Behaviour of solution through (0.8, 0):
I Behaviour of solution through (1, 3):
9 / 18
Example 1
Phase portrait from pplane
dx/dt = x (x − 1)
dy/dt = x2 − y
3
2.5
2
1.5
y
1
0.5
0
−0.5
−1
−1.5
−2
−2
−1
0
1
2
3
x
10 / 18
Example 2
Sketch the phase portrait for the system
dx
= x(2 − x − y ),
dt
dy
= y (3 − 2y − x),
dt
for x, y ≥ 0.
I Find equilibria:
11 / 18
Example 2: Linearisation
I Jacobian:
I Behaviour of solutions near (0, 0):
12 / 18
Example 2: Linearisation continued
I Behaviour of solutions near (0, 3/2):
I Behaviour of solutions near (2, 0):
13 / 18
Example 2: Linearisation continued
I Behaviour of solutions near (1, 1):
14 / 18
Example 2: Nullclines
15 / 18
Example 2: Nullclines and phase portrait
3
2.5
2
1.5
1
0.5
0
0
0.5
1
1.5
2
2.5
3
16 / 18
Example 2: Phase portrait from pplane
dx/dt = x (2 − x − y)
dy/dt = y (3 − 2 y − x)
4
3.5
3
y
2.5
2
1.5
1
0.5
0
0
0.5
1
1.5
2
x
2.5
3
3.5
4
17 / 18
Important ideas from today:
To sketch a phase portrait for a nonlinear system:
1. Find all equilibria. Where possible, use linearisation to
determine their types (e.g., saddle, spiral source).
2. Draw the nullclines. Determine the direction of solutions in
the regions between nullclines. Determine the direction of
solutions on the nullclines.
3. Sketch some representative solution curves. Make sure the
solution curves you sketch go in the directions determined by
the nullclines and behave like the appropriate linearised system
near any equilibrium.
18 / 18
Maths 260: Differential Equations
Lecture 26: More with nullclines – Periodic orbits
I Reading for this lecture: BDH Section 2.1
1 / 18
Example 1
Sketch the phase portrait for the system
dx
= x − y2 + 2
dt
dy
= y − x.
dt
2 / 18
Example 1
J(x, y ) =
J(−1, −1) =
3 / 18
Example 1
J(2, 2) =
4 / 18
Example 1: Nullclines
5 / 18
Example 1: Nullclines and phase portrait
4
3
2
y
1
0
−1
−2
−3
−3
−2
−1
0
1
2
3
4
x
6 / 18
The approximate phase portrait obtained using nullclines looks
very like the phase portrait obtained with pplane:
4
3
2
y
1
0
−1
−2
−3
−3
−2
−1
0
1
2
3
4
x
7 / 18
Example 2:
Sketch the phase portrait for the system
dx
= −y
dt
dy
= 1 − 0.9y − x 2 − xy
dt
Find equilibria:
8 / 18
Example 2
I Jacobian:
I Behaviour of solutions near (1,0)
9 / 18
Example 2
I Behaviour of solutions near (-1,0)
10 / 18
Example 2: Nullclines and phase portrait
ẋ = 0 ⇒ y = 0,
ẏ = 0 ⇒ 1 − 0.9y − x 2 − xy = 0
3
2.5
2
1.5
1
0.5
0
−0.5
−1
−1.5
−2
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
3
11 / 18
Phase portrait from pplane:
3
2
1
0
−1
−2
−3
−3
−2
−1
0
1
2
3
Note how close together solution curves get in a band around the
equilibrium at (−1, 0).
12 / 18
A periodic solution
Careful use of pplane gives the following solution curve:
2
1
0
−1
−2
−3
−4
−2
−1
0
1
2
3
4
We see there is a closed solution curve passing close to the origin.
This curve corresponds to a periodic solution of the system, i.e. a
solution for which each dependent variable is a periodic function of
time.
13 / 18
Example 3
Use pplane to investigate the qualitative changes in the behaviour
of solutions to the system
dx
= −y
dt
dy
= µ − 0.9y − x 2 − xy
dt
that occur as µ is varied in the interval [−2, 2].
14 / 18
Some advanced features of pplane are useful for investigating this
system. In particular, pplane can be used to do the following.
I Plot nullclines. Select the ‘Nullclines’ option in the lower right
of the ‘Setup’ window.
I Find equilibria and determine their type. Select the option
‘Find an equilibrium’ from the ‘Solutions’ menu on the
‘Display’ window, move the cursor to a place in the display
window near where you expect the equilibrium to be and click.
I Plot solutions for t increasing only. In the ‘Display’ window,
pull down the ‘Options’ menu, pick ‘Solution direction’ and
then select ‘Forward’.
15 / 18
Real-life Example: Belousov-Zhabotinsky Reaction
I Most chemical reactions proceed monotonically towards
chemical equilibrium.
I The BZ reaction does not do this. Instead, it oscillates around
chemical equilibrium.
I Discovered around 1950, not recognised by the scientific
community until 1961.
16 / 18
Real-life Example: Belousov-Zhabotinsky Reaction
There are several different mathematical models which try to
capture the behaviour of the BZ reaction.
A simplified version of the model known as the Brusselator is:
dx
= 1 + x 2 y − kx − x
dt
dy
= kx − x 2 y
dt
Here, x and y represent concentrations of two of the (many)
chemicals involved in the reaction. The constant k is a parameter.
17 / 18
Important ideas from today:
I Autonomous systems with two or more dependent variables
can have periodic solutions, where each of the dependent
variables is a periodic function of the independent variable.
I A periodic solution lies on a closed curve in the phase plane.
I Nonlinear systems can exhibit many interesting bifurcations
and, if there are three or more dependent variables, can
exhibit a type of complicated behaviour called chaos. The
study of bifurcations in nonlinear systems is called Dynamical
Systems and is studied more in the course Maths 761.
18 / 18
Maths 260: Differential Equations
Lecture 27 Part I: Modelling using systems
▶ Reading for this lecture: BDH Section 2.1
▶ Suggested exercises: BDH Section 2.1, #1-4,9,10
1 / 17
Modelling basics
Using knowledge about how a quantity changes to write down a
DE is called modelling, and a DE is a model.
The goal of modelling is to use the model to predict future values
of the quantity being modelled.
Important steps in making a model:
1. Identify assumptions on which the model is based.
2. Identify all relevant quantities in the model.
3. Using the assumptions, write down equations relating the
quantities to each other.
We then use analytical, qualitative or numerical methods to find
out about the behaviour of solutions to the model, and hence
make predictions about the system being modelled.
2 / 17
Example 1: A population model
A small population of animals is living in a large game park.
Initially the population grows at the rate of 5% per year. The
maximum population that can be supported by the resources of
the park is 80,000.
(a) Write down a differential equation to model the way the
population changes when it is small (i.e. much less than
80,000).
(b) Write down a differential equation to model the way in which
the population changes.
(c) It is decided to take 500 animals from the park every year.
Modify your model from (b) to include a term or terms that
model this.
(d) Use the model to determine the eventual size of the
population if the initial population is
(i) 13, 000
(ii) 10, 000.
3 / 17
Example 1: A population model
4 / 17
Modelling populations: a predator/prey system
The following equations give a typical simple model of two
populations where animals of one type (known as the predators)
eat animals of the other type (known as the prey).
Let R(t) = number of prey (e.g., rabbits) measured in 1000’s.
Then R = 1 means there are 1000 prey animals in the population.
Let F (t) = number of predators (e.g., foxes) measured in 1000’s.
Then F = 1 means there are 1000 predator animals in the
population.
A possible model of change in the two populations is given by
Ṙ =0.4R − 0.1RF ,
Ḟ = − 0.5F + 0.1RF ,
R ≥ 0, F ≥ 0.
5 / 17
Physical significance of terms in the DEs
▶ If there are no predators (F = 0), Ṙ = 0.4R, which has the
solution R(t) = R(0)e 0.4t .
Thus, the term 0.4R models exponential growth of the prey
population in the absence of any predators.
▶ If there are no prey (R = 0), Ḟ = −0.5F , which has the
solution F (t) = F (0)e −0.5t .
Thus, the term −0.5F models exponential decay of the
predator population in the absence of any prey.
6 / 17
Physical significance of terms in the DEs
▶ The term −0.1RF in the Ṙ equation models the negative
effect on the prey population of ‘interactions’ between prey
and predators.
That is, predators eat prey and the prey population decreases.
▶ The term 0.1RF in the Ḟ equation models the positive effect
on the predator population of interactions between prey and
predators.
That is, predators eat prey and the predator population
increases.
7 / 17
Equilibrium solutions to the predator/prey system
It is easy to see that (R, F ) = (0, 0) is an equilibrium solution.
▶ What does this mean physically?
We also see that (R, F ) = (5, 4) is an equilibrium solution.
▶ Physically, this tells us that a prey population of 5000 and a
predator population of 4000 is perfectly balanced; neither
population increases or decreases over time.
8 / 17
Phase portrait
The phase portrait for the predator/prey system obtained with
pplane is:
10
9
Foxes (thousands)
8
7
6
5
4
3
2
1
0
0
2
4
6
8
10
Rabbits (thousands)
This simple predator-prey model is known as the Lotka-Volterra
model (1925).
9 / 17
Modifying the model
We could modify this model to include different assumptions. For
example, we could:
▶ limit the growth of the prey population when there are no
predators by including a term −aR 2 in Ṙ equation (a > 0)
▶ assume that the predator population can survive even when
there are no prey (e.g., if there was another food source) by
including a term bF in the Ḟ equation (b > 0)
▶ model the effect of a fixed number of predator being killed by
hunters each year by including a term −h in the Ḟ equation
(h > 0)
10 / 17
What other types of populations can we model?
▶ Two species in competition for the same resources
1. Can both species survive?
2. Can one species become extinct and the other species survive?
3. Can both species become extinct?
▶ What about species that are mutually beneficial?
1. Here, each species helps the other one survive
2. But the populations can only grow to the limit of the natural
resources available
3. Populations should not be able to grow indefinitely as there are
limits on natural resources
▶ Infectious diseases
1. Think about the different populations involved (infected,
immune, susceptible, dead, ...)
2. How do they affect each other?
▶ And lots and lots more ....
11 / 17
Modelling mutually beneficial species
Consider the nonlinear system
dx
= x(1 − 0.5x + 0.1y )
dt
dy
= y (1 − 0.8y + 0.5x)
dt
where x(t), y (t) ≥ 0.
Think of x(t) and y (t) as two different populations that help each
other. How can we tell (from the equations) that they help each
other?
12 / 17
Phase portrait from pplane
4
3.5
3
y
2.5
2
1.5
1
0.5
0
0
0.5
1
1.5
2
x
2.5
3
3.5
4
13 / 17
Other applications of differential equation models
▶ Chemical reactions
▶ Finance
▶ Cell biology/physiology
▶ Mechanics
▶ Climate change/meteorology
▶ Fluid dynamics
▶ Traffic flow
Chapter 2 of the text book has a good discussion of modelling with
systems of ODEs. It is your responsibility to read the text book and
make sure you are ready to do a modelling question in the exam.
14 / 17
A typical exam question
In New Zealand, the possum is a serious pest, eating native trees
and altering the bush diversity. The system of equations given
below is a simple model for the interaction between the trees and
possum.
x
dx
= ax 1 −
− cxy
dt
Kx
y
dy
= by 1 −
+ dxy
dt
Ky
In this model, x(t) represents the population of trees (as a
function of time t), and y (t) represents the number of possum.
Time t is measured in years. The letters a, b, c, d, Kx and Ky are
positive constants in the model.
1. Explain carefully the physical meaning of all the terms in the
system of equations.
15 / 17
2. A new vaccine is being developed to slow the reproduction
rate of the possum. How might you alter the model to
represent the effect of this vaccine?
3. Briefly describe (i.e., in one or two paragraphs) some methods
you could use to analyse these equations to get information
about solutions to the model.
16 / 17
Important ideas from today’s lecture:
▶ Simple population interactions can be modelled using a
system of nonlinear differential equations. Examples include
modelling predator-prey systems, competitive species and
infectious diseases (epidemics).
▶ Simple models might not be completely accurate but they can
be very useful in a vast range of applications (not just for
population models).
▶ We can investigate the behaviour of nonlinear ODE models of
real life situations using qualitative techniques (e.g., drawing
phase portraits) and using numerical methods combined with
bifurcation theory.
Analytic techniques (other than linearisation) are not usually
useful for realistic models.
17 / 17
Maths 260: Differential Equations
Lecture 27 Part II: Modelling using systems - An SIR model of
COVID-19 spread
▶ Reading for this lecture: BDH Section 2.7 (The SIR model
of an epidemic)
▶ Suggested exercises: BDH Section 2.7
▶ Reading for next lecture: BDH Section 3.6 (harmonic
oscillator)
1 / 15
The SIR model without birth and death.
One of the simplest models for the spread of a disease is an SIR
model. The letters stand for
Susceptible: These are people who can catch the disease. They
have no current immunity.
Infected: People who have the disease and can spread it.
Recovered or Removed: People who have had the disease but do
not anymore (through recovery or death). They are assumed to be
immune to the disease.
2 / 15
SIR as a compartment model
β
S
γ
I
R
The dependant variables are S, I and R. This is a
three-dimensional system. The independent variable is t. The
parameters are
1. β > 0: the rate of infection (how fast susceptible people
become infected).
2. γ > 0: the rate that infected people recover (“recover” in this
case includes the mortality rate).
Let N = S + I + R be the total population, and s = NS , i = NI and
R
r=N
be the population densities.
3 / 15
System of 3 non-linear DEs
ds
=
dt
di
=
dt
dr
=
dt
We also assume that the overall population is relatively stable (N
doesn’t change).
4 / 15
Really it is 2 non-linear DEs
Note that r = 1 − s − i is known if s and i are known, so we only
need to consider the 2D system
ds
= −βsi
dt
di
= βsi − γi
dt
Equilibrium points:
Physical interpretation:
5 / 15
Nullclines and phase portrait
s-nullclines: s = 0 and i = 0
i-nullclines: i = 0 and s = γ/β
6 / 15
Phase portrait from pplane: β = 0.2, γ = 0.1
s´ = - beta * s * i
1
beta=0.2
i´ = beta * s * i - gamma* i
0.9
0.8
0.7
0.6
i 0.5
0.4
0.3
0.2
0.1
0
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
s
7 / 15
s(t) and i(t): β = 0.2, γ = 0.1
s´ = - beta * s * i
i´ = beta * s * i - gamma* i
1
0.9
0.8
0.7
s
&
0.6
0.5
i
0.4
0.3
0.2
0.1
0
0
40
20
80
120
60
100
160
140
t
8 / 15
Basic reproduction number
A key parameter in disease modelling or population growth is the
basic reproduction number R0 . For this model
R0 =
β
.
γ
This number tells you how many people will have the disease at
time t0 + 1 if one person has it at time t0 and everyone else is
susceptible. For this model
di
= β · si − γ · i
dt
β
= ( · s − 1)γ · i
γ
= (R0 · s − 1)γ · i.
What happens if s ≈ 1 and R0 > 1?
What happens if s ≈ 1 and R0 < 1?
9 / 15
Basic reproduction number
Disease
Measles
Diphtheria
Smallpox
Mumps
HIV/AIDS
SARS
Influenza(1918 pandemic strain)
Normal flu
Ebola(2014 Ebola outbreak)
COVID-19 - original
COVID-19 - delta variant
COVID-19 - omicron variant
Transmission
Aerosol
Saliva
Airborne droplet
Airborne droplet
Sexual contact
Airborne droplet
Airborne droplet
Airborne droplet
Bodily fluids
Airborne droplets
Airborne droplets
Airborne droplets
R0
12-18
6-7
5-7
4-7
2-5
2-5
2-3
1.2-2
1.5-2.5
∼ 2.8
∼5
∼ 10
Table: Values of R0 of well-known infectious diseases
Note: R0 does not inform you how many people die, only how
many people get infected.
10 / 15
Effective reproduction number
A more useful number is the effective reproduction number:
Reff (t) =
β(t)
s(t)
γ(t)
This number tells you how many people will have the disease at
time t0 + 1 if one person has it at time t0 , but
▶ not everyone is susceptible (s(t0 ) < 1), e.g. already recovered
and gained immunity, vaccination.
▶ the infection rate β can be reduced, e.g. lockdowns,
mask-wearing.
▶ the recovery rate γ can be increased, e.g. a treatment has
been found.
We get
di
= (Reff (t) − 1)γ · i
dt
As long as Reff (t) < 1, the infected population will decay.
11 / 15
R0 = 6, how vaccination can help
s´ = - beta * s * i
1
beta=0.6
gamma=0.1
i´ = beta * s * i - gamma* i
0.9
0.8
0.7
0.6
i 0.5
0.4
0.3
0.2
0.1
0
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
s
12 / 15
Numerical simulations
Great website by Nicky Case: https://ncase.me/covid-19/
(It’s a little outdated with the R0 value of COVID-19. Thanks
Delta!)
13 / 15
The role of mathematics in a pandemic
1. R0 changes theoretically, depending on the model and its
assumptions. What do we know about COVID-19 that is not
included in this simple SIR model?
2. Reff also changes in reality (measured in the data) over time.
Reff is different depending on the country, lockdown level,
decisions made leaders and society, vaccines etc. Which of
these will make a significant difference?
3. A good mathematician will use data and insight of other
experts in order to improve their model and use its predictive
power to give feedback to the other experts and/or
decision-makers.
14 / 15
Important ideas from SIR model:
▶ The SIR model is a compartment model of disease spread
which gives us a set of 3 ODEs.
▶ The basic reproduction number R0 gives an indication as to
how quickly a disease will spread when it first outbreaks and
without any interventions.
▶ The effective reproduction number Reff indicates how quickly
a disease will spread given the current interventions
(lockdowns, vaccines etc.). Reff > 1 is bad, Reff < 1 is good.
▶ Mathematical modelling should not be done in isolation. It
should be done with other scientists and should inform real
decisions.
15 / 15
Maths 260: Differential Equations
Lecture 28: Higher order differential equations
I Reading for this lecture: BDH Section 3.6
I Suggested exercises: BDH Section 3.6, #1, 3, 5, 7, 9, 11
I Reading for next lecture: BDH Section 3.6
1 / 19
Example 1: Modelling a mass/spring system
We wish to model the motion of an object that is attached to a
spring and slides in a straight line on a table.
I Let y (t) be the position of the object at time t, with y = 0
corresponding to the spring being neither stretched nor
compressed.
I Main idea from physics: Newton’s second law says
mass × acceleration = sum of forces acting on the object.
2 / 19
Forces
Typical forces on the object that we might consider are
I r (y ), the restoring force (the spring does not like to be
compressed or stretched);
I f (v ), frictional forces, where v = dy
dt ;
I g (t, y ), external forcing.
Substituting into Newton’s law, we get
m
d 2y
= r (y ) + f (v ) + g (t, y )
dt 2
where m is the mass of the object attached to the spring.
3 / 19
Simplifying assumptions
A common case assumes
I linear restoring force, i.e. r (y ) = −ky for some constant
k > 0;
I linear damping, i.e. f (v ) = −bv for some constant b > 0;
I no spatial dependence in the forcing, i.e., g is a function of t
but not of y .
The first two assumptions are often valid if y and v = dy
dt remain
small.
We can write this case as
d 2y
b dy
k
1
+
+ y = g (t)
2
dt
m dt
m
m
This is an example of a higher order differential equation, i.e. a DE
involving derivatives of second or higher order.
4 / 19
Higher order differential equations
Other examples:
I
d 2θ
dθ
+ c1
+ c2 sin θ = 0
2
dt
dt
d 3y
I
− 2y
dt 3
d 2y
dt 2
2
+
dy
= sin t
dt
I A higher order system of DEs:
dx
= 2x + y
dt
d 2y
dx dy
+
+ 3x = 0
dt 2
dt dt
5 / 19
Converting to a system
We can usually convert a higher order DE into an equivalent
system of first order DEs. To do so, we define new dependent
variables.
Example 2: Rewrite the following equation as an equivalent
system of first order equations:
d 2y
k
+ y =0
2
dt
m
6 / 19
Example 3
Rewrite the following equation as an equivalent system of first
order equations:
2
d 3x
dx
= sin t
+2
3
dt
dt
7 / 19
Equivalent system
Saying that a system of DEs is equivalent to a higher order DE
means that if we know a solution to the system we can find a
solution to the higher order equation, and vice versa.
Example 4: The function
r
y1 (t) = sin
is a solution to
k
t
m
d 2y
k
+ y =0
2
dt
m
8 / 19
Example 4
Therefore, the pair of functions
r
r
r
k
k
k
dy1
y1 (t) = sin
t, v1 (t) ≡
=
cos
t
m
dt
m
m
must be a solution to the equivalent system
dy
=v
dt
dv
k
=− y
dt
m
9 / 19
Which format is better - first order system or a single
higher order equation?
I To determine the behaviour of solutions of a higher order DE
we can rewrite the DE as the equivalent first order system.
Then we can study the system using the numerical methods
and qualitative techniques already learnt (e.g. sketching
solutions via phase plane methods). We can also use results
like the Existence and Uniqueness Theorem.
I However, in some special cases, it is convenient to study the
original higher order equation directly.
For example, convenient analytic techniques exist for solving
linear higher order equations – we will see these techniques in
the next few lectures.
10 / 19
Linear, Constant Coefficient, Higher Order DEs
A differential equation of the form
an
d n−1 y
dy
d ny
+ an−1 n−1 + · · · + a1
+ a0 y = 0
n
dt
dt
dt
where all ai are constant, and an 6= 0, is called an nth order, linear,
constant coefficient DE.
Example 5: The differential equation
dy
d 2y
+5
+ 6y = 0
2
dt
dt
is a second order, linear, constant coefficient DE.
We could solve this by converting to a system, then finding
eigenvalues and eigenvectors etc, but there is a short cut for
solving equations of this form.
11 / 19
Idea behind the shortcut:
For Example 5, the equivalent system is:
dY
0
1
y
=
Y, Y =
−6 −5
z
dt
I We expect solutions of the form
Y(t) = eλt v.
I The first component of such a Y is
y (t) = ceλt
where c is a constant (the first entry in v).
I Hence, we guess a solution to the higher order DE of the form
y (t) = eλt
where λ is to be determined.
12 / 19
Example 5
Substitute this candidate solution into our DE:
d 2y
dy
+ 6y = 0
+5
2
dt
dt
13 / 19
Example 5
This is exactly what we would have got by using eigenvalues and
eigenvectors to solve the equivalent system directly.
I The equivalent system is
dY
0
1
y
=
Y, Y =
−6
−5
z
dt
which has eigenvalues -3 and -2 with associated eigenvectors
1
1
, and
,
−3
−2
respectively. The general solution is
1
y (t)
1
−2t
−3t
= c1 e
+ c2 e
,
−3
−2
z(t)
which gives y (t) = c1 e −3t + c2 e −2t .
This “guessing” method is often quicker than converting to a
system and solving.
14 / 19
Example 6
Find some linearly independent solutions of
d 2y
dy
+3
+ 2y = 0
2
dt
dt
15 / 19
Example 7
Find some linearly independent solutions of
d 3y
d 2y
dy
+
−6
=0
3
2
dt
dt
dt
16 / 19
General result:
Consider the differential equation
an
d n−1 y
dy
d ny
+
a
+ · · · + a1
+ a0 y = 0
n−1
n
n−1
dt
dt
dt
Let y1 (t), y2 (t), . . . , yn (t) be n linearly independent solutions of
the DE.
Then for arbitrary constants ci ,
y (t) = c1 y1 (t) + c2 y2 (t) + · · · + cn yn (t)
is the general solution to the DE. Every solution to the DE can
be written in this form by picking the ci appropriately.
17 / 19
Example 8
Find the general solution of
d 2y
− 5y = 0
dt 2
18 / 19
Important ideas from today:
I A higher order differential equation can usually be rewritten as
an equivalent system of first order differential equations.
I Solutions can then be investigated using the methods
(qualitative, analytic, numerical) already studied for systems.
I However, in the case of linear, constant coefficient higher
order equations it is usually possible and quicker to find
analytic solutions directly. The ‘guessing’ method we use will
be formalised in the next lecture.
19 / 19
Maths 260: Differential Equations
Lecture 29: More on higher order differential equations
I Topics for today:
Linear, constant coefficient, higher order DEs
Initial value problems for higher order DEs
The harmonic oscillator
I Reading for this lecture: BDH Section 3.6
I Suggested exercises: BDH Section 3.6, #13,15,17,21,23,25
I Reading for next lecture: BDH Sections 4.1, 4.2
1 / 22
General result from last lecture:
Consider the differential equation
an
d n−1 y
dy
d ny
+
a
+ · · · + a1
+ a0 y = 0
n−1
n
n−1
dt
dt
dt
Let y1 (t), y2 (t), . . . , yn (t) be n linearly independent solutions of
the DE.
Then for arbitrary constants ci ,
y (t) = c1 y1 (t) + c2 y2 (t) + · · · + cn yn (t)
is the general solution to the DE.
Every solution to the DE can be written in this form by picking the
ci appropriately.
2 / 22
Example 1:
Find the general solution to the differential equation
2
dy
d 2y
+5
+ 3y = 0
2
dt
dt
3 / 22
Example 2
Find the general solution to the differential equation
d 2y
dy
+4
+ 5y = 0
2
dt
dt
4 / 22
Example 3
Find the general solution to the differential equation
d 2y
dy
+4
+ 4y = 0
2
dt
dt
5 / 22
Example 3
Convert to a system
dy
=v
dt
dv
d 2y
dy
= 2 = −4
− 4y = −4v − 4y
dt
dt
dt
So the equivalent system is:
dY
=
dt
0
1
Y
−4 −4
6 / 22
General Method
To find the general solution to
an
d ny
d n−1 y
dy
+ a0 y = 0
+
a
+ · · · + a1
n−1
dt n
dt n−1
dt
I Write down the characteristic polynomial:
an λn + an−1 λn−1 + · · · + a1 λ + a0 = 0
and find n roots, λ1 , λ2 , . . . , λn (some may be repeated or
complex).
I For each λi , the function eλi t will be a solution to the DE.
I If all the roots are distinct, construct the general solution by
taking a linear combination:
y (t) = c1 eλ1 t + c2 eλ2 t + · · · + cn eλn t
(converting to real form if necessary).
7 / 22
General Method
I If a root (say λi ) is repeated k times, then the k functions
eλi t , teλi t , t 2 eλi t , . . . , t k−1 eλi t ,
are linearly independent solutions and we can use a linear
combination of these in the general solution.
Remember that the general solution to an nth order linear,
constant coefficient DE contains n arbitrary constants and n
linearly independent solutions.
8 / 22
Example 4
Find the general solution to the differential equation
d 3y
dy
+
=0
3
dt
dt
9 / 22
Initial value problems for higher order DEs
Consider a higher order DE such as
d 2y
dy
+ 2y = 0
+3
2
dt
dt
with associated system
dY
=
dt
0
1
Y,
−2 −3
y
Y=
v
and v = dy
dt .
To define an IVP for the system we specify an initial condition
y
Y(t0 ) = Y0 = 0 ,
v0
i.e., y (t0 ) = y0 and v (t0 ) = dy
dt (t0 ) = v0 .
The equivalent IVP for the original higher order DE therefore has
two initial conditions: y (t0 ) = y0 and v (t0 ) = dy
dt (t0 ) = v0 .
10 / 22
Initial value problems for higher order DEs
More generally, an nth order IVP is an nth order DE
an
d ny
d n−1 y
dy
+ a0 y = 0
+
a
+ · · · + a1
n−1
dt n
dt n−1
dt
together with n initial conditions
y (t0 ) = y0
dy
(t0 ) = y1
dt
..
.
d n−1
(t0 ) = yn−1
dt n−1
11 / 22
Reminder: Existence and Uniqueness Theorem for systems
Consider the IVP
dY
= F(t, Y),
dt
Y(t0 ) = Y0 .
If F is continuous and has continuous first partial derivatives with
respect to all the dependent variables, then there is a constant
> 0 and a function Y(t) defined for t0 − < t < t0 + such that
Y(t) is a solution to the IVP.
For t in this interval, the solution is unique.
12 / 22
Example 5
Find a solution to the IVP y 00 − 2y 0 + 10y = 0, where y (0) = 0,
y 0 (0) = −2.
2
d y
00
Note: here (and elsewhere), y 0 = dy
dt , y = dt 2 .
13 / 22
The Harmonic Oscillator
Consider the second order, linear, constant coefficient DE
m
d 2y
dy
+b
+ ky = 0
dt 2
dt
where m, k > 0, b ≥ 0.
Any physical system modelled by this equation is called a
harmonic oscillator.
For instance, the mass/spring system considered in the last lecture
is a harmonic oscillator if we assume linear damping and restoring
forces, and no external forcing.
We can now completely classify the different types of solution to
this problem.
14 / 22
The Harmonic Oscillator
The characteristic polynomial for the harmonic oscillator is
mλ2 + bλ + k = 0
which has roots
λ1 =
−b +
√
b 2 − 4mk
,
2m
λ2 =
−b −
√
b 2 − 4mk
2m
and the general solution is
y (t) = c1 eλ1 t + c2 eλ2 t
There are four different cases, depending on the size of b, the
damping coefficient.
15 / 22
Case 1: b = 0 (no damping)
16 / 22
Case 2: 0 < b <
√
4km (underdamped)
17 / 22
Case 3: b >
√
4km (overdamped)
18 / 22
Case 4: b =
√
4km (critically damped)
19 / 22
Summary
For the harmonic oscillator, modelled by the DE
m
dy
d 2y
+b
+ ky = 0
2
dt
dt
with constants m, k > 0, b ≥ 0:
I if b = 0 all solutions are periodic except the equilibrium at
y =0
I if b > 0 all solutions tend to zero as t tends to ∞.
20 / 22
Important ideas from today
To find the general solution to
an
d n−1 y
dy
d ny
+
a
+ · · · + a1
+ a0 y = 0
n−1
n
n−1
dt
dt
dt
I Write down the characteristic polynomial:
an λn + an−1 λn−1 + · · · + a1 λ + a0 = 0
and find n roots,λ1 , λ2 , . . . , λn . The function eλi t will be a
solution to the DE.
I If all the roots are distinct, construct the general solution by
taking a linear combination:
y (t) = c1 eλ1 t + c2 eλ2 t + · · · + cn eλn t
(converting to real form if necessary).
21 / 22
Important ideas from today
I If a root (say λi ) is repeated k times, then the k functions
eλi t , teλi t , t 2 eλi t , . . . , t n eλi t ,
are linearly independent solutions and we can use a linear
combination of these in the general solution.
22 / 22
Maths 260: Differential Equations
Lecture 30: Nonhomogeneous higher order DEs
I Reading for this lecture: BDH Sections 4.1, 4.2
I Suggested exercises: BDH Section 4.1, #1, 3, 7, 11 and
Section 4.2, #1, 3, 9, 13
I Reading for next lecture: BDH Sections 4.3, 4.4
1 / 19
Nonhomogeneous higher order linear DEs
An nth order linear DE of the form
an
d ny
d n−1 y
dy
+ a0 y = f (t)
+
a
+ · · · + a1
n−1
n
n−1
dt
dt
dt
is called nonhomogeneous if f (t) is nonzero.
The function f (t) is called the forcing function or
nonhomogeneous term.
Example 1: The differential equation
m
d 2y
dy
+b
+ ky = sin t
2
dt
dt
models the behaviour of a mass/spring system subject to periodic
forcing.
2 / 19
Nonhomogeneous higher order linear DEs
To solve a nonhomogeneous DE, we first solve the corresponding
homogeneous equation and then combine this solution with a
particular solution to the nonhomogeneous equation.
We saw this idea earlier when looking for solutions to first order
linear systems.
For the nonhomogeneous DE
an
d ny
d n−1 y
dy
+ a0 y = f (t)
+
a
+ · · · + a1
n−1
n
n−1
dt
dt
dt
the corresponding homogeneous equation is:
an
d ny
d n−1 y
dy
+
a
+ · · · + a1
+ a0 y = 0
n−1
dt n
dt n−1
dt
3 / 19
The extended linearity principle
I If yq is a solution to the homogeneous DE and yp is a
particular solution to the nonhomogeneous DE then
y = yq + yp
is also a solution to the nonhomogeneous DE.
I If yh is the general solution to the homogeneous DE and yp is
a particular solution to the nonhomogeneous equation then
y = yh + yp
is the general solution to the nonhomogeneous DE.
4 / 19
Verification of the extended linearity principle
Let yh be a solution to y 00 + py 0 + qy = 0 and let yp be a solution
to y 00 + py 0 + qy = f (t).
Then y = yh + yp is a solution to y 00 + py 0 + qy = f (t).
5 / 19
Example 2:
Show that yp = −2e−3t is a particular solution to the equation
d 2y
dy
+ 8y = 2e−3t
+6
2
dt
dt
Hence find the general solution to this equation.
6 / 19
Summary of method of solution for nonhomogeneous
equations:
1. Find the general solution yh to the corresponding
homogeneous equation.
2. Find one solution to the nonhomogeneous equation (a
particular solution yp ).
3. Add answers to steps 1 and 2 to get the general solution to
the nonhomogeneous equation: y = yh + yp .
7 / 19
Finding a particular solution: a guessing method
Example 3: Find a particular solution to the DE
d 2y
dy
+3
+ 2y = et
2
dt
dt
8 / 19
Example 4:
Find a particular solution to the DE
d 2y
dy
+3
+ 2y = cos t
2
dt
dt
9 / 19
Example 5:
Find a particular solution to the DE
d 2y
dy
+3
+ 2y = 2t 2
2
dt
dt
10 / 19
Method of undetermined coefficients:
We can formalise the guessing method used in these examples:
To find a particular solution to the DE
an
d ny
d n−1 y
dy
+
a
+ · · · + a1
+ a0 y = f (t)
n−1
dt n
dt n−1
dt
where f (t) is
I a constant, or
I t n for n a positive integer, or
I eλt for real nonzero λ, or
I sin(bt) or cos(bt), for b constant, or
I a finite product of terms like these
take the following steps:
11 / 19
Method of undetermined coefficients:
Step 1: Write down the UC set, which is the set made up of the
function f (t) and all linearly independent functions obtained
by repeated differentiation of f (t).
Step 2: If any of the functions in the UC set is also a solution to the
homogeneous DE, multiply all functions in the set by t k ,
where k is the smallest integer so that the modified UC set
does not contain any solutions to the homogeneous DE.
Step 3: Find a particular solution to the DE by taking a linear
combination of all the functions in the (possibly modified) UC
set. Determine the unknown constants by substituting this
linear combination into the DE.
12 / 19
Example 6:
Find the general solution to the DE
d 2y
dy
+3
+ 2y = e−t
2
dt
dt
13 / 19
Example 7:
Find the general solution to the DE
d 2y
dy
+4
+ 3y = t
2
dt
dt
14 / 19
Example 8:
Find the solution to the IVP
d 2y
dy
− 3y = te3t ,
−2
2
dt
dt
y (0) = 0, y 0 (0) = 1
15 / 19
Example 8 continued:
Try yp = k1 t 2 e3t + k2 te3t = e3t (k1 t 2 + k2 t). Then
yp0 = e 3t (2k1 t + k2 ) + 3e3t (k1 t 2 + k2 t)
= e 3t (3k1 t 2 + (3k2 + 2k1 )t + k2 )
yp00 = e3t (6k1 t + (3k2 + 2k1 )) + 3e3t (3k1 t 2 + (3k2 + 2k1 )t + k2 )
= e3t (9k1 t 2 + (9k2 + 12k1 )t + (6k2 + 2k1 ))
So
yp00 − 2yp0 − 3yp = t 2 e3t (9k1 − 2 × 3k1 + 3k1 )
+ te3t (9k2 + 12k1 − 2(3k2 + 2k1 ) − 3k2 )
+ e3t (6k2 + 2k1 − 2k2 )
= te3t (8k1 ) + e3t (4k2 + 2k1 )
16 / 19
Example 8:
So we must have:
and the general solution is
1
1
y (t) = t 2 e3t − te3t + c1 e−t + c2 e3t
8
16
With the initial conditions y (0) = 0, y 0 (0) = 1, we can solve for c1
and c2 :
1
17
17
1
y (t) = t 2 e3t − te3t − e−t + e3t
8
16
64
64
17 / 19
Important ideas from today
I To solve a nonhomogeneous DE
an
d n−1 y
dy
d ny
+ a0 y = f (t)
+ an−1 n−1 + · · · + a1
n
dt
dt
dt
we first solve the corresponding homogeneous equation (i.e.,
with f (t) = 0) and then combine this solution with a
particular solution to the nonhomogeneous equation.
I To find a particular solution, we use the method of the
undetermined coefficients.
18 / 19
Important ideas from today
Specifically, we
I Form a UC set consisting of f (t) and all linearly independent
functions obtained by repeated differentiation of f (t).
I If any of the functions in the UC set is also a solution to the
homogeneous DE, multiply all functions in the set by t k ,
where k is the smallest integer so that the modified UC set
does not contain any solutions to the homogeneous DE.
I Find a particular solution to the DE by taking a linear
combination of all the functions in the (possibly modified) UC
set. Determine the unknown constants by substituting this
linear combination into the DE.
19 / 19
Maths 260: Differential Equations
Lecture 31: Nonhomogeneous higher order DEs
I Topics for today:
More nonhomogeneous higher order DEs
Forcing and resonance in the harmonic oscillator
I Reading for this lecture: BDH Sections 4.3, 4.4
I Suggested exercises: BDH Section 4.3, #3,7,9
Section 4.4, #2
I Reading for next lecture: None
1 / 18
Recap: Finding the general solution for a nonhomogeneous
linear DE
To find the general solution to equations of the form
an
d ny
d n−1 y
dy
+ a0 y = f (t)
+
a
+ · · · + a1
n−1
n
n−1
dt
dt
dt
1. Find the general solution yh to the related homogeneous
equation.
2. Find one solution to the nonhomogeneous equation (a
particular solution yp ).
3. Add answers to steps 1 and 2 to get the general solution to
the nonhomogeneous equation: y = yh + yp .
2 / 18
Recap: Method of undetermined coefficients:
To find a particular solution to the DE
an
d n−1 y
dy
d ny
+
a
+ · · · + a1
+ a0 y = f (t)
n−1
n
n−1
dt
dt
dt
where f (t) is
I constant, or
I t n for n a positive integer, or
I eλt for real nonzero λ, or
I sin(bt) or cos(bt), for b constant, or
I a finite product of terms like these
3 / 18
Recap: Method of undetermined coefficients:
Step 1: Form the UC set consisting of f (t) and all linearly independent
functions obtained by repeated differentiation of f (t).
Step 2: If any of the functions in the UC set is also a solution to the
homogeneous DE, multiply all functions in the set by t k ,
where k is the smallest integer so that the modified UC set
does not contain any solutions to the homogeneous DE.
Step 3: Find a particular solution to the DE by taking a linear
combination of all the functions in the (possibly modified) UC
set. Determine the unknown constants by substituting this
linear combination into the DE.
4 / 18
Example 1:
Find the general solution to
d 2y
dy
−3
+ 2y = 2 sin t
2
dt
dt
5 / 18
Example 2:
Find the general solution to
d 2y
dy
−3
+ 2y = −e2t
2
dt
dt
6 / 18
More complicated forcing functions
We can modify this method to solve DEs for which the forcing
function is a finite sum of terms.
For example, to find a solution to
an
d ny
d n−1 y
dy
+ a0 y = f1 (t) + f2 (t)
+
a
+ · · · + a1
n−1
n
n−1
dt
dt
dt
I First find y1 that solves
d n−1 y
dy
d ny
+
a
+ · · · + a1
+ a0 y = f1 (t)
n−1
n
n−1
dt
dt
dt
I Then find y2 that solves
an
an
d ny
d n−1 y
dy
+
a
+ · · · + a1
+ a0 y = f2 (t)
n−1
n
n−1
dt
dt
dt
Then y = y1 + y2 solves the DE with forcing term
f (t) = f1 (t) + f2 (t).
7 / 18
Example 3:
Find the general solution to
d 2y
dy
−3
+ 2y = 2 sin t − e2t
2
dt
dt
8 / 18
Example 4:
Find the general solution to
d 3y
d 2y
dy
+
2
+5
= t + 2et
3
2
dt
dt
dt
I Find a solution to the corresponding homogeneous equation
9 / 18
2
3
I Find a particular solution to ddt y3 + 2 ddt y2 + 5 dy
dt = t
3
2
t
I Then find a particular solution to ddt y3 + 2 ddt y2 + 5 dy
dt = 2e
10 / 18
The forced harmonic oscillator
A higher order equation of special interest in applications is the
periodically forced harmonic oscillator, i.e.
d 2y
dy
+p
+ qy = cos(ωt)
2
dt
dt
for constants p ≥ 0, q > 0 and ω > 0.
We are interested in the long term behaviour of solutions for
various values of the damping coefficient p.
The characteristic polynomial is λ2 + pλ + q = 0, which has roots
p
p
p 2 − 4q
λ=− ±
2
2
11 / 18
The forced harmonic oscillator
Thus, in the case 0 < p 2 < 4q, the homogeneous equation has
general solution
p
p
yh = c1 e− 2 t cos(αt) + c2 e− 2 t sin(αt)
where
p
4q − p 2
α=
2
12 / 18
The forced harmonic oscillator
To find the particular solution:
13 / 18
The forced harmonic oscillator
We find
yp = A cos(ωt + θ)
where
1
A= p
,
(q − ω 2 )2 + (ωp)2
−1
θ = tan
−ωp
q − ω2
Qualitative behaviour of this solution:
14 / 18
The forced harmonic oscillator
Plot of amplitude of yp as a function of ω in the case q = 2 and
for various p:
8
7
6
p=0.1
A
5
4
3
2
p=0.5
p=1.0
1
0
0
0.5
1
1.5
w
2
2.5
3
15 / 18
Summary:
I For the damped periodically forced harmonic oscillator
dy
dy
+p
+ qy = cos(ωt)
dt
dt
all solutions eventually become periodic with frequency the
same as the forcing frequency, ω, and with amplitude
depending on ω.
I The amplitude of the long term solutions can be very large if
the forcing frequency, ω, is close to the natural frequency of
√
the unforced system ( q).
I Also, smaller damping (p) leads to a larger amplitude for the
long term solutions.
16 / 18
Important ideas from today
To find a solution to
an
d ny
d n−1 y
dy
+ a0 y = f1 (t) + f2 (t)
+
a
+ · · · + a1
n−1
n
n−1
dt
dt
dt
we use linearity, i.e., first find y1 that solves
an
d n−1 y
dy
d ny
+
a
+ · · · + a1
+ a0 y = f1 (t)
n−1
dt n
dt n−1
dt
and then find y2 that solves
an
d ny
d n−1 y
dy
+
a
+ · · · + a1
+ a0 y = f2 (t)
n−1
n
n−1
dt
dt
dt
Then y = y1 + y2 solves the DE with forcing term
f (t) = f1 (t) + f2 (t).
17 / 18
For the damped periodically forced harmonic oscillator
dy
dy
+p
+ qy = cos(ωt)
dt
dt
all solutions eventually become periodic.
I The frequency of the periodic behaviour is the same as the
forcing frequency, ω,
I The amplitude of the periodic behaviour depends on ω, i.e.
the amplitude is larger if the forcing frequency, ω, is closer to
√
q, the natural frequency of the unforced system.
18 / 18
Download