1
00:00:01,580 --> 00:00:07,910
What we need to do now is to define the PD of Navier Stokes equation.

2
00:00:07,940 --> 00:00:12,650
Of course, our PD is the Navier Stokes equation, which is.

3
00:00:13,860 --> 00:00:14,840
This one.

4
00:00:14,850 --> 00:00:16,620
So we will do it.

5
00:00:16,620 --> 00:00:18,630
And of course, a step by step.

6
00:00:20,990 --> 00:00:21,440
Okay.

7
00:00:21,440 --> 00:00:26,750
So to define it, we need as we did before, it will have.

8
00:00:27,600 --> 00:00:29,100
X and Y.

9
00:00:29,980 --> 00:00:35,560
And X is basically the values in which we are.

10
00:00:37,620 --> 00:00:42,630
The independent values and the Y is the dependent values.

11
00:00:42,630 --> 00:00:52,590
So X is is like like x and y and y is u, P and V, of course.

12
00:00:53,720 --> 00:01:04,190
So the first thing is we have in this equation, let's see, we have we have we have second derivative

13
00:01:04,190 --> 00:01:07,930
of u over all of them has to be defined.

14
00:01:07,940 --> 00:01:14,360
So let's start with d, u, d, x, d, x equals.

15
00:01:14,360 --> 00:01:15,260
And we will see.

16
00:01:15,290 --> 00:01:16,460
Of course there are.

17
00:01:16,820 --> 00:01:23,660
The good thing is in the documentation of deep, this equation is more or less similar to Navier-Stokes

18
00:01:23,660 --> 00:01:24,080
equation.

19
00:01:24,080 --> 00:01:34,520
And then we can see how they are basically doing this like first derivative, this is the second derivative

20
00:01:34,520 --> 00:01:35,120
and so on.

21
00:01:35,120 --> 00:01:42,020
So the first derivative and I want you to also kind of training is you always look at the documentation,

22
00:01:42,050 --> 00:01:51,980
you always try to mimic the documentation and even you use another method or another library to to do

23
00:01:51,980 --> 00:01:53,060
this work.

24
00:01:53,090 --> 00:01:55,140
You can always use it.

25
00:01:55,140 --> 00:02:03,540
And for example, for the first derivative, you use this one and you just copy it and put it here.

26
00:02:03,650 --> 00:02:06,780
D Grad dot Jacobian.

27
00:02:06,900 --> 00:02:08,490
What is the first?

28
00:02:08,520 --> 00:02:18,330
Of course u is not you here put it he's he's putting u here and x we have here u is y so we put y changing

29
00:02:18,330 --> 00:02:30,060
with x x he put it here, small x we put a with big x and zero zero means the first component is the

30
00:02:30,720 --> 00:02:37,440
U, which is basically the U that he put here.

31
00:02:37,440 --> 00:02:48,150
Y So that means is means the velocity which is zero and J is X, which is also zero.

32
00:02:48,510 --> 00:02:55,620
So d v over d, x has to be a little bit different.

33
00:02:55,650 --> 00:02:59,250
The V means the velocity.

34
00:03:00,330 --> 00:03:06,230
Or d u over d y d u over d y.

35
00:03:06,260 --> 00:03:11,280
We need velocity, which is zero, but J has to be one.

36
00:03:11,300 --> 00:03:11,870
Why?

37
00:03:11,900 --> 00:03:14,210
Because now we are talking about.

38
00:03:15,090 --> 00:03:16,740
A y axis.

39
00:03:16,740 --> 00:03:18,980
So here you also see it.

40
00:03:18,990 --> 00:03:20,570
He's doing the same thing.

41
00:03:20,580 --> 00:03:24,690
Velocity and Y has to be J equals one.

42
00:03:26,670 --> 00:03:27,180
Okay.

43
00:03:27,630 --> 00:03:29,910
Okay, So we continue.

44
00:03:31,730 --> 00:03:32,390
De.

45
00:03:33,230 --> 00:03:36,140
V over and over.

46
00:03:36,140 --> 00:03:42,170
D y, d v over will become one zero and over.

