﻿1
00:00:00,430 --> 00:00:01,330
‫Welcome back.

2
00:00:01,720 --> 00:00:08,980
‫But now, if you remember, we could rewrite this vector here like this.

3
00:00:09,760 --> 00:00:13,990
‫But now everything have till date because they are all augmented.

4
00:00:14,350 --> 00:00:18,100
‫So this matrix here was called C Double Bar.

5
00:00:18,670 --> 00:00:25,120
‫And then this one here was called like this a double hat.

6
00:00:25,990 --> 00:00:36,490
‫So be till there, then a till the times b till there, then a till the squared times B till there and

7
00:00:36,490 --> 00:00:40,120
‫then a till the cubed times B till there.

8
00:00:40,810 --> 00:00:44,410
‫They all have dimensions nine by three.

9
00:00:45,160 --> 00:00:55,500
‫That means that C double bar is thirty six by 12 and then a till there and then a till the squared,

10
00:00:55,510 --> 00:00:59,830
‫a tilde cubed and then a tilde to the power of four.

11
00:01:00,790 --> 00:01:03,670
‫They were all nine by nine.

12
00:01:04,510 --> 00:01:15,250
‫So that means that this entire global matrix, a double had it's going to be 36 rows and nine columns.

13
00:01:16,330 --> 00:01:27,160
‫So essentially, you have rewritten this vector here x still the global in terms of augmented presence,

14
00:01:27,160 --> 00:01:35,980
‫state vector, which is this one and the control input increments like these ones here.

15
00:01:36,580 --> 00:01:45,940
‫So you rewrite this vector like this and then this vector transposed, well, it's this one here.

16
00:01:46,600 --> 00:01:57,010
‫And then again, this vector here, you rewrite it like this and remember that this c double bar and

17
00:01:57,010 --> 00:02:00,640
‫a double hat, they use easier assumption.

18
00:02:01,600 --> 00:02:11,590
‫The A Tilde Matrix does not get updated here as we predict future states from K plus one up until K

19
00:02:11,590 --> 00:02:12,430
‫plus four.

20
00:02:13,530 --> 00:02:23,400
‫And by the way, if in the future you have to use this non simplified LP and PC version, then here

21
00:02:23,400 --> 00:02:31,470
‫again, when you augment your system, meaning that you go from U2, you three and you for two Delta,

22
00:02:31,470 --> 00:02:36,030
‫U2, Delta you three and Delta you four.

23
00:02:36,720 --> 00:02:43,260
‫Then of course, in here you will have deltas everywhere like this.

24
00:02:43,980 --> 00:02:51,960
‫So Delta, you zero, delta, you want Delta, you two and Delta you three, and then all your mattresses

25
00:02:51,960 --> 00:03:01,770
‫will be augmented and also all your air mattresses will be augmented, just like we had discussed it

26
00:03:01,770 --> 00:03:02,280
‫here.

27
00:03:02,910 --> 00:03:04,070
‫You see, this is your eighth.

28
00:03:04,110 --> 00:03:06,210
‫Will there be till there?

29
00:03:06,810 --> 00:03:10,530
‫See Tilda and Tilda, you're eight.

30
00:03:10,530 --> 00:03:19,620
‫Till that consists of these discrete A and B matrices and also your zero matrix and then identity matrix.

31
00:03:20,280 --> 00:03:28,770
‫Your B tilde has this discrete B matrix and an identity matrix and then your C tilde.

32
00:03:29,430 --> 00:03:35,940
‫It contains your discrete C matrix and then a zero matrix and then your D tilde.

33
00:03:36,600 --> 00:03:39,510
‫It's just a zero matrix that you can neglect.

34
00:03:40,520 --> 00:03:52,130
‫OK, but now, since your control inputs are delta use and not use, then you might ask how you update

35
00:03:52,130 --> 00:03:55,490
‫your global omega in the matrix.

36
00:03:56,000 --> 00:04:00,830
‫You got your omega zero global from the plant in the previous loop.

37
00:04:01,490 --> 00:04:11,930
‫But remember, you also had to obtain Omega one global omega two global in omega three global that you

38
00:04:11,930 --> 00:04:19,130
‫would put inside your A1 matrices, a two matrices and a three matrices.

39
00:04:19,730 --> 00:04:23,510
‫Just like this one went into your A0 matrix.

