‫And now you have all the information you need in order to calculate your one, your predicted state
‫vector one time step into the future.
‫This predicted XB one, it will look like this.
‫You have your new Phi Phi Don Theta on that and side that that will be here inside your X1 vector.
‫And now you want to predict your future state vector two time steps into the future.
‫And so this is the equation a one times X1 plus b times you won.
‫Now this you want here, that's your second left over from the previous loop.
‫That's this one here or in this loop.
‫We named it like this.
‫So your second left over you two from the previous loop in this loop, it's you one.
‫And so this one here, then of course, the beam matrix.
‫It's constant everywhere.
‫Then this X1 vector here, it's this one here.
‫Your future predicted state one time step into the future.
‫And with that, you can now update your a matrix.
‫Now, from here, you will take 5.1 and 3.1 from this X1 vector and you put it inside your A1 matrix,
‫but you also need to update your omega inside your A1 matrix.
‫Now this omega zero, here it was calculated.
‫Using this you one control input from feedback notation box and using these you two use three and you
‫for values that you apply to the plan in the previous loop.
‫You see you one.
‫It came from your feedback linear zation box, but then you to use three and you four.
‫These are the values that you had applied to your plan box in the previous loop.
‫And out of all that, you got your Omega.
‫And that's how you got your omega zero.
‫But now, in order to update our Omega and have some kind of omega one that would go inside your A1
‫matrix.
‫For that, we will use you to Q3 and Q4 values from here, from use of one in the previous loop or in
‫other words, you sub zero in this loop.
‫So Omega Zero was calculated using this information.
‫Omega one will be calculated using this information.
‫And don't forget we're talking about our global omega, the omega that we are talking about here.
‫It's this one here, the omega that is composed of all this omega super water.
‫And so if you look at this global control architecture, then you can see that your you one, it will
‫be the same during all the inner loop iterations, you will get a new you one value only after you start
‫with a new outer loop, but during your inner loop iterations, your U1 will stay the same.
‫And so in order to calculate your omega one global, your you one will remain unchanged.
‫But for you to use in Q4, you use these values here and then you just put them inside these formulas
‫here.
‫You get your omega one, two, three and four for smaller one, two, three and four, and then you
‫add them together using this formula here and this one here that will be your omega one global.
‫And so you're a matrix is now updated.
‫We call it A1.
‫It now contains 5.1 theta that one and omega one global.
‫And now you can calculate your X2.
‫This is your predicted state vector two time steps into the future, but now you want to predict your
‫state vector three time steps into the future.
‫And so for that, your equations will be a two times x two plus b times you two.
‫And so you simply followed the same drill.
‫You have this equation here.
‫This you two here.
‫That's your third and final leftover from the previous loop.
‫It was you three in the previous loop.
‫And now in this loop, it has become you two.
‫And that's why here I call you to your Vector X2.
‫It looks like this.
‫And just like you took.
‫Find out one and see to that one in order to update your image x here.
‫Inform your A1 matrix the same thing.
‫Here you're going to take your 5.2 and feet under two that comes from this x two state vector and you're
‫going to update your a matrix.
‫With these two variables, 5.2 and thethird are two.
‫But of course, you also have to update your global omega inside your matrix in order to form your A2
‫matrix.
‫You need your omega to global, and in order to do that, you go back to these equations.
‫Your you one will be the same because your new one will change only after you go through this feedback
‫unionisation box again, but you two using your four, they will change.
‫And so now you will take this sub vector here.
‫Your second left over and you will use that together with your unchanged you one in order to calculate
‫your omega to global.
‫So this second left over, it's this one here.
‫Or if you think in terms of a next loop, then it's this one here.
‫And so you put all these used here inside your formula, you calculate your omega one, two, three
‫and four for your model one, two, three and four, and then you form your global omega, which will
‫be your omega to global that will also go inside this AA matrix.
‫And so your A2 matrix is now complete and then you'll be.
‫Matrix remains unchanged.
‫And with all that, you can compute your EXP three, which is your predicted state vector three time
‫steps into the future.
‫And in order to predict for time steps into the future, you will have this equation a three times Exp
‫three plus B times use of three.
‫Now, the thing is that there is no left over left for your U3.
‫We have used up all the use here.
‫The first one went into the plant in the previous loop.
‫Then in the next loop, your you one became your use zero and went here.
‫Then you two became u one and went here and then your U3.
‫It became you two and it went here.
‫So you have no more use left.
‫But that's OK because your main goal is not to calculate, except for your main goal is to update this
‫matrix and get your A3 matrix and you get this A3 matrix updated by using information from Excerpt three.
‫So my ace up is here and then from X up three, you will simply take five, three and three to the three
‫because this is how your x three looks like transposed.
‫And so you will take this one and this one.
‫And now you also need to calculate your omega three global.
‫And in order to do that, you take this final left over here that you had discarded in the previous
‫loop.
‫And you're going to use that to calculate your omega three global together with your unchanged you one
‫value because again, you one only changes when your next outlook starts.
‫And so you put all that inside your omega formulas, you calculate your global omega, which will be
‫your omega three global.
‫And with that, you update your a matrix and you will have your A3 matrix.
‫And since our horizon period equals four, then this is where we stop.
‫And so in the end, you have an eight zero matrix that depends on a 5.0 seat, the zero and omega zero
‫global, then you have a one that is a function of find out one seat and at one and omega one, global
‫A2 is a function of fine, a two seater that two and omega two global.
‫And finally, a three.
‫It's a function of fine, a three seater that three and omega three global.
‫So even if you are inside your NPC box predicting your state vectors into the future internally, even
‫then we are updating our matrices.
‫So let's now put them in a global matrix vector form where you only need your use and your present state
‫vector in order to compute your X1, X2, X3 and X4 in one go.
‫Let's do that in the next video.
‫Thank you very much.