1
00:00:01,360 --> 00:00:03,360
After defining the problem.

2
00:00:03,370 --> 00:00:07,810
Now we need to solve it in order to solve it.

3
00:00:07,840 --> 00:00:15,340
Well, we simply or not simply, we have to use the discretized form of the equation.

4
00:00:15,340 --> 00:00:21,460
And to calculate it a time, one time step at a time.

5
00:00:21,760 --> 00:00:27,880
Our solution will be what we call explicit, in which we will update the solution or we will find the

6
00:00:27,880 --> 00:00:28,780
solution.

7
00:00:29,200 --> 00:00:31,180
And for the next time, step.

8
00:00:31,180 --> 00:00:37,870
So we start from the initial condition and then go one time step at the time, one time step, and then

9
00:00:38,080 --> 00:00:39,490
see what is the solution.

10
00:00:39,490 --> 00:00:42,820
And then another time step and then another time step and another and another.

11
00:00:42,850 --> 00:00:47,450
This is what we call an explicit, explicit solution.

12
00:00:47,470 --> 00:00:54,700
And this is how we like discretized our equation.

13
00:00:54,700 --> 00:00:58,300
So let's see here what is happening.

14
00:00:59,250 --> 00:01:06,270
So we have do you over and of course equals K do the second derivative of U over.

15
00:01:07,140 --> 00:01:14,810
And now what we need to do we need to write this equation in terms of time plus DT.

16
00:01:15,510 --> 00:01:21,790
So every time we predict we will predict the value of the next time step.

17
00:01:21,840 --> 00:01:23,070
This is how it works.

18
00:01:23,070 --> 00:01:25,440
We have to predict the next time.

19
00:01:25,440 --> 00:01:25,890
Step what?

20
00:01:25,890 --> 00:01:27,240
What's going to happen?

21
00:01:27,270 --> 00:01:30,540
This goes, um, because this is a simulation.

22
00:01:30,540 --> 00:01:34,260
We need to always predict what what is going to happen.

23
00:01:34,260 --> 00:01:36,750
So here we start.

24
00:01:36,870 --> 00:01:41,430
Uh, well, first, calculating the time.

25
00:01:42,420 --> 00:01:45,770
Just give it some here just to move a little bit.

26
00:01:46,560 --> 00:01:47,040
Freely.

27
00:01:48,990 --> 00:01:52,440
And here we start for t in.

28
00:01:53,350 --> 00:01:54,460
Range.

29
00:01:56,010 --> 00:01:57,840
Starting from one.

30
00:01:58,890 --> 00:02:00,570
To the length.

31
00:02:01,420 --> 00:02:03,160
Of Victor.

32
00:02:04,670 --> 00:02:06,410
The victor.

33
00:02:06,440 --> 00:02:07,250
This one?

34
00:02:13,900 --> 00:02:14,800
Minus one.

35
00:02:16,360 --> 00:02:24,700
Y minus one because the the T actually in here, it will start from a in python.

36
00:02:24,700 --> 00:02:27,520
We start addressing the first element to zero.

37
00:02:27,520 --> 00:02:31,150
So the last element we will have one element lost.

38
00:02:31,150 --> 00:02:34,540
So this is why we always put it minus one.

39
00:02:34,540 --> 00:02:47,800
So it's a kind of python thing as it's, as it's known in range X also from one to the length of x.

40
00:02:49,000 --> 00:02:50,400
It's the same.

41
00:02:51,240 --> 00:02:51,360
And.

42
00:02:54,680 --> 00:02:58,010
A x vector, also minus one.

43
00:02:58,190 --> 00:03:01,610
And here we need to calculate.

44
00:03:02,300 --> 00:03:04,070
So what do we need to calculate?

45
00:03:04,100 --> 00:03:07,160
We need to calculate you.

46
00:03:09,530 --> 00:03:09,950
Act.

47
00:03:11,160 --> 00:03:14,820
Specific X at a specific time.

48
00:03:15,120 --> 00:03:17,530
But what is the time going to be?

49
00:03:17,550 --> 00:03:21,360
It's the time plus one.

50
00:03:22,170 --> 00:03:30,090
Y plus one, because in this simulation, in the explicit simulation, we're actually predicting what's

51
00:03:30,090 --> 00:03:31,590
going to happen in the future.

