1
00:00:00,990 --> 00:00:09,090
Deep XD is a library that is designed for pinns computation.

2
00:00:09,570 --> 00:00:20,820
Of course, using a library is not as flexible as using PyTorch in order to achieve our like solving

3
00:00:20,820 --> 00:00:21,510
the pens.

4
00:00:22,080 --> 00:00:23,160
However.

5
00:00:23,910 --> 00:00:32,850
It is sometimes quite useful for, let's say, sample testing or just somebody who's trying to learn

6
00:00:32,850 --> 00:00:40,050
pens will just use it as a as a reference for our computation, or just to compare between our belt

7
00:00:40,050 --> 00:00:42,330
code and the library.

8
00:00:43,640 --> 00:00:45,680
So this library is built on.

9
00:00:46,370 --> 00:00:48,890
Top of TensorFlow and actually PyTorch.

10
00:00:49,190 --> 00:00:57,890
And this is its main backend and of course with, with other like other libraries that is back into

11
00:00:57,890 --> 00:00:59,780
this deep.

12
00:01:01,550 --> 00:01:10,220
So what we will learn today or this class is how to solve heat equation using deep.

13
00:01:11,330 --> 00:01:19,760
So the first thing is well just a quick thing is here of course again like it's a temporal difference

14
00:01:19,880 --> 00:01:22,880
temporal component and diffusion component.

15
00:01:22,880 --> 00:01:33,170
The spatial component of of you changing with x square and k is diffusion coefficient or kinematic diffusion

16
00:01:33,170 --> 00:01:34,080
coefficient.

17
00:01:34,100 --> 00:01:35,870
So this is a constant.

18
00:01:35,870 --> 00:01:39,800
And this is we're trying to solve you with an input of t and x.

19
00:01:39,800 --> 00:01:41,690
And we need to solve this equation.

20
00:01:41,900 --> 00:01:42,710
So.

21
00:01:43,570 --> 00:01:46,200
How to do it the same as we always do.

22
00:01:46,210 --> 00:01:47,410
So we do.

23
00:01:47,440 --> 00:01:52,000
We start by, we say deep XD.

24
00:01:53,260 --> 00:01:53,650
Um.

25
00:01:55,370 --> 00:01:57,800
Heat or even 1d.

26
00:01:58,490 --> 00:01:59,270
1D.

27
00:01:59,300 --> 00:02:03,140
Heat and main, let's say.

28
00:02:03,960 --> 00:02:07,170
Of course you can just name it anything you want.

29
00:02:07,170 --> 00:02:11,700
And we start, as always, by importing the needed libraries.

30
00:02:11,700 --> 00:02:23,790
So import of course deep x XD as d and from deep x d.

31
00:02:24,960 --> 00:02:25,500
But.

32
00:02:26,580 --> 00:02:27,600
Back end.

33
00:02:27,720 --> 00:02:30,330
Back end import.

34
00:02:31,090 --> 00:02:31,990
TensorFlow.

35
00:02:33,260 --> 00:02:45,380
And import numpy as NP as always and import matplotlib dot pi.

36
00:02:45,380 --> 00:02:46,100
Plot.

37
00:02:46,800 --> 00:02:48,390
For plotting.

38
00:02:48,510 --> 00:02:50,160
Plotting if needed.

39
00:02:50,550 --> 00:02:52,110
And of course, you have to enter.

40
00:02:52,230 --> 00:02:55,470
So this is basically the needed libraries for us.

41
00:02:55,470 --> 00:02:57,000
We take them.

42
00:02:57,000 --> 00:03:03,120
And now what we will do is we will have a first defining the constant.

43
00:03:03,120 --> 00:03:05,880
And this diffusion coefficient this k.

44
00:03:06,330 --> 00:03:09,000
So k equals 0.4.

45
00:03:09,740 --> 00:03:19,310
Length of the domain is one, length of time is one, and this is what we are going to use like soon.

46
00:03:20,350 --> 00:03:25,810
So geometry geom equals e dot.

47
00:03:25,840 --> 00:03:31,180
Of course this is we have to follow the rules and how we write the code for deep.