47
00:03:42,170 --> 00:03:43,650
D y is one.

48
00:03:43,700 --> 00:03:45,020
Y y.

49
00:03:45,050 --> 00:03:46,880
Because V is one.

50
00:03:46,910 --> 00:03:48,950
The second component.

51
00:03:48,980 --> 00:03:50,360
The first component is zero.

52
00:03:50,420 --> 00:03:54,530
U second component is one V and of course, J.

53
00:03:56,110 --> 00:03:56,830
As we go.

54
00:03:57,750 --> 00:04:00,330
The last thing is or not the last thing.

55
00:04:00,330 --> 00:04:01,230
The first derivative.

56
00:04:01,230 --> 00:04:03,720
Last thing is we need.

57
00:04:04,370 --> 00:04:04,880
P.

58
00:04:06,650 --> 00:04:10,160
And P over the X and over Y.

59
00:04:10,190 --> 00:04:16,250
And here is going to be two and two zero for X and one for Y.

60
00:04:16,820 --> 00:04:19,490
Of course, you can also see it in here.

61
00:04:19,610 --> 00:04:22,040
The P over the X you.

62
00:04:22,760 --> 00:04:25,670
Just like 2021.

63
00:04:25,760 --> 00:04:28,020
So it's all, uh.

64
00:04:28,280 --> 00:04:29,780
Yeah, this one is not exist.

65
00:04:30,560 --> 00:04:38,480
So basically, this is our first derivative, and this is just we see a little bit the equation.

66
00:04:38,480 --> 00:04:45,440
We can see we have the U over the X, we have the U over D y, we have DV over the x over d, y, d,

67
00:04:45,440 --> 00:04:47,280
p, over the x, p over d y.

68
00:04:47,300 --> 00:04:49,520
So now we already made this.

69
00:04:49,520 --> 00:04:51,820
Made this, this, this, this and this.

70
00:04:51,830 --> 00:04:53,910
Now, the second derivative is a bit tricky.

71
00:04:53,930 --> 00:04:59,690
Tricky because it's, it's, it seems a strange logic the way they define it.

72
00:04:59,690 --> 00:05:09,560
But basically the second derivative, which is this one, um, or let's take this 1UXX the first thing

73
00:05:09,560 --> 00:05:15,980
he defined the component which is the U and then it will become, which is the first derivative and

74
00:05:15,980 --> 00:05:17,560
what is the second derivative.

75
00:05:17,570 --> 00:05:18,380
So.

76
00:05:19,570 --> 00:05:26,620
D u over x x well equals we use heisen.

77
00:05:28,330 --> 00:05:29,920
Or Haitian.

78
00:05:31,070 --> 00:05:31,820
A method.

79
00:05:32,090 --> 00:05:35,420
And here it's going to be why?

80
00:05:39,150 --> 00:05:39,690
Here.

81
00:05:39,690 --> 00:05:40,230
Why?

82
00:05:41,250 --> 00:05:41,970
Here.

83
00:05:43,160 --> 00:05:45,590
X component is you.

84
00:05:45,620 --> 00:05:46,760
It is zero.

85
00:05:46,790 --> 00:05:50,780
X is also zero and Y is also zero.

86
00:05:50,780 --> 00:05:53,690
So this is the way to go.

87
00:05:54,420 --> 00:05:55,710
Now we.

88
00:05:56,610 --> 00:06:01,980
Do another thing, which is the second derivative of U over Y.

89
00:06:02,550 --> 00:06:04,170
The first component is zero.

90
00:06:04,200 --> 00:06:04,890
That's correct.

91
00:06:04,890 --> 00:06:09,000
The second component is one, and J is one.

92
00:06:09,000 --> 00:06:09,360
Why?

93
00:06:09,390 --> 00:06:10,860
Because first derivative.

94
00:06:10,980 --> 00:06:13,650
The second derivative of Y and y.

95
00:06:13,680 --> 00:06:15,900
So this is y y it will be one one.

96
00:06:17,210 --> 00:06:20,990
Do the same thing, but this time dv.

