1
00:00:00,230 --> 00:00:02,340
We have discussed what we want to consider.

2
00:00:02,550 --> 00:00:07,080
We want to solve this equation using of this particular potential.

3
00:00:07,800 --> 00:00:15,030
And also we have compared our our system with our previous system, which was a one dimensional harmonic

4
00:00:15,030 --> 00:00:18,810
oscillator where we had two of these differential equations.

5
00:00:18,990 --> 00:00:25,140
Since this was a second order equation, we could replace it by two first order differential equations.

6
00:00:25,770 --> 00:00:32,700
So now, since we have two harmonic oscillators, we will have four a four dimensional system, at least

7
00:00:32,700 --> 00:00:33,870
mathematically speaking.

8
00:00:34,620 --> 00:00:36,990
So let me show you how this works.

9
00:00:37,770 --> 00:00:40,560
Well, first of all, we must define the function.

10
00:00:41,250 --> 00:00:45,030
So we right define f o d e.

11
00:00:45,030 --> 00:00:49,980
We could also use a different name, but I want to show you that this is really nothing new, and therefore

12
00:00:49,980 --> 00:00:51,660
I use the same name as before.

13
00:00:51,990 --> 00:00:53,240
So, all right, everybody.

14
00:00:53,700 --> 00:01:00,120
And for the variables we have, T and our this is really the same thing that we had previously.

15
00:01:00,360 --> 00:01:03,450
When you see here he was our function here.

16
00:01:03,450 --> 00:01:07,800
We had tea and theta with detail was our spatial variable.

17
00:01:08,100 --> 00:01:17,190
And now we have tea and our all right and now we must return a total of four functions.

18
00:01:17,490 --> 00:01:22,380
So we right here function one two, three four.

19
00:01:23,130 --> 00:01:26,070
And now, of course, we must think, what do we want to return?

20
00:01:26,700 --> 00:01:30,170
And since this can be a bit tricky, I want to make it a bit more simple for us.

21
00:01:30,180 --> 00:01:42,090
So I write X comma y is equal to R zero to two just means take the first and a second entry of the position

22
00:01:42,090 --> 00:01:42,780
vector R.

23
00:01:43,200 --> 00:01:49,830
So this corresponds to index zero and one and store these values as X and Y, but only in this function,

24
00:01:49,950 --> 00:01:51,750
only to make it a bit easier for us.

25
00:01:51,780 --> 00:01:55,680
This is not really necessary, but it makes it a bit easier to understand what's happening.

26
00:01:56,520 --> 00:02:02,730
And now we do the same thing for the velocities, which is, of course, then the first derivative,

27
00:02:02,730 --> 00:02:04,860
which was quite common to this one here.

28
00:02:05,490 --> 00:02:06,360
So there we right.

29
00:02:06,480 --> 00:02:07,350
This is our.

30
00:02:07,500 --> 00:02:09,240
And then from two to four.

31
00:02:09,600 --> 00:02:14,740
So this corresponds to the second and third index, which means the third and fourth component.

32
00:02:14,910 --> 00:02:20,610
Since Python starts counting at zero and now we must think, what do we want to return?

33
00:02:21,510 --> 00:02:26,910
And just to make this clear, this is the same as we did before the first entry.

34
00:02:26,980 --> 00:02:33,670
If we want to return would be the theta one, which would basically be the first derivative.

35
00:02:33,750 --> 00:02:36,420
So in our case, this would be the velocity.

36
00:02:37,080 --> 00:02:38,250
So it would be the X.

37
00:02:39,210 --> 00:02:47,760
And also it would be, of course, Levi, because now we have two physical dimensions, so we have now

38
00:02:47,760 --> 00:02:48,750
two velocities.

39
00:02:49,620 --> 00:02:55,560
And here we must write the differential equations on the right hand side of the differential equation.

40
00:02:55,830 --> 00:02:58,800
So let me scroll up to the beginning where we have it here.

41
00:02:59,400 --> 00:03:05,820
So we basically have to solve this equation, forges our double dots, so we have to divide the whole