48
00:03:31,930 --> 00:03:35,320
So the geo.

49
00:03:36,340 --> 00:03:37,390
Mitre.

50
00:03:38,670 --> 00:03:43,630
Dot interval from zero to L.

51
00:03:45,090 --> 00:03:50,100
And time domain equals dee dee dee.

52
00:03:50,430 --> 00:03:51,180
Of course.

53
00:03:51,210 --> 00:03:53,580
This dot.

54
00:03:54,740 --> 00:03:55,550
Geometry.

55
00:03:57,060 --> 00:03:57,750
Dot.

56
00:03:58,610 --> 00:03:59,330
Time.

57
00:03:59,420 --> 00:04:03,080
Capital letter domain also capital letter domain.

58
00:04:03,840 --> 00:04:08,430
And it goes from zero to this in.

59
00:04:10,060 --> 00:04:10,990
And sorry.

60
00:04:11,080 --> 00:04:12,100
Not in.

61
00:04:14,680 --> 00:04:15,340
Jim.

62
00:04:16,570 --> 00:04:21,580
Time, which is geometry and time dot.

63
00:04:22,790 --> 00:04:25,600
In geome geometry.

64
00:04:26,320 --> 00:04:28,150
Basically dot.

65
00:04:28,420 --> 00:04:29,440
Another method.

66
00:04:29,440 --> 00:04:31,530
Geome Mitre.

67
00:04:33,640 --> 00:04:34,380
X.

68
00:04:35,160 --> 00:04:35,910
Time.

69
00:04:36,540 --> 00:04:40,710
And Jim and the time domain.

70
00:04:42,600 --> 00:04:50,100
So here we defined our geometry and we put a push shift enter and we are done.

71
00:04:50,580 --> 00:04:51,330
That's it.

72
00:04:51,360 --> 00:04:58,950
It's very quick very kind of shortcuts using this library however.

73
00:04:59,990 --> 00:05:06,050
We need to define the boundary condition and the initial condition.

74
00:05:06,050 --> 00:05:06,950
So.

75
00:05:09,040 --> 00:05:16,810
And defining the boundary condition or the initial condition will require us to have a lambda function.

76
00:05:16,930 --> 00:05:22,510
So well, for example, I would say I will define the initial condition.

77
00:05:22,510 --> 00:05:27,070
But and then I will explain how to deal with lambda function.

78
00:05:27,070 --> 00:05:34,180
And then I will define the boundary condition based on a function lambda function but also based on

79
00:05:34,180 --> 00:05:34,990
external function.

80
00:05:34,990 --> 00:05:39,880
So we can play with it whatever we want or however we want to define.

81
00:05:40,150 --> 00:05:40,990
So.

82
00:05:41,800 --> 00:05:46,570
I c equals d dot I c.

83
00:05:46,600 --> 00:05:48,250
Initial condition.

84
00:05:49,300 --> 00:05:50,200
And.

85
00:05:52,870 --> 00:05:56,260
And initial condition and boundary condition.

86
00:05:56,350 --> 00:06:02,500
Dot c means also initial condition and then we pass on the geometry.

87
00:06:05,710 --> 00:06:10,630
And we define the lambda function.

88
00:06:14,420 --> 00:06:15,590
And lambda.

89
00:06:18,760 --> 00:06:20,470
Lambda Lambda.

90
00:06:24,870 --> 00:06:26,400
And X.

91
00:06:27,230 --> 00:06:29,030
NP dot sign.

92
00:06:32,310 --> 00:06:34,620
In multiplied.

93
00:06:35,600 --> 00:06:38,000
In p dot.

94
00:06:38,840 --> 00:06:39,410
Pie.

95
00:06:40,820 --> 00:06:45,890
And of course, is the length of the time domain.

96
00:06:48,890 --> 00:06:50,960
Multiplied x.

97
00:06:52,580 --> 00:06:54,170
Everything to.

98
00:06:55,170 --> 00:06:56,820
021.

99
00:06:58,310 --> 00:07:01,720
And divide everything by L.

100
00:07:02,440 --> 00:07:03,910
Which is this one?

101
00:07:09,140 --> 00:07:15,800
And we have to put another function lambda as do nothing function.

