‫So the code inside your inner loop is the same like it was in section eight.
‫The first difference that you have is here.
‫That's when you enter inside your embassy simplification function.
‫Do you remember this?
‫Why Max and why men array that contain your maximum and minimum?
‫You two use three and you for values?
‫Well, now I'm going to take those two arrays and I'm going to put them here so that my embassy simplification
‫function could accept them.
‫So in section eight, I did not have these two variables here.
‫And so now we are inside our embassy simplification function.
‫And you can see that here it is accepting these two arrays.
‫Why IMAX and why men?
‫And there are not many additions in this function, either, but there are a couple, for example,
‫here.
‫I also have constraints which the function needs to know if you want to consider constraints or not.
‫And so if it equals one meaning that you want to consider constraints, then first of all, I extract
‫this matrix here.
‫It's this one.
‫Tilde star.
‫You used it to extract your you to use three and you four values from your augment that state vectors.
‫And so you have this matrix here now and now, this matrix here.
‫For now, it's a zero matrix, but this variable.
‫It's meant for this matrix here.
‫See Tilde Star Global.
‫Remember, the purpose of this matrix was to extract your YouTube Q3 and Q4 values from all these predicted
‫augment that state vectors.
‫That's why these small C till the stars they were positioned here in such a way diagonally.
‫Because then you will be able to extract all your Q2, Q3 and Q4 values from all these augmented predicted
‫state vectors.
‫But it's important to note that this is a zero matrix.
‫You see, I have no p dot zeros.
‫Meaning that I don't have these c tilde the star matrix here.
‫For now, I simply create a matrix that has the same dimensions like this one here, but all the elements
‫are zeros.
‫And then later on, I will start putting these C2, the star matrices inside this global one.
‫But for now, it's just a zero matrix.
‫So I am pretty finding this matrix.
‫I'm giving it the right dimensions, and I'm doing the same thing with y max global and y minimum global.
‫They are zero vectors, but they have the same dimensions like this vector here.
‫And then later on, I will have this vector and I will have this vector here.
‫So all these y star means they are the same and all these y star max is they are the same.
‫They are these ones here, y max in women.
‫They contain your you three and you for maximum and minimum values.
‫So this vector here you two men, u three women and u.
‫Four men, it's this one here.
‫It's also this one here.
‫It's also this one here, and it's also this one here.
‫And then this vector here.
‫It's this one, this one, this one and this one.
‫So you can see that all these y star minimums are the same and also all these y star maximums, they
‫are also the same.
‫And so this y star global minimum and y star global maximum, they are these ones here, but at the
‫beginning they are just zero vectors.
‫So I'm simply pre defining these vectors and giving them the right dimensions.
‫But at this moment, they're all zeros.
‫And then later on, I'm going to start putting y star men and y star max inside these big global vectors.
‫And well, if I choose not to use constraints, then I just make them zero.
‫Since this function needs to return this variable, this variable and this variable, even if I don't
‫use constraints, I have to give them some kind of values.
‫Otherwise, I'm going to get an error.
‫But if I don't use constraints, I'm not going to be using these variables anymore.
‫And so when we go down, then everything else.
‫Would be like in section eight, except here and also here.
‫So remember, now I'm inside this loop where I generate my cue a bar T double bar and RW bar matrices.
‫But if I choose to consider constraints, then I also have one line here and one line here.
‫Essentially, what I'm doing here, I'm generating this seed till the global star matrix.
‫So every loop I put a new C tilde star inside my C to the Star Global Matrix.
‫So in the first loop, I put the C to a star here in this position.
‫In the second loop, I put it in this position.
‫Then I put it in this position and then I put it in this position here.
‫So after four loops, I will have my filled in C till the Star Global Matrix.
‫And well, all this here is just to make sure that I put this seat till the star in the right position
‫so that I would have the right roles and columns.
‫And then if we go down, then here we generated our C double bar matrix and also our a double circle
‫flex matrix.
‫They were these ones here, c double bar and a double circuit flex.
‫But now if I consider my constraints, then I also generate my y max global and Y men global vectors.
‫They are these ones here and here again.
‫Since I'm inside the loop, then every loop I take one y star men and one y star max vector.
‫And then I put them inside these global vectors.
‫So in the first loop, this goes here and this goes here in the second loop.
‫This goes here and this goes here.
‫The third loop would put them here, and then the fourth loop would put them here.
‫And so your zero y star global minimum and Weisser Global maximum vectors will become the ones that
‫contain your you two, you U3 amine and you four men and your you two max, U3 Max and you four max
‫in the order as they are shown here.
‫And again, what you have here in the brackets and also what you have here in the brackets, it's just
‫there to position these y star men and y star max sub vectors in the right places inside these global
‫vectors.
‫And then we go down.
‫And then this function in PC simplification, it takes these three extra variables see till the Star
‫Global and then whilst our global minimum and y star global maximum and it gives them back to the main
‫file, which is right here, you see, this is your C2, the Star Global Y Max Global and Women Global.