1
00:00:00,720 --> 00:00:05,000
Now we are going to solve the burgers equation.

2
00:00:05,010 --> 00:00:13,890
So when when we talk about the burgers equation, first let's look at the terms of the burgers equation.

3
00:00:14,130 --> 00:00:22,020
And in this case, we'll have the first one is the temporal difference, which or the temperance, the

4
00:00:22,020 --> 00:00:31,200
temporal component which is du over DT We can see well, basically it it govern or it.

5
00:00:34,660 --> 00:00:40,390
Show the difference between the new value with the time itself.

6
00:00:41,030 --> 00:00:44,030
And plus you itself.

7
00:00:44,030 --> 00:00:45,080
This is you.

8
00:00:45,080 --> 00:00:53,120
And then the change of you with respect to the to the which is the change of you with space, which

9
00:00:53,120 --> 00:00:58,130
is we call it the spatial component of Berger's equations.

10
00:00:58,400 --> 00:01:11,090
And this will equal to viscosity denoted by V and the second derivative of U with respect to space.

11
00:01:11,090 --> 00:01:22,460
So we have two spatial components and one temporal component or time well governed or like change of

12
00:01:22,460 --> 00:01:23,990
U with respect to time.

13
00:01:24,260 --> 00:01:31,880
So solving this equation means we have to solve U for every time step we have.

14
00:01:32,210 --> 00:01:39,680
So what we will need to do is we will have an X, which is space, and we will have time.

15
00:01:40,680 --> 00:01:41,340
And.

16
00:01:42,130 --> 00:01:52,510
Basically what we need to have is a neural network that will take the space and the time we we assign

17
00:01:52,510 --> 00:01:55,180
it and it will give us.

18
00:01:55,810 --> 00:01:57,160
That you value.

19
00:01:57,340 --> 00:02:01,360
So this is basically what we are doing or what we want to do.

20
00:02:01,810 --> 00:02:05,830
So let's let's code it and step by step.

21
00:02:05,860 --> 00:02:11,350
Of course, let's have like discussion of what kind of things we need to consider.

22
00:02:12,960 --> 00:02:20,010
So the first thing is we need to we start by basically just writing the file.

23
00:02:20,770 --> 00:02:24,730
Name, which is Burgers, girls.

24
00:02:25,930 --> 00:02:27,070
It will mean.

25
00:02:28,510 --> 00:02:30,340
And actually, it's one.

26
00:02:33,360 --> 00:02:37,350
And we as always, we import the needed libraries.

27
00:02:37,350 --> 00:02:39,750
So we start with importing math.

28
00:02:41,170 --> 00:02:44,770
I'm not sure we're going to use math, but but let's import it anyway.

29
00:02:44,770 --> 00:02:56,350
If we needed some mathematical issues or features or like functions as NP numpy of course import for

30
00:02:56,350 --> 00:03:07,120
plotting seaborne, we will import we will plot the like heat contour plot so it will be useful, see

31
00:03:07,480 --> 00:03:10,060
like see Seaborn.

32
00:03:10,480 --> 00:03:13,240
And then of course import matplotlib.

33
00:03:14,380 --> 00:03:19,210
Plot lib dot pyplot as plt.

34
00:03:20,430 --> 00:03:21,450
And.

35
00:03:22,440 --> 00:03:24,420
But I'm take you.

36
00:03:25,610 --> 00:03:27,200
The import.

37
00:03:28,860 --> 00:03:30,540
Dcdm.

38
00:03:31,740 --> 00:03:32,730
Import.

39
00:03:33,550 --> 00:03:38,920
Torch and of course import torch dot n.

40
00:03:38,920 --> 00:03:39,190
N.

41
00:03:39,190 --> 00:03:41,260
As in n network.

42
00:03:42,040 --> 00:03:47,200
Tqdm is just to show us the progress bar if we needed to see the progress bar.

43
00:03:48,250 --> 00:03:54,170
So these are the libraries we need to upload and of course shift enter to take them.

44
00:03:54,190 --> 00:04:00,610
Now it's set and we can start by first.

45
00:04:01,260 --> 00:04:02,790
Building our network.

46
00:04:03,120 --> 00:04:14,200
The network we need to build is going to, as I said, take X and T and provide us with basically the

47
00:04:14,430 --> 00:04:14,910
value.

48
00:04:15,180 --> 00:04:19,350
So so let's let's write a neural network for that.

49
00:04:19,350 --> 00:04:29,730
So we start by class in, in and neural network, we inherit the module.

50
00:04:31,070 --> 00:04:36,590
And as as as any like TensorFlow.

51
00:04:37,740 --> 00:04:38,070
In.

52
00:04:40,690 --> 00:04:43,210
The PyTorch module.

53
00:04:43,210 --> 00:04:44,020
We.

54
00:04:44,810 --> 00:04:47,060
We always right this way.

55
00:04:47,240 --> 00:04:49,040
And super.

56
00:04:50,210 --> 00:04:51,470
Neural network.

57
00:04:52,010 --> 00:04:53,240
We take it.

58
00:04:54,210 --> 00:04:55,740
And self.

59
00:04:57,150 --> 00:04:58,440
We initiate.

60
00:05:03,900 --> 00:05:05,610
Well, basically this one.

61
00:05:06,990 --> 00:05:07,920
In it.

62
00:05:14,060 --> 00:05:17,750
And now we will start writing the neural network.

63
00:05:19,840 --> 00:05:23,590
So the neural network has to start with basically two.

64
00:05:24,460 --> 00:05:25,420
Two inputs.

