﻿1
00:00:00,360 --> 00:00:01,340
‫Welcome back.

2
00:00:02,290 --> 00:00:10,110
‫And so this is your time sample line, and at zero, you have your present state a zero.

3
00:00:10,840 --> 00:00:13,840
‫Like I said, you don't predict that, you already know it.

4
00:00:14,620 --> 00:00:20,000
‫And then using this formula, you can predict your future state.

5
00:00:20,860 --> 00:00:28,510
‫For example, if you predict X one, then you will predict what the state will be in zero point one

6
00:00:28,510 --> 00:00:29,320
‫second.

7
00:00:30,100 --> 00:00:39,820
‫And then using the same formula, you can also predict your state at to your state at three and your

8
00:00:39,820 --> 00:00:42,000
‫state at four.

9
00:00:42,220 --> 00:00:45,940
‫And you don't need to do more because your horizon period is four.

10
00:00:45,940 --> 00:00:53,950
‫So your last predicted state would be X of four, so this one would be zero point two seconds into the

11
00:00:53,950 --> 00:00:54,500
‫future.

12
00:00:54,520 --> 00:00:59,260
‫This one zero point three seconds into the future and this one zero point four seconds into the future.

13
00:00:59,890 --> 00:01:07,960
‫So let's say that if you want to compute X for this predicted state zero point four seconds into the

14
00:01:07,960 --> 00:01:11,770
‫future, then the formula for that would look like this.

15
00:01:12,580 --> 00:01:17,440
‫You OK in this formula would be K equals four.

16
00:01:18,280 --> 00:01:23,900
‫So X are for equals then A to the power of four.

17
00:01:24,700 --> 00:01:33,580
‫So it's like multiplying for a matrices like this then that you multiply by your present state.

18
00:01:34,420 --> 00:01:39,850
‫And then in this vector you have first of all, this term A to the power of K minus one.

19
00:01:39,850 --> 00:01:43,990
‫So that would be a to the power of four minus one.

20
00:01:43,990 --> 00:01:47,590
‫That would be three then times the B matrix.

21
00:01:48,260 --> 00:01:54,220
‫And here you would have A to the power of two because K minus two, four, minus two, that would give

22
00:01:54,220 --> 00:02:03,540
‫you two times B, then here you would have A, B, so K minus three, four, minus three equals one.

23
00:02:03,550 --> 00:02:09,640
‫So you would have like one year and then finally you would have B here.

24
00:02:10,120 --> 00:02:16,840
‫Well actually you have A here but then you would have zero here because K minus four would be four,

25
00:02:16,840 --> 00:02:22,780
‫minus four which is zero and then eight to the power of zero would be one.

26
00:02:23,260 --> 00:02:30,220
‫So you can just say that it's one and then here you would have your control input at zero.

27
00:02:30,970 --> 00:02:40,210
‫This one here, then this one here will go here, then use up two would be this one and finally use

28
00:02:40,210 --> 00:02:44,500
‫up three would be this one here.

29
00:02:45,340 --> 00:02:54,990
‫And that was the way to directly compute except for without computing except one except two and except

30
00:02:55,030 --> 00:02:56,350
‫three first.

31
00:02:57,040 --> 00:03:03,690
‫And so if you write it out this entire formula, then it will look like this.

32
00:03:04,660 --> 00:03:07,720
‫And so the state vectors here are the following.

33
00:03:07,720 --> 00:03:09,730
‫This one is like this.

34
00:03:10,540 --> 00:03:19,180
‫So five zero five zero three zero zero zero and besides zero, that's how it looks like.

35
00:03:19,630 --> 00:03:24,010
‫And then this state vector looks like this.

36
00:03:24,970 --> 00:03:26,020
‫That's how it looks like.

37
00:03:26,020 --> 00:03:30,580
‫And of course, both of them, they are transposed because they are column vectors.

38
00:03:31,420 --> 00:03:36,280
‫And so that is what you predict them to be in zero point four seconds.

39
00:03:36,850 --> 00:03:39,100
‫Now, remember, this is a prediction.

