1
00:00:00,330 --> 00:00:08,130
So the reason why we used the eigenvalue methods to analyze the EIGEN frequencies was because we wanted

2
00:00:08,130 --> 00:00:14,550
to analyze the numerical result a bit more because it looked pretty difficult and we couldn't really

3
00:00:14,550 --> 00:00:15,870
learn much from it.

4
00:00:16,830 --> 00:00:22,920
But now, since we have the ion frequencies, it would be a good thing to figure out if we can really

5
00:00:22,920 --> 00:00:28,380
find these frequencies, which are given by just groups of these numbers here.

6
00:00:29,100 --> 00:00:35,750
If we can really find these in the numerical solution and this is what we will do next.

7
00:00:35,760 --> 00:00:39,960
So first of all, let me copy of this one here because we will need this.

8
00:00:41,280 --> 00:00:49,860
So like this, and the first thing that I will do is here is once again, the equation for the full

9
00:00:49,860 --> 00:00:56,250
year transform that we will use now, and we can use the four year transform to find the characteristic

10
00:00:56,250 --> 00:00:59,200
frequencies of such a spectrum here, which is harmonic.

11
00:00:59,670 --> 00:01:02,400
So sorry, not harmonic, but periodic.

12
00:01:02,850 --> 00:01:11,250
And we can basically split the non harmonic spectrum into several harmonic spectra, and it will be

13
00:01:11,250 --> 00:01:13,530
then a superposition of these contributions.

14
00:01:14,850 --> 00:01:19,560
So the first thing that we need is something that we have programmed much earlier.

15
00:01:20,130 --> 00:01:23,850
It was a method how to calculate integrals.

16
00:01:24,450 --> 00:01:31,920
And we did several different methods, and one of the better ones was the trapezoidal methods.

17
00:01:32,580 --> 00:01:34,980
So we have programmed this already in a previous lecture.

18
00:01:34,980 --> 00:01:39,660
Here, I will just type it in case you forgot it.

19
00:01:39,660 --> 00:01:47,310
You can also go back to the previous Notebook Python book and just copy the code that we have written

20
00:01:47,310 --> 00:01:48,060
that down there.

21
00:01:48,060 --> 00:01:49,140
So it's the same thing.

22
00:01:49,830 --> 00:02:01,470
So basically, we loop over all the points except for one, and then we add up the contributions which

23
00:02:01,470 --> 00:02:03,090
are given as follows.

24
00:02:03,660 --> 00:02:10,979
So a plus and then data the Y.

25
00:02:10,979 --> 00:02:11,760
Well, you.

26
00:02:12,390 --> 00:02:14,670
And then the next index.

27
00:02:18,080 --> 00:02:21,650
Adds to my value of the current index.

28
00:02:23,640 --> 00:02:29,970
Divide it by two, and then we have here the difference in the X values.

29
00:02:31,860 --> 00:02:38,570
So this would be day to zero five plus one and data.

30
00:02:40,480 --> 00:02:43,540
Zero calories, so think about it for a second.

31
00:02:43,900 --> 00:02:49,660
And if you really don't remember how it works, then you can go back to the video where we programmed

32
00:02:49,660 --> 00:02:52,240
this, it was in the integration part of the course.

33
00:02:53,530 --> 00:02:53,760
OK.

34
00:02:53,770 --> 00:02:56,050
And of course, in the end, we return this summer.

35
00:02:57,070 --> 00:03:05,800
OK, so this was how we can integrate a dataset where we have basically two lists a list for the X component

36
00:03:05,800 --> 00:03:07,660
and the list for the Y components.

37
00:03:08,650 --> 00:03:10,240
And we want to use these methods.

38
00:03:13,720 --> 00:03:19,480
Like this well, to use this method to calculate this integral here, which is if we transformed.

39
00:03:20,470 --> 00:03:27,220
But before we do this, what we can also do is we could integrate the individual fluctuations here.

40
00:03:28,520 --> 00:03:32,440
OK, but this you can do as a practice if you want.