42
00:03:05,820 --> 00:03:06,600
thing by M.

43
00:03:07,020 --> 00:03:15,060
And so then the right side of the equation becomes minus psi over m times first derivative of R minus

44
00:03:15,060 --> 00:03:21,420
gradient of you, which was two you times the position vector and then does external function.

45
00:03:21,420 --> 00:03:23,250
But we we leave it out.

46
00:03:23,250 --> 00:03:24,630
For now, we send it to zero.

47
00:03:25,620 --> 00:03:33,960
So basically then the right hand side for the X component will be minus psi over m times the X.

48
00:03:34,500 --> 00:03:40,950
And then here we get minus two times U times X and also divided by M.

49
00:03:42,120 --> 00:03:43,500
So let's write this down.

50
00:03:45,440 --> 00:03:52,450
So this will be the entry for the X component, so we ride, as I just said, minus sign over m times

51
00:03:52,460 --> 00:04:03,320
the B X and then the second term minus two times u zero divided by M, times X and Y component is of

52
00:04:03,320 --> 00:04:08,150
course, very similar, but with we y and the Y components.

53
00:04:09,680 --> 00:04:17,209
And now you see, we have several constants here that we must define and as typically we will just set

54
00:04:17,209 --> 00:04:17,990
them to one.

55
00:04:18,200 --> 00:04:21,769
You can, of course, later on play with them and see what changes in the solution.

56
00:04:22,220 --> 00:04:27,800
Also, the U0 will be one and size, and that is something that I could damping constant.

57
00:04:27,800 --> 00:04:31,580
I will not choose equal to one but make it a bit smaller, like zero point one.

58
00:04:33,080 --> 00:04:33,560
All right.

59
00:04:33,680 --> 00:04:38,600
So now we have to find the function, but now we can just solve for the function.

60
00:04:39,660 --> 00:04:43,700
So let me scroll up here and see how we did it previously, initially.

61
00:04:44,390 --> 00:04:46,760
So we don't have to write all of this stuff again.

62
00:04:46,760 --> 00:04:51,170
Let me just copy this and I would continue to write here.

63
00:04:51,440 --> 00:04:56,870
So you see, I will discuss know several examples, and we will start with a example that gives rise

64
00:04:56,870 --> 00:04:58,160
to a linear trajectory.

65
00:04:59,330 --> 00:05:03,380
So I want to start the solution just by naming its solution.

66
00:05:03,800 --> 00:05:06,020
And now we have to see what do we have to change?

67
00:05:06,080 --> 00:05:08,990
Well, this one, we gave it a same name so we can leave it.

68
00:05:09,440 --> 00:05:16,970
This one is to time so we can make it a bit more general to just write T starred and T.

69
00:05:16,970 --> 00:05:26,720
And then of course, we have to define these variables, so I will write T start is equal to zero and

70
00:05:26,720 --> 00:05:29,140
T and is equal to 100.

71
00:05:30,020 --> 00:05:34,160
And then we can do the same thing here t start and T end.

72
00:05:35,540 --> 00:05:37,700
And this would be here and the number of points.

73
00:05:37,700 --> 00:05:40,250
And I would say, let's just increase the number of points a bit.

74
00:05:40,970 --> 00:05:44,990
And then the only thing that we have to change is these two entries.

75
00:05:45,830 --> 00:05:48,920
So this one, no, sorry, only only this one.

76
00:05:49,760 --> 00:05:52,460
And this would be the starting conditions.

77
00:05:53,240 --> 00:05:59,900
So we must now specify four different starting conditions for the X, Y, X and Y.

78
00:06:01,070 --> 00:06:13,640
So I will write down like this x zero y zero v x zero and revise zero.

79
00:06:14,360 --> 00:06:17,040
So you see, I just said it in the wrong order.

80
00:06:17,060 --> 00:06:18,770
This is the correct order that we want to do.

81
00:06:19,910 --> 00:06:20,360
All right.