40
00:04:24,170 --> 00:04:31,910
‫Well, remember you need it, you one, you two three, and you fought for that.

41
00:04:32,510 --> 00:04:33,700
‫And so you won.

42
00:04:33,710 --> 00:04:35,210
‫That was always the same.

43
00:04:35,840 --> 00:04:44,360
‫It only changed after each outer loop, but during the inner loop iterations you won, that came from

44
00:04:44,360 --> 00:04:47,390
‫your state feedback minimization controller.

45
00:04:48,020 --> 00:04:51,410
‫During the inner loops, it remained unchanged.

46
00:04:51,980 --> 00:05:02,120
‫But in order to get omega one global, you will use to Q3 and Q4 values from this predicted augment

47
00:05:02,120 --> 00:05:05,180
‫the state vector X till the sub one.

48
00:05:05,840 --> 00:05:13,790
‫As you can see, I've also put Tilda's here and also here, where your present state vector is in order

49
00:05:13,790 --> 00:05:16,520
‫to indicate that they are augmented.

50
00:05:17,120 --> 00:05:19,880
‫So remember X still that one?

51
00:05:20,540 --> 00:05:21,920
‫It's this one here.

52
00:05:22,550 --> 00:05:33,020
‫And so your omega one global, it will depend on the unchanged u one and these values here and now in

53
00:05:33,020 --> 00:05:34,680
‫order to get actual.

54
00:05:34,700 --> 00:05:41,960
‫Until then, you will also use this Delta Use Zero, which is the first left over from the previous

55
00:05:41,960 --> 00:05:42,290
‫loop.

56
00:05:42,980 --> 00:05:48,320
‫So in the previous loop, you received this solution from your AMPK controller.

57
00:05:48,950 --> 00:05:51,620
‫You only used this one here.

58
00:05:52,250 --> 00:05:54,620
‫You did not use this one here.

59
00:05:55,220 --> 00:06:00,320
‫And so this was your first left over in the previous loop.

60
00:06:00,890 --> 00:06:08,630
‫But now in this loop, it became Delta U zero, just like this one became Delta U minus one.

61
00:06:09,230 --> 00:06:17,730
‫And so you use this one here for this Delta use zero in order to obtain your ex tilde one.

62
00:06:18,380 --> 00:06:23,060
‫And then from that, you will get these utu you three and you for values.

63
00:06:23,690 --> 00:06:28,970
‫And together with the unchanged u one value, you will get your omega one global.

64
00:06:29,570 --> 00:06:38,030
‫Similarly, in order to get your Omega two global, you will use the unchanged U one value and then

65
00:06:38,030 --> 00:06:41,210
‫you will have ex the two your predicted.

66
00:06:41,210 --> 00:06:46,550
‫AUGMENT the state vector two time steps into the future, and it looks like this.

67
00:06:47,180 --> 00:06:52,080
‫And so you will also use these values together with your unchanged U.

68
00:06:52,100 --> 00:06:59,380
‫One value in order to obtain your omega two global and in order to get your ex still the two.

69
00:07:00,020 --> 00:07:09,110
‫You will also use this variable here, which is your second left over from the previous loop.

70
00:07:09,560 --> 00:07:12,920
‫And so in this loop, it would be Delta U.

71
00:07:12,920 --> 00:07:13,490
‫One.

72
00:07:14,150 --> 00:07:23,150
‫And so this variable, it goes here, and that's how you get your ex tilde to finally, in order to

73
00:07:23,150 --> 00:07:27,110
‫get your omega three global for that, you are going to need it.

74
00:07:27,140 --> 00:07:29,990
‫Still, the three and it looks like this.

75
00:07:30,620 --> 00:07:40,460
‫And so in order to get your omega three global again, you use your unchanged you one value and these

76
00:07:40,460 --> 00:07:44,960
‫values here and also in order to compute your ex.

77
00:07:44,960 --> 00:07:52,400
‫Still, the three for that, you will take your final left over from the previous loop, which was Delta

78
00:07:52,400 --> 00:07:53,300
‫you three there.

79
00:07:53,300 --> 00:07:56,520
‫But now in this loop, it's Delta, you two.

80
00:07:57,200 --> 00:08:04,220
‫And so you take this variable and you put it here where your delta you two is, and that's how you obtained