41
00:03:32,920 --> 00:03:36,920
What I will do next is I will generate the data, right?

42
00:03:37,510 --> 00:03:46,480
So as I said, it's an array of X and Y values and it will be and he dot free.

43
00:03:48,730 --> 00:03:56,140
And now basically, we have to access the solutions.

44
00:03:56,140 --> 00:04:03,370
Here we have basically here we have the Tier T list for the home values, which will give the X component.

45
00:04:03,850 --> 00:04:09,400
And then we have these solutions, which will be the coordinates, which will be the Y solution.

46
00:04:10,360 --> 00:04:17,980
So basically, we will specify now a list where the X components will be just a time list.

47
00:04:18,550 --> 00:04:19,690
So that's pretty easy.

48
00:04:20,050 --> 00:04:26,400
We can just write and p dot a.

49
00:04:29,880 --> 00:04:34,350
Solution three o a seed dot t.

50
00:04:35,130 --> 00:04:37,170
And now we must try to come up.

51
00:04:37,570 --> 00:04:42,720
And now we must write the the function of which we integrate.

52
00:04:43,300 --> 00:04:48,570
And this would be one over square root of two pi times the solution.

53
00:04:48,660 --> 00:04:52,290
So basically this one and then this exponential factor here as well.

54
00:04:53,580 --> 00:05:02,760
So it will be, as I just said, one over and peed on the square root two times and peed five times

55
00:05:03,060 --> 00:05:04,320
the solution.

56
00:05:04,320 --> 00:05:07,260
So this would be solution on the score.

57
00:05:07,290 --> 00:05:10,230
Three O C Thought Y.

58
00:05:10,770 --> 00:05:16,070
And now we could, of course, program the individual components each one after another.

59
00:05:16,080 --> 00:05:19,180
But here I want to make basically an array inside of an array.

60
00:05:19,200 --> 00:05:20,540
This is why I wrote here also.

61
00:05:20,540 --> 00:05:20,880
Three.

62
00:05:21,450 --> 00:05:24,300
So we will later on loop over this index here.

63
00:05:25,110 --> 00:05:26,910
So we have now why?

64
00:05:27,570 --> 00:05:30,520
And then the IV component, which will be zero, one and two.

65
00:05:31,170 --> 00:05:40,920
And then we multiply by the exponential function and p dot p s p and then the imaginary units, which

66
00:05:40,920 --> 00:05:54,480
in Python is one g times o m, which will be the frequency and then times the solution.

67
00:05:56,460 --> 00:05:59,790
And basically, this will be time again, so I can just copy this one here.

68
00:06:00,990 --> 00:06:05,100
So you see this one is eye times, omega times t.

69
00:06:05,940 --> 00:06:16,200
So exactly what we wrote here and what is important to realize or to remember is that free to transform

70
00:06:16,680 --> 00:06:19,800
is a function depending on omega.

71
00:06:20,040 --> 00:06:24,660
So for each value omega, we have to calculate this integral here.

72
00:06:25,590 --> 00:06:30,900
So of course, we could now say, OK, we want to use Omega is equal to sun number, for example, I

73
00:06:30,900 --> 00:06:32,040
don't know 0.5.

74
00:06:32,430 --> 00:06:37,500
And then we calculate the value of the four you transformed for this particular omega.

75
00:06:38,130 --> 00:06:41,310
But actually, we want to have it as a whole array.

76
00:06:41,820 --> 00:06:48,510
So I will just write here integral trapezoidal.

77
00:06:50,960 --> 00:07:02,060
And then we have now our array or data set basically with the X values and the Y values over which we

78
00:07:02,060 --> 00:07:02,770
integrate.

79
00:07:02,780 --> 00:07:09,530
But I just said Omega is just a fixed value, so we must create a whole array where we basically have

80
00:07:09,530 --> 00:07:17,810
different values for omega so we can write like this omega comma and the value.

81
00:07:18,320 --> 00:07:28,490
And then we can basically just tried to close it here and write four and then we can write for Omega.

82
00:07:31,260 --> 00:07:34,650
In A.P. Dodds, Lance Bass.

