1
00:00:00,060 --> 00:00:00,660
Welcome back.

2
00:00:00,760 --> 00:00:08,910
And now we will continue our comparison of the results given by Oyler methods compared to the new commands

3
00:00:09,900 --> 00:00:15,090
IVP that is provided by Python or more precisely by Typekit.

4
00:00:16,020 --> 00:00:22,770
So here we will go now to the pendulum and we will consider straight away the most difficult case of

5
00:00:22,770 --> 00:00:29,430
the pendulum for the last one that we had considered previously, which was this jammed and driven pendulum

6
00:00:29,430 --> 00:00:30,720
which gave us this results.

7
00:00:31,030 --> 00:00:37,650
And you can see I just copy the code from this cell and pasted it at the back or at the bottom of our

8
00:00:37,650 --> 00:00:38,130
notebook.

9
00:00:38,640 --> 00:00:39,190
We're on it.

10
00:00:39,240 --> 00:00:43,080
And here we get this result for theta over tea.

11
00:00:44,550 --> 00:00:52,230
Now, for the new result, we of course, have to once again consider this syntax very similar to this

12
00:00:52,230 --> 00:00:52,530
one.

13
00:00:53,040 --> 00:00:55,020
So let me copy this.

14
00:00:57,520 --> 00:01:00,250
These two cells, this one as well.

15
00:01:02,270 --> 00:01:04,640
And let's change them according to our needs.

16
00:01:05,120 --> 00:01:10,220
So our differential equation will be pretty similar to this one.

17
00:01:12,230 --> 00:01:14,160
So we could just copy this here.

18
00:01:16,400 --> 00:01:19,470
But of course, we have to make sure that we make this one correct.

19
00:01:19,550 --> 00:01:30,710
So I write to Peter and then I write C to see the one like because it there's no list with two elements

20
00:01:31,490 --> 00:01:34,280
and this one will be the zero element of SEATO.

21
00:01:35,240 --> 00:01:36,860
And this one we can leave as it is.

22
00:01:36,860 --> 00:01:45,770
And then like previously for the free fall, we have to provide also the other components.

23
00:01:46,820 --> 00:01:47,780
So I write.

24
00:01:49,540 --> 00:01:52,270
Peter, one, come.

25
00:01:53,170 --> 00:02:00,340
So this is really exactly the same way we changed the ordinary differential equation for the fall.

26
00:02:01,570 --> 00:02:06,340
But now we have just adapted to the other differential equation of the pendulum.

27
00:02:07,240 --> 00:02:08,680
So really nothing new here.

28
00:02:09,789 --> 00:02:20,480
Then we need to starting values to zero zero, which was two and three to zero one zero, which was

29
00:02:20,560 --> 00:02:21,100
zero.

30
00:02:23,530 --> 00:02:30,160
And now we just have to change you to values to fit them to our previous calculations.

31
00:02:31,000 --> 00:02:36,430
So if it's zero zero and ft one zero and.

32
00:02:38,290 --> 00:02:39,060
You know what?

33
00:02:39,220 --> 00:02:41,140
What should we use here, maybe?

34
00:02:41,920 --> 00:02:43,440
I think we did it like this.

35
00:02:43,450 --> 00:02:44,200
Let's compare.

36
00:02:44,620 --> 00:02:49,960
Yeah, we are 200 times steps at a total time of 100.

37
00:02:50,020 --> 00:02:52,150
So that's exactly what we have now here.

38
00:02:53,020 --> 00:02:56,260
And I think this should work already.

39
00:02:56,910 --> 00:03:04,840
Now we can just go ahead and change this one to theto and run it.

40
00:03:06,820 --> 00:03:11,830
So it looks pretty confusing at first, but we can just wait here not to connect the dots.

41
00:03:12,310 --> 00:03:13,870
And you see, now it looks much better.

42
00:03:14,650 --> 00:03:22,570
And I will write here that this is supposed to be read and I want to compare it to the previous solution,

43
00:03:23,350 --> 00:03:25,420
which was this one.

44
00:03:27,520 --> 00:03:33,720
So we can just copy this because these solution variables are still, you know, haven't been deleted,

45
00:03:33,730 --> 00:03:36,610
they're still valid, so we can still use them, of course.

46
00:03:37,240 --> 00:03:39,930
And so we can compare the different results.

47
00:03:40,000 --> 00:03:42,250
And so the new results are indirect ones.

48
00:03:42,250 --> 00:03:43,390
The old ones are the blue ones.

49
00:03:44,080 --> 00:03:50,560
And you see in general, it looks pretty similar, but in details they will differ a bit.

50
00:03:51,730 --> 00:03:58,570
And so we have discussed this earlier during a quarter, 45 methods can be pretty much different compared

51
00:03:58,570 --> 00:04:04,150
to the old methods, not only in terms of efficiency, where it is much more efficient and much faster,

