1
00:00:00,270 --> 00:00:06,150
So in the previous lecture, we have set up diaries for coordinates and for defector potential, which

2
00:00:06,150 --> 00:00:08,039
is still empty, so only zeros.

3
00:00:08,430 --> 00:00:12,480
And now we can actually carry out the integral here.

4
00:00:13,290 --> 00:00:18,360
So we will do this now, and I told you already that we will not integrate over the whole space with

5
00:00:18,360 --> 00:00:20,020
just over the wire.

6
00:00:20,040 --> 00:00:25,290
So just over the sea access from zero negative to positive other n0.

7
00:00:26,760 --> 00:00:32,610
So first of all, we need a number for the integration steps.

8
00:00:33,570 --> 00:00:36,810
So basically, how many points do we put into the wire?

9
00:00:37,380 --> 00:00:43,650
And they check that it gives us a nicely converged result for five thousand or five thousand and one

10
00:00:44,190 --> 00:00:48,120
when we have one to have a nicely spaced list here.

11
00:00:49,170 --> 00:00:58,570
So you see the length is two times one thousand and the numbers of steps that we have is five thousand

12
00:00:58,570 --> 00:01:02,400
and one, and now we can do our loop.

13
00:01:02,940 --> 00:01:14,370
So for index for the X coordinate in and P Dot arrange num points and the same for Y, of course.

14
00:01:18,030 --> 00:01:26,370
So this will be then in the loop over the X and Y coordinate of the normal position vectors of this

15
00:01:26,370 --> 00:01:28,500
one here or also of this one.

16
00:01:29,070 --> 00:01:35,460
So we will go now through the whole space and there we will ask, OK, what's the value of a what's

17
00:01:35,460 --> 00:01:37,050
the value of B later on?

18
00:01:38,010 --> 00:01:43,170
So for example, here this will be one of the points in this theory that we try to fill now.

19
00:01:44,130 --> 00:01:45,990
So here we go.

20
00:01:48,570 --> 00:02:03,300
This is now the position of port position are for which we are currently calculating the vector potential

21
00:02:03,310 --> 00:02:08,520
eight and so are is given by MP Dot Perry.

22
00:02:11,630 --> 00:02:17,540
We could now call it just from from courts, but we can also reconstruct that it doesn't really matter

23
00:02:17,540 --> 00:02:19,850
in terms of calculation times or much.

24
00:02:20,270 --> 00:02:27,110
So I just tried minus court max plus i x times D.

25
00:02:29,080 --> 00:02:33,920
And then we have minus courts.

26
00:02:34,360 --> 00:02:40,450
Basically the same thing here, just with the high wire city index for why.

27
00:02:40,840 --> 00:02:43,990
And we said that U.S. values should always be zero.

28
00:02:45,580 --> 00:02:49,540
So I don't remember, did we define already the value of these?

29
00:02:49,570 --> 00:02:50,470
No, we forgot it.

30
00:02:50,980 --> 00:02:56,890
So the value of that I'm using here is the step size and the step size, of course, is directly calculated

31
00:02:56,890 --> 00:02:58,000
from these two numbers.

32
00:02:58,300 --> 00:03:08,950
It's calculated by DH is equal to two times called MAX, divided by number of points minus one.

33
00:03:09,580 --> 00:03:15,790
So in our case, it is two times four point nine, divided by 49.

34
00:03:15,790 --> 00:03:18,830
So it is 0.2 and you can expect these leaders.

35
00:03:18,850 --> 00:03:19,750
This is true here.

36
00:03:19,850 --> 00:03:21,280
Step sizes 0.2.

37
00:03:22,990 --> 00:03:23,430
OK.

38
00:03:24,100 --> 00:03:29,080
So, of course, I have to run these cells now again because we changed them.

39
00:03:29,440 --> 00:03:33,250
And now we can continue writing the code here.

40
00:03:33,790 --> 00:03:38,800
So we have no defined the position vector and now we must start the integration for this particular

41
00:03:38,800 --> 00:03:39,730
position vector.

42
00:03:40,420 --> 00:03:50,740
So for C.J., so this will be the z coordinate of the position vector that corresponds to the current.

43
00:03:50,770 --> 00:03:55,150
So this will be the z component of this, our dash and also this one here.

44
00:03:55,390 --> 00:03:57,180
So I labeled it Z J.

45
00:03:57,190 --> 00:04:13,780
This particular index z j in and P totally in space going from minus L0 to positive at zero in steps

46
00:04:13,780 --> 00:04:15,550
of no end.

