Professional Documents
Culture Documents
Qualitative
theory. Numerics.
Luis L. Bonilla
Outline
Figure: State (phase) line and solution curves for logistic ODE with harvesting.
Bifurcations
Pitchfork bifurcation y 0 = (c − y 2 )y .
Direction field
Direction field in the (x, y ) plane for the autonomous ODE y 0 = 9.8 − 0.2y
showing the equilibrium solution y ∗ = 9.8/0.2 = 49. This ODE describes
how a body weighting 1 kg falls, if its velocity is y (x) and its friction force
is ky , with k = 0.2 kg/s. y ∗ = 49 m/s is the limiting velocity.
Bonilla (UC3M) Lecture 2 September 10, 2019 8 / 26
Direction fields
Direction field
It is possible to draw the direction field by studying the function f (x, y ) in
the ODE y 0 = f (x, y ) as in the example: y 0 = xy (y − 2)
Figure: Sectors of (a) decreasing and increasing y (x), (b) concave and convex
y (x), (c) combined information about signs of y 0 and y 00 for the ODE
y 0 = xy (y − 2). We have used y 00 = ∂x
∂f ∂f
+ ∂y f = y (y − 2)(1 + 2x 2 y − 2x 2 ).
Direction field
It is faster to draw the direction field by using Mathematica or Matlab. In
Mathematica: f [x− , y− ] := xy (y − 2);
StreamPlot[{1, f [x, y ]}, {x, −5, 5}, {y , −2, 3}, Frame− > False, Axes− >
True, AspectRatio− > 1/GoldenRatio]
Streamlines
y
x
-4 -2 2 4
-1
-2
Bonilla (UC3M) Lecture 2 September 10, 2019 11 / 26
Direction fields
Seems: Solution curves come arbitrarily close for large positive and
negative values of t − t0 .
dy
Euler method for dt = f (t, y )
dy
Euler method for dt = f (t, y )
Figure: The explicit (forward) Euler method yj+1 = yj + f (tj , yj )h, y0 = y (t0 ),
approximates a given trajectory y = ϕ(t) by segments that move it to nearby
trajectories ϕ1 (t), ϕ2 (t), . . . in the (t, y ) plane.
dy
Explicit Euler method for dt = 3 − 2t − y2 , y (0) = 1
Trajectories
y
2.0
1.5
1.0
0.5
t
0.5 1.0 1.5 2.0 2.5 3.0
-0.5
-1.0
Bonilla (UC3M) Lecture 2 September 10, 2019 16 / 26
Numerical solutions: Euler methods
dy
Explicit Euler method for dt = 3 − 2t − y2 , y (0) = 1
Figure: Error of the explicit Euler method is O(h), and it should decrease for large
t: exact solution y (t) = 14 − 4t − 13 e −t/2 .
dy
Explicit Euler method for dt = 4 − t + 2y , y (0) = 1
Trajectories
y
3
t
0.5 1.0 1.5 2.0
-1
Bonilla (UC3M) Lecture 2 September 10, 2019 18 / 26
Numerical solutions: Euler methods
dy
Explicit Euler method for dt = 4 − t + 2y , y (0) = 1
Figure: Error of the explicit Euler method is O(h), and it should increase for large
t: exact solution y (t) = − 74 + 2t + 11 2t
4 e . In this case, implicit Euler is better.
Theorem
y 0 = f (t, y ),
y (t0 ) = y0 ,
has a unique solution for |t − t0 | < δ (for some δ > 0 that leaves t in the
rectangle R). The IVP has a solution (existence) but no more than one
solution in R on any t-interval containing t0 (uniqueness).
y 0 = 2y 1/2 , y (t0 ) = y0 .
f (y ) =2y 1/2 continuous for all y ≥ 0 but f 0 (y ) = y −1/2 not continuous at
y = 0. One of the theorem conditions fails for rectangles about any point
1/2
(t0 , 0). Separation of variables give t − t0 = y 1/2 − y0 , i.e.,
1/2
y = (y0 + t − t0 )2 for any y0 > 0. This solution holds for y0 = 0 but
there are infinitely many solutions of the same IVP: y = 0 and:
0, t<s
y (t) = 2
(t − s) , t ≥ s ≥ t0 .
y
ty 0 − y = t 2 cos t, t>0 (f (t, y ) =
+ t cos t not continuous at t = 0).
t
Multiplying by 1/t 2 , we get (y /t)0 = cos t, and therefore
y = t sin t + Ct, t > 0.
This formula gives solutions also for t ≤ 0 and all these solutions satisfy
y (0) = 0. The IVP with: y (0) = 0 has infinitely many solutions whereas
any IVP with initial condition y (0) = y0 6= 0 has no solution at all!
y 0 = −y 1 − y , t > 0, y (0) = 1.
p
∂f y p
( = √ − 1 − y not continuous at y = 1).
∂y 2 1−y
Separation of variables
Z y Z t
dy
√ =− dt = −t, t > 0.
1 y 1−y 0
√ √ √
z = 1 − y gives ln[1 − 1 − y ] − ln[1 + 1 − y ] = −t. After some
algebra: y (t) = cosh1 2 t . Note y (t) = 1 also solves IVP.
2
�������
�
���
���
���
���
���
�
-�� -� � ��
p
yj+1 = yj − hyj 1 − yj ,y0 = 0.99.
p
yj+1 = f (yj , h), f (yj , h) = (1 − h 1 − yj )yj .
Plot functions yj+1 = yj , yj+1 = f (yj , h) and iterate starting from y0 .
√
Fixed points are y = 0, 1. Note that ∂y ∂f
(y , h) = 1 − h 1 − y + √hy1−y
, so
∂f
that ∂y (0, h) = 1 − h. Near y = 0, yj+1 ≈ (1 − h)yj . Thus yj moves away
from y = 0 for |h − 1| > 1, or h > 2 (numerical instability).
p
yj+1 = yj − hyj+1 1 − yj+1 , y0 = 0.99.
p
yj = g (yj+1 , h), g (yj+1 , h) = (1 + h 1 − yj+1 )yj+1 .
Plot functions yj+1 = yj , yj = g (yj+1 , h) and iterate starting from y0 :
∂g √
= 1 + h 1 − y − √hy
∂y (y , h) 1−y
, so ∂g 1
∂y (0, h) = 1 + h. Then yj+1 ≈ 1+h yj
near y = 0, which converges to y = 0 because 1 + h > 1 for all h > 0.
Bonilla (UC3M) Lecture 2 September 10, 2019 26 / 26