1
00:00:00,660 --> 00:00:07,590
All right, so let us now come to another example, and this is called the heat equation and the heat

2
00:00:07,590 --> 00:00:15,750
equation describes how heat or how temperature changes in a spatial region.

3
00:00:16,350 --> 00:00:23,220
For example, we could use a single baard and it would be a one dimensional system as here where we

4
00:00:23,220 --> 00:00:26,520
make it hot on the left hand side and called on the right hand side.

5
00:00:26,520 --> 00:00:31,350
And then we see how over time the temperature changes inside the bar.

6
00:00:33,070 --> 00:00:38,050
So this is how you write it down in two, three or more dimensions.

7
00:00:38,410 --> 00:00:45,310
What you have here in the left hand side of time derivative of the you, which is in the array that

8
00:00:45,310 --> 00:00:47,740
has different values for different times.

9
00:00:48,340 --> 00:00:50,660
So you see here we have a dependence on our.

10
00:00:50,680 --> 00:00:52,510
So basically, we have here such an array.

11
00:00:52,900 --> 00:00:57,630
You want you two until you end and then we have also a time dependence.

12
00:00:57,670 --> 00:01:03,490
So for every time step, these values here will change and devalue.

13
00:01:03,760 --> 00:01:10,060
You want to you and will describe the temperature at this particular point in space.

14
00:01:11,500 --> 00:01:14,290
And so we have you on the left hand side the time derivative.

15
00:01:14,300 --> 00:01:16,280
So this is how it changes over time.

16
00:01:16,960 --> 00:01:20,920
On the right hand side, we have a constant and then the the plus operator.

17
00:01:22,070 --> 00:01:25,910
Which is basically the second order derivative in space.

18
00:01:26,150 --> 00:01:28,460
And we add of the different components.

19
00:01:29,270 --> 00:01:35,480
So as I wrote down here in one dimension, this is just eight times to second the derivative with respect

20
00:01:35,480 --> 00:01:37,670
to X of you x A..

21
00:01:38,720 --> 00:01:40,550
So this is our differential equation.

22
00:01:41,510 --> 00:01:48,950
And so maybe you realize this now that this is fundamentally a very different a system that we are solving

23
00:01:48,950 --> 00:01:49,280
here.

24
00:01:49,700 --> 00:01:55,940
So before we had the harmonic oscillator and we have the loren's system, which in both cases was just

25
00:01:56,210 --> 00:02:03,170
a single particle, it was in one dimension and two dimensional in three dimensions where we had X,

26
00:02:03,170 --> 00:02:09,889
Y and Z coordinates, and we only had a single set of these coordinates.

27
00:02:09,889 --> 00:02:12,500
So we had just had one particle that we had to describe.

28
00:02:13,340 --> 00:02:14,540
And here it's different.

29
00:02:15,110 --> 00:02:21,710
We have a sample in space, for example, in one dimension, but could also be in two or more dimensions.

30
00:02:22,250 --> 00:02:25,370
And this is disc criticised by individual values.

31
00:02:26,630 --> 00:02:30,950
Each of these values is just a temperature, so it's just a scalar.

32
00:02:31,340 --> 00:02:37,850
But in terms of the mathematics, this is you could see an end dimensional system.

33
00:02:38,060 --> 00:02:45,890
So since we have full values, you want to you and we will have and different coupled differential equations.

34
00:02:46,880 --> 00:02:54,140
So from the from the methodology, it's pretty similar to the Lawrence system where we had three coupled

35
00:02:54,140 --> 00:02:54,800
equations.

36
00:02:55,310 --> 00:02:59,390
But now we have and coupled equations and the end can be pretty large.

37
00:02:59,390 --> 00:03:02,240
It can be several thousands of equations that are coupled.

38
00:03:02,810 --> 00:03:04,970
And here we will see how we can solve it.

39
00:03:06,290 --> 00:03:12,650
So first of all, to show you why this is such a system, it is described by so many differential equations.

40
00:03:13,250 --> 00:03:16,640
We must, of course, this ties the right hand side.

41
00:03:17,420 --> 00:03:18,490
So this is the left hand side.

42
00:03:18,500 --> 00:03:20,600
It's exactly in the shape that we want to have.