52
00:03:31,590 --> 00:03:36,300
So t plus one, this is what's going to happen in the future at this location.

53
00:03:36,420 --> 00:03:44,940
We every time step we will calculate what's happening in the future for every a the next time, step

54
00:03:44,940 --> 00:03:46,800
for every location.

55
00:03:46,800 --> 00:03:49,560
So this is basically what we are going to do.

56
00:03:50,580 --> 00:03:52,290
And this will equals what?

57
00:03:52,320 --> 00:03:53,820
This will equals.

58
00:03:54,120 --> 00:03:57,030
Let's see the equation we have.

59
00:03:59,570 --> 00:04:00,800
Well, we have.

60
00:04:01,580 --> 00:04:02,510
This.

61
00:04:03,890 --> 00:04:07,190
If we move this, you or we.

62
00:04:07,190 --> 00:04:08,360
We move this.

63
00:04:09,380 --> 00:04:11,390
We move it here.

64
00:04:11,390 --> 00:04:17,020
So K has to be multiplied by and divided by d x squared.

65
00:04:17,030 --> 00:04:18,590
So let's do that.

66
00:04:18,770 --> 00:04:25,940
So it's I think it's just a simple math of how we have to arrange these equation.

67
00:04:25,940 --> 00:04:28,100
So we will, we will do it.

68
00:04:28,490 --> 00:04:32,390
And so the first one is K.

69
00:04:33,550 --> 00:04:34,870
Multiplied.

70
00:04:37,810 --> 00:04:39,160
It will multiply.

71
00:04:40,760 --> 00:04:46,070
That is going to be divided by the square.

72
00:04:48,370 --> 00:04:49,150
And.

73
00:04:50,750 --> 00:04:51,740
This.

74
00:04:52,410 --> 00:04:59,340
Values because we again go to the discretized form.

75
00:04:59,340 --> 00:05:12,420
So we have k multiplied t divided by the square or dt divided by the x square multiplied k, and then

76
00:05:12,420 --> 00:05:17,850
all of this, these values has to be multiplied by all of this part.

77
00:05:17,850 --> 00:05:24,240
And later we have to plus u t dt so we may go and do it.

78
00:05:25,170 --> 00:05:26,160
So that.

79
00:05:26,980 --> 00:05:29,500
The term will be you.

80
00:05:31,460 --> 00:05:32,960
A little bit like this.

81
00:05:33,780 --> 00:05:36,420
U of T.

82
00:05:39,750 --> 00:05:41,460
X plus one.

83
00:05:43,620 --> 00:05:46,050
Minus two multiplied.

84
00:05:46,080 --> 00:05:48,450
Of course we have to go.

85
00:05:48,450 --> 00:05:51,270
And maybe it's better put it.

86
00:05:53,780 --> 00:05:55,700
Somewhere like this.

87
00:06:03,600 --> 00:06:03,950
Yeah.

88
00:06:03,960 --> 00:06:04,470
This way.

89
00:06:04,860 --> 00:06:05,580
So.

90
00:06:06,670 --> 00:06:10,780
You t x plus x, it means x plus one.

91
00:06:11,140 --> 00:06:12,850
The next point.

92
00:06:12,880 --> 00:06:16,720
This is our current point is x and next point will be x plus one.

93
00:06:17,080 --> 00:06:25,390
Multiply two which is this one two multiplied you at this time, which is going to be you.

94
00:06:27,170 --> 00:06:30,050
Time and x.

95
00:06:30,870 --> 00:06:33,930
This time the current location plus.

96
00:06:34,860 --> 00:06:35,580
Plus.

97
00:06:36,790 --> 00:06:37,660
This.

98
00:06:37,930 --> 00:06:39,640
Which is you?

99
00:06:40,660 --> 00:06:42,010
Current time, Of course.

100
00:06:42,010 --> 00:06:42,940
And.

101
00:06:43,300 --> 00:06:43,750
Oh, sorry.

102
00:06:43,750 --> 00:06:44,020
Sorry.

103
00:06:45,340 --> 00:06:46,150
And.

104
00:06:49,100 --> 00:06:50,870
X minus.

105
00:06:51,690 --> 00:06:54,300
One the last point.

106
00:06:55,800 --> 00:06:57,240
So all of this.

107
00:06:59,070 --> 00:07:01,410
Is written in here.

