All right, so let us now come to another example, and this is called the heat equation and the heat
equation describes how heat or how temperature changes in a spatial region.
For example, we could use a single baard and it would be a one dimensional system as here where we
make it hot on the left hand side and called on the right hand side.
And then we see how over time the temperature changes inside the bar.
So this is how you write it down in two, three or more dimensions.
What you have here in the left hand side of time derivative of the you, which is in the array that
has different values for different times.
So you see here we have a dependence on our.
So basically, we have here such an array.
You want you two until you end and then we have also a time dependence.
So for every time step, these values here will change and devalue.
You want to you and will describe the temperature at this particular point in space.
And so we have you on the left hand side the time derivative.
So this is how it changes over time.
On the right hand side, we have a constant and then the the plus operator.
Which is basically the second order derivative in space.
And we add of the different components.
So as I wrote down here in one dimension, this is just eight times to second the derivative with respect
to X of you x A..
So this is our differential equation.
And so maybe you realize this now that this is fundamentally a very different a system that we are solving
here.
So before we had the harmonic oscillator and we have the loren's system, which in both cases was just
a single particle, it was in one dimension and two dimensional in three dimensions where we had X,
Y and Z coordinates, and we only had a single set of these coordinates.
So we had just had one particle that we had to describe.
And here it's different.
We have a sample in space, for example, in one dimension, but could also be in two or more dimensions.
And this is disc criticised by individual values.
Each of these values is just a temperature, so it's just a scalar.
But in terms of the mathematics, this is you could see an end dimensional system.
So since we have full values, you want to you and we will have and different coupled differential equations.
So from the from the methodology, it's pretty similar to the Lawrence system where we had three coupled
equations.
But now we have and coupled equations and the end can be pretty large.
It can be several thousands of equations that are coupled.
And here we will see how we can solve it.
So first of all, to show you why this is such a system, it is described by so many differential equations.
We must, of course, this ties the right hand side.
So this is the left hand side.
It's exactly in the shape that we want to have.
It is basically you dot.
And so we must describe ties only the right insight.
And so we must just criticize the second derivative.
So we have learned that there are different methods to do this, and you can increase, of course,
the accuracy by using certain methods for the derivative.
But you will use just a very simple approach.
We will just disparities by using the central differences methods.
So basically, the value of the second derivative of you at the position J or with the Index J is given
by the some of the neighbors minus two times devalue at the actual position.
And then we divide by Delta X, which is the spatial distance between two neighboring cells here and
we square it.
And this is pretty straightforward.
We can do this for every value of J, except for the element that is at the end.
So basically, you want and you n or when you use Python indices, you zero and you and minus one.
So we will see that we can even leave these two values out for the derivative.
But we could also just say, OK, in this case, we don't use the central methods we use to double the
forward or to double back what methods.
And so then this is what we get.
This is, of course, not such a good approximation.
But yeah, there's nothing else we can do because these are at the edges and there are missing neighbors,
so we have to determine somehow the second or the spatial derivative.
So this means we can now write down this equation here for every individual element of this array with
the disparities.
Second Order derivative.
So we're right, for example, for the derivative of UJA is equal to eight times and then this democratize
derivative.
So eight times u j minus one minus two times U J plus a huge plus one.
If we divide by Delta X squared and we do this for every single cell and for every index, so we get
such a very large set of differential equations.
And just as I mentioned, we don't really have to consider the left and the right differential equation
in a different way, we can just say here the temperature is supposed to be constant.
And this would correspond to a so-called heat bath in in physics.
So sometimes you consider, for example, an infinitely large water pool with the constant temperature
and the temperature is not effected by the object that we are actually simulating.
And so you so you see the left and the right and correspond to such a heat bath and the temperature
is then constant.
This makes it even more simple.
So then you could just neglect these two equations here and say the temperature change is just zero.
All right.
And so now we begin and we implement these equations and solve them once again with our integrate module
from Spain.
So let's run the cell and then let's go ahead and implement everything.