1
00:00:00,750 --> 00:00:05,010
After we decide both the initial conditions and boundary condition.

2
00:00:05,430 --> 00:00:10,350
What we will need to do is we will start defining the PDE.

3
00:00:10,380 --> 00:00:21,630
We we're trying to solve and basically the network and here with X deep, deep is these things are quite

4
00:00:21,630 --> 00:00:22,210
simple.

5
00:00:22,230 --> 00:00:25,660
So or like concise regarding the code.

6
00:00:25,680 --> 00:00:32,550
So def we write a function that will take x and.

7
00:00:34,950 --> 00:00:36,540
Will take six and.

8
00:00:37,770 --> 00:00:44,970
Why are you in our case and then d or just make it you.

9
00:00:46,840 --> 00:00:47,740
Due.

10
00:00:48,850 --> 00:00:58,690
With time we're going to be d d e dot grad dot jacobian.

11
00:01:00,120 --> 00:01:02,520
And then we take the value of you.

12
00:01:02,550 --> 00:01:07,860
We take the value of X and I equals.

13
00:01:08,910 --> 00:01:09,630
Zero.

14
00:01:11,420 --> 00:01:15,110
To J equals one.

15
00:01:16,680 --> 00:01:19,530
So this is going to be.

16
00:01:20,940 --> 00:01:23,810
Our first giacobbe.

17
00:01:23,820 --> 00:01:27,870
The second Giacobbe is due over.

18
00:01:28,440 --> 00:01:32,750
This is the second derivative and we do the same thing.

19
00:01:32,760 --> 00:01:34,140
Well, what?

20
00:01:34,500 --> 00:01:38,850
What will change is the method in which we are going to.

21
00:01:40,870 --> 00:01:41,650
Dig the great.

22
00:01:41,680 --> 00:01:44,590
The Great Forum is a Haitian.

23
00:01:45,210 --> 00:01:49,230
And we it will take you or it will give us.

24
00:01:49,740 --> 00:01:53,660
Well, the value of you giving, of course, X.

25
00:01:54,940 --> 00:01:55,870
And.

26
00:01:57,460 --> 00:02:02,860
We have I equals zero and.

27
00:02:03,650 --> 00:02:07,820
J equals or J equals zero.

28
00:02:08,730 --> 00:02:11,490
Because the function this one.

29
00:02:11,940 --> 00:02:19,080
Well, we can call it X, we can call it other thing like for example, um, comp space.

30
00:02:21,290 --> 00:02:22,790
Is comp space.

31
00:02:22,790 --> 00:02:25,880
So it's I think it's better to call it like this.

32
00:02:25,880 --> 00:02:27,770
So comp space.

33
00:02:30,100 --> 00:02:37,330
This is the you, the one we want to calculate and comp space is basically it will has it will have

34
00:02:37,330 --> 00:02:38,200
two components.

35
00:02:38,200 --> 00:02:49,150
The first component is a space which is a which is J equals zero means this space of zero and the J

36
00:02:49,150 --> 00:02:51,010
equals one is the time.

37
00:02:51,010 --> 00:02:53,140
So this is basically how it works.

38
00:02:53,140 --> 00:03:02,530
So comp is both X and Y, and then we have I equals one, which is only you already we have only we

39
00:03:02,530 --> 00:03:07,480
are calculating only one thing, which is you and has one component which is because it's scalar.

40
00:03:08,300 --> 00:03:13,790
Or like nuts, it's most likely it will be like a victor, but it has one value only.

41
00:03:13,790 --> 00:03:17,570
So we put it on the zero and we don't have one.

42
00:03:17,570 --> 00:03:21,530
So basically this is what the what what it means.

43
00:03:21,530 --> 00:03:24,860
And I think comp is better to write it this way.

44
00:03:24,860 --> 00:03:28,310
And the last thing is we need to put return.

45
00:03:29,920 --> 00:03:33,190
Well d d u over d y.

46
00:03:33,220 --> 00:03:36,430
We just put this way.

47
00:03:36,430 --> 00:03:46,570
So basically, um, we have du over dt we move all of this to here and we create something called residual.

48
00:03:46,600 --> 00:03:49,270
The residual has to equal zero.

49
00:03:49,540 --> 00:03:50,440
So.

50
00:03:51,920 --> 00:03:56,660
We created this residual by Du over DT minus.

51
00:03:57,920 --> 00:04:00,190
K multiplied.

