Professional Documents
Culture Documents
Blatt6 Solution
Blatt6 Solution
Worksheet 6
Sample Solutions
Continuous Models: Ordinary Differential Equations
(H) Exercise 1: Critical Points and Direction Fields for Higher-Order ODEs
is called ODE of order n, i.e. the index of the highest derivative corresponds to the order of the
ODE. In order to facilitate the analysis of ODEs, every ODE of order n > 1 can be transformed
into a system of ODEs of order n = 1 as explained below.
First, assume our ODE from equation (1) to have order n > 1. Then, we can introduce helper
functions y0 , . . . , yn−1 :
y0 ( t ) : = y ( t ),
dy(t)
y1 ( t ) : = ,
dt
..
.
d n −1 y ( t )
y n −1 : = .
dtn−1
Second, using the helper functions, we can transform the ODE from equation (1) into the fol-
lowing system of ODEs:
dy0
= y1 ,
dt
dy1
= y2 ,
dt
..
.
dy0 dy1 dyn−1
f (t, y0 , , ,..., ) = 0.
dt dt dt
The latter system only consists of first-order derivatives with respect to the helper functions.
Complete the folowing tasks for the ODE
d2 y
= −y, (2)
dt2
which is defined on an interval t ∈ [0, π/2].
(a) Determine the order of this ODE.
1
(b) Transform the ODE into a system of first-order ODEs. Write the transformed system as
dy0
dt y0
.. .
. ..
= A· (3)
dyn−1 y n −1
dt
with a system matrix A ∈ Rn×n .
(c) Similar to the one-dimensional case, homogeneous systems of ODEs, that is ODEs which
are of the form from equation (3) (without a constant vector b), can be solved analytically
using the exponential function for matrices. In case of equation (3) and initial conditions
y0 (0) = c0 , y1 (0) = c1 ,. . . , yn−1 (0) = cn−1 , the solution is given by:
y0 ( t ) c0
.. .
= exp( A · t) .. (4)
.
y n −1 ( t ) c n −1
Use the results from the Worksheet 4 Exercise 4 to determine the general solution of equa-
tion (2). Which information is required to obtain a unique solution? Find at least two
approaches to obtain a unique solution for the given ODE.
(d) Consider the ODE from equation (2) and its respective matrix-vector form (equation (3)).
What can you say about its critical points and stability? Draw the direction field on
[−1; 1] × [−1; 1].
(e) Write a python script which plots the direction field to validate your theoretical results
from (d).
(f) Consider the modified ODE
d2 y ( t )
= −µ · y(t)
dt2
with µ ≥ 0. How does the parameter µ affect the critical point, stability and the direction
field from (d)? Modify your python script for this purpose.
(g) Consider the ODE
d2 y ( t ) dy(t)
2
= −µ · y(t) +
dt dt
with µ ∈ R \ {0}. What happens to the critical point, stability and direction field in this
case?
Solution:
(a) The index of the highest derivative in equation (2) is two. Hence, the order of the ODE is
n = 2.
(b) We introduce two functions y0 (t) and y1 (t) as follows:
y0 ( t ) = y ( t )
dy(t)
y1 ( t ) =
dt
2
From this, we obtain the following relation for the first derivatives of y0 , y1 :
(c) From Worksheet 4 Exercise 4 we know that the exponential exp( A · t) for our matrix A
from above has the form
cos(t) sin(t)
exp( A · t) = I · cos(t) + A · sin(t) =
− sin(t) cos(t)
are given by λ = ±i. The eigenvalue is complex and its real part is zero. Following the
table on “Stability of Linear Systems” (cf. Slide 27 of the lecture population2.pdf), the
system is therefore expected to be stable and to have a “centered” critical point. Since A
has full rank and since our system is homogeneous, the critical point is given by A−1~0 =
~0.
(e) See ws6 ex1.py.
√
(f) See ws6 ex1.py. The eigenvalues arise in this case to be λ = ± µi. The stability is
– according to the overview from the lecture – still guaranteed. The matrix A has full
3
rank for all µ 6= 0; the critical point remains at ~0 in this case. The direction field has an
ellipsoidal shape.
For µ = 0, the ODE reads d2 y(t)/dt2 = 0 and has the solution y(t) = c · t + d with
constants c, d ∈ R. The only eigenvalue of A is λ = 0 in this case.
(g) See ws6 ex1.py. Re-writing the ODE as a system of first-order ODEs yields a homoge-
neous system (y0 (t), y1 (t))> = A · (y0 (t), y1 (t))> with matrix
0 1
A := .
−µ 1
p
1± 1 − 4µ
The eigenvalues are λ0,1 = . Since µ 6= 0, the inverse of A exists and is given
2
by
1 1 −1
A −1 : = .
µ µ 0
For
• µ = 0.25, we have only one real eigenvalue λ0 = λ1 = 0.5 > 0. From the overview in
the lecture, we expect the system to have a single node as critical point and unstable
behaviour. Since the system is homogeneous, the critical point is again given by ~0.
• µ < 0.25, we have two real-valued eigenvalues. If
– 0 < µ < 0.25, all eigenvalues are bigger than zero ⇒ critical point is a node,
system is unstable
– µ < 0, one eigenvalue is bigger and one eigenvalue is smaller than zero ⇒
critical point is a saddle point, system is unstable
• µ > 0.25, we have complex eigenvalues, λ0,1 = 12 ± 4µ − 1i. Since the real part
p
of the eigenvalues is always bigger than zero, we expect a spiral point and unstable
behavior.
Solution:
4
To determine the stability of these points one has to calculate the spatial derivative of dx dt .
If the real part of the derivative is less than zero at the critical points, it is stable, otherwise
it is unstable.
< 0 : stable
∂ dx
Re > 0 : unstable
∂x dt
= 0 : both possible
∂ dx
The spatial derivative of the logistic function is ∂x dt = a − 2bx. Thus the critical point
∗
x1 = 0 is stable for a < 0 and unstable for a > 0. For a = 0 equation (5) can be rewritten
as dx 2 ∗ ∗ a
dt = − bx . The point x = 0 then is a saddle point. For x2 = b the derivative becomes
∂ dx
∂x dt = − a. The point is stable when a > 0, unstable for a < 0 and is a saddle point for
a = 0.
(b) Figure 1 shows the bifurcation diagram for the logistic function. Stable points are marked
green, unstable red. Remark: in the bifurcation point a = 0 the two critical points collide
and swap their stability. This behavior is called transcritical bifurcation.
Figure 1: Bifurcation diagram of the continuous logistic equation. Stable points are marked
green, unstable red.
The stability of a nonlinear system of ODEs can be determined by considering the linear behav-
ior of this system in the neighborhood of the critical points. Without loss of generality, consider
two first-order differential equations:
dx
= u( x, y)
dt (6)
dy
= v( x, y)
dt
If x0 and y0 are critical points of the general system of ODEs (6), we can expand this system
5
about ( x0 , y0 )
∂2 u
d(δx ) ∂u ∂u
= δx + δy + δxδy + . . .
dt ∂x (x,y)=(x0 ,y0 ) ∂y (x,y)=( x0 ,y0 ) ∂x∂y (x,y)=( x0 ,y0 )
(7)
∂2 v
d(δy) ∂v ∂v
= δx + δy + δxδy + . . .
dt ∂x (x,y)=( x0 ,y0 ) ∂y (x,y)=( x0 ,y0 ) ∂x∂y (x,y)=( x0 ,y0 )
The matrix J is called the Jacobian or stability matrix. By analysing the eigenvalues of this
matrix in the same way as for linear systems we determine the stability and type of the critical
points.
As an example consider a general competing species model
dx
= 36x − 12x2 − 2xy
dt (9)
dy
= 30y − 6y2 − 6xy
dt
where two species are denoted by x ≥ 0 and y ≥ 0.
To analyze the evolution of the species complete the following tasks:
(a) Find all the critical points of the dynamic system.
(b) Compute the Jacobian matrix of the dynamic system and analyze the stability and type
of the critical points.
(c) Sketch a phase portrait or direction field of the given two species model, marking all the
critical points on your sketch.
Solution:
(a) To find the critical points we solve the system of equations with all time derivatives set to
zero
x (36 − 12x − 2y) = 0
y(30 − 6y − 6x ) = 0
The elementary solution of this system of equations is ( x, y)1 = (0, 0).
Next, we set x = 0 and solve 30 − 6y = 0 to find y, what gives ( x, y)2 = (0, 5).
Similarly, for y = 0 and 36 − 12x = 0 we obtain ( x, y)3 = (3, 0).
Finally, to find the last root of the system we solve the following linear system
12x + 2y = 36
6y + 6x = 30
which yields ( x, y)4 = (2.6, 2.4).
6
(b) The Jacobian matrix takes the form
36 − 24x − 2y −2x
J=
−6y 30 − 12y − 6x
Next, we analyze the stability and type of the critical points by computing eigenvalues of
the Jacobian matrix at this points.
• Point ( x, y)1 = (0, 0):
36 0
J (0, 0) =
0 30
The eigenvalues of this Jacobian are both positive λ1 = 36 and λ2 = 30, so this is an
unstable node.
• Point ( x, y)2 = (0, 5):
26 0
J (0, 5) =
−30 −30
The eigenvalues of the matrix are λ1 = 26 > 0 and λ2 = −30 < 0, so we have a
saddle point.
• Point ( x, y)3 = (3, 0):
−36 −6
J (3, 0) =
0 12
The eigenvalues of the Jacobian matrix are λ1 = −36 < 0, λ2 = 12 > 0 and we
obtain another saddle point.
• Point ( x, y)4 = (2.6, 2.4):
2 −78 −13
J (2.6, 2.4) =
5 −36 −36
7
6 Direction Field for x'=36x-12x^2-2xy, y'=30y-6y^2-6xy System of ODEs
3
y
0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
x
dx
= − xy
dt (10)
dy
= x2 − y
dt
dy
(a) Plot the nullclines ( dx
dt = 0 or dt = 0) of the system and sketch the direction field.
(b) Compute the eigenvalues of the Jacobian matrix on the critical point of the system. Can
you classify the critical point based on the eigenvalues?
(c) Use V ( x, y) = x2 + y2 as a Lyapunov function to show that the critical point is stable.
8
Solution:
(a) For the nullclines at least one of the time derivatives has to vanish.
dx
= 0 ⇔ x = 0∨y = 0
dt
dy
= 0 ⇔ y = x2
dt
Figure 3 shows the nullclines and the vectorfield of the system. Note the critical point at
( x, y) = (0, 0).
dy dx
Figure 3: Vectorfield and nullclines ( dt = 0, dt = 0) of the problem
9
(H*) Exercise 5: Discrete Dynamic System – Logistic Map
f ( x ) = ax (1 − x ), a≥0 (11)
(a) Determine the critical points of the map, i. e. the points x ∗ for which f ( x ∗ ) = x ∗ holds.
In addition, discuss their stability as a function of the parameter a.
(b) Determine the critical points of the map f (2) ( x ) := f ( f ( x )).
Hint: f ( x ) and f (2) ( x ) share two critical points. Make use of this and apply polynomial
division.
(c) Sketch the stable critical points as a function of 0 ≤ a ≤ 4.
Solution:
(a) For critical points the relation f ( x ∗ ) = x ∗ holds. In the trivial case a = 0 the map reads
xn+1 = 0, i. e. there is one stable critical point x ∗ = 0. Otherwise we have
!
f ( x ∗ ) = ax ∗ (1 − x ∗ ) = x ∗ ⇔ x ∗ [− ax ∗ + ( a − 1)] = 0
a −1
and therefore x1∗ = 0 and x2∗ = a .
For x1∗ = 0, we have f 0 (0) = a, which means we have a stable critical point at x1∗ = 0
for 0 < a < 1 and an unstable critical point for a > 1.
On the other hand, we have f 0 ( x2∗ ) = 2 − a for x2∗ = a−a 1 . If 1 < a < 3 we obtain
| f 0 ( x2∗ )| < 1 and therefore a stable critical point. The choices 0 < a < 1 or a > 3 result in
| f 0 ( x2∗ )| > 1 and an unstable critical point.
x ∗ = f ( f ( x ∗ ))
= a f ( x ∗ )(1 − f ( x ∗ ))
= a( ax ∗ (1 − x ∗ ))(1 − ax ∗ (1 − x ∗ ))
10
There are four solutions (critical points) of this equation because the corresponding poly-
nomial is of degree four. For the critical points x1∗ and x2∗ of xn+1 = f ( xn ) it holds
∗ ∗ ∗
f ( f ( x1,2 )) = f ( x1,2 ) = x1,2 .
Hence, critical points of xn+1 = f ( xn ) are also critical points of xn+1 = f ( f ( xn )). We
can use this result to transform the fourth order polynomial equation with the help of
polynomial division into a second order polynomial equation, this results in the new
critical points
p
∗ −( a3 + a2 ) ± ( a3 + a2 )2 − 4(− a3 )(− a2 − a)
x3,4 = .
−2a3
Those are real for a > 3 and fulfil the following relations
(c) For 0 < a < 1 only the critical point x1∗ is stable. At a = 1 the critical points exchange their
stability properties (transcritical bifurcation) and the critical point x2∗ is stable and plotted
in Figure 4. At a = 3 the critical points of xn+1 = f ( f ( xn )) (see (b)) become real-valued.
The simple logistic map shows chaotic behaviour for higher a.
Figure 4: Stable critical points of the logistic map over the parameter a.
11