102
00:07:16,890 --> 00:07:18,150
Uh, this way.

103
00:07:18,390 --> 00:07:20,430
And the last one on.

104
00:07:21,510 --> 00:07:23,340
A nickel.

105
00:07:25,490 --> 00:07:26,270
On initial.

106
00:07:29,330 --> 00:07:41,000
So this way what what do we have is a sine function in which we are going to apply this function.

107
00:07:41,570 --> 00:07:45,380
Basically it's x its only initial condition.

108
00:07:45,380 --> 00:07:53,660
And it will take x and multiply it well based on the end value and the value with a pi.

109
00:07:53,660 --> 00:07:56,360
And we will take the sine of the whole thing.

110
00:07:56,360 --> 00:07:58,760
And this is going to be our function.

111
00:07:58,760 --> 00:08:04,520
So basically what we have so far is we have the domain.

112
00:08:04,520 --> 00:08:07,220
It looks like it's a little bit small.

113
00:08:10,170 --> 00:08:14,580
We have the domain that maybe if there are bigger.

114
00:08:14,610 --> 00:08:19,410
Okay, this we have the domain that looks like this.

115
00:08:19,410 --> 00:08:22,320
This is x and this is T.

116
00:08:23,120 --> 00:08:25,550
And it goes like this.

117
00:08:26,030 --> 00:08:28,040
X is from.

118
00:08:28,700 --> 00:08:35,270
X is from zero to here one and t is from also zero.

119
00:08:35,270 --> 00:08:39,740
So here to one here this is t.

120
00:08:40,310 --> 00:08:41,600
Now the.

121
00:08:42,250 --> 00:08:48,070
The the initial condition it will go it's going to be a sine wave.

122
00:08:48,070 --> 00:08:50,260
So it will look like.

123
00:08:51,150 --> 00:08:51,420
It.

124
00:08:53,520 --> 00:08:54,480
This.

125
00:08:56,160 --> 00:09:03,900
And then we will define also a boundary condition that is going to be only one at the beginning.

126
00:09:03,900 --> 00:09:07,800
And at the end we will set it as.

127
00:09:08,870 --> 00:09:09,440
To.

128
00:09:11,520 --> 00:09:15,000
So basically this is our boundary condition.

129
00:09:15,000 --> 00:09:16,070
And what does it mean.

130
00:09:16,080 --> 00:09:19,070
It means that a.

131
00:09:20,670 --> 00:09:22,980
Well, it's basically the.

132
00:09:24,480 --> 00:09:31,620
We start the boundary condition from here, it will be zero and.

133
00:09:33,460 --> 00:09:34,720
But say this.

134
00:09:35,380 --> 00:09:37,660
This is the initial condition.

135
00:09:37,660 --> 00:09:40,550
And the boundary condition is going to be two here.

136
00:09:40,600 --> 00:09:43,960
So also at the end of this thing.

137
00:09:44,730 --> 00:09:46,230
The initial condition.

138
00:09:46,260 --> 00:09:51,870
The boundary condition will be zero and the here the boundary condition is going to be two.

139
00:09:52,140 --> 00:09:56,130
So this is going to all the boundary condition.

140
00:09:56,340 --> 00:09:59,160
And basically also here.

141
00:09:59,160 --> 00:10:00,550
So we have a line.

142
00:10:00,570 --> 00:10:02,970
The line in between we have to calculate.

143
00:10:02,970 --> 00:10:10,260
But the boundary condition between the the beginning and the end is basically two.

144
00:10:10,970 --> 00:10:13,370
So it's in the left side.

145
00:10:13,370 --> 00:10:16,010
This one is always going to be 000.

146
00:10:16,010 --> 00:10:20,110
And on the right side the boundary condition is going to be two, two, two.

147
00:10:20,120 --> 00:10:22,970
So this is what we will do.

148
00:10:24,190 --> 00:10:25,330
For the initial condition.

149
00:10:25,330 --> 00:10:27,940
We already defined this as a function.

150
00:10:27,970 --> 00:10:32,140
A sine function that will deal that will be related to n and l.

151
00:10:32,170 --> 00:10:33,790
Of course we can remove n.