108
00:07:02,160 --> 00:07:07,770
So this all of this is in this part of the equation, this one.

109
00:07:09,100 --> 00:07:15,510
K This is going to be and then over the square is this one.

110
00:07:15,840 --> 00:07:24,870
So this is constant multiplied by this value that will depend on the all the time and the X.

111
00:07:25,080 --> 00:07:29,940
Now what is left is I would like to put a big.

112
00:07:31,040 --> 00:07:31,550
Parent.

113
00:07:31,580 --> 00:07:32,240
Oh, sorry.

114
00:07:32,360 --> 00:07:37,430
A big parentheses between here, although it might be not necessary.

115
00:07:37,430 --> 00:07:41,660
And this, which is We have all of this.

116
00:07:42,220 --> 00:07:42,630
We.

117
00:07:42,640 --> 00:07:47,380
We need to sum the value of you.

118
00:07:49,350 --> 00:07:55,560
And time and X at our specific.

119
00:07:56,600 --> 00:08:00,930
Time this one and specific X.

120
00:08:00,950 --> 00:08:03,710
So this is this equation.

121
00:08:04,880 --> 00:08:08,540
We'll just make it a little bit this way.

122
00:08:13,420 --> 00:08:16,960
We will calculate for every all the time.

123
00:08:18,370 --> 00:08:22,210
Starting from well, t equals one from the initial condition.

124
00:08:22,210 --> 00:08:25,000
And then we keep updating the initial condition.

125
00:08:25,320 --> 00:08:28,240
We will calculate for the whole space.

126
00:08:29,110 --> 00:08:34,630
And we will update for the time plus one for the next time step.

127
00:08:34,630 --> 00:08:38,110
And we keep doing this until we reach to the final time step.

128
00:08:39,390 --> 00:08:40,620
Which is this one?

129
00:08:41,420 --> 00:08:45,470
This, you move it here and this is going to be the you.

130
00:08:45,650 --> 00:08:47,980
And then we still have this bulky thing.

131
00:08:47,990 --> 00:08:50,690
This one will be here.

132
00:08:51,680 --> 00:08:53,510
The x squared is here.

133
00:08:53,600 --> 00:08:56,660
D is here because we moved it here.

134
00:08:56,690 --> 00:08:59,060
The x is this one and then k.

135
00:08:59,940 --> 00:09:01,260
This constant.

136
00:09:01,680 --> 00:09:06,550
This values will be summed with this value.

137
00:09:06,570 --> 00:09:08,100
So what is left?

138
00:09:08,130 --> 00:09:08,760
Nothing.

139
00:09:08,760 --> 00:09:10,440
We just run it.

140
00:09:12,980 --> 00:09:13,730
It.

141
00:09:17,890 --> 00:09:18,790
You.

142
00:09:19,670 --> 00:09:22,010
Minus two x.

143
00:09:23,350 --> 00:09:24,670
A 100.

144
00:09:26,700 --> 00:09:26,960
It's.

145
00:09:34,660 --> 00:09:35,260
Uh, sorry.

146
00:09:35,290 --> 00:09:36,310
T vector.

147
00:09:37,120 --> 00:09:37,420
Um.

148
00:09:38,350 --> 00:09:39,490
I made a mistake.

149
00:09:39,520 --> 00:09:40,870
This is x vector.

150
00:09:40,900 --> 00:09:42,840
I put it X here, but I forgot.

151
00:09:42,850 --> 00:09:43,350
Okay.

152
00:09:43,360 --> 00:09:44,560
Now it should work.

153
00:09:44,650 --> 00:09:53,890
So now it's computing, and we can see how after this finish, we can see how you become.

154
00:09:54,630 --> 00:09:59,390
So it's now computing, Now it's finished and we can see you.

155
00:09:59,430 --> 00:10:04,410
We print it out and we can see the values got updated.

156
00:10:04,440 --> 00:10:13,110
Of course, these values, you can see this is the 200 is the far right, and then it will start diffusing

157
00:10:13,110 --> 00:10:18,120
little by little here and then here, basically all the rods.

158
00:10:18,120 --> 00:10:25,860
And then this is the values, of course, starting from zero and step by step, updating these values.

159
00:10:27,070 --> 00:10:30,780
Okay, so this is how we solved our equation.

160
00:10:30,790 --> 00:10:33,490
Next time we will just check the solution.