97
00:06:21,260 --> 00:06:23,270
Second derivative dv.

98
00:06:24,350 --> 00:06:24,830
DV.

99
00:06:27,330 --> 00:06:28,630
We have the same thing here.

100
00:06:28,650 --> 00:06:30,570
X x will be x x and.

101
00:06:30,570 --> 00:06:32,460
But here one.

102
00:06:33,720 --> 00:06:34,130
And when.

103
00:06:36,320 --> 00:06:37,040
That's it.

104
00:06:37,340 --> 00:06:39,170
That's the small derivatives.

105
00:06:39,170 --> 00:06:41,390
However, we need now to combine everything.

106
00:06:42,100 --> 00:06:44,350
D or E?

107
00:06:46,710 --> 00:06:47,310
Of.

108
00:06:48,960 --> 00:06:50,520
The you.

109
00:06:50,880 --> 00:06:52,590
This is the momentum.

110
00:06:54,920 --> 00:06:55,370
Or.

111
00:06:57,100 --> 00:07:00,610
Yeah, well you can say like this of the.

112
00:07:01,700 --> 00:07:08,150
Which is that the momentum in the direction and.

113
00:07:10,830 --> 00:07:11,680
Continuity.

114
00:07:11,790 --> 00:07:12,930
Continuity.

115
00:07:13,700 --> 00:07:16,100
We need to all be defined.

116
00:07:16,730 --> 00:07:27,260
So the first one is we need to consider, well, in our case you do over the X, so let's consider this

117
00:07:27,260 --> 00:07:28,070
equation.

118
00:07:34,340 --> 00:07:37,100
D u over d x multiplied by u.

119
00:07:37,130 --> 00:07:51,680
So which is why this value is going to be everything and 0 to 1 which is the first component multiplied

120
00:07:51,710 --> 00:07:56,030
d u d x plus.

121
00:07:58,140 --> 00:08:00,090
The same thing.

122
00:08:01,740 --> 00:08:03,570
Well for all the points.

123
00:08:04,340 --> 00:08:11,570
And zero one bit became one too, because now it's you.

124
00:08:12,560 --> 00:08:14,270
Multiplied the.

125
00:08:15,420 --> 00:08:17,760
You over the one thing.

126
00:08:19,390 --> 00:08:20,410
The over the.

127
00:08:22,960 --> 00:08:24,970
The you over.

128
00:08:26,660 --> 00:08:27,380
Why?

129
00:08:28,650 --> 00:08:32,520
Plus one over Rho.

130
00:08:33,800 --> 00:08:34,640
Or roll.

131
00:08:36,000 --> 00:08:37,680
Multiply DPI.

132
00:08:40,220 --> 00:08:40,730
Over.

133
00:08:46,060 --> 00:08:47,020
Minus.

134
00:08:48,670 --> 00:08:51,820
Mu over rho.

135
00:08:55,760 --> 00:08:56,720
Multiplied.

136
00:08:58,710 --> 00:08:59,460
The you.

137
00:09:01,210 --> 00:09:01,540
X.

138
00:09:01,540 --> 00:09:04,280
X plus do.

139
00:09:05,270 --> 00:09:05,630
Why?

140
00:09:05,630 --> 00:09:05,960
Why?

141
00:09:06,500 --> 00:09:08,060
What does that mean?

142
00:09:08,180 --> 00:09:09,320
Means.

143
00:09:10,100 --> 00:09:11,030
This is you.

144
00:09:11,060 --> 00:09:14,810
The you over the and this is the the you over.

145
00:09:15,200 --> 00:09:16,310
And this one.

146
00:09:16,310 --> 00:09:18,740
We have to move it to this direction.

147
00:09:18,740 --> 00:09:24,200
One over P the P over this plus become minus.

148
00:09:24,200 --> 00:09:31,160
And this is we said the kinematic viscosity, which is mu over rho.

149
00:09:31,160 --> 00:09:38,900
So this is we put it mu over rho the second derivative of u over the second derivative of u over D This

150
00:09:38,900 --> 00:09:42,290
is why this become minus and this become positive.