52
00:04:04,540 --> 00:04:06,700
but also in terms of accuracy.

53
00:04:07,330 --> 00:04:09,010
And you see this here, for example.

54
00:04:10,030 --> 00:04:17,050
And now for the remaining part, I just want to show you that we can compare different methods and I

55
00:04:17,050 --> 00:04:22,870
just want to show you that they differ a tiny bit and just want to introduce to you to different methods.

56
00:04:23,860 --> 00:04:32,350
So here's what I found on this website where the sniper module integrates thoughts of undescribed is

57
00:04:32,350 --> 00:04:32,940
explained.

58
00:04:33,480 --> 00:04:34,560
There it is written.

59
00:04:34,570 --> 00:04:36,280
That's the optional argument.

60
00:04:36,280 --> 00:04:42,910
Methods can have the following values we have used so far our K five, but there are also other methods

61
00:04:43,240 --> 00:04:45,970
and we will explore them now in the following.

62
00:04:47,230 --> 00:04:55,450
So the good thing is, you're really that we can just use the same syntax as before by writing solution

63
00:04:55,450 --> 00:05:02,110
underscore R.K. 45 and then the integrates of IVP with all the arguments and then the methods.

64
00:05:02,530 --> 00:05:09,400
And the only thing that we have to change now is this one and this one, and we will go through all

65
00:05:09,400 --> 00:05:10,090
these methods.

66
00:05:11,140 --> 00:05:12,610
So I've prepared this already.

67
00:05:12,610 --> 00:05:15,880
So let me just copy this so that we don't lose too much time.

68
00:05:16,480 --> 00:05:22,990
If you want, you can type along and basically just have to copy this five times enough to change these

69
00:05:22,990 --> 00:05:24,220
names and these names.

70
00:05:24,220 --> 00:05:26,350
So it isn't that much of an effort.

71
00:05:27,250 --> 00:05:32,590
And then we can go ahead and there's a problem here.

72
00:05:32,590 --> 00:05:35,110
Oh, this is because I didn't define the Tara.

73
00:05:36,280 --> 00:05:38,890
Tara is basically this one.

74
00:05:42,770 --> 00:05:48,170
So I write to pray like this.

75
00:05:48,520 --> 00:05:49,350
Yeah, now it works.

76
00:05:50,480 --> 00:05:53,750
And now we want to plotz and for the plots.

77
00:05:54,350 --> 00:05:55,610
I will.

78
00:05:57,290 --> 00:05:57,890
Yeah.

79
00:05:57,920 --> 00:05:58,910
How should we do it?

80
00:06:00,350 --> 00:06:07,700
I would say we will compare all these solutions in comparison to the R.K. 45 methods.

81
00:06:08,930 --> 00:06:18,890
So for example, for this solution here of our old methods, I would write solution and then or maybe

82
00:06:18,890 --> 00:06:19,750
let me do it like this.

83
00:06:19,790 --> 00:06:26,720
Sorry, I used the archive 45, and then I will just subtract here the solution

84
00:06:29,690 --> 00:06:30,740
from our old method.

85
00:06:31,880 --> 00:06:35,330
And then you see, this is the difference between the two curves.

86
00:06:36,830 --> 00:06:42,980
I'm not quite sure if this is correct now, but it should be.

87
00:06:42,980 --> 00:06:43,310
Yeah.

88
00:06:43,550 --> 00:06:51,050
So it looks a bit maybe exaggerated at first, but it is really a large, large difference at points.

89
00:06:52,070 --> 00:06:57,620
This is because here, for example, it looks as the difference is pretty small because it only appears

90
00:06:57,620 --> 00:06:58,310
to be shifted.

91
00:06:58,700 --> 00:07:02,930
But for example, this value here corresponds to some value here, for example.

92
00:07:02,930 --> 00:07:05,650
So the difference is really larger than two.

93
00:07:05,660 --> 00:07:08,030
So it's really a gigantic difference.

94
00:07:09,200 --> 00:07:14,570
And now, of course, we can continue and compare this also to the other functions.

95
00:07:15,470 --> 00:07:17,060
And this I have prepared as well.

96
00:07:17,420 --> 00:07:25,730
So basically using the same syntax, we used a solution of the R.K. 45 and subtracted solutions of all

97
00:07:25,730 --> 00:07:27,490
the other methods here.

98
00:07:28,600 --> 00:07:29,330
Going run this.

99
00:07:29,330 --> 00:07:35,570
We get a curve like this where you can see basically only the black curve has a very large differences,

100
00:07:35,570 --> 00:07:37,940
and then the others have pretty small differences.

101
00:07:38,870 --> 00:07:43,380
For example, the blue one seems to have only know of almost no difference.

102
00:07:43,400 --> 00:07:44,600
So this is OK.