40
00:03:39,400 --> 00:03:44,350
‫Your model does not take everything in the world into account.

41
00:03:44,810 --> 00:03:55,420
‫You USV will have true states at that time and those true states will be slightly different than these

42
00:03:55,420 --> 00:03:56,830
‫predicted states.

43
00:03:57,610 --> 00:04:01,390
‫And then your control input vectors will be the following.

44
00:04:01,750 --> 00:04:04,970
‫So you really know that this is your use of zero.

45
00:04:04,990 --> 00:04:08,530
‫It looks like this you one looks like this.

46
00:04:09,720 --> 00:04:17,970
‫You looks like this and then you three looks like this, and again, they're all com vectors.

47
00:04:18,720 --> 00:04:28,640
‫And again, to reiterate the A and B matrix, here they are, the discrete ones, OK?

48
00:04:28,650 --> 00:04:32,140
‫They're the ace D and B, the matrices.

49
00:04:32,700 --> 00:04:45,150
‫However, now we would like to compute the predicted X one, x two, x three and X four.

50
00:04:45,990 --> 00:04:54,540
‫We would like to compute these predicted states in one go and for that we created a more compact way

51
00:04:54,540 --> 00:04:56,780
‫to do it like this.

52
00:04:57,000 --> 00:05:01,140
‫This is a screenshot from the autonomous vehicle course.

53
00:05:02,010 --> 00:05:10,320
‫And you can see that here when you put your equations in this form, then you can compute all your predicted

54
00:05:10,320 --> 00:05:18,870
‫states in our case from one to four in one go for as long as you have your control inputs from zero

55
00:05:18,870 --> 00:05:20,220
‫to will.

56
00:05:20,220 --> 00:05:23,880
‫In our case, it was from zero to three and four.

57
00:05:23,880 --> 00:05:30,510
‫As long as you have your present state, then you can compute your predicted states in one go.

58
00:05:31,380 --> 00:05:40,170
‫And so we can do the same thing with the oveI, if that's the equation in order to predict your X1 x2.

59
00:05:41,170 --> 00:05:48,820
‫X three and finally X four, and we don't need more because our Horizon period was for.

60
00:05:50,030 --> 00:05:55,730
‫Then you can rewrite these equations in this form here.

61
00:05:56,790 --> 00:06:02,250
‫So if you write out these equations, then you will get the white ones here.

62
00:06:02,310 --> 00:06:06,010
‫It's exactly the same thing, only in a different format.

63
00:06:06,780 --> 00:06:10,600
‫And remember these A's and B's here they are sub matrices.

64
00:06:10,620 --> 00:06:13,380
‫So this is one huge matrix.

65
00:06:13,650 --> 00:06:16,830
‫And inside this huge matrix, you have sub matrices.

66
00:06:17,490 --> 00:06:28,140
‫So this is a sub matrix is a six by six sub matrix, and this B is a six by three sub matrix.

67
00:06:28,920 --> 00:06:34,890
‫That means that this entire thing here, it would be six times four.

68
00:06:35,040 --> 00:06:40,970
‫So that would be twenty four by six.

69
00:06:42,120 --> 00:06:54,120
‫And this huge matrix here, it would be twenty four by twelve, so twenty four rows and twelve columns

70
00:06:54,660 --> 00:07:03,930
‫because once sub matrix has six rows and three columns and here you have six rows and six columns and

71
00:07:03,930 --> 00:07:06,570
‫the number of columns does not expand.

72
00:07:06,630 --> 00:07:10,480
‫However the number of rows does expand.

73
00:07:10,590 --> 00:07:14,820
‫So twenty four rows by six columns.

74
00:07:15,600 --> 00:07:16,950
‫And one final thing.

75
00:07:17,760 --> 00:07:26,610
‫In our case you cannot have a predicted state that is larger than except for you cannot have X of five

76
00:07:27,480 --> 00:07:33,390
‫because remember then after X of four, you will already have a new outer loop.

77
00:07:33,840 --> 00:07:38,550
‫So the feedback lionization controller will give you a new target to chase.

