﻿1
00:00:00,720 --> 00:00:05,880
‫So the code inside your inner loop is the same like it was in section eight.

2
00:00:06,600 --> 00:00:09,690
‫The first difference that you have is here.

3
00:00:10,350 --> 00:00:15,060
‫That's when you enter inside your embassy simplification function.

4
00:00:15,750 --> 00:00:16,970
‫Do you remember this?

5
00:00:16,980 --> 00:00:22,920
‫Why Max and why men array that contain your maximum and minimum?

6
00:00:23,100 --> 00:00:25,830
‫You two use three and you for values?

7
00:00:26,460 --> 00:00:33,840
‫Well, now I'm going to take those two arrays and I'm going to put them here so that my embassy simplification

8
00:00:33,840 --> 00:00:35,250
‫function could accept them.

9
00:00:35,910 --> 00:00:39,720
‫So in section eight, I did not have these two variables here.

10
00:00:40,320 --> 00:00:44,220
‫And so now we are inside our embassy simplification function.

11
00:00:44,880 --> 00:00:48,780
‫And you can see that here it is accepting these two arrays.

12
00:00:49,020 --> 00:00:50,430
‫Why IMAX and why men?

13
00:00:50,910 --> 00:00:57,600
‫And there are not many additions in this function, either, but there are a couple, for example,

14
00:00:57,600 --> 00:00:58,140
‫here.

15
00:00:58,170 --> 00:01:05,550
‫I also have constraints which the function needs to know if you want to consider constraints or not.

16
00:01:06,120 --> 00:01:13,740
‫And so if it equals one meaning that you want to consider constraints, then first of all, I extract

17
00:01:14,040 --> 00:01:15,360
‫this matrix here.

18
00:01:15,960 --> 00:01:16,890
‫It's this one.

19
00:01:17,580 --> 00:01:18,540
‫Tilde star.

20
00:01:19,110 --> 00:01:26,400
‫You used it to extract your you to use three and you four values from your augment that state vectors.

21
00:01:27,030 --> 00:01:32,160
‫And so you have this matrix here now and now, this matrix here.

22
00:01:32,760 --> 00:01:36,900
‫For now, it's a zero matrix, but this variable.

23
00:01:37,560 --> 00:01:39,780
‫It's meant for this matrix here.

24
00:01:40,420 --> 00:01:42,240
‫See Tilde Star Global.

25
00:01:42,870 --> 00:01:52,370
‫Remember, the purpose of this matrix was to extract your YouTube Q3 and Q4 values from all these predicted

26
00:01:52,380 --> 00:01:53,880
‫augment that state vectors.

27
00:01:54,480 --> 00:02:02,070
‫That's why these small C till the stars they were positioned here in such a way diagonally.

28
00:02:02,670 --> 00:02:11,760
‫Because then you will be able to extract all your Q2, Q3 and Q4 values from all these augmented predicted

29
00:02:11,760 --> 00:02:12,660
‫state vectors.

30
00:02:13,290 --> 00:02:17,610
‫But it's important to note that this is a zero matrix.

31
00:02:18,030 --> 00:02:20,370
‫You see, I have no p dot zeros.

32
00:02:21,060 --> 00:02:25,770
‫Meaning that I don't have these c tilde the star matrix here.

33
00:02:26,370 --> 00:02:35,580
‫For now, I simply create a matrix that has the same dimensions like this one here, but all the elements

34
00:02:35,580 --> 00:02:36,330
‫are zeros.

35
00:02:36,990 --> 00:02:43,800
‫And then later on, I will start putting these C2, the star matrices inside this global one.

36
00:02:44,370 --> 00:02:46,380
‫But for now, it's just a zero matrix.

37
00:02:47,040 --> 00:02:49,170
‫So I am pretty finding this matrix.

38
00:02:49,530 --> 00:02:58,650
‫I'm giving it the right dimensions, and I'm doing the same thing with y max global and y minimum global.

39
00:02:59,280 --> 00:03:04,560
‫They are zero vectors, but they have the same dimensions like this vector here.

40
00:03:05,190 --> 00:03:11,160
‫And then later on, I will have this vector and I will have this vector here.

41
00:03:11,760 --> 00:03:19,170
‫So all these y star means they are the same and all these y star max is they are the same.

42
00:03:19,740 --> 00:03:23,040
‫They are these ones here, y max in women.

43
00:03:23,730 --> 00:03:29,610
‫They contain your you three and you for maximum and minimum values.

44
00:03:30,270 --> 00:03:33,840
‫So this vector here you two men, u three women and u.

45
00:03:33,840 --> 00:03:36,420
‫Four men, it's this one here.

46
00:03:37,080 --> 00:03:38,700
‫It's also this one here.

47
00:03:39,360 --> 00:03:42,930
‫It's also this one here, and it's also this one here.

48
00:03:43,560 --> 00:03:45,090
‫And then this vector here.

49
00:03:45,720 --> 00:03:51,090
‫It's this one, this one, this one and this one.