103
00:07:45,020 --> 00:07:45,800
23.

104
00:07:47,300 --> 00:07:52,700
So it means that our whole our method that we have programmed ourselves to are the method seems to be

105
00:07:52,700 --> 00:07:58,400
the first method of all because it is the only one that really is different to all the other methods.

106
00:07:58,410 --> 00:08:00,110
So, yeah, bad news.

107
00:08:00,110 --> 00:08:06,230
Our our own method is the worst, unfortunately, but this was pretty clear and was expected because

108
00:08:06,710 --> 00:08:08,300
it's also the most simple one.

109
00:08:10,370 --> 00:08:19,850
So in the following, I will just copy these all of these actually, and I will just change the plot

110
00:08:19,850 --> 00:08:20,480
range a bit.

111
00:08:22,340 --> 00:08:25,220
So Peel T Dot X.

112
00:08:26,870 --> 00:08:30,590
And we could go from zero to 22 of this range here.

113
00:08:30,590 --> 00:08:39,830
And then for the Y range we go from, yeah, we have to zoom in here a bit, maybe minus zero point

114
00:08:39,830 --> 00:08:42,650
one to zero point one.

115
00:08:45,110 --> 00:08:47,630
And also, we know that the black curve is gigantic.

116
00:08:47,630 --> 00:08:49,970
So let's just look plotted here.

117
00:08:51,200 --> 00:08:52,120
Yeah, so that's it.

118
00:08:52,130 --> 00:08:56,210
So now we can pretty much see how the different methods compare to each other.

119
00:08:56,870 --> 00:09:03,470
So overall, I can't really see what's the correct method to use, and probably the correct solution

120
00:09:03,470 --> 00:09:07,040
is even difference to these that are suggested here.

121
00:09:08,090 --> 00:09:11,750
But the point is that all of these methods are pretty close to each other.

122
00:09:13,010 --> 00:09:18,780
And the only difference you see is that the R.K. 23 is pretty close to the arcade.

123
00:09:18,860 --> 00:09:21,530
Forty five, it's has the slowest deviation.

124
00:09:22,790 --> 00:09:28,370
So that's of course, because they are they belong to the same family of methods.

125
00:09:28,910 --> 00:09:33,410
So of course, the results will be pretty similar than we have here.

126
00:09:33,410 --> 00:09:40,910
The green and the red one, which art is the top eight, five, three and around all methods, and they

127
00:09:40,910 --> 00:09:41,990
are pretty similar.

128
00:09:42,020 --> 00:09:51,560
And then we have the purple and the yellow one or orange, which are the PDAF and also the which are

129
00:09:51,860 --> 00:09:57,020
themselves pretty similar, but they have the largest deviation from the R.K. methods.

130
00:09:57,980 --> 00:10:03,140
So as I said, it doesn't mean that one of these methods is wrong and the other one is correct.

131
00:10:03,140 --> 00:10:11,150
It just means that you see that overall, they give pretty similar results and we can check this, by

132
00:10:11,150 --> 00:10:13,130
the way, by just.

133
00:10:15,260 --> 00:10:24,050
Plotting this one more time and just plotting here like this so that we don't show difference, but

134
00:10:24,050 --> 00:10:28,220
the actual value and you will see that they are very much the same.

135
00:10:29,480 --> 00:10:34,970
So you see there is almost no difference that can be can be seen here.

136
00:10:35,840 --> 00:10:38,270
Especially important is, of course, the ending.

137
00:10:38,690 --> 00:10:47,210
So we could zoom in here a bit more at the ending parts of 90 to 100 and in the range of the law.

138
00:10:47,390 --> 00:10:47,810
Like this?

139
00:10:47,810 --> 00:10:48,170
Maybe.

140
00:10:49,490 --> 00:10:53,000
And still, you cannot really see that much of a difference.

141
00:10:53,240 --> 00:10:56,750
So overall, it doesn't matter so much which of the methods you use.

142
00:10:57,260 --> 00:11:04,910
But if you want to have the correct result, you should probably use one of these methods that belonged

143
00:11:04,910 --> 00:11:12,260
to the of IBP module, and you should probably not use to oil the method that we have programmed ourselves.

144
00:11:13,220 --> 00:11:20,750
Still, I think it was revolting and useful that we have programmed the oil method ourself because only

145
00:11:20,750 --> 00:11:27,950
in this way we know how to solve such problems and how to program such algorithms and to really understand

146
00:11:27,950 --> 00:11:29,600
what's happening in the background.

147
00:11:30,200 --> 00:11:36,860
And also, we have seen to some extent, especially for the analytical examples like in the beginning

148
00:11:36,860 --> 00:11:41,000
here, for example, this one was at a time of amplified decay.

149
00:11:41,630 --> 00:11:46,970
We could really restore the analytical solution, and the old method wasn't so bad, after all.