82
00:06:20,600 --> 00:06:23,870
And now we must, of course, specify some values.

83
00:06:24,380 --> 00:06:32,480
So just for simplicity, I would say let's use maybe not zero in all cases, because if if we set it

84
00:06:32,480 --> 00:06:37,340
to zero, then we are just in the minimum of two potential and then nothing will happen.

85
00:06:38,510 --> 00:06:40,370
But for the velocities, we can say OK.

86
00:06:40,610 --> 00:06:45,770
At the time of zero, we will start in a stationary state where the velocity is zero.

87
00:06:46,100 --> 00:06:47,090
So just like this?

88
00:06:48,500 --> 00:06:48,930
All right.

89
00:06:48,950 --> 00:06:56,210
So we run this and we add a new cell and can plot our results so I can just copy this once again from

90
00:06:56,210 --> 00:06:56,630
above.

91
00:06:57,230 --> 00:06:58,760
So just this one.

92
00:07:01,220 --> 00:07:15,020
And now we have here our time T and here we have poor coordinates X and Y, and what we want to plot

93
00:07:15,020 --> 00:07:21,080
now is the zero component of why this is correct.

94
00:07:21,530 --> 00:07:24,680
So this would be corresponding to X.

95
00:07:25,340 --> 00:07:32,540
So here you have to be a bit careful because the way this, this, this command here is programmed is

96
00:07:32,540 --> 00:07:39,410
that it gives you as an output the time the times, which is indicated by Dot T, and it gives you also

97
00:07:39,410 --> 00:07:42,290
the coordinates, which is indicated by Dot Y.

98
00:07:42,740 --> 00:07:46,040
And it doesn't matter what you call these variables here.

99
00:07:46,370 --> 00:07:52,520
It will always be told y so dot y and then zero in these brackets corresponds to this one.

100
00:07:53,630 --> 00:07:54,080
All right.

101
00:07:54,590 --> 00:07:57,110
So this is good, I think.

102
00:07:57,590 --> 00:08:04,790
And now we can add also the Y coordinate, which would be here one and we give it a different color.

103
00:08:06,710 --> 00:08:15,980
And you can see we have now some nicely oscillating behavior for the accent and for the week on oh,

104
00:08:15,980 --> 00:08:17,900
sorry, sorry, I did the mistake.

105
00:08:18,410 --> 00:08:22,520
I was just wondering why does it look so similar to our previous example?

106
00:08:22,760 --> 00:08:28,130
And the reason is, of course, that we are plotting here the previous result, which was quite solution,

107
00:08:28,130 --> 00:08:32,840
underscore Aki 45, and our new solution is just solution.

108
00:08:33,710 --> 00:08:36,380
So, yeah, let's delete this very quickly.

109
00:08:36,380 --> 00:08:39,799
And you know, I get a mistake error.

110
00:08:39,950 --> 00:08:43,429
So here the same thing, of course.

111
00:08:44,960 --> 00:08:46,520
And now finally, we have it.

112
00:08:48,470 --> 00:08:48,940
All right.

113
00:08:48,950 --> 00:08:55,310
So we have now our dependence of the X coordinate, which would be a threat.

114
00:08:55,640 --> 00:08:59,510
And you see this stays at zero the whole time.

115
00:09:00,260 --> 00:09:05,900
And then for the Y coordinate, you have the blue curve, which is oscillating and it's a damped oscillation.

116
00:09:07,040 --> 00:09:12,590
And this makes sense because for the X coordinate, we are already at the equilibrium position.

117
00:09:13,010 --> 00:09:16,550
So there isn't any oscillation happening here.

118
00:09:17,120 --> 00:09:18,590
So we need to make this a bit more clear.

119
00:09:18,590 --> 00:09:21,020
Let's plot the trajectory.

120
00:09:22,550 --> 00:09:26,420
So here I have to basically plot.

121
00:09:27,590 --> 00:09:29,480
Maybe let's just copy this one.