50
00:03:51,540 --> 00:03:58,530
‫So you can see that all these y star minimums are the same and also all these y star maximums, they

51
00:03:58,530 --> 00:03:59,490
‫are also the same.

52
00:04:00,120 --> 00:04:09,210
‫And so this y star global minimum and y star global maximum, they are these ones here, but at the

53
00:04:09,210 --> 00:04:12,450
‫beginning they are just zero vectors.

54
00:04:13,080 --> 00:04:18,660
‫So I'm simply pre defining these vectors and giving them the right dimensions.

55
00:04:19,290 --> 00:04:22,110
‫But at this moment, they're all zeros.

56
00:04:22,650 --> 00:04:31,470
‫And then later on, I'm going to start putting y star men and y star max inside these big global vectors.

57
00:04:32,130 --> 00:04:37,080
‫And well, if I choose not to use constraints, then I just make them zero.

58
00:04:37,710 --> 00:04:45,150
‫Since this function needs to return this variable, this variable and this variable, even if I don't

59
00:04:45,150 --> 00:04:49,140
‫use constraints, I have to give them some kind of values.

60
00:04:49,800 --> 00:04:51,360
‫Otherwise, I'm going to get an error.

61
00:04:51,960 --> 00:04:56,490
‫But if I don't use constraints, I'm not going to be using these variables anymore.

62
00:04:57,030 --> 00:05:00,150
‫And so when we go down, then everything else.

63
00:05:00,280 --> 00:05:06,730
‫Would be like in section eight, except here and also here.

64
00:05:07,330 --> 00:05:17,290
‫So remember, now I'm inside this loop where I generate my cue a bar T double bar and RW bar matrices.

65
00:05:17,950 --> 00:05:26,200
‫But if I choose to consider constraints, then I also have one line here and one line here.

66
00:05:26,860 --> 00:05:33,130
‫Essentially, what I'm doing here, I'm generating this seed till the global star matrix.

67
00:05:33,820 --> 00:05:41,560
‫So every loop I put a new C tilde star inside my C to the Star Global Matrix.

68
00:05:42,220 --> 00:05:46,750
‫So in the first loop, I put the C to a star here in this position.

69
00:05:47,140 --> 00:05:49,870
‫In the second loop, I put it in this position.

70
00:05:50,260 --> 00:05:54,310
‫Then I put it in this position and then I put it in this position here.

71
00:05:54,910 --> 00:06:00,630
‫So after four loops, I will have my filled in C till the Star Global Matrix.

72
00:06:01,240 --> 00:06:10,780
‫And well, all this here is just to make sure that I put this seat till the star in the right position

73
00:06:11,350 --> 00:06:14,290
‫so that I would have the right roles and columns.

74
00:06:14,950 --> 00:06:24,070
‫And then if we go down, then here we generated our C double bar matrix and also our a double circle

75
00:06:24,070 --> 00:06:24,940
‫flex matrix.

76
00:06:25,720 --> 00:06:29,920
‫They were these ones here, c double bar and a double circuit flex.

77
00:06:30,550 --> 00:06:40,210
‫But now if I consider my constraints, then I also generate my y max global and Y men global vectors.

78
00:06:40,900 --> 00:06:44,830
‫They are these ones here and here again.

79
00:06:45,340 --> 00:06:54,970
‫Since I'm inside the loop, then every loop I take one y star men and one y star max vector.

80
00:06:55,600 --> 00:06:59,980
‫And then I put them inside these global vectors.

81
00:07:00,640 --> 00:07:05,980
‫So in the first loop, this goes here and this goes here in the second loop.

82
00:07:06,160 --> 00:07:08,500
‫This goes here and this goes here.

83
00:07:09,250 --> 00:07:15,250
‫The third loop would put them here, and then the fourth loop would put them here.

84
00:07:15,850 --> 00:07:24,820
‫And so your zero y star global minimum and Weisser Global maximum vectors will become the ones that

85
00:07:24,820 --> 00:07:34,390
‫contain your you two, you U3 amine and you four men and your you two max, U3 Max and you four max

86
00:07:35,020 --> 00:07:37,600
‫in the order as they are shown here.

87
00:07:38,200 --> 00:07:46,120
‫And again, what you have here in the brackets and also what you have here in the brackets, it's just

88
00:07:46,120 --> 00:07:55,390
‫there to position these y star men and y star max sub vectors in the right places inside these global

89
00:07:55,390 --> 00:07:55,990
‫vectors.

90
00:07:56,590 --> 00:07:58,030
‫And then we go down.

91
00:07:58,690 --> 00:08:07,300
‫And then this function in PC simplification, it takes these three extra variables see till the Star

92
00:08:07,300 --> 00:08:16,090
‫Global and then whilst our global minimum and y star global maximum and it gives them back to the main

93
00:08:16,090 --> 00:08:24,760
‫file, which is right here, you see, this is your C2, the Star Global Y Max Global and Women Global.