52
00:04:01,060 --> 00:04:01,720
Do you?

53
00:04:03,690 --> 00:04:07,110
Over the x and we shift enter.

54
00:04:08,560 --> 00:04:12,880
The next thing we need to do is basically defining the data.

55
00:04:12,880 --> 00:04:14,080
So data.

56
00:04:14,110 --> 00:04:17,590
This is going to define the actual data that we are going to train.

57
00:04:18,680 --> 00:04:21,400
As we said, we have two types of losses.

58
00:04:21,410 --> 00:04:29,120
The the losses related to the the initial condition, boundary condition and the losses related with

59
00:04:29,120 --> 00:04:32,210
the whole domain that has to follow the physics.

60
00:04:32,210 --> 00:04:39,200
So we need to define in this case the data that we are going to use for training, both for the well,

61
00:04:39,200 --> 00:04:42,500
the initial condition, boundary condition, as well as the whole domain.

62
00:04:42,500 --> 00:04:47,000
So data equals dot data.

63
00:04:47,910 --> 00:04:51,030
A dot time PD.

64
00:04:51,450 --> 00:04:54,480
And we open parentheses.

65
00:04:54,800 --> 00:04:59,770
I don't I wanted to to put it here, but anyway, Jim.

66
00:05:00,890 --> 00:05:01,760
Time.

67
00:05:03,760 --> 00:05:04,600
And.

68
00:05:06,700 --> 00:05:14,020
We pass this one basically, and we need to pass boundary condition and initial condition, which we

69
00:05:14,050 --> 00:05:16,600
define here, boundary condition and way up.

70
00:05:16,600 --> 00:05:20,710
We define here the initial condition and.

71
00:05:23,040 --> 00:05:24,870
We also number.

72
00:05:25,910 --> 00:05:31,520
Of domain equals 2540.

73
00:05:32,970 --> 00:05:33,840
And.

74
00:05:34,780 --> 00:05:35,500
Number.

75
00:05:35,500 --> 00:05:38,020
These are the points that's going to be in the domain.

76
00:05:38,050 --> 00:05:39,370
Number of.

77
00:05:40,140 --> 00:05:41,730
Bone dry.

78
00:05:43,460 --> 00:05:44,900
Equals 80.

79
00:05:46,650 --> 00:05:48,690
I'm just checking the spelling.

80
00:05:49,900 --> 00:05:51,030
Boundary.

81
00:05:51,040 --> 00:05:51,430
Yeah.

82
00:05:52,270 --> 00:05:53,200
And.

83
00:05:53,780 --> 00:05:56,660
Number of initial.

84
00:05:57,550 --> 00:05:59,350
Points 160.

85
00:06:00,410 --> 00:06:06,770
Number of test equals to 2540.

86
00:06:08,120 --> 00:06:09,680
And that's it.

87
00:06:10,940 --> 00:06:12,560
So this is the data.

88
00:06:12,980 --> 00:06:13,910
That's it.

89
00:06:14,030 --> 00:06:17,900
It's very quite like, lovely.

90
00:06:19,300 --> 00:06:20,820
And sorry.

91
00:06:20,830 --> 00:06:22,300
2000.

92
00:06:23,730 --> 00:06:24,400
Yeah, it's.

93
00:06:24,580 --> 00:06:24,810
It's.

94
00:06:25,230 --> 00:06:26,670
It's just a warning.

95
00:06:26,940 --> 00:06:27,810
We're using this.

96
00:06:27,840 --> 00:06:28,800
We're using this.

97
00:06:28,800 --> 00:06:30,300
But point.

98
00:06:31,240 --> 00:06:32,830
Yeah, I think no problem.

99
00:06:32,830 --> 00:06:34,000
Yeah I think no problem.

100
00:06:34,450 --> 00:06:38,080
So net equals we now define the network.

101
00:06:38,080 --> 00:06:41,230
And also defining the network is quite simple.

102
00:06:43,650 --> 00:06:44,700
Dot in.

103
00:06:44,700 --> 00:06:45,090
In.

104
00:06:46,150 --> 00:06:48,460
Forward neural network.

105
00:06:49,030 --> 00:06:51,160
And we open it.

106
00:06:51,190 --> 00:06:54,570
We have input of two, which is X and T.

107
00:06:56,410 --> 00:06:59,440
Plus we have 20.

108
00:07:00,060 --> 00:07:05,330
A neuron with three layers with 20 neurons.

