1
00:00:03,000 --> 00:00:08,000
In this homework, well write a program to calculate the capacity dimension of a trajectory of a dynamical system
2
00:00:08,000 --> 00:00:12,000
For simplicity, for this video, well focus on the two-dimensional case
3
00:00:12,000 --> 00:00:16,000
But later, in the more advanced version of the homework, youll work in the n-dimensional case
4
00:00:16,000 --> 00:00:23,000
The first step in this process is to write a program to calculate the number of boxes needed, of side length epsilon, needed to cover an object
5
00:00:23,000 --> 00:00:26,000
To do this, well cover the object with a grid
6
00:00:26,000 --> 00:00:28,000
These are the grey dots you see in the right picture
7
00:00:28,000 --> 00:00:31,000
Each one of these squares is epsilon by epsilon wide
8
00:00:31,000 --> 00:00:34,000
In your code, you dont actually want to build this grid every time
9
00:00:34,000 --> 00:00:37,000
The grid is simply there as a visual for understanding this algorithm
10
00:00:37,000 --> 00:00:43,000
What we want to do is have a matrix, where each index in the matrix is mapped to one element in this grid
11
00:00:43,000 --> 00:00:48,000
So for example, the grid element in the upper left would be mapped to the matrix element (1, 1)
12
00:00:48,000 --> 00:00:51,000
This chunk of code sets up such a matrix
13
00:00:51,000 --> 00:01:00,000
We then simply need to walk over the trajectory, and map each element in the trajectory to one of these positions in the matrix, and then activate that element in the matrix
14
00:01:00,000 --> 00:01:03,000
In the video youll see new black stars appearing
15
00:01:03,000 --> 00:01:07,000
Each black star corresponds to the next point in the trajectory
16
00:01:07,000 --> 00:01:15,000
We will then use this map, which takes the current element minus the minimum in that direction, divided by epsilon, and takes the ceiling of that
17
00:01:15,000 --> 00:01:19,000
Thatll map that element of the trajectory to an index in the matrix
18
00:01:19,000 --> 00:01:22,000
We then simply need to activate that element in the matrix
19
00:01:22,000 --> 00:01:26,000
That is, we simply need to set the entry in the matrix at that index equal to one
20
00:01:26,000 --> 00:01:31,000
In the video, this is shown as the grayed-out boxes being activated by red
21
00:01:31,000 --> 00:01:37,000
So just for visual mapping, the black stars are being mapped by this mapping to a position in the box matrix
22
00:01:37,000 --> 00:01:43,000
And then the entry at that index in the matrix is being set equal to one, and this is equivalent to the red boxes appearing
23
00:01:43,000 --> 00:01:47,000
Once weve gone through the entire trajectory, well see something like this
24
00:01:47,000 --> 00:01:52,000
Here, the trajectory has been covered by the minimum number of boxes of that size epsilon needed
25
00:01:52,000 --> 00:02:01,000
In the matrix notation, you have a matrix where each one of these red boxes is represented by a one, and each one of the grayed-out boxes is represented by a zero
26
00:02:01,000 --> 00:02:10,000
If we then just sum up all the entries of the matrix thats this line here well get the number of boxes needed, of that size epsilon, to cover the trajectory
27
00:02:10,000 --> 00:02:14,000
This is precisely the function you needed for part 1 of the homework
28
00:02:14,000 --> 00:02:18,000
With the function I just showed you, you can now answer questions a through d
29
00:02:18,000 --> 00:02:31,000
If you run this code using an epsilon of 0.05, using an x, z projection of the trajectory located at the link in this homework, you get that it takes 13,968 boxes
30
00:02:31,000 --> 00:02:43,000
Part b asks, would this point that is, log(1/epsilon) over log(N(epsilon)) be in the scaling region of a log(N(epsilon)) versus log(1/epsilon) plot for this trajectory
31
00:02:43,000 --> 00:02:48,000
And the answer to this is no: all points are covered by approximately their own box
32
00:02:48,000 --> 00:02:55,000
If you look at the length of this time series, or the length of this trajectory, its 14,000 points long
33
00:02:55,000 --> 00:03:03,000
The fact that theres 13,968 boxes means that basically every point has its own box
34
00:03:03,000 --> 00:03:08,000
Most likely this point would be on the top, flat curve, not in the scaling region
35
00:03:08,000 --> 00:03:12,000
For part c, we instead use an epsilon of 0.5
36
00:03:12,000 --> 00:03:16,000
In this case, we get that we have 4,342 boxes
37
00:03:16,000 --> 00:03:20,000
Part d asks the same thing as part b, but instead, epsilon is 0.5
38
00:03:20,000 --> 00:03:28,000
Since we had 14,000 points in the trajectory, and we had 4,342 boxes, its most likely the case that this point would be in the scaling region
39
00:03:28,000 --> 00:03:31,000
Certainly, all points are not covered by a single box
40
00:03:31,000 --> 00:03:34,000
Theyre covered by 4,342 boxes
41
00:03:34,000 --> 00:03:37,000
And, not all points are covered by approximately their own box
42
00:03:37,000 --> 00:03:39,000
Many boxes are shared
43
00:03:39,000 --> 00:03:42,000
So its likely that this point would be in the scaling region
44
00:03:42,000 --> 00:03:51,000
However, to show that this is true, you would need to do this calculation for a range of epsilon, and plot log(N(epsilon)) versus log(1/epsilon), and check for a scaling region by hand