151
00:09:42,960 --> 00:09:45,180
This is going to be the first residual.

152
00:09:45,210 --> 00:09:53,400
The second thing, what we will do here, where more or less the same you and here V but this is becomes

153
00:09:53,430 --> 00:10:02,910
the V over the y, the v over y, dp over y.

154
00:10:03,760 --> 00:10:04,780
And.

155
00:10:05,520 --> 00:10:09,030
Second derivative of.

156
00:10:09,820 --> 00:10:10,690
Y y.

157
00:10:11,700 --> 00:10:13,830
Oh, no, it's just here.

158
00:10:15,130 --> 00:10:18,910
V not because X and Y already exist in both.

159
00:10:18,910 --> 00:10:22,090
So here you and you.

160
00:10:22,730 --> 00:10:26,770
I think it's pretty much no problem.

161
00:10:27,310 --> 00:10:29,050
The last one is.

162
00:10:29,140 --> 00:10:30,760
Well, there's this very simple thing.

163
00:10:30,760 --> 00:10:31,750
Is this one.

164
00:10:31,780 --> 00:10:36,100
The U over x plus D over over d, y, d.

165
00:10:37,090 --> 00:10:38,770
You're over X.

166
00:10:39,850 --> 00:10:41,760
Plus DV.

167
00:10:42,730 --> 00:10:43,390
Why?

168
00:10:44,650 --> 00:10:45,610
Return.

169
00:10:48,730 --> 00:10:49,540
Everything.

170
00:10:49,540 --> 00:10:50,560
Just these.

171
00:10:50,590 --> 00:10:53,410
These are the things that has to be equal.

172
00:10:53,470 --> 00:10:56,920
That has to equal to zero because.

173
00:10:57,590 --> 00:10:59,240
We have all of this.

174
00:10:59,360 --> 00:11:01,100
It's called residual and residual.

175
00:11:01,130 --> 00:11:06,760
Basically, we keep all the equation on one side and we equal it to zero.

176
00:11:06,770 --> 00:11:11,540
It has to be achieved if we want to converge our solution.

177
00:11:12,740 --> 00:11:13,170
Shift.

178
00:11:13,190 --> 00:11:13,520
Enter.

179
00:11:13,550 --> 00:11:15,470
Hopefully we didn't forget anything.

180
00:11:15,830 --> 00:11:21,080
And this is basically our now data.

181
00:11:21,290 --> 00:11:22,340
The data.

182
00:11:23,100 --> 00:11:24,300
We need to create.

183
00:11:25,090 --> 00:11:31,320
Data is basically that the neural network has to train on it in order to converge.

184
00:11:32,410 --> 00:11:37,780
The dot data dot PD.

185
00:11:38,970 --> 00:11:40,560
What we need to add.

186
00:11:40,560 --> 00:11:44,160
The first one is geometry.

187
00:11:45,170 --> 00:11:46,220
This one.

188
00:11:50,520 --> 00:11:51,690
Second one is.

189
00:11:54,640 --> 00:11:57,610
Which is the whole thing, this one.

190
00:11:57,610 --> 00:12:01,480
And of course, it has these little beads.

191
00:12:01,510 --> 00:12:11,020
I would say like the like everything it will have now, number of domain points equals one 2000.

192
00:12:11,020 --> 00:12:14,800
Domain points, number of boundary.

193
00:12:15,600 --> 00:12:16,320
Bone.

194
00:12:19,260 --> 00:12:22,530
The points is again 2000.

195
00:12:26,120 --> 00:12:31,850
This should be domain boundary is also okay.

196
00:12:32,570 --> 00:12:34,370
Number of test.

197
00:12:35,300 --> 00:12:36,890
Just put it wherever.

198
00:12:37,010 --> 00:12:38,150
Just keep it.

199
00:12:38,870 --> 00:12:39,920
100.

200
00:12:40,610 --> 00:12:41,540
Just 200.

201
00:12:41,540 --> 00:12:42,290
Because.

202
00:12:42,740 --> 00:12:47,840
Follow the 2 to 2 and pretty much.