152
00:10:33,820 --> 00:10:35,350
It doesn't really matter.

153
00:10:35,560 --> 00:10:40,120
We can do whatever we want and as we define here is initial condition.

154
00:10:40,120 --> 00:10:44,620
He will apply this equation only on the initial condition.

155
00:10:44,620 --> 00:10:51,760
So he will take the whole domain and only take the boundary condition or sorry, the initial condition,

156
00:10:51,760 --> 00:10:53,560
and then apply it to the equation.

157
00:10:53,560 --> 00:10:55,720
And then he will get his initial condition.

158
00:10:55,750 --> 00:11:01,300
Now what we need to do of course, to consider the lambda.

159
00:11:01,300 --> 00:11:06,040
It's not very common for us to use lambda function.

160
00:11:06,040 --> 00:11:12,370
So what we will do is or now just define using lambda function only the initial condition.

161
00:11:12,370 --> 00:11:20,020
But for the boundary condition I will define it using a lambda function, but also a normal function

162
00:11:20,020 --> 00:11:23,740
to basically do whatever we want, we change whatever we want.

163
00:11:24,790 --> 00:11:27,520
So here we shift enter and it's already entered.

164
00:11:27,550 --> 00:11:31,720
Now before that let's understand a little bit about lambda functions.

165
00:11:31,720 --> 00:11:35,140
So let's imagine we have an input.

166
00:11:36,530 --> 00:11:37,550
Just a little light.

167
00:11:37,610 --> 00:11:39,470
Take some spaces.

168
00:11:40,470 --> 00:11:41,880
So input.

169
00:11:42,850 --> 00:11:43,210
Array.

170
00:11:45,040 --> 00:11:47,800
Of NP dot array.

171
00:11:48,930 --> 00:11:55,290
And let's consider it as let's say it's like a grid so or a mesh.

172
00:11:55,590 --> 00:12:00,300
Here we have like kind of or it is 2D and.

173
00:12:02,020 --> 00:12:03,280
This one.

174
00:12:04,690 --> 00:12:05,740
Will be.

175
00:12:08,420 --> 00:12:11,660
This four, five six.

176
00:12:13,090 --> 00:12:15,910
And that we have this.

177
00:12:17,120 --> 00:12:21,460
The last one will be, let's say seven, eight, nine.

178
00:12:21,470 --> 00:12:21,890
Yeah.

179
00:12:21,890 --> 00:12:24,210
So we have now a.

180
00:12:25,520 --> 00:12:26,360
An array.

181
00:12:27,110 --> 00:12:30,140
And we will define a lambda function.

182
00:12:30,140 --> 00:12:32,060
So first lambda.

183
00:12:34,590 --> 00:12:37,050
Function equals.

184
00:12:38,350 --> 00:12:39,040
Lambda.

185
00:12:40,800 --> 00:12:43,800
And then we define what we will change.

186
00:12:43,800 --> 00:12:47,370
So x we multiply it by.

187
00:12:48,290 --> 00:12:50,960
X only taking.

188
00:12:51,770 --> 00:12:53,810
The first column.

189
00:12:53,810 --> 00:12:55,310
So we take everything.

190
00:12:55,460 --> 00:12:56,480
We take.

191
00:12:57,680 --> 00:12:58,400
Everything.

192
00:12:58,400 --> 00:13:06,110
This column and it will change from 0 to 1 means 0 to 1 is basically zero because.

193
00:13:06,850 --> 00:13:09,100
While we cannot take one.

194
00:13:09,400 --> 00:13:10,690
So in this case.

195
00:13:12,120 --> 00:13:15,300
Results of this lambda function.

196
00:13:15,300 --> 00:13:16,410
Result.

197
00:13:17,910 --> 00:13:17,970
Uh.

198
00:13:18,030 --> 00:13:18,360
Well.

199
00:13:18,380 --> 00:13:18,750
Array.

200
00:13:20,880 --> 00:13:23,460
Equals the lambda function.

201
00:13:23,460 --> 00:13:26,880
And when we pass the input array.

202
00:13:28,430 --> 00:13:30,680
And let's say, print.