81
00:08:04,220 --> 00:08:04,790
‫X2.

82
00:08:04,790 --> 00:08:05,330
‫Still the three.

83
00:08:05,900 --> 00:08:18,500
‫And that's where we could stop, because with all that, we could obtain our A0, A1, A2 and A3 matrices

84
00:08:19,070 --> 00:08:21,590
‫for the non simplified NPV method.

85
00:08:22,660 --> 00:08:30,070
‫But the thing is that you don't need to put till this year in order to know whether your mattresses

86
00:08:30,070 --> 00:08:31,420
‫are augmented or not.

87
00:08:31,990 --> 00:08:39,490
‫And that's because when you see in the equations that you have Delta use zero delta, you want Delta,

88
00:08:39,490 --> 00:08:41,710
‫you two and Delta you three.

89
00:08:42,310 --> 00:08:51,070
‫In other words, when you see that you're working with these control inputs and not with these control

90
00:08:51,070 --> 00:08:56,170
‫inputs, then you automatically know that you're a bee.

91
00:08:56,800 --> 00:08:59,500
‫And then also see matrices are augmented.

92
00:09:00,100 --> 00:09:01,840
‫You don't have to put till this year.

93
00:09:02,470 --> 00:09:06,550
‫It's like we did it with this discrete versus continuous version.

94
00:09:07,150 --> 00:09:08,950
‫This was your discrete format.

95
00:09:09,670 --> 00:09:11,740
‫This was your continuous format.

96
00:09:12,340 --> 00:09:18,970
‫When your equations were in this form where you had x dot equals and then everything else.

97
00:09:19,690 --> 00:09:26,020
‫Then you knew that your A and B matrices that they were continuous.

98
00:09:26,650 --> 00:09:33,550
‫But when your equations were in this form, so you had XSET K plus one equals and then here you had

99
00:09:33,640 --> 00:09:45,400
‫exit K and you had K, then you knew that your A and B matrices that they were discrete, they were

100
00:09:45,400 --> 00:09:54,100
‫discrete ties and the relationships between the discrete ties and continues a, b and C matrices.

101
00:09:54,820 --> 00:09:59,800
‫They were derived in the first car course and you can see their relationships here.

102
00:10:00,220 --> 00:10:04,150
‫These could equals all this and this is your continuous.

103
00:10:04,160 --> 00:10:07,270
‫A discrete B equals all this.

104
00:10:07,960 --> 00:10:12,820
‫This is your continuous B and then discrete C equals continuous C.

105
00:10:13,300 --> 00:10:24,460
‫So you did not need to write a D or B D or c d for your discrete matrices because you saw it from the

106
00:10:24,460 --> 00:10:26,020
‫equations you were working with.

107
00:10:26,590 --> 00:10:29,170
‫And the same thing with system augmentation.

108
00:10:29,800 --> 00:10:35,130
‫If your system is in this form, then it's not augment it.

109
00:10:35,710 --> 00:10:39,850
‫But if it's in this form, then it is augmented.

110
00:10:40,420 --> 00:10:40,890
‫Why?

111
00:10:41,620 --> 00:10:47,260
‫Because here you have use up K and here you have delta use of K.

112
00:10:47,890 --> 00:10:52,810
‫So you know that these two a matrices, they are not the same.

113
00:10:53,350 --> 00:10:56,830
‫And you know that these two B matrices, they are not the same.

114
00:10:57,340 --> 00:11:01,930
‫Just like you knew that these two matrices are not the same.

115
00:11:02,560 --> 00:11:07,780
‫And these to be matrices are not the same in the first one.

116
00:11:08,500 --> 00:11:11,140
‫This a is a discrete a matrix.

117
00:11:11,410 --> 00:11:18,220
‫And this b that these could be matrix because your control input is use of K.

118
00:11:18,820 --> 00:11:23,030
‫But in the second equation, your control input is delta.

119
00:11:23,050 --> 00:11:26,260
‫Use of K the change of your control input.

120
00:11:26,860 --> 00:11:29,680
‫That's why you know that this a matrix.

121
00:11:30,340 --> 00:11:32,980
‫It's actually your augmented a matrix.

122
00:11:33,460 --> 00:11:37,330
‫And this matrix, it's your augmented B matrix.

123
00:11:38,050 --> 00:11:45,730
‫But you don't need to put these till this here, because the fact that you have delta use of K here,