43
00:03:20,600 --> 00:03:22,130
It is basically you dot.

44
00:03:22,730 --> 00:03:25,790
And so we must describe ties only the right insight.

45
00:03:25,790 --> 00:03:28,700
And so we must just criticize the second derivative.

46
00:03:30,050 --> 00:03:34,520
So we have learned that there are different methods to do this, and you can increase, of course,

47
00:03:34,520 --> 00:03:38,930
the accuracy by using certain methods for the derivative.

48
00:03:38,930 --> 00:03:42,020
But you will use just a very simple approach.

49
00:03:42,020 --> 00:03:48,200
We will just disparities by using the central differences methods.

50
00:03:48,890 --> 00:03:56,360
So basically, the value of the second derivative of you at the position J or with the Index J is given

51
00:03:56,360 --> 00:04:01,010
by the some of the neighbors minus two times devalue at the actual position.

52
00:04:01,010 --> 00:04:09,080
And then we divide by Delta X, which is the spatial distance between two neighboring cells here and

53
00:04:09,080 --> 00:04:09,770
we square it.

54
00:04:10,880 --> 00:04:13,160
And this is pretty straightforward.

55
00:04:13,160 --> 00:04:19,769
We can do this for every value of J, except for the element that is at the end.

56
00:04:19,820 --> 00:04:27,200
So basically, you want and you n or when you use Python indices, you zero and you and minus one.

57
00:04:29,000 --> 00:04:33,170
So we will see that we can even leave these two values out for the derivative.

58
00:04:33,710 --> 00:04:39,980
But we could also just say, OK, in this case, we don't use the central methods we use to double the

59
00:04:39,980 --> 00:04:41,780
forward or to double back what methods.

60
00:04:42,200 --> 00:04:43,700
And so then this is what we get.

61
00:04:44,050 --> 00:04:46,400
This is, of course, not such a good approximation.

62
00:04:46,400 --> 00:04:52,030
But yeah, there's nothing else we can do because these are at the edges and there are missing neighbors,

63
00:04:52,040 --> 00:04:55,970
so we have to determine somehow the second or the spatial derivative.

64
00:04:57,620 --> 00:05:05,960
So this means we can now write down this equation here for every individual element of this array with

65
00:05:05,960 --> 00:05:06,890
the disparities.

66
00:05:06,950 --> 00:05:08,180
Second Order derivative.

67
00:05:09,290 --> 00:05:18,590
So we're right, for example, for the derivative of UJA is equal to eight times and then this democratize

68
00:05:18,590 --> 00:05:19,250
derivative.

69
00:05:19,520 --> 00:05:25,190
So eight times u j minus one minus two times U J plus a huge plus one.

70
00:05:25,610 --> 00:05:33,080
If we divide by Delta X squared and we do this for every single cell and for every index, so we get

71
00:05:33,080 --> 00:05:36,530
such a very large set of differential equations.

72
00:05:38,280 --> 00:05:45,870
And just as I mentioned, we don't really have to consider the left and the right differential equation

73
00:05:47,130 --> 00:05:51,990
in a different way, we can just say here the temperature is supposed to be constant.

74
00:05:52,680 --> 00:05:58,140
And this would correspond to a so-called heat bath in in physics.

75
00:05:58,950 --> 00:06:06,000
So sometimes you consider, for example, an infinitely large water pool with the constant temperature

76
00:06:06,000 --> 00:06:10,620
and the temperature is not effected by the object that we are actually simulating.

77
00:06:10,620 --> 00:06:16,260
And so you so you see the left and the right and correspond to such a heat bath and the temperature

78
00:06:16,260 --> 00:06:17,070
is then constant.

79
00:06:17,130 --> 00:06:18,830
This makes it even more simple.

80
00:06:18,840 --> 00:06:24,420
So then you could just neglect these two equations here and say the temperature change is just zero.

81
00:06:25,860 --> 00:06:26,280
All right.

82
00:06:26,850 --> 00:06:34,620
And so now we begin and we implement these equations and solve them once again with our integrate module

83
00:06:34,620 --> 00:06:35,580
from Spain.

84
00:06:36,270 --> 00:06:39,930
So let's run the cell and then let's go ahead and implement everything.