203
00:13:31,490 --> 00:13:31,970
Results.

204
00:13:34,380 --> 00:13:35,520
So what's happening here?

205
00:13:36,470 --> 00:13:37,350
The input array.

206
00:13:37,370 --> 00:13:39,050
This part of the code we already know.

207
00:13:39,380 --> 00:13:46,100
This is what db db is going to provide our to our Lambda function.

208
00:13:46,310 --> 00:13:51,080
And it will pass it to basically our lambda function.

209
00:13:51,080 --> 00:13:57,880
So what will happen is it will take this input array and we'll consider it.

210
00:13:57,890 --> 00:13:59,570
This is going to be the x.

211
00:13:59,570 --> 00:14:01,520
So we said lambda x.

212
00:14:01,520 --> 00:14:03,320
So it's going to be x.

213
00:14:03,320 --> 00:14:12,950
And then what will happen is we will take this x and then do this operation which is multiply.

214
00:14:12,980 --> 00:14:24,020
First we we we extract the component we want which is the first column from 0 to 1 because it will change

215
00:14:24,020 --> 00:14:24,890
from 0 to 1.

216
00:14:24,890 --> 00:14:30,140
Let's say like the just the the first, basically the first component.

217
00:14:30,140 --> 00:14:36,560
And then what we will do is we multiply it by two and that's it.

218
00:14:36,560 --> 00:14:40,040
So the result will be two.

219
00:14:40,690 --> 00:14:46,930
And this four multiplied by two, it will become eight and seven multiplied by two it becomes 14.

220
00:14:49,000 --> 00:14:51,070
If we can do another things with lambda functions.

221
00:14:51,070 --> 00:14:53,620
So if we have a conditional lambda function.

222
00:14:53,620 --> 00:14:58,420
So conditional a conditional.

223
00:14:59,310 --> 00:14:59,630
Well.

224
00:14:59,650 --> 00:15:00,420
Lambda.

225
00:15:02,320 --> 00:15:03,070
Lambda.

226
00:15:05,250 --> 00:15:06,270
Equals.

227
00:15:07,080 --> 00:15:09,270
The same thing, same structure.

228
00:15:09,270 --> 00:15:11,130
So lambda x.

229
00:15:14,470 --> 00:15:19,900
Lambda x, and then we change the what we want if let's say.

230
00:15:21,080 --> 00:15:22,820
Uh, even, even.

231
00:15:23,730 --> 00:15:24,480
If.

232
00:15:25,880 --> 00:15:26,570
X.

233
00:15:27,580 --> 00:15:32,350
The remaining of dividing by two is zero.

234
00:15:32,560 --> 00:15:35,590
Else it's, let's say, an odd number.

235
00:15:35,630 --> 00:15:39,220
Odd number and print.

236
00:15:43,800 --> 00:15:47,610
Conditional lambda we pass for.

237
00:15:48,580 --> 00:15:51,160
And do the same with passing.

238
00:15:52,480 --> 00:15:53,860
Uh, three, let's say.

239
00:15:56,230 --> 00:15:56,680
So.

240
00:15:57,870 --> 00:16:00,660
He takes the four and then apply it.

241
00:16:00,660 --> 00:16:02,970
So this is his X, this is his.

242
00:16:03,000 --> 00:16:05,580
The value he cares about is x.

243
00:16:05,580 --> 00:16:11,850
And then he will pass it through the through the system through lambda function.

244
00:16:11,850 --> 00:16:18,030
And then if it's of course, if it's you know, the remainder is zero, it will just do whatever the

245
00:16:18,030 --> 00:16:23,400
if condition is there and then it will just give us what, what it whatever we want.

246
00:16:23,880 --> 00:16:29,610
So this is what we can say like a conditional lambda function.

247
00:16:29,700 --> 00:16:38,100
Now what we want to do is we want to use the lambda function to actually pass on.

248
00:16:39,590 --> 00:16:41,930
Well, basically.

249
00:16:43,550 --> 00:16:44,510
Boundary condition.

250
00:16:45,990 --> 00:16:47,100
It through a function.

251
00:16:47,220 --> 00:16:49,050
So in order to do that.