122
00:09:29,900 --> 00:09:33,170
I have to plot the X versus the Y coordinates.

123
00:09:33,650 --> 00:09:41,060
So like this and you see it just goes from bottom to top.

124
00:09:42,020 --> 00:09:45,430
So it would be, of course, good to add to your circle.

125
00:09:45,920 --> 00:09:48,770
And yeah, I have this already.

126
00:09:48,770 --> 00:09:53,810
So let me copy this so that we don't lose too much time in this lecture because by now, you have practiced

127
00:09:53,810 --> 00:09:54,680
as a whole lot.

128
00:09:55,400 --> 00:10:00,350
So you see, if I write the right here, this is the same as we had before than we have.

129
00:10:00,350 --> 00:10:02,660
Here are label X and Y.

130
00:10:03,110 --> 00:10:06,290
We have here the aspect ratio that is set to one.

131
00:10:06,740 --> 00:10:11,150
And here we have some parameter T that goes from zero to two pi.

132
00:10:11,180 --> 00:10:17,330
And when we calculate the cosine and assign for X and Y, we get a circle and radius.

133
00:10:17,330 --> 00:10:20,030
I have chosen to be equal to three.

134
00:10:20,210 --> 00:10:23,550
And here it plots the circle, which I can make blue.

135
00:10:25,640 --> 00:10:31,250
And then I run it and you see here, this is our circle, which should indicate indicate to the bobble

136
00:10:31,250 --> 00:10:32,600
in some, in some sense.

137
00:10:32,840 --> 00:10:35,960
So it's an extra potential line of bull.

138
00:10:36,170 --> 00:10:44,090
And here we have our trajectory and now of a change to starting conditions, for example, to this one

139
00:10:45,020 --> 00:10:45,920
and run it again.

140
00:10:47,150 --> 00:10:49,580
And you see X and Y are now on top of each other.

141
00:10:50,150 --> 00:10:54,320
And it oscillates now along this diagonal.

142
00:10:55,160 --> 00:11:00,590
And of course, I could also do something like this zero point five.

143
00:11:01,640 --> 00:11:08,360
And you see here, the two coordinates are always independent of each other, and we have this nice

144
00:11:09,440 --> 00:11:10,250
oscillation.

145
00:11:10,520 --> 00:11:17,450
So when you think of it in a physical example, so when you take a wall, put it in a bowl at a different

146
00:11:17,450 --> 00:11:24,260
position than the energetic minimums or the middle, then the the ball will just roll back and forth

147
00:11:24,260 --> 00:11:29,720
back and forth on the same trajectory until it remains stationary in the middle.

148
00:11:31,130 --> 00:11:31,520
All right.

149
00:11:31,520 --> 00:11:37,100
So I think that was pretty good because now we have learned how to solve such a two-dimensional example.

150
00:11:37,100 --> 00:11:43,550
And to be honest, it was nothing new at all because we used the same method that we used before.

151
00:11:43,880 --> 00:11:46,340
You see these two commands I wouldn't really have to do.

152
00:11:46,340 --> 00:11:51,350
I could have just written here, for example, of V X two.

153
00:11:51,830 --> 00:11:53,360
And here we x.

154
00:11:53,720 --> 00:11:58,490
I'm sorry, not be x our two and our three.

155
00:11:59,060 --> 00:12:04,820
And then this would have been exactly the same as we did here where we wrote Theta one.

156
00:12:06,110 --> 00:12:06,500
OK.

157
00:12:06,680 --> 00:12:13,580
So you see, in terms of the commands and in terms of the mathematics is really nothing new.

158
00:12:13,820 --> 00:12:20,180
It's just that now we have really described a two dimensional physical system and you see that when

159
00:12:20,180 --> 00:12:25,580
we choose the accent, we y to be zero, then we always get this linear trajectory.

160
00:12:26,180 --> 00:12:29,450
And on the following, we will play a bit more with the starting conditions.

161
00:12:29,450 --> 00:12:34,640
And also we will add some external forces and see what happens now to the trajectory.

