﻿1
00:00:00,450 --> 00:00:01,200
‫Welcome back.

2
00:00:01,620 --> 00:00:08,770
‫So let's solve this exercise now, the task was to put these equations into this vector matrix form.

3
00:00:09,210 --> 00:00:12,860
‫And so let's first take this first role.

4
00:00:13,500 --> 00:00:18,030
‫So you have your X plus one, which is this one here.

5
00:00:18,630 --> 00:00:21,620
‫Your X up key would be here.

6
00:00:22,230 --> 00:00:29,800
‫Use of K minus one would be here and then Delta use up K, it would be here.

7
00:00:30,600 --> 00:00:35,750
‫So that means that this a here it will go here.

8
00:00:36,600 --> 00:00:43,680
‫This B here it will go here and the same B which is here, it will also go here.

9
00:00:44,550 --> 00:00:53,910
‫And now we take the second equation, USB key which is here use K minus one, that's this one here.

10
00:00:54,180 --> 00:00:57,570
‫And Delta use up K, that's this one here.

11
00:00:58,290 --> 00:01:09,150
‫Note that use of K is a three by one vector, three rows, one column and the same thing is this one

12
00:01:09,540 --> 00:01:12,930
‫use of K minus one three by one vector.

13
00:01:13,800 --> 00:01:20,700
‫The state vector is of course six by one because we had six states, this one as well.

14
00:01:21,580 --> 00:01:34,140
‫That means that this a matrix, it's six by six and this B matrix is six by three because you would

15
00:01:34,140 --> 00:01:38,820
‫multiply this B by this three by one vector.

16
00:01:39,880 --> 00:01:47,440
‫That means what you have here is an identity matrix, which in the scalar world would be one, and since

17
00:01:47,470 --> 00:01:53,710
‫this is three by one and this is three by one, that means that your identity matrix would be a three

18
00:01:53,710 --> 00:01:59,320
‫by three identity matrix because you would multiply it.

19
00:02:00,160 --> 00:02:02,890
‫This one here, that's your identity matrix.

20
00:02:03,550 --> 00:02:10,120
‫You would multiply by this vector, which is this one here and the same thing here.

21
00:02:10,120 --> 00:02:12,450
‫You also have an identity matrix here.

22
00:02:13,390 --> 00:02:22,510
‫That means that you have a three by three identity matrix as the second element in this global matrix.

23
00:02:23,120 --> 00:02:27,190
‫It's like a sub matrix within a big global matrix.

24
00:02:28,090 --> 00:02:38,500
‫And well, since you have three roles in this vector, in this use of K vector, but this a matrix has

25
00:02:38,500 --> 00:02:46,770
‫six columns, then that means that you will have a zero matrix here with three rows and six columns.

26
00:02:47,710 --> 00:02:49,200
‫And now what about the output?

27
00:02:49,450 --> 00:02:59,080
‫Remember that you have six states and then out of those six states you would select three outputs and

28
00:02:59,080 --> 00:03:02,560
‫you would do that with a C matrix.

29
00:03:04,180 --> 00:03:11,200
‫So you would have to multiply the C matrix by your state vector, which is here.

30
00:03:12,070 --> 00:03:19,320
‫And since you have three outputs and six states, then the C matrix will be three by six.

31
00:03:20,290 --> 00:03:24,320
‫So this three by six C matrix will come here.

32
00:03:25,150 --> 00:03:30,490
‫Now you have three outputs and then three control inputs.

33
00:03:31,270 --> 00:03:35,620
‫That means that you will have a three by three zero matrix.

34
00:03:36,470 --> 00:03:41,520
‫And when it comes to your output, then there is no contribution from this vector here.

35
00:03:42,250 --> 00:03:47,260
‫So three outputs and then three delta use.

36
00:03:47,770 --> 00:03:51,220
‫That means that you will have a three by three.

37
00:03:52,220 --> 00:04:01,520
‫Zero matrix, in other words, you can just ignore this term, we would call this Matrix D still there,

38
00:04:02,270 --> 00:04:06,680
‫but you can ignore it, but you cannot ignore other matrices.

39
00:04:07,670 --> 00:04:12,320
‫This global matrix here, we call it a tilde.

40
00:04:13,040 --> 00:04:15,130
‫It's an augmented a matrix.

41
00:04:15,980 --> 00:04:19,460
‫This is beating the Yog, meant to be matrix.

42
00:04:20,390 --> 00:04:24,310
‫And this is C Tilde, the augmented C matrix.

43
00:04:25,310 --> 00:04:31,210
‫This here would be your augmented presence state vector.

44
00:04:32,210 --> 00:04:37,220
‫This would be your augmented state vector.

45
00:04:37,220 --> 00:04:43,640
‫But the zero point one seconds in the future, the new augmented state vector.

46
00:04:44,450 --> 00:04:48,140
‫Again, this is the augmented presence state vector.

47
00:04:49,070 --> 00:04:53,030
‫And so this form here, it's equivalent to this form here.

48
00:04:53,360 --> 00:04:56,830
‫We have simply put it in the vector matrix form.

49
00:04:57,470 --> 00:05:07,020
‫So, you know, the dimensions of the sub matrices, A, B, C, the identity matrix and also sub vectors.

