﻿1
00:00:00,660 --> 00:00:08,220
‫So to be honest with you, the difference between the oilor and wrong Akutan method is not that big.

2
00:00:09,440 --> 00:00:18,290
‫This is your oilor method, and this X is just a random state, and note that now I didn't put an end

3
00:00:18,290 --> 00:00:19,910
‫here, I don't have an end here.

4
00:00:20,360 --> 00:00:26,300
‫So that means that I'm not chopping this sample time interval into multiple pieces.

5
00:00:27,430 --> 00:00:38,530
‫And so this ex dot sub, kay, that's your state time derivative, that's your Delta X over Tietz.

6
00:00:39,500 --> 00:00:43,310
‫And you know what, this slope here.

7
00:00:44,410 --> 00:00:49,520
‫It's the only difference between the oilor and the cuter method.

8
00:00:49,840 --> 00:00:51,010
‫The only difference.

9
00:00:52,190 --> 00:00:55,280
‫This is the only place where the difference comes in.

10
00:00:56,480 --> 00:01:03,890
‫In the Oilor method, you only have one slope, which is the time derivative of your state when your

11
00:01:03,890 --> 00:01:14,810
‫state is X, OK, so your present state, but in a fourth order, wrong Akutan method, you have four

12
00:01:15,110 --> 00:01:20,180
‫different slopes for different time, derivatives of your states.

13
00:01:21,080 --> 00:01:29,630
‫And the final slope that you will put here is the weighted average of those four slopes.

14
00:01:30,890 --> 00:01:46,580
‫So let's just say that you're for slope's are X dots up, K sub one, then X dot stuff K sub to X.com

15
00:01:46,580 --> 00:01:54,560
‫case sub three and X dots up, case up for these are your four slope's.

16
00:01:55,580 --> 00:01:58,310
‫And don't worry, you will see how to get them.

17
00:01:59,390 --> 00:02:06,560
‫But assuming that, you know, you're for Slope's, you will compute their weighted average like this.

18
00:02:07,900 --> 00:02:18,130
‫So your weighted average slope, let's call it just X dots up K and W A. which stands for a weighted

19
00:02:18,130 --> 00:02:21,700
‫average, and then the formula is like this.

20
00:02:22,750 --> 00:02:28,330
‫One sixth time's the first slope plus.

21
00:02:29,610 --> 00:02:32,400
‫Two times the second slope plus.

22
00:02:33,500 --> 00:02:36,590
‫Two times the third slope and plus.

23
00:02:37,750 --> 00:02:40,690
‫The fourth slope like this.

24
00:02:41,740 --> 00:02:47,270
‫And of course, if you open up your parenthesis, then you will have this equation like this.

25
00:02:48,550 --> 00:02:56,050
‫And so these numbers in front of the slopes, they are the weights.

26
00:02:57,190 --> 00:03:04,090
‫And you can see that the second slope and the third slope, they have bigger weights and that means

27
00:03:04,090 --> 00:03:12,430
‫that they have stronger influence over the final answer that you will get when you compare your weighted

28
00:03:12,430 --> 00:03:17,150
‫average slope and apply it in this formula here.

29
00:03:18,250 --> 00:03:27,160
‫And so the first and the fourth slope, because of their smaller weights, they influence the final

30
00:03:27,160 --> 00:03:28,420
‫result less.

31
00:03:29,620 --> 00:03:37,540
‫And also it makes sense that you have six in the denominator here, because when you add up all the

32
00:03:37,540 --> 00:03:39,880
‫weights, then you have to get one.

33
00:03:40,780 --> 00:03:50,330
‫So it's like one sixth plus two sixth plus two sixth plus one sixth and all that equals one.

34
00:03:51,370 --> 00:03:53,770
‫So your weights, they have to be normalized.

35
00:03:53,770 --> 00:03:55,460
‫They have to be like a percentage.

36
00:03:56,410 --> 00:04:04,630
‫Now, if you're curious about why the weights are exactly like that, I assume that they were deduced

37
00:04:04,930 --> 00:04:10,120
‫through experimentation that two German mathematicians.

38
00:04:11,420 --> 00:04:20,360
‫Carl Runga and Martin Kutta, when they develop these methods, perhaps they tested it with different

39
00:04:20,360 --> 00:04:30,750
‫weights and decided that the weights which you see here, are very good for the four different slopes.

40
00:04:31,100 --> 00:04:32,840
‫However, that's just my opinion.

41
00:04:33,110 --> 00:04:34,610
‫I haven't researched that.

42
00:04:34,610 --> 00:04:35,210
‫Exactly.

43
00:04:36,290 --> 00:04:43,760
‫But what I can tell you is this, again, we have our state time, Grauwe.

44
00:04:44,980 --> 00:04:53,470
‫And our first slope is equivalent to the one that we had when we used the Oiler method at time equals

45
00:04:54,040 --> 00:04:55,150
‫30 seconds.

46
00:04:55,490 --> 00:04:56,650
‫So right here.

47
00:04:57,930 --> 00:05:05,820
‫So, in fact, the first slope that you have here is the same slope that you had in the Oiler method

48
00:05:06,030 --> 00:05:06,990
‫is just wrong.

49
00:05:06,990 --> 00:05:10,080
‫Akutan method, you will have three more slopes.