252
00:16:50,220 --> 00:16:53,340
We first define the function define function.

253
00:16:53,340 --> 00:16:55,590
Let's say it is double.

254
00:16:55,590 --> 00:17:00,870
We said about the from 0 to 2 the first.

255
00:17:02,360 --> 00:17:02,990
Column.

256
00:17:04,450 --> 00:17:05,410
Input.

257
00:17:06,850 --> 00:17:07,180
Ray.

258
00:17:07,180 --> 00:17:15,010
Of course, this lambda function is quite not usual for engineers and maybe scientists to use, but

259
00:17:15,910 --> 00:17:27,250
this is how this is what the people who wrote the well, basically the code the deep want us to do.

260
00:17:27,250 --> 00:17:29,050
So we have to to do it.

261
00:17:32,080 --> 00:17:34,840
So here, for example, is.

262
00:17:36,200 --> 00:17:37,400
The input array.

263
00:17:37,640 --> 00:17:42,690
Input equals to input array from 0 to 1.

264
00:17:42,710 --> 00:17:48,350
So we we write the same function here and.

265
00:17:50,700 --> 00:17:54,780
Well, basically boundary condition equals.

266
00:17:55,860 --> 00:18:01,070
The will use the same like just will change some what what is needed.

267
00:18:03,140 --> 00:18:05,210
So DDE means dxt.

268
00:18:05,540 --> 00:18:09,110
And here we have Di.

269
00:18:09,940 --> 00:18:11,610
Ric lit.

270
00:18:11,850 --> 00:18:13,500
Boundary condition.

271
00:18:16,250 --> 00:18:18,510
It's also syntax geometry.

272
00:18:18,530 --> 00:18:21,320
Lambda function has to be.

273
00:18:21,560 --> 00:18:24,170
Well, I'll try to do it this way.

274
00:18:25,090 --> 00:18:26,560
It's a little bit cleaner.

275
00:18:30,450 --> 00:18:38,310
So the lambda function we need to have input array rather than x input array.

276
00:18:38,580 --> 00:18:39,600
And.

277
00:18:40,340 --> 00:18:52,040
Basically we pass on the function of input array, and here on we have to change it also syntax bound

278
00:18:52,850 --> 00:18:53,420
dairy.

279
00:18:54,460 --> 00:18:57,310
And here also on boundary.

280
00:18:59,430 --> 00:18:59,850
Yeah.

281
00:18:59,850 --> 00:19:00,390
This way.

282
00:19:01,710 --> 00:19:10,470
So now we define the initial condition and the boundary condition using of course lambda function.

283
00:19:12,090 --> 00:19:22,950
One thing to note regarding how I treated this regarding 0 to 1 is we need to to understand it fully.

284
00:19:22,950 --> 00:19:27,540
We need to print what the things we are writing.

285
00:19:27,540 --> 00:19:33,800
So the first thing is this is the input array that is going to be from the boundary.

286
00:19:33,810 --> 00:19:35,760
The first thing is input array.

287
00:19:35,760 --> 00:19:42,480
Let's see what kind of input array they are providing to this function.

288
00:19:42,750 --> 00:19:49,260
So the input array we put it in here which is going to be of course our boundary condition.

289
00:19:49,530 --> 00:19:52,380
And next thing is the input array.

290
00:19:52,380 --> 00:19:54,270
We need to see the shape of it.

291
00:19:55,270 --> 00:19:56,410
In case if it's big.

292
00:19:56,440 --> 00:19:58,000
Of course it's not so big.

293
00:19:58,000 --> 00:20:00,220
It's it's 80.

294
00:20:00,250 --> 00:20:01,120
Multiply two.

295
00:20:01,300 --> 00:20:04,990
We will say that shape and.

296
00:20:06,000 --> 00:20:08,010
What we will do is also.

297
00:20:09,100 --> 00:20:13,000
We put the input array in this way.

298
00:20:13,620 --> 00:20:18,930
The where we are passing it to our system.

299
00:20:20,650 --> 00:20:22,420
And here is the same.

300
00:20:23,280 --> 00:20:30,990
And the last thing, what if we didn't do that and we just simply providing this kind of input array?