50
00:05:07,040 --> 00:05:16,400
‫So you had a six by one state vector and then a three by one control input vector and then also a three

51
00:05:16,400 --> 00:05:20,590
‫by one, the increment of the control input vector.

52
00:05:21,560 --> 00:05:26,570
‫But the dimensions of the augmented vectors and matrices are the following.

53
00:05:27,470 --> 00:05:33,150
‫This one here now has nine rows and one column.

54
00:05:33,170 --> 00:05:38,510
‫So it's this one, the same thing for this thing.

55
00:05:39,350 --> 00:05:43,340
‫The augmented state vector has nine rows in one column.

56
00:05:43,730 --> 00:05:46,820
‫Now, the output, of course, was three by one.

57
00:05:47,690 --> 00:05:54,230
‫Now, since you have nine rows in one column here and nine rows in one column here, then this a there,

58
00:05:54,230 --> 00:05:58,190
‫it will be a nine by nine matrix.

59
00:05:58,940 --> 00:06:03,900
‫And you can also see from the sub matrices if you add up their dimensions.

60
00:06:04,790 --> 00:06:11,510
‫Now, since you have three rows in your delta, you vector and then nine rows in your augment a state

61
00:06:11,510 --> 00:06:20,150
‫vector, then that means that your be toolbar is nine by three and then you have three rows in your

62
00:06:20,150 --> 00:06:24,830
‫output vector and then nine rows in your augment a state vector.

63
00:06:24,830 --> 00:06:31,620
‫That means that your Kielder is three by nine, three rows, nine columns.

64
00:06:32,750 --> 00:06:41,560
‫So remember when you see a still there, it means augmented matrices and augmented state vectors.

65
00:06:42,590 --> 00:06:54,590
‫In addition, remember one thing since the Horizon period of our NPC is for your NPC will find a sequence

66
00:06:54,590 --> 00:06:58,000
‫of control inputs that looks like this.

67
00:06:58,820 --> 00:07:00,980
‫That's what your NPC will find.

68
00:07:01,640 --> 00:07:09,860
‫So if we take a random element here just to see how it looks like, then it looks like this delta you

69
00:07:10,010 --> 00:07:22,910
‫to add K plus to Delta U three at K plus two and Delta U for at K plus two.

70
00:07:23,910 --> 00:07:31,140
‫So that's how each element looks like and therefore, since this one is three by one, well, then you

71
00:07:31,140 --> 00:07:37,830
‫know that this entire vector will be 12 by one, 12 rows and one column.

72
00:07:38,580 --> 00:07:49,770
‫However, remember that in each NPC duration, only the first sub vector is considered and the rest

73
00:07:50,280 --> 00:07:51,810
‫is neglected.

74
00:07:52,620 --> 00:07:59,670
‫And also remember that the plant has to receive the real control inputs, not its increments.

75
00:08:00,570 --> 00:08:06,800
‫So it has to receive use up key and not Delta use up.

76
00:08:07,800 --> 00:08:09,510
‫That's not what the plant wants.

77
00:08:09,780 --> 00:08:15,360
‫The plant wants this, but you can achieve that very easily with this operation.

78
00:08:16,140 --> 00:08:22,110
‫Use up K equals use up K minus one plus Delta.

79
00:08:22,350 --> 00:08:35,220
‫You sup K or in the vector matrix form it would be like this use of K equals use up K minus one plus.

80
00:08:36,210 --> 00:08:41,790
‫Then you have a matrix here and this is your global control input sequence.

81
00:08:42,120 --> 00:08:43,870
‫It's this one here.

82
00:08:44,730 --> 00:08:52,380
‫So if you want to extract this element here, then you will have an identity matrix here, which is

83
00:08:52,380 --> 00:08:53,340
‫three by three.

84
00:08:54,120 --> 00:08:59,910
‫And then in order to cancel out the other elements, you just need to have zero matrices here.

85
00:09:00,540 --> 00:09:10,440
‫A three by three zero matrix for this one, a three by three zero matrix for this one here, and a three

86
00:09:10,440 --> 00:09:13,990
‫by three zero matrix for this one here.

87
00:09:14,850 --> 00:09:29,040
‫So this term here is this term here and then this entire term here, it would be this term here like

88
00:09:29,040 --> 00:09:29,580
‫this.

89
00:09:30,390 --> 00:09:37,800
‫And then you get this vector and this vector will go into your plant in the vehicle case, your control

90
00:09:37,800 --> 00:09:39,840
‫input was a scalar.

91
00:09:40,110 --> 00:09:45,850
‫So you could do this extraction with a simple roll vector with ones and zeros.

92
00:09:46,650 --> 00:09:48,840
‫So that's how we did it.

93
00:09:48,840 --> 00:09:50,340
‫In the previous course.

94
00:09:50,580 --> 00:09:56,940
‫You didn't have an identity matrix, you just had one and then you had zeros here because these elements

95
00:09:56,940 --> 00:10:02,360
‫here, they were scalars, they were not vectors, they were scalars.

96
00:10:03,240 --> 00:10:03,790
‫All right.

97
00:10:04,200 --> 00:10:09,540
‫So in the next video, we're going to go back to our cost function and we're going to continue working

98
00:10:09,540 --> 00:10:10,050
‫with that.

99
00:10:10,330 --> 00:10:11,220
‫Thank you very much.