47
00:04:16,000 --> 00:04:23,140
So basically, this will go the number of steps that we have in this range here and now we finally do

48
00:04:23,140 --> 00:04:24,010
the integration.

49
00:04:24,160 --> 00:04:27,880
So we integrate over all

50
00:04:31,030 --> 00:04:31,480
our

51
00:04:34,360 --> 00:04:35,680
dash in the wire.

52
00:04:37,630 --> 00:04:45,310
So we called his Ardeshir RJ because I don't like the dash here for programming, so let's call it RJ

53
00:04:45,310 --> 00:04:46,960
for our current density.

54
00:04:47,620 --> 00:04:50,290
And this will be ENPI Dot three

55
00:04:52,930 --> 00:05:01,900
zero zero and then C j and now we can do it, we can write a.

56
00:05:02,830 --> 00:05:11,320
And here we write all the coordinates and then the value of the index for the X Coordinate Index for

57
00:05:11,320 --> 00:05:14,870
the Y Coordinate Index, for the Z coordinate, which is zero.

58
00:05:15,460 --> 00:05:21,130
And now we can just write is equal to the old one because we integrate.

59
00:05:21,130 --> 00:05:27,670
This will be basically a sum here, plus the change, which will be what is written down.

60
00:05:29,570 --> 00:05:30,730
Where is it here?

61
00:05:31,570 --> 00:05:32,230
This one?

62
00:05:33,370 --> 00:05:38,170
So j at this position divided by the absolute value of the difference you.

63
00:05:40,370 --> 00:05:51,530
So we write J of our J divided by and then we could write the appeal and I can all or we can also just

64
00:05:51,530 --> 00:05:53,840
do it ourself and fiddle with the square root,

65
00:05:57,440 --> 00:06:00,520
our zero squared.

66
00:06:02,090 --> 00:06:08,180
So now it's pretty easy to calculate the absolute value of the difference because this one here only

67
00:06:08,180 --> 00:06:09,800
has an X and Y coordinates.

68
00:06:10,130 --> 00:06:14,510
And this one here only has a Z coordinates, so there's actually not really a difference.

69
00:06:14,510 --> 00:06:15,950
We can just write down like this

70
00:06:19,820 --> 00:06:24,010
and then RJ to square.

71
00:06:24,290 --> 00:06:30,800
But of course, you could also write here and in our top norm of army notes, RJ would give you the

72
00:06:30,800 --> 00:06:31,550
same result.

73
00:06:32,720 --> 00:06:35,750
OK, so now this should work.

74
00:06:35,750 --> 00:06:40,670
I think because we integrate over this, oh, I forgot to write the return.

75
00:06:41,190 --> 00:06:44,360
So no, it's no sorry.

76
00:06:44,450 --> 00:06:46,000
I was confused here for a second.

77
00:06:46,010 --> 00:06:49,310
I thought I would have forgotten to write the return.

78
00:06:49,640 --> 00:06:50,750
But this is not a function.

79
00:06:50,750 --> 00:06:52,820
This is just a loop, so we don't need any return.

80
00:06:53,180 --> 00:06:54,470
So this is just good to go.

81
00:06:54,800 --> 00:06:57,800
And you see, because I already used quite a large number.

82
00:06:58,070 --> 00:07:00,650
The calculation takes some time.

83
00:07:01,280 --> 00:07:07,640
So if you have a bit of a weak computer or laptop, then please reduce the number, maybe go to five

84
00:07:07,640 --> 00:07:10,520
hundred and one because otherwise you will sit forever.

85
00:07:11,030 --> 00:07:16,040
And if you take a lower value here, then your result will not be as accurate as mine.

86
00:07:16,040 --> 00:07:17,690
But that's not really a big problem.

87
00:07:17,700 --> 00:07:19,040
It's just here.

88
00:07:19,040 --> 00:07:21,590
So we get the general results correct.

89
00:07:21,590 --> 00:07:24,260
So it's not a big deal if you don't have accurate numbers.

90
00:07:24,620 --> 00:07:27,530
So you can use here a bit of a smaller value as well.

91
00:07:27,680 --> 00:07:30,890
And especially when you first test these code.

92
00:07:30,890 --> 00:07:33,560
And also this is what I did when I prepared the notebook.

93
00:07:33,860 --> 00:07:36,500
I, of course, started here with a much smaller value.

94
00:07:38,270 --> 00:07:44,090
So now one thing that we are still missing is while this is running, I can explain this to you.

95
00:07:44,390 --> 00:07:51,050
We are still missing the prefecture and we did not account for the size of this integration element