83
00:07:35,070 --> 00:07:45,240
And now we must specify the range for Omega, and I will take values from zero to three and steps of

84
00:07:46,440 --> 00:07:48,360
size zero point zero one.

85
00:07:49,410 --> 00:07:51,990
So this will now be a loop over the Omega.

86
00:07:52,650 --> 00:07:55,810
But I think we are not finished yet.

87
00:07:55,850 --> 00:07:59,890
Yes, this is because we have to close.

88
00:07:59,910 --> 00:08:02,130
Now, of course, the brackets I will do this year.

89
00:08:05,650 --> 00:08:19,990
And opened the bracket, and then I want to loop over another index, which will be for I in range three

90
00:08:19,990 --> 00:08:25,220
because we want to loop over all three oscillators and here we have to index it.

91
00:08:25,240 --> 00:08:29,170
So we need basically another one of these brackets here.

92
00:08:31,540 --> 00:08:38,409
OK, so now we have F.T, which is the whole array of the Fuji transform, and we can, first of all,

93
00:08:38,409 --> 00:08:45,940
say, for example, F.T 051 F2 and then four three will give an error.

94
00:08:46,070 --> 00:08:51,840
Yeah, because this is from this loop here, this will just be the index for the oscillator.

95
00:08:52,420 --> 00:08:57,670
For example, if we want to have the free transform of the first oscillator, we wrote F.T Zero and

96
00:08:57,670 --> 00:09:08,770
then when we arrived one, when we write this, then we have all the the values of the four transform.

97
00:09:08,780 --> 00:09:12,880
So basically this one here y tilde of omega.

98
00:09:13,540 --> 00:09:17,950
And if we write zero, then we have all the Omegas.

99
00:09:19,060 --> 00:09:24,490
So you see here they are still stored in the complex data type, but actually it's just a real number

100
00:09:24,490 --> 00:09:27,280
because the imaginary part is always zero.

101
00:09:28,360 --> 00:09:32,920
So now we can go ahead and plot this, so I will write

102
00:09:35,410 --> 00:09:38,050
Potti Dot plots.

103
00:09:38,830 --> 00:09:42,850
And as I just showed you, we have to now write the omega lists.

104
00:09:42,860 --> 00:09:49,300
So this would be hefty zero comma, all comma zero.

105
00:09:49,780 --> 00:09:53,250
And then to get rid of the imaginary part, we can write dot real.

106
00:09:53,830 --> 00:09:57,190
And then we must use the actual value.

107
00:09:57,210 --> 00:09:59,080
So here we must change this to one.

108
00:09:59,560 --> 00:10:05,920
And typically, when you plot, if we transform to take the absolute value because it's a complex property

109
00:10:05,920 --> 00:10:07,350
and you square it.

110
00:10:09,610 --> 00:10:11,590
OK, now I will add the labels.

111
00:10:12,010 --> 00:10:16,870
Plus, he told X label is frequency.

112
00:10:20,340 --> 00:10:28,380
Well, it's actually frequency Omega, so this would be two pi times the frequency and then Kielty dots,

113
00:10:29,010 --> 00:10:31,260
why label is?

114
00:10:31,650 --> 00:10:38,220
You could see something like Inten City of Tafoya transforming.

115
00:10:41,110 --> 00:10:42,470
OK, so here we go.

116
00:10:42,490 --> 00:10:51,940
This is the fit, and now we could continue and rides peel to.

117
00:10:53,940 --> 00:10:54,820
Talk show.

118
00:10:57,180 --> 00:11:01,880
And now we can basically plot all of three free transports.

119
00:11:03,630 --> 00:11:08,600
So this would be done one two one two.

120
00:11:10,920 --> 00:11:18,210
And you see, these are now all the four you transforms with individual peaks at certain frequencies.

121
00:11:18,510 --> 00:11:25,950
So what's worth highlighting here is that these three peaks here correspond to the three frequencies

122
00:11:25,950 --> 00:11:30,150
that we have discovered before I have plotted them or I've written them down here.