301
00:20:34,740 --> 00:20:35,940
Um, yeah.

302
00:20:35,940 --> 00:20:40,680
We put here zero and here zero.

303
00:20:41,140 --> 00:20:48,490
So this is going to be printed as we run the our computation and.

304
00:20:50,220 --> 00:21:02,880
Yeah, let's let's just keep it this way until we have our code ready and we can see how these are changing.

305
00:21:02,880 --> 00:21:12,300
So basically what we need to understand or I can provide let's say the Rand software.

306
00:21:13,830 --> 00:21:17,400
Is this is going to be the result.

307
00:21:17,430 --> 00:21:18,300
Of course.

308
00:21:19,140 --> 00:21:21,090
And this is input array.

309
00:21:33,110 --> 00:21:35,420
So this is how it will look.

310
00:21:35,450 --> 00:21:38,400
The input array of the the input array.

311
00:21:38,420 --> 00:21:43,110
The our input array is going to look like a like this.

312
00:21:43,130 --> 00:21:47,720
Basically you have a the value and you have the time.

313
00:21:47,720 --> 00:21:51,200
So this is this is all a boundary values.

314
00:21:51,230 --> 00:21:54,440
Of course this is we will see it when the when the program runs.

315
00:21:54,440 --> 00:21:55,670
We just will not it.

316
00:21:55,670 --> 00:22:01,760
But it's very important to explain it here in the in the section we are talking about the boundary condition

317
00:22:01,760 --> 00:22:02,990
and of course the initial condition.

318
00:22:03,170 --> 00:22:07,220
So we have the input array which is going to be all like this.

319
00:22:07,940 --> 00:22:13,790
And then the input shape is 80 and to why it's 80.

320
00:22:14,150 --> 00:22:22,820
Well, because again this is later we will decide how many number of boundary points we will put.

321
00:22:22,850 --> 00:22:25,250
Of course these are also random points.

322
00:22:25,250 --> 00:22:28,580
We are also going to see that now input.

323
00:22:29,000 --> 00:22:37,940
When we when we put this thing like this we will have the input array to be looks like this.

324
00:22:37,940 --> 00:22:41,450
Basically you have a list.

325
00:22:41,450 --> 00:22:46,040
And inside the list we have another list and all the values that we need to change.

326
00:22:46,040 --> 00:22:50,090
Basically apply the to multiply them by two.

327
00:22:51,360 --> 00:23:00,960
And this is going to be the dimension is 8180 columns and 180 rows and one column, as you can see here.

328
00:23:00,960 --> 00:23:07,980
However, if we put this way, if we put input array this one and zero, what we will get is we will

329
00:23:07,980 --> 00:23:11,280
get a list that looks like this, which is not what we want.

330
00:23:11,910 --> 00:23:15,510
This is not physics, this is simply programming.

331
00:23:15,510 --> 00:23:24,540
This is how we have to write it in order to get the correct shape of the, of the of the input value.

332
00:23:24,540 --> 00:23:32,400
So this is a well in detail why we put here from 0 to 1.

333
00:23:33,410 --> 00:23:34,790
One thing to note.

334
00:23:35,610 --> 00:23:36,750
Is there.

335
00:23:37,230 --> 00:23:43,770
When we use this definition of boundary condition, we will need three needed information.

336
00:23:43,950 --> 00:23:45,800
The first one is x.

337
00:23:46,610 --> 00:23:48,080
The location in space.

338
00:23:48,260 --> 00:23:50,520
The second one is time.

339
00:23:50,840 --> 00:23:58,550
The boundary condition will end at a specific time, and the third one is the value at this boundary

340
00:23:58,550 --> 00:23:59,240
condition.

341
00:23:59,240 --> 00:24:03,410
So how did we well define them?

342
00:24:03,950 --> 00:24:10,520
Well, this lambda function that we talked maybe a lot about how it is structured.

343
00:24:10,580 --> 00:24:15,860
We can see the input array which is will give us two informations.

344
00:24:15,860 --> 00:24:19,130
That is x and time the x.

345
00:24:19,130 --> 00:24:22,070
We can see it here 0 or 1.