203
00:12:47,840 --> 00:12:48,360
That's it.

204
00:12:48,380 --> 00:12:48,800
Shift.

205
00:12:48,800 --> 00:12:49,310
Enter.

206
00:12:49,310 --> 00:12:50,140
And.

207
00:12:53,440 --> 00:12:54,940
There's the problem.

208
00:12:56,670 --> 00:12:57,950
It is business.

209
00:13:01,650 --> 00:13:02,970
Oh, sorry, sorry, sorry, sorry.

210
00:13:03,060 --> 00:13:04,470
Boundary conditions.

211
00:13:04,470 --> 00:13:05,670
We forgot.

212
00:13:07,070 --> 00:13:08,300
It's a big problem.

213
00:13:09,260 --> 00:13:10,010
Sorry.

214
00:13:11,680 --> 00:13:12,720
Here.

215
00:13:15,380 --> 00:13:17,120
We put our.

216
00:13:26,220 --> 00:13:27,300
Well, it's not.

217
00:13:27,300 --> 00:13:27,700
Yeah.

218
00:13:28,410 --> 00:13:32,310
The first one is, well, the wall boundary.

219
00:13:33,710 --> 00:13:36,440
You wall boundary.

220
00:13:37,740 --> 00:13:38,580
The.

221
00:13:39,490 --> 00:13:40,540
And.

222
00:13:41,420 --> 00:13:42,440
And let's.

223
00:13:45,190 --> 00:13:47,170
And let the.

224
00:13:49,710 --> 00:13:50,430
Pressure.

225
00:13:55,250 --> 00:13:59,150
Um, pressure outlet v and outlet pressure.

226
00:13:59,840 --> 00:14:03,120
I think now it seems correct.

227
00:14:03,140 --> 00:14:03,740
This is.

228
00:14:03,740 --> 00:14:05,780
Let's just skipping a bit.

229
00:14:06,760 --> 00:14:07,450
Higher.

230
00:14:08,790 --> 00:14:10,190
Seems okay.

231
00:14:10,620 --> 00:14:10,850
Okay.

232
00:14:10,860 --> 00:14:12,510
Now I think it will work.

233
00:14:13,540 --> 00:14:13,890
Shift.

234
00:14:13,900 --> 00:14:14,350
Enter.

235
00:14:14,380 --> 00:14:25,030
Okay, so now he's passing all this data to our functions and he's checking if it's if these points.

236
00:14:25,450 --> 00:14:26,950
This is a problem.

237
00:14:26,950 --> 00:14:27,700
There are.

238
00:14:33,280 --> 00:14:36,330
It just seems to be some issue.

239
00:14:43,580 --> 00:14:47,420
The problem is we didn't pass on X and on boundary.

240
00:14:47,420 --> 00:14:49,070
We didn't pass the points.

241
00:14:49,070 --> 00:14:51,020
So this is what causes trouble.

242
00:14:51,050 --> 00:14:52,160
Now we.

243
00:14:52,520 --> 00:14:59,300
Well, it's better to shift like run the whole thing from the beginning because we don't know what we

244
00:14:59,300 --> 00:15:00,500
already defined.

245
00:15:01,640 --> 00:15:03,530
I think now is okay.

246
00:15:03,530 --> 00:15:09,620
And before I put here 2000 points, now it's just change it to 200 points.

247
00:15:10,940 --> 00:15:11,710
It seems.

248
00:15:11,710 --> 00:15:12,310
No.

249
00:15:13,740 --> 00:15:15,300
Point is running.

250
00:15:15,300 --> 00:15:16,470
Okay.

251
00:15:18,080 --> 00:15:20,450
Let's take just a little bit like this.

252
00:15:22,690 --> 00:15:23,230
Yeah.

253
00:15:24,760 --> 00:15:25,240
Now.

254
00:15:25,240 --> 00:15:25,690
It's.

255
00:15:25,690 --> 00:15:26,560
It's good.

256
00:15:26,620 --> 00:15:27,760
Do you see this?

257
00:15:27,910 --> 00:15:32,470
False and true means we create a 200 boundaries.