123
00:11:30,630 --> 00:11:34,410
So this was what we have figured out eigenvalues eigenvectors.

124
00:11:34,860 --> 00:11:41,490
And when you calculate the numbers here, this gives 0.7, one point four and one point eight.

125
00:11:41,790 --> 00:11:45,520
These are exactly the values that we see here for the peaks.

126
00:11:46,200 --> 00:11:52,620
So indeed, if we calculate the four transform of our numerically solved equations, we get peaks at

127
00:11:52,620 --> 00:11:56,490
these unique frequencies, which are two agan frequencies of the system.

128
00:11:57,630 --> 00:12:03,900
And furthermore, we can also have a look at the eigenvectors because we have seen that the first and

129
00:12:03,900 --> 00:12:07,360
the third oscillator, they move in a pretty similar way.

130
00:12:07,380 --> 00:12:15,660
They often only change or have different signs here and here and here, and then the middle oscillators

131
00:12:15,660 --> 00:12:24,600
special because, for example, for the EIGEN mode with omega equal to one point four, the eigenvectors

132
00:12:24,600 --> 00:12:25,200
zero.

133
00:12:25,650 --> 00:12:33,240
And indeed, for the second oscillator, we do not see a peak in the frequency spectrum at one point

134
00:12:33,240 --> 00:12:33,600
four.

135
00:12:34,200 --> 00:12:40,590
So for this particular oscillator, this frequency does not exist, and we know that this is true because

136
00:12:40,590 --> 00:12:45,330
the eigenvectors has a zero for the component for this particular frequency.

137
00:12:46,080 --> 00:12:51,210
And also, we see that the spectrum for the first and the third oscillator are exactly the same.

138
00:12:51,990 --> 00:12:59,400
So our results from the eigenvalue problem are indeed contained in the numerical solution, as we have

139
00:12:59,400 --> 00:13:05,220
just analyzed by calculating the Fourier transform of this spectrum here.

140
00:13:06,600 --> 00:13:15,720
So what this means is that we can express the numerical solution by a superposition of three different

141
00:13:15,720 --> 00:13:22,830
harmonic functions, so we could write that our function is given by a sound function with the first

142
00:13:22,830 --> 00:13:28,410
ion frequency, plus a sound function with the second ion frequency plus assigned function with the

143
00:13:28,410 --> 00:13:29,760
third ion frequency.

144
00:13:30,600 --> 00:13:36,180
But of course, it's not so easy because all of these sine functions have different amplitudes and different

145
00:13:36,180 --> 00:13:37,080
face factors.

146
00:13:37,530 --> 00:13:43,530
So this means we have six different parameters that we first had to figure out if we want to fit this

147
00:13:43,530 --> 00:13:44,280
to the data.

148
00:13:45,090 --> 00:13:48,390
And actually, this is what we want to do in the next lecture.

149
00:13:49,560 --> 00:13:55,200
Just one more thing that I want to show you is that if I just rerun the whole notebook, we start with

150
00:13:55,200 --> 00:13:56,800
different starting conditions.

151
00:13:57,420 --> 00:14:02,040
And so this will give rise to different intensity spectra each of the time.

152
00:14:02,670 --> 00:14:09,750
For example, now you see that in all three cases, the one point four case does not really have a peak,

153
00:14:09,750 --> 00:14:12,030
except here, maybe a very, very small one.

154
00:14:12,870 --> 00:14:18,790
So let's do it once again, we have once again different starting conditions, and you see the amplitudes

155
00:14:18,810 --> 00:14:22,030
of these individual frequencies can be very, very different.

156
00:14:22,050 --> 00:14:27,390
For example, now it is even the largest peak, even though previously it wasn't there at all.

157
00:14:28,350 --> 00:14:35,220
But you always see the same thing that you do not see this peak for the second oscillator and that the

158
00:14:35,220 --> 00:14:37,890
first and the third one always looked the same.

159
00:14:38,700 --> 00:14:45,330
But the intensity of the peaks will always be different, and it depends strongly on the starting condition.