96
00:07:51,200 --> 00:07:51,800
DV.

97
00:07:53,090 --> 00:07:58,250
So by the way, now the calculation is finished, but we need to still calculate something.

98
00:07:59,000 --> 00:08:08,190
So a must actually be multiplied with the prefecture, which is mile zero, which was one and then divided

99
00:08:08,210 --> 00:08:11,850
by four times PI.

100
00:08:12,680 --> 00:08:15,610
And then we must calculate the DV element.

101
00:08:15,620 --> 00:08:20,660
This would be basically d x times d y times.

102
00:08:21,230 --> 00:08:26,120
The Z and the Z is pretty easy.

103
00:08:27,260 --> 00:08:34,370
This is just two times the length of a wire divided by the number of our integration steps.

104
00:08:34,789 --> 00:08:41,929
So now and minus one and the X and Y are both the same.

105
00:08:42,770 --> 00:08:57,050
This would be pretty similar, actually two times code MAX divided by NUM points minus one and then

106
00:08:57,050 --> 00:08:58,730
the same for d y.

107
00:08:59,900 --> 00:09:02,910
However, I don't want to do it like this.

108
00:09:02,960 --> 00:09:09,950
This would be like the you could see the brute force way of calculating this, because this would really

109
00:09:09,950 --> 00:09:12,050
correspond to the numerical integration.

110
00:09:13,100 --> 00:09:21,530
But actually, what this would do when you think about it, it would put our wire here in cubes so you

111
00:09:21,530 --> 00:09:26,270
would have no cubes or Q boards that are stacked on top of each other.

112
00:09:26,270 --> 00:09:34,460
And so the cross-section would then just be a square where the edges are given basically by the value

113
00:09:34,460 --> 00:09:36,650
of of the of the size here D.

114
00:09:37,220 --> 00:09:38,720
And this is, of course not what we want.

115
00:09:39,620 --> 00:09:41,210
We want that.

116
00:09:41,300 --> 00:09:47,930
We have really our a cross section, which is a circle and where the radius is given by our value.

117
00:09:48,500 --> 00:09:51,950
So we are maybe cheating here a bit in terms of numerics.

118
00:09:51,950 --> 00:09:58,400
But you could also say we are just clever because we are physicists and we know what the radius will

119
00:09:58,400 --> 00:09:58,550
be.

120
00:09:58,550 --> 00:09:58,880
So.

121
00:09:59,630 --> 00:10:03,890
Let me comment off these lines here because because this is not what we will use.

122
00:10:04,460 --> 00:10:10,940
Instead, we will introduce a new element, which will be the element of the of the area.

123
00:10:11,480 --> 00:10:20,660
So I call this d f and this will be, of course, the radius or the area of the circle with the radius

124
00:10:20,660 --> 00:10:21,380
r zero.

125
00:10:21,860 --> 00:10:27,170
So and p told pi times r zero squared.

126
00:10:28,370 --> 00:10:34,250
And then we can calculate a by writing eight is eight times the prefect.

127
00:10:34,250 --> 00:10:38,540
Our times the easy times t f.

128
00:10:39,690 --> 00:10:42,300
OK, so then we will get a much better result.

129
00:10:43,170 --> 00:10:48,390
So this calculation has finished and now I run this cell for the normalization of the result.

130
00:10:48,990 --> 00:10:53,220
And now we can finally go ahead and plot this whole thing.

131
00:10:54,690 --> 00:10:59,970
So as typically, we will use some of these options here for plotting, I will make the aspect ratio

132
00:10:59,970 --> 00:11:00,720
equal to one.

133
00:11:01,050 --> 00:11:07,380
And I will add here a label for X and Y, and then I will go ahead and plot the vector potential.

134
00:11:09,690 --> 00:11:11,790
So for this, I will use a control plot.

135
00:11:13,020 --> 00:11:16,530
So basically, we are the value of the vector potential is given by the color.

136
00:11:18,180 --> 00:11:31,050
And so the X, the list of the X well use will be co-ords zero and all X or Y, and only the plane where

137
00:11:31,050 --> 00:11:38,400
Z is equal to zero, then the wireless will basically be the same, but of course, with the Y component

138
00:11:38,400 --> 00:11:38,710
here.

139
00:11:38,730 --> 00:11:40,050
So we change this to one.

140
00:11:40,570 --> 00:11:42,810
And now we must include the value of eight.

141
00:11:43,860 --> 00:11:47,700
And for a I can first use the X component of A.

142
00:11:49,110 --> 00:11:54,480
So then all X or Y and only if the plane was equal to zero.