258
00:15:32,770 --> 00:15:34,330
We create 200 boundary points.

259
00:15:34,330 --> 00:15:37,570
If the boundary matches the well.

260
00:15:37,600 --> 00:15:44,680
True or false, the the the boundary condition here we put it will give false and it will not apply

261
00:15:44,920 --> 00:15:49,450
this boundary condition with zero or UN or whatever we define.

262
00:15:49,450 --> 00:15:53,410
So this is a little bit more solid way to define it rather than before.

263
00:15:53,410 --> 00:15:59,920
However, before method can work, however, you have to be very cautious that when you enter this boundary

264
00:15:59,920 --> 00:16:02,740
points you have to decide which is which.

265
00:16:04,450 --> 00:16:07,140
So now we have done it.

266
00:16:07,150 --> 00:16:09,610
Let's just plot.

267
00:16:11,470 --> 00:16:12,190
The.

268
00:16:13,110 --> 00:16:13,710
Figure.

269
00:16:16,670 --> 00:16:18,380
Like plot the point itself.

270
00:16:18,980 --> 00:16:20,240
Fixed size.

271
00:16:22,150 --> 00:16:23,320
Equals.

272
00:16:24,750 --> 00:16:25,470
Eight.

273
00:16:29,210 --> 00:16:29,660
Dot.

274
00:16:31,100 --> 00:16:32,350
Scatter.

275
00:16:40,330 --> 00:16:44,220
And that train is the same as we did before.

276
00:16:45,260 --> 00:16:53,420
Uh, so just this is the X, and we do the same thing here.

277
00:16:54,610 --> 00:16:56,260
Or why?

278
00:16:57,660 --> 00:17:00,600
X equals 0.5.

279
00:17:02,430 --> 00:17:02,970
Well.

280
00:17:04,040 --> 00:17:04,610
Pldt.

281
00:17:06,250 --> 00:17:07,570
That X label.

282
00:17:09,360 --> 00:17:10,950
And just plotting things.

283
00:17:19,400 --> 00:17:20,290
Yep, that's it.

284
00:17:20,300 --> 00:17:21,290
PLT dot show.

285
00:17:24,450 --> 00:17:26,280
So these are our points.

286
00:17:26,280 --> 00:17:28,730
We can see this is the boundary points.

287
00:17:28,740 --> 00:17:30,210
This is the domain points.

288
00:17:30,210 --> 00:17:32,310
Of course, this is like.

289
00:17:33,520 --> 00:17:37,060
Scattered randomly and.

290
00:17:38,440 --> 00:17:42,190
The last thing we have to do is define the neural network.

291
00:17:42,340 --> 00:17:43,300
So.

292
00:17:45,010 --> 00:17:59,530
The network will equals the dot maps dot forward neural network and it will have input of two Y is two

293
00:17:59,560 --> 00:18:03,430
because we have X and y only.

294
00:18:05,080 --> 00:18:06,450
A plus.

295
00:18:06,460 --> 00:18:11,410
We have 64 multiplied by multiplied five.

296
00:18:11,440 --> 00:18:16,240
This is going to be our hidden layer.

297
00:18:16,750 --> 00:18:18,160
We put it like this.

298
00:18:21,560 --> 00:18:30,140
And output is three, Y is three because u, V and P3A activation function.

299
00:18:31,660 --> 00:18:32,650
Then it.

300
00:18:33,650 --> 00:18:43,340
Then H and the initialization we said we need to initialize everything with a mean of zero.

301
00:18:43,340 --> 00:18:46,640
So they will spread, but they will have the mean of zero.

302
00:18:47,760 --> 00:18:49,310
Elk Lodge.

303
00:18:51,160 --> 00:18:53,260
Rot uniform.

304
00:18:54,610 --> 00:18:54,970
Form.

305
00:18:57,100 --> 00:18:58,120
Shift into.

306
00:18:58,120 --> 00:19:00,220
And this is our network.

307
00:19:00,370 --> 00:19:05,920
Next thing, what we will do is we need to train the actual network.