124
00:11:46,390 --> 00:11:55,030
‫it already tells you that you're A and B matrices and also your C matrix that they are all augmented.

125
00:11:55,630 --> 00:11:57,850
‫So you don't actually need to put till this year.

126
00:11:58,360 --> 00:12:04,390
‫You know that you are working with an augmented system because you can see deltas here.

127
00:12:04,990 --> 00:12:14,650
‫You know that this guy, this guy and this guy, they are both discrete A, B and C matrices because

128
00:12:14,650 --> 00:12:24,940
‫here you have K plus one K and K, and they are also augmented A, B and C matrices because you have

129
00:12:24,940 --> 00:12:25,840
‫delta here.

130
00:12:27,160 --> 00:12:33,670
‫And next, we will again open up the parenthesis, just like in the previous course.

131
00:12:34,800 --> 00:12:44,040
‫And so if you now have your prime cost function and you open up the parentheses here, then this is

132
00:12:44,040 --> 00:12:45,330
‫what you will get.

133
00:12:45,930 --> 00:12:51,240
‫It's exactly like in the previous course only instead of deltas you have use.

134
00:12:51,720 --> 00:12:55,200
‫But the logic and the procedure is exactly the same.

135
00:12:55,620 --> 00:13:02,160
‫And again, you will have some constant terms that you don't need for optimization purposes.

136
00:13:02,160 --> 00:13:04,690
‫So you can just say that they are zero.

137
00:13:04,710 --> 00:13:06,030
‫You can just lose them.

138
00:13:06,810 --> 00:13:13,710
‫And if you do that, if you lose those constant terms, then you will have a new cost function, a cost

139
00:13:13,710 --> 00:13:15,870
‫function without these constant terms.

140
00:13:16,170 --> 00:13:20,460
‫And we're going to name that J double prime.

141
00:13:21,210 --> 00:13:30,060
‫And then exactly like you did in the previous course, you take this J double prime that you have here,

142
00:13:30,810 --> 00:13:40,770
‫which is this one here and you put it in a form where your control input increments are like that.

143
00:13:41,130 --> 00:13:43,830
‫So you have a control input increment here.

144
00:13:44,160 --> 00:13:50,940
‫And then here you have the same thing, but transposed and then in the middle you have a collection

145
00:13:50,940 --> 00:13:51,930
‫of matrices.

146
00:13:51,960 --> 00:13:55,680
‫If you put them together like this, you will get your h double bar.

147
00:13:56,460 --> 00:14:03,660
‫And then you take the remaining terms and you make sure that your control input increment is here.

148
00:14:04,320 --> 00:14:14,450
‫Your present state vector, which is augmented, is here, then your reference value vector is here.

149
00:14:15,360 --> 00:14:23,640
‫And then in the middle, you will have this collection of matrices that we called f double bar transposed.

150
00:14:24,570 --> 00:14:31,590
‫And the same thing happens for us is just instead of Delta Delta us, you're going to have Delta use.

151
00:14:32,520 --> 00:14:39,810
‫And so that's how your final G double prime cost function looks like.

152
00:14:40,320 --> 00:14:42,420
‫That's its final form.

153
00:14:43,170 --> 00:14:45,990
‫This vector here is 12 by one.

154
00:14:47,040 --> 00:14:50,160
‫This one here is one by 12.

155
00:14:50,790 --> 00:14:57,510
‫That means that you're h double bar is 12 by 12.

156
00:14:58,350 --> 00:15:01,410
‫Then this one is one by nine.

157
00:15:02,130 --> 00:15:06,360
‫This one is one by 12.

158
00:15:07,140 --> 00:15:13,650
‫That means that this entire thing is one by twenty one.

159
00:15:14,550 --> 00:15:18,300
‫This one is twelve by one.

160
00:15:18,570 --> 00:15:24,690
‫That means that this one is twenty one by twelve.

161
00:15:25,410 --> 00:15:36,030
‫That means that this entire thing here will be one by one because you would cancel out 20 1s and 12s

162
00:15:36,100 --> 00:15:36,900
‫like this.

163
00:15:37,830 --> 00:15:46,350
‫And of course, here you would also have one by one because you would cancel out these buttons and these

164
00:15:46,370 --> 00:15:47,640
‫12s like this.