109
00:07:05,780 --> 00:07:10,100
And the last thing is going to be plus one.

110
00:07:11,000 --> 00:07:18,170
Again, this is the syntax of this of this library.

111
00:07:18,170 --> 00:07:19,550
We have to follow it.

112
00:07:20,360 --> 00:07:21,920
And then we have.

113
00:07:22,630 --> 00:07:24,240
Ten each.

114
00:07:25,750 --> 00:07:28,570
And this activation function, of course.

115
00:07:28,570 --> 00:07:30,730
And there is a glorot.

116
00:07:32,800 --> 00:07:33,090
Route.

117
00:07:33,910 --> 00:07:34,990
Normal.

118
00:07:37,420 --> 00:07:37,890
It's.

119
00:07:39,770 --> 00:07:40,880
Yeah, this one.

120
00:07:40,880 --> 00:07:49,070
So this one is related with initializing the network itself and or in this method it will initialize

121
00:07:49,070 --> 00:07:52,670
the network weights with a mean equals zero.

122
00:07:52,670 --> 00:07:57,860
So they will change randomly, but the mean of them it will be always zero.

123
00:07:58,570 --> 00:08:00,790
If we want to see the grid, our grid, let's.

124
00:08:00,790 --> 00:08:01,420
Let's see it.

125
00:08:01,420 --> 00:08:04,960
Let's plot dot figure.

126
00:08:06,020 --> 00:08:09,050
And let's see our grid, how it looks.

127
00:08:09,050 --> 00:08:11,990
And of course, there is no grid in pens.

128
00:08:12,020 --> 00:08:13,430
It's a mistress.

129
00:08:15,270 --> 00:08:15,780
The method.

130
00:08:16,710 --> 00:08:18,330
Size equals.

131
00:08:19,690 --> 00:08:21,460
Ten and eight.

132
00:08:23,570 --> 00:08:26,120
PLT dot scatter.

133
00:08:27,440 --> 00:08:29,170
Data dot.

134
00:08:30,440 --> 00:08:31,220
Train.

135
00:08:32,710 --> 00:08:34,330
Takes all.

136
00:08:35,320 --> 00:08:37,420
This is, of course, syntax.

137
00:08:37,450 --> 00:08:41,560
We want to have the points.

138
00:08:41,590 --> 00:08:43,600
We will print them.

139
00:08:43,780 --> 00:08:45,480
This is the X.

140
00:08:46,290 --> 00:08:51,120
And this is the equivalent values of Y.

141
00:08:52,490 --> 00:08:53,450
And of course.

142
00:08:55,580 --> 00:08:56,500
Dot x.

143
00:08:58,110 --> 00:08:58,860
Label.

144
00:08:59,930 --> 00:09:00,720
It's X.

145
00:09:04,820 --> 00:09:05,570
Why?

146
00:09:08,410 --> 00:09:10,240
And we destroy the thing.

147
00:09:10,330 --> 00:09:12,370
PLT dot show.

148
00:09:14,860 --> 00:09:16,480
So what does it mean?

149
00:09:17,050 --> 00:09:18,490
Of course it's random points.

150
00:09:18,490 --> 00:09:19,720
It's just separated.

151
00:09:19,720 --> 00:09:26,410
But the number of points in the in the whole boundaries is 80.

152
00:09:26,500 --> 00:09:29,170
This 80 and this is 80.

153
00:09:29,170 --> 00:09:35,280
And this we have a 160 points and all this in the domain.

154
00:09:35,290 --> 00:09:38,470
We have 2540 points.

155
00:09:38,680 --> 00:09:43,810
So basically, this is how our computation domain will look like.

156
00:09:43,810 --> 00:09:49,030
This is we we will have a kind of fine here, lots of points here.

157
00:09:49,030 --> 00:09:49,720
We will have.

158
00:09:49,720 --> 00:09:54,400
And I'm not so bad points in the boundary we have we will have a lot of boundary in the middle.

159
00:09:54,400 --> 00:09:57,760
And this is how we will calculate this is our actual domain.

160
00:09:58,350 --> 00:09:59,130
And.

161
00:09:59,670 --> 00:10:00,210
Yeah.

162
00:10:00,210 --> 00:10:00,860
So that's it.

163
00:10:00,870 --> 00:10:01,410
That's it.

164
00:10:01,410 --> 00:10:09,780
And let's next time we will solve this like the heat equation.

165
00:10:09,780 --> 00:10:12,210
And of course later we will see the results.