50
00:05:11,260 --> 00:05:22,000
‫So this first slope is calculated in this point at K. at time equals T. Then the second and third slope

51
00:05:22,840 --> 00:05:28,720
‫they are computed at time T plus T.

52
00:05:28,720 --> 00:05:30,820
‫S over to.

53
00:05:31,740 --> 00:05:42,180
‫So this point here would be t plus tips, and so both the second and the third slope, both of them,

54
00:05:42,660 --> 00:05:47,700
‫they are computed in the middle of your sample time interval here.

55
00:05:48,780 --> 00:05:55,440
‫And then the fourth slope is computed at time T plus two seconds.

56
00:05:56,870 --> 00:06:05,330
‫So if you look at these four weights, then I guess in order to accurately predict the new true state.

57
00:06:06,370 --> 00:06:14,230
‫It's more important to consider what's happening in the middle of your sample time interval than on

58
00:06:14,230 --> 00:06:15,100
‫the edges.

59
00:06:16,310 --> 00:06:24,260
‫So that's why I guess the second and then the third slope have bigger weights in order to assign more

60
00:06:24,260 --> 00:06:25,380
‫importance to them.

61
00:06:26,510 --> 00:06:35,030
‫And so once you have your weighted average slope, this one here, you compute the new state in the

62
00:06:35,030 --> 00:06:44,420
‫same way like in the Euler case, meaning that this thing here, it will go into this thing here.

63
00:06:45,560 --> 00:06:46,800
‫So that's the difference.

64
00:06:47,150 --> 00:06:53,750
‫Now you just use a weighted average slope that consists of four different slopes.

65
00:06:54,780 --> 00:07:03,630
‫And so if you want to, you can also rewrite this method like this and note this red part, that's your

66
00:07:03,630 --> 00:07:04,980
‫weighted average slope.

67
00:07:06,090 --> 00:07:17,040
‫And that's the difference between Guta and the Oiler method, not that I did not divide the time interval

68
00:07:17,280 --> 00:07:24,870
‫into different sub intervals, that means that I can get useful results with less iterations.

69
00:07:25,620 --> 00:07:40,080
‫Also, note that when I write X up K and X up K plus one in our context, the K and K plus one, they

70
00:07:40,080 --> 00:07:41,730
‫do not represent time here.

71
00:07:42,240 --> 00:07:48,020
‫They just represent the state now and the next state.

72
00:07:49,020 --> 00:08:00,060
‫So in the Euler case, the state now was up K and then the next state except K plus one.

73
00:08:01,350 --> 00:08:10,780
‫Was at time T plus T as over nd that's when we chopped the T into several pieces.

74
00:08:12,030 --> 00:08:21,630
‫So let's say if you're T equals zero point one seconds and then you're N equals five, then that means

75
00:08:21,630 --> 00:08:29,280
‫that your true interval after which you're going to compute a new state, you're going to compute a

76
00:08:29,280 --> 00:08:32,280
‫new state after zero point zero two seconds.

77
00:08:33,500 --> 00:08:45,260
‫So when you use this approach, then your subindex K means your state now and your subindex K plus one

78
00:08:45,710 --> 00:08:51,020
‫means your state zero point zero two seconds later.

79
00:08:52,220 --> 00:09:00,260
‫But now in our Runga Kutta scenario, since we are not shopping our teams into multiple pieces.

80
00:09:01,390 --> 00:09:11,080
‫The now ex up K still means the state now, so the present state, but in our wrong Akutan scenario,

81
00:09:11,080 --> 00:09:19,210
‫except K plus one now means a new state at a time plus T.

82
00:09:19,330 --> 00:09:28,720
‫S or zero point one seconds later, not zero point zero two seconds later, zero point one seconds later.

83
00:09:30,050 --> 00:09:38,480
‫So the subindices, Kate and Kate, plus one, they are not for time, they are just to tell you what's

84
00:09:38,480 --> 00:09:45,540
‫now, what's present and what's the next state, no matter what time interval you choose.

85
00:09:46,580 --> 00:09:54,020
‫And so in the wrong Kakuta scenario, we chose our time interval to be zero point one seconds.

86
00:09:54,890 --> 00:10:04,850
‫But since I use the weighted average slope, I still get precise results even by not cutting the ties

87
00:10:04,850 --> 00:10:06,440
‫into several pieces.

88
00:10:07,620 --> 00:10:15,750
‫And now we are going to use our state's basic equations to show you how exactly this slope calculations

89
00:10:15,750 --> 00:10:19,200
‫happen, because this is what the game will be now.

90
00:10:19,590 --> 00:10:24,130
‫The game will be about finding these four slopes.

91
00:10:24,540 --> 00:10:30,960
‫Well, actually, you already know how to get the first slope is the same one that you had in the earlier

92
00:10:30,960 --> 00:10:31,800
‫method case.

93
00:10:32,220 --> 00:10:36,920
‫But now the game will be about finding the rest of the four slopes.

94
00:10:38,160 --> 00:10:48,020
‫We will go through the entire process from the states at K up until we get to the States at K plus one.

95
00:10:49,140 --> 00:10:55,650
‫And by the way, again, I use the same logic in my code, so.

96
00:10:56,840 --> 00:10:59,510
‫Let's get started on that in the next video.

97
00:11:00,470 --> 00:11:01,460
‫Thank you very much.

