So the reason why we used the eigenvalue methods to analyze the EIGEN frequencies was because we wanted
to analyze the numerical result a bit more because it looked pretty difficult and we couldn't really
learn much from it.
But now, since we have the ion frequencies, it would be a good thing to figure out if we can really
find these frequencies, which are given by just groups of these numbers here.
If we can really find these in the numerical solution and this is what we will do next.
So first of all, let me copy of this one here because we will need this.
So like this, and the first thing that I will do is here is once again, the equation for the full
year transform that we will use now, and we can use the four year transform to find the characteristic
frequencies of such a spectrum here, which is harmonic.
So sorry, not harmonic, but periodic.
And we can basically split the non harmonic spectrum into several harmonic spectra, and it will be
then a superposition of these contributions.
So the first thing that we need is something that we have programmed much earlier.
It was a method how to calculate integrals.
And we did several different methods, and one of the better ones was the trapezoidal methods.
So we have programmed this already in a previous lecture.
Here, I will just type it in case you forgot it.
You can also go back to the previous Notebook Python book and just copy the code that we have written
that down there.
So it's the same thing.
So basically, we loop over all the points except for one, and then we add up the contributions which
are given as follows.
So a plus and then data the Y.
Well, you.
And then the next index.
Adds to my value of the current index.
Divide it by two, and then we have here the difference in the X values.
So this would be day to zero five plus one and data.
Zero calories, so think about it for a second.
And if you really don't remember how it works, then you can go back to the video where we programmed
this, it was in the integration part of the course.
OK.
And of course, in the end, we return this summer.
OK, so this was how we can integrate a dataset where we have basically two lists a list for the X component
and the list for the Y components.
And we want to use these methods.
Like this well, to use this method to calculate this integral here, which is if we transformed.
But before we do this, what we can also do is we could integrate the individual fluctuations here.
OK, but this you can do as a practice if you want.
What I will do next is I will generate the data, right?
So as I said, it's an array of X and Y values and it will be and he dot free.
And now basically, we have to access the solutions.
Here we have basically here we have the Tier T list for the home values, which will give the X component.
And then we have these solutions, which will be the coordinates, which will be the Y solution.
So basically, we will specify now a list where the X components will be just a time list.
So that's pretty easy.
We can just write and p dot a.
Solution three o a seed dot t.
And now we must try to come up.
And now we must write the the function of which we integrate.
And this would be one over square root of two pi times the solution.
So basically this one and then this exponential factor here as well.
So it will be, as I just said, one over and peed on the square root two times and peed five times
the solution.
So this would be solution on the score.
Three O C Thought Y.
And now we could, of course, program the individual components each one after another.
But here I want to make basically an array inside of an array.
This is why I wrote here also.
Three.
So we will later on loop over this index here.
So we have now why?
And then the IV component, which will be zero, one and two.
And then we multiply by the exponential function and p dot p s p and then the imaginary units, which
in Python is one g times o m, which will be the frequency and then times the solution.
And basically, this will be time again, so I can just copy this one here.
So you see this one is eye times, omega times t.
So exactly what we wrote here and what is important to realize or to remember is that free to transform
is a function depending on omega.
So for each value omega, we have to calculate this integral here.
So of course, we could now say, OK, we want to use Omega is equal to sun number, for example, I
don't know 0.5.
And then we calculate the value of the four you transformed for this particular omega.
But actually, we want to have it as a whole array.
So I will just write here integral trapezoidal.
And then we have now our array or data set basically with the X values and the Y values over which we
integrate.
But I just said Omega is just a fixed value, so we must create a whole array where we basically have
different values for omega so we can write like this omega comma and the value.
And then we can basically just tried to close it here and write four and then we can write for Omega.
In A.P. Dodds, Lance Bass.
And now we must specify the range for Omega, and I will take values from zero to three and steps of
size zero point zero one.
So this will now be a loop over the Omega.
But I think we are not finished yet.
Yes, this is because we have to close.
Now, of course, the brackets I will do this year.
And opened the bracket, and then I want to loop over another index, which will be for I in range three
because we want to loop over all three oscillators and here we have to index it.
So we need basically another one of these brackets here.
OK, so now we have F.T, which is the whole array of the Fuji transform, and we can, first of all,
say, for example, F.T 051 F2 and then four three will give an error.
Yeah, because this is from this loop here, this will just be the index for the oscillator.
For example, if we want to have the free transform of the first oscillator, we wrote F.T Zero and
then when we arrived one, when we write this, then we have all the the values of the four transform.
So basically this one here y tilde of omega.
And if we write zero, then we have all the Omegas.
So you see here they are still stored in the complex data type, but actually it's just a real number
because the imaginary part is always zero.
So now we can go ahead and plot this, so I will write
Potti Dot plots.
And as I just showed you, we have to now write the omega lists.
So this would be hefty zero comma, all comma zero.
And then to get rid of the imaginary part, we can write dot real.
And then we must use the actual value.
So here we must change this to one.
And typically, when you plot, if we transform to take the absolute value because it's a complex property
and you square it.
OK, now I will add the labels.
Plus, he told X label is frequency.
Well, it's actually frequency Omega, so this would be two pi times the frequency and then Kielty dots,
why label is?
You could see something like Inten City of Tafoya transforming.
OK, so here we go.
This is the fit, and now we could continue and rides peel to.
Talk show.
And now we can basically plot all of three free transports.
So this would be done one two one two.
And you see, these are now all the four you transforms with individual peaks at certain frequencies.
So what's worth highlighting here is that these three peaks here correspond to the three frequencies
that we have discovered before I have plotted them or I've written them down here.
So this was what we have figured out eigenvalues eigenvectors.
And when you calculate the numbers here, this gives 0.7, one point four and one point eight.
These are exactly the values that we see here for the peaks.
So indeed, if we calculate the four transform of our numerically solved equations, we get peaks at
these unique frequencies, which are two agan frequencies of the system.
And furthermore, we can also have a look at the eigenvectors because we have seen that the first and
the third oscillator, they move in a pretty similar way.
They often only change or have different signs here and here and here, and then the middle oscillators
special because, for example, for the EIGEN mode with omega equal to one point four, the eigenvectors
zero.
And indeed, for the second oscillator, we do not see a peak in the frequency spectrum at one point
four.
So for this particular oscillator, this frequency does not exist, and we know that this is true because
the eigenvectors has a zero for the component for this particular frequency.
And also, we see that the spectrum for the first and the third oscillator are exactly the same.
So our results from the eigenvalue problem are indeed contained in the numerical solution, as we have
just analyzed by calculating the Fourier transform of this spectrum here.
So what this means is that we can express the numerical solution by a superposition of three different
harmonic functions, so we could write that our function is given by a sound function with the first
ion frequency, plus a sound function with the second ion frequency plus assigned function with the
third ion frequency.
But of course, it's not so easy because all of these sine functions have different amplitudes and different
face factors.
So this means we have six different parameters that we first had to figure out if we want to fit this
to the data.
And actually, this is what we want to do in the next lecture.
Just one more thing that I want to show you is that if I just rerun the whole notebook, we start with
different starting conditions.
And so this will give rise to different intensity spectra each of the time.
For example, now you see that in all three cases, the one point four case does not really have a peak,
except here, maybe a very, very small one.
So let's do it once again, we have once again different starting conditions, and you see the amplitudes
of these individual frequencies can be very, very different.
For example, now it is even the largest peak, even though previously it wasn't there at all.
But you always see the same thing that you do not see this peak for the second oscillator and that the
first and the third one always looked the same.
But the intensity of the peaks will always be different, and it depends strongly on the starting condition.