65
00:05:25,420 --> 00:05:31,690
So but of course we need a sequential to torch and n dot.

66
00:05:35,780 --> 00:05:37,370
Sequential.

67
00:05:46,770 --> 00:05:48,120
And seek.

68
00:05:49,360 --> 00:05:52,840
One chill seems legit.

69
00:05:57,170 --> 00:05:58,010
And.

70
00:06:00,180 --> 00:06:03,600
We start by the neural network.

71
00:06:05,380 --> 00:06:06,040
Linear.

72
00:06:09,300 --> 00:06:12,840
Two inputs and it will expand to 20.

73
00:06:14,780 --> 00:06:16,910
So what's happening here?

74
00:06:19,170 --> 00:06:29,970
We're starting with two inputs X and T, and then the network will expand to 28 elements.

75
00:06:30,210 --> 00:06:32,970
And of course, we need to also.

76
00:06:35,050 --> 00:06:36,820
I'm not sure why it's not.

77
00:06:38,920 --> 00:06:39,790
Oh, this way.

78
00:06:47,170 --> 00:06:51,570
Yeah, I wanted to to have on the same line as here.

79
00:06:51,580 --> 00:06:56,110
So after that we need to put an activation function.

80
00:06:56,110 --> 00:07:02,530
So we use an activation function very also common activation function.

81
00:07:02,530 --> 00:07:13,240
And after that, what we will need to do is we said we have 20 a a well after two it will expand to

82
00:07:13,240 --> 00:07:17,230
20 neurons and then 20 we want to expand to 30.

83
00:07:17,590 --> 00:07:25,450
So what we have is basically we will start by two neurons.

84
00:07:28,010 --> 00:07:32,920
And then we will have the first layer.

85
00:07:32,930 --> 00:07:34,730
It will be 20.

86
00:07:36,380 --> 00:07:45,560
A well, 20 nodes, and then we will expand to even 30 nodes and we will continue a little bit 30 and

87
00:07:45,560 --> 00:07:49,520
then we will go back to 20.

88
00:07:49,520 --> 00:07:51,710
So I think this way.

89
00:07:52,490 --> 00:07:54,850
So this is what we are trying to build.

90
00:07:54,860 --> 00:07:58,550
And of course, at the end we need just one, which is the.

91
00:08:01,610 --> 00:08:02,240
Of course.

92
00:08:02,240 --> 00:08:04,060
Which is the you here?

93
00:08:04,160 --> 00:08:04,460
Of course.

94
00:08:04,460 --> 00:08:05,690
We have to also.

95
00:08:06,670 --> 00:08:09,670
Consider the activation function.

96
00:08:09,670 --> 00:08:19,000
And here we take on 30 and let's say we provide another 30 or we keep it the same level.

97
00:08:19,000 --> 00:08:24,130
Even if you change it differently, it will work.

98
00:08:24,130 --> 00:08:26,650
Even if all of this is 20 is going to work.

99
00:08:26,650 --> 00:08:30,400
But the reason I'm doing this is just to try to.

100
00:08:31,870 --> 00:08:34,120
Have more command over the network.

101
00:08:34,120 --> 00:08:37,660
So we try to change this network.

102
00:08:39,620 --> 00:08:40,790
Here, 2020.

103
00:08:40,820 --> 00:08:43,010
And then basically.

104
00:08:44,400 --> 00:08:47,850
We take 20 and make it into.

105
00:08:48,560 --> 00:08:51,260
One value and just remove this one.

106
00:08:51,350 --> 00:09:00,050
So we'll have to 20, 20, 30, 30, 30, 30, 20, 2020, and then 20 to 1.

107
00:09:00,080 --> 00:09:03,830
And of course we don't have an activation function after that.

108
00:09:04,760 --> 00:09:05,180
Okay.

109
00:09:05,180 --> 00:09:14,750
So this one is going to be the network we have, and then we have to assign the forward pass, which

110
00:09:14,750 --> 00:09:15,950
is self.

111
00:09:16,590 --> 00:09:23,070
And X also very usual thing output will equals to self.

112
00:09:24,130 --> 00:09:27,610
Dot net and it will have.

113
00:09:30,190 --> 00:09:31,720
And return.

114
00:09:32,760 --> 00:09:33,870
The output.

115
00:09:35,240 --> 00:09:45,080
This way we assign the neural network and it is it will have an input size, an input size of two,

116
00:09:45,080 --> 00:09:49,160
and then you will have the first layer of 20.

117
00:09:49,190 --> 00:09:50,600
Second layer of 30.

118
00:09:50,630 --> 00:09:52,700
Third layer of 30.

119
00:09:53,360 --> 00:09:55,160
Fourth layer of 20.

120
00:09:55,160 --> 00:10:01,340
And fifth layer is the final layer, which is there's just one, one point.

121
00:10:01,340 --> 00:10:04,010
It's just the point we need to calculate, which is you.

122
00:10:04,280 --> 00:10:09,770
So here we, we do this and then we shift enter.

123
00:10:10,130 --> 00:10:13,490
Now we already took it by now.

124
00:10:13,490 --> 00:10:16,880
We already assigned the network.

125
00:10:16,910 --> 00:10:23,540
The next step is going to be considering the data that we need to use.

126
00:10:23,570 --> 00:10:26,300
And the data means we have the.

127
00:10:27,750 --> 00:10:36,390
A Well, the state the data means the boundary condition along with the initial condition that this

128
00:10:36,390 --> 00:10:42,450
network has to bind with to get the right solution for us.