143
00:11:54,900 --> 00:12:01,320
And when I run this, it gives me just a plain color, which indicates that probably all the values

144
00:12:01,320 --> 00:12:05,690
o zero, we cannot cross chapters by adding here a color bar.

145
00:12:05,700 --> 00:12:08,700
So kielty that color bar.

146
00:12:12,360 --> 00:12:13,380
And you see, yes.

147
00:12:13,560 --> 00:12:17,220
So it's very small, so all the values here are zero.

148
00:12:17,790 --> 00:12:23,010
Now we can check for the Y coordinate with Y component better to say also zero.

149
00:12:23,400 --> 00:12:28,590
But the Z component is on zero and that's the one that we are interested in.

150
00:12:29,520 --> 00:12:33,510
So this is now the z component of the vector potential.

151
00:12:33,540 --> 00:12:34,860
Let me write this down here.

152
00:12:35,190 --> 00:12:42,130
So this is the C bar and we will change to C Bar set label.

153
00:12:44,160 --> 00:12:50,730
And this is the vector potential A to Z components.

154
00:12:52,130 --> 00:12:52,670
All right.

155
00:12:52,850 --> 00:12:59,300
So this is the result of our first integration or this is the integration that we want to do.

156
00:13:00,020 --> 00:13:09,200
So we integrated this equation here over divides and divides included all the points in the wire and

157
00:13:09,200 --> 00:13:15,920
we did the approximation that the wire is only on the z axis and we considered a radius, which was

158
00:13:15,920 --> 00:13:17,660
the 0.001.

159
00:13:18,710 --> 00:13:26,330
And you see that the vector potential is largest here in the middle and then it declines when you go

160
00:13:27,200 --> 00:13:28,490
away from the z axis.

161
00:13:29,480 --> 00:13:32,270
So not just some comments about the analytical solution.

162
00:13:32,720 --> 00:13:37,640
So I told you already earlier that in my other course on the Maxwell equations, we solved this problem

163
00:13:37,880 --> 00:13:38,690
analytically.

164
00:13:39,170 --> 00:13:44,840
So you don't have to understand what's shown here, but I just want to show it to you that it's possible

165
00:13:44,840 --> 00:13:46,160
to solve this analytically.

166
00:13:46,550 --> 00:13:48,800
And basically, we do hear a similar thing.

167
00:13:48,810 --> 00:13:55,340
We integrate, of course, over the current density, which we assume to be constant in the wire so

168
00:13:55,340 --> 00:13:56,990
we can pull it out of the integral.

169
00:13:57,260 --> 00:14:03,770
And so we basically only integrate of army knows our dash, and this will be something like a square

170
00:14:03,770 --> 00:14:04,170
root.

171
00:14:04,190 --> 00:14:08,240
And if you integrate over such a thing, it will give you the logarithm.

172
00:14:09,200 --> 00:14:13,540
And so I have programmed this equation here.

173
00:14:13,550 --> 00:14:16,670
So the analytical solution is written down here again.

174
00:14:17,210 --> 00:14:28,820
This I programmed and I cut basically through the through our plot here along this line.

175
00:14:29,000 --> 00:14:34,700
So for Y equals zero or close to zero because we didn't have the value of zero in our list.

176
00:14:35,180 --> 00:14:43,940
But I've chosen zero point one and I've cut through this line and plot now the vector potential to Z

177
00:14:43,940 --> 00:14:44,630
component.

178
00:14:45,200 --> 00:14:50,900
And you see as you see the blue values, all the ones from our numerical calculation, which is the

179
00:14:50,900 --> 00:14:52,390
same that are shown here.

180
00:14:52,410 --> 00:14:54,830
So just cut through this and then look at the color.

181
00:14:55,160 --> 00:14:56,570
This will give you the same values.

182
00:14:57,950 --> 00:15:03,650
And then the red line that I've programmed using this equation, which is the same as I've just shown

183
00:15:03,650 --> 00:15:05,030
you this one here.

184
00:15:06,140 --> 00:15:10,880
This gives you these red lines and you see we have a pretty nice agreement.

185
00:15:11,390 --> 00:15:17,510
There is maybe a small problem here directly in the middle, but that's pretty clear because, yeah,

186
00:15:17,570 --> 00:15:23,810
there are we have maybe not enough points for our integration and for considering all the points in

187
00:15:23,810 --> 00:15:27,110
this space, but overall, it's a pretty remarkable result.

188
00:15:27,500 --> 00:15:29,660
And we got the vector potential correct.