346
00:24:22,070 --> 00:24:31,190
And then here 000111 at different time location that we will basically randomly generate it or going

347
00:24:31,190 --> 00:24:31,820
to generate it.

348
00:24:32,910 --> 00:24:35,340
So these are the two informations.

349
00:24:35,340 --> 00:24:40,740
And they are going to input in this lambda function in this input array.

350
00:24:41,550 --> 00:24:43,860
Now we have the two information.

351
00:24:43,860 --> 00:24:45,330
How about the third information.

352
00:24:45,330 --> 00:24:46,770
And the third information.

353
00:24:46,770 --> 00:24:49,230
We get it by the double first column.

354
00:24:49,230 --> 00:24:51,660
This basically the.

355
00:24:52,400 --> 00:24:58,430
Function and how this information is, is going to be used.

356
00:24:58,430 --> 00:25:05,900
Well we will this function will give us the third information, but well how we put the input array

357
00:25:05,900 --> 00:25:07,250
in that function.

358
00:25:07,250 --> 00:25:10,880
And we use only the space location.

359
00:25:11,570 --> 00:25:16,520
As a to describe the output function which is.

360
00:25:16,520 --> 00:25:22,610
In this function, the space multiplied by two will equal the boundary condition.

361
00:25:22,730 --> 00:25:25,850
Let's see in the this graph.

362
00:25:26,690 --> 00:25:27,010
That.

363
00:25:27,050 --> 00:25:28,610
So our solution will be like this.

364
00:25:28,610 --> 00:25:36,740
Basically, we will have a boundary condition and in the one direction is going to be, well zero and

365
00:25:36,740 --> 00:25:38,810
the other direction which is here.

366
00:25:39,720 --> 00:25:46,800
And at x equals one we will have the boundary condition of well two x basically.

367
00:25:46,800 --> 00:25:53,340
And with time this initial condition will start to diffuse into its final solution.

368
00:25:53,430 --> 00:25:55,200
So x and time.

369
00:25:56,010 --> 00:26:04,080
Is related with X and time, we have a boundary condition value that is related with this equation.

370
00:26:04,110 --> 00:26:07,620
Boundary condition value is two multiplied x.

371
00:26:07,620 --> 00:26:13,740
If the x equals zero, the boundary information or the boundary condition will be zero.

372
00:26:13,740 --> 00:26:21,810
Two multiplied zero is zero and at x equals one it will be two multiplied x, which is one and equals

373
00:26:21,810 --> 00:26:22,410
to two.

374
00:26:22,440 --> 00:26:25,500
This is why we can see this value is two.

375
00:26:25,680 --> 00:26:26,610
So.

376
00:26:27,440 --> 00:26:28,550
At the initial condition.

377
00:26:28,550 --> 00:26:37,160
This one we will start this initial condition diffuse through this well basically the final solution

378
00:26:37,160 --> 00:26:38,420
of the heat equation.

379
00:26:38,570 --> 00:26:46,490
So the well just a minute here we can see that output is going to.

380
00:26:46,520 --> 00:26:48,740
We will take x location.

381
00:26:48,740 --> 00:26:52,850
This one only zero one which is only this value.

382
00:26:52,850 --> 00:26:59,780
And we will multiply it by two which is two x will equal the boundary condition.

383
00:26:59,780 --> 00:27:09,740
And we will add this as one one information which is we can see the values will be this way.

384
00:27:09,920 --> 00:27:13,280
So these are the will the input array.

385
00:27:13,280 --> 00:27:18,620
But if we multiply it by this is the input between 0 and 1.

386
00:27:18,620 --> 00:27:21,740
But we set to multiply this input array which is.

387
00:27:21,740 --> 00:27:22,850
This will be two.

388
00:27:22,880 --> 00:27:23,840
This will be zero.

389
00:27:23,870 --> 00:27:24,740
This will be two.

390
00:27:24,740 --> 00:27:29,480
Because the location every location will be multiplied by two.

391
00:27:29,480 --> 00:27:40,610
So this is the other input x and t output is an array that will take this input function and multiply

392
00:27:40,610 --> 00:27:41,930
it by two.
