So in the previous lecture, we have solved the differential equation, and we have found that the first
look at the result seems to be reasonable.
So it makes sense what we get here.
But also we didn't really see what's going on here in detail.
We just see that basically Earth and Moon are both rotating on a circular trajectory around the Sun.
So let's look at all three objects in detail.
Let's start with the Sun.
So I copy these three lines here, and we have now the trajectory of the sun and to see a bit more.
Let me increase here to simulation time to 10 years.
So let's rerun and let's rerun this.
And you see, this is no the trajectory of the Sun.
So the axes are a bit distorted.
So here you have to multiply this with 10 to the power of seven.
And here you see we have quantities and the magnitude of 10 to the power of five.
So these are still some kilometers that the Sun is moving here.
And at first, this may look surprising because we have to find that the Sun is starting at the center
of our coordinate system and that the Sun does not have a velocity at the beginning.
However, of course, the Sun is also affected by the other two objects, so actually it would be better
if we would plot in the following all of our solutions with respect to the Sun.
So basically subtracting here the values from the Sun and from the Moon.
But still, you see this changes in the magnitude of 10 to the power of seven, and here we have magnitude
tended to part of 11.
So I will just neglect the small motion here and we will consider it basically to zero.
But if we want to be precise, you would have to take these two values here and subtract them here from
these values.
So now let's go ahead and discuss the Earth.
And first of all, I want to plot the motion
basically like this without the Moon.
And you see, I mean, it's pretty clear the blue trajectory was underneath the moon trajectory.
So it's really circulating around the sun.
But what we can also do is we can go one step further and we can plot something else.
So let me add a new cell here, and I will plot now on the x axis the time T in here.
And on the y axis, I will plot the distance, sun and Earth.
So now I will basically plot the blue curve here, and I will plot for the X values solution, but T
and since we want to plot it in years, I have to divide by this factor here, which are 60 seconds,
60 minutes, 24 hours, 365 dots, two five days.
So I go back here and divide by these values.
So now we have here at a time, in years and for the y axis, I plotted the distance between Earth and
Sun.
So I right and p dots within Arc thought no.
And now we must subtract it two vectors.
So basically the position vectors.
So this would be solution dot y and then the first three components for the sun and then minus solution
thought y three to six for the Earth.
And now when I run this, it gives me probably an error.
Yes, because when we scroll down here, there are many error messages, but the lowest one is probably
the one that's reasonable.
The problem is that X and Y, which are our two lists, so the T list and the value list must have the
same dimension.
And the T list has, of course, 100000.
And one point as we have defined and our value list here, this one only has a single point now.
That's the problem of the total in our norm because it basically flattens all of these arrays.
So these are now three components for one hundred thousand and one points of time, and then that calculates
the norm of all of these components.
So we must tell only calculate the norm with respect to these X, Y and Z components and do this forever
point of time and then construct an area out of this.
We can do this by writing axes equal to zero.
If you would write X is equal to one, then we would get a three component vector here, where the norm
is calculated with respect to all the points of time.
So like this, I think should work.
And indeed, we see now that we have to distance on the Earth and the time ten years and from zero to
ten years, we see all of these fluctuations and obviously the periods of these fluctuations is one
year.
So our values are constants are correct and the algorithm is correct, and it takes one year for the
Earth to move around the sun.
So in our 10 years, we have a total of 10 installations, so now we can go ahead and discuss the Moon.
And you see the trajectory of the Moon is the same as the Earth basically on this length scale.
But of course, if we would zoom in, then we would see that the Earth surrounded the moon circles around
the Earth.
So I want to plot first the motion or the moon orbits around the Earth.
So I basically what should I take, I think a copy this one and then changed his cell so that I don't
have to start from zero here.
So we have here a plot that has an aspect ratio of one.
And here we have the coordinates X and Y and I just right here X of the Moon with respect to Earth and
Y of Moon with respect to Earth.
So we have now only a single plot, which we plot in green because we want to have the Moon and I want
to plot it with respect to the Earth.
So I write you minus solution called y comma or two component is three.
And here are eight minus solution y component four.
And this is what we get.
So we see if we calculate the motion of the moon versus back to the Earth, it's once again a circular
trajectory.
However, the lines here are pretty thick.
And this comes, of course, from many, many constellations here.
And it turns out that this oscillation is not always on the same point.
So maybe here or starting values were a bit inaccurate.
Or maybe our accuracy of the RJ 45 was not high enough.
So, yeah, we could, of course, improve here the method.
But the general result stands, and I think it's reasonable that we have this circular motion of the
Moon around the Earth, even though in the beginning of our simulation, the radius changes a bit so
we can check this, of course.
Maybe it has also a different origin.
I'm just thinking now so we can check this.
Maybe my expectation was wrong and it has a different origin.
Let's see.
I a copy this one from the Sun Earth distance and now we use distance.
Earth Moon.
So we can leave everything as it is, we just have to change these indices, and we take three six two
six nine, which means Earth minus Moon and of course, in green.
And yes, OK, I first had a wrong assumption.
It is not ethical line because the radius changes, it is a thick line because the moon moves actually
on an oval trajectory around the Earth, and this oval trajectory changes all of the time.
Let me show you what I mean.
So this is something I wanted to prepare anyway.
What I want to do next is I want to plot once again this one here, but I want to exaggerate the basically
the moon orbit radius.
So it sounds a bit artificial and it is indeed artificial.
But you will.
I think you will realize in the second what I'm trying to do here.
So I will go ahead and basically copy our starting plots.
Where is it?
Here it is.
Our starting plot with all three objects, and I will delete this one, this was not the one I wanted.
And now I will just change the line for the Moon and I will exaggerate the radius between Earth and
Moon.
So I will start with this one with the position of the Earth.
And then in reference to this Earth Point, I will add the change of solution.
Why?
Sorry, thought y components six minus solution y component three the distance of the Moon to the Earth
and the X component.
And here we do the same thing for the light component.
So this will be seven minus four.
So basically, I start from the position of the Earth and then at the change or the distance between
Earth and Moon so that I arrive at the Moon.
So far, it will give us the same result as before.
However, now I can add here eFFECTOR and I will add to your factor of 100, which artificially just
for visualization increases the radius between Earth and Moon by a factor of 100.
And you see, now this is what happens here.
The moon moves around the Earth, and at the same time, the Earth moves around the Sun, so the moon
will be shifted.
And so you get this nice spiral trajectory.
And then the other plot, this one here, basically, it looked as if there wasn't convergence reached
yet or that there was some error, but it is just yeah, due to the spiral trajectory.
OK, so that's pretty nice.
I think even though, of course, this plot here is not really correct because I have artificially increased
the radius and it doesn't follow know the correct laws of physics, but we can see how much better what's
going on here.
So that's just a nice trick for the visualization and for understanding what's going on.
OK, so this was the whole first part.
This the solution of the three body problem.
We have introduced the equations of motion considering Sun, Earth and Moon, and we have 18 variables,
18 differential equations, and we have pretty easily solved this.
The only problem was that we had to tune here the tolerance, basically the accuracy of our methods
because by using the starting values, we did not get the correct solution.
The Earth was not moving on a circular trajectory, but was spiraling towards the sun and then crashing
into the Sun.
That would, of course, be a very bad simulation.
However, it was pretty easy to just decrease the tolerance, so make the calculation more strict.
And this slowed down, of course, the simulation.
But in the end, we got a nice result, and we have analyzed the motion of the Sun, which is actually
not fixed because it is pushed around also a bit by the Earth and by the Moon.
And we have analyzed the motion of the Earth and the distance to the Sun.
And you see, there's a nice period.
So you see the Earth is moving a bit on an oval trajectory is slightly oval and the period is one year.
Exactly.
And then we have the same thing for the Moon, but with respect to the Earth, and we see here that
it's also moving on an all the trajectory and that we can exaggerate the moon radius and then get such
a nice plot as here.
So now in the next lecture, we will go ahead and further complicate our problem and we will add here
a fourth body, a rocket or spaceship.
So stay tuned.
It's a really exciting topic, and let's go ahead.