Lecture slides for UCLA LS 30B, Spring 2020
Public worksheets/Lecture slides - Spring 2020 / Mini-Lecture 5-2 - Discrete-time models of dynamical systems.ipynb
17944 viewsLicense: GPL3
ubuntu2004
Kernel: SageMath 9.3
All of our models so far (differential equations) have assumed that time () is continuous.
This was why we needed to use Euler's method, with a “small” , to approximate solutions to our differential equations. And this was always just an approximation: we can make it more accurate by using a smaller , but we can never get the exact solution using Euler's method.
But sometimes, it makes sense to think of time as discrete. This means that the variable can only be a whole number.
This makes sense, for example, for models of populations that have a distinct mating season, or a very fixed life cycle that repeats each year (such as many insects).
Discrete time models
(Also known as difference equations)
In [1]:
In [2]:
Out[2]:
10
In [3]:
Out[3]:
20
In [4]:
Out[4]:
40
In [5]:
Out[5]:
80
In [6]:
Out[6]:
160
In [7]:
Out[7]:
[5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120]
In [8]:
Out[8]:
In [9]:
In [10]:
Out[10]:
0.960000000000000
In [11]:
Out[11]:
0.153600000000000
In [12]:
Out[12]:
0.520028160000000
In [13]:
Out[13]:
0.998395491228058
In [14]:
Out[14]:
0.00640773729417265
In [15]:
In [16]:
Out[16]:
In [17]:
Out[17]:
In [18]:
Out[18]:
In [19]:
Out[19]:
In [20]:
Out[20]: