‫Welcome back.
‫And so this is your time sample line, and at zero, you have your present state a zero.
‫Like I said, you don't predict that, you already know it.
‫And then using this formula, you can predict your future state.
‫For example, if you predict X one, then you will predict what the state will be in zero point one
‫second.
‫And then using the same formula, you can also predict your state at to your state at three and your
‫state at four.
‫And you don't need to do more because your horizon period is four.
‫So your last predicted state would be X of four, so this one would be zero point two seconds into the
‫future.
‫This one zero point three seconds into the future and this one zero point four seconds into the future.
‫So let's say that if you want to compute X for this predicted state zero point four seconds into the
‫future, then the formula for that would look like this.
‫You OK in this formula would be K equals four.
‫So X are for equals then A to the power of four.
‫So it's like multiplying for a matrices like this then that you multiply by your present state.
‫And then in this vector you have first of all, this term A to the power of K minus one.
‫So that would be a to the power of four minus one.
‫That would be three then times the B matrix.
‫And here you would have A to the power of two because K minus two, four, minus two, that would give
‫you two times B, then here you would have A, B, so K minus three, four, minus three equals one.
‫So you would have like one year and then finally you would have B here.
‫Well actually you have A here but then you would have zero here because K minus four would be four,
‫minus four which is zero and then eight to the power of zero would be one.
‫So you can just say that it's one and then here you would have your control input at zero.
‫This one here, then this one here will go here, then use up two would be this one and finally use
‫up three would be this one here.
‫And that was the way to directly compute except for without computing except one except two and except
‫three first.
‫And so if you write it out this entire formula, then it will look like this.
‫And so the state vectors here are the following.
‫This one is like this.
‫So five zero five zero three zero zero zero and besides zero, that's how it looks like.
‫And then this state vector looks like this.
‫That's how it looks like.
‫And of course, both of them, they are transposed because they are column vectors.
‫And so that is what you predict them to be in zero point four seconds.
‫Now, remember, this is a prediction.
‫Your model does not take everything in the world into account.
‫You USV will have true states at that time and those true states will be slightly different than these
‫predicted states.
‫And then your control input vectors will be the following.
‫So you really know that this is your use of zero.
‫It looks like this you one looks like this.
‫You looks like this and then you three looks like this, and again, they're all com vectors.
‫And again, to reiterate the A and B matrix, here they are, the discrete ones, OK?
‫They're the ace D and B, the matrices.
‫However, now we would like to compute the predicted X one, x two, x three and X four.
‫We would like to compute these predicted states in one go and for that we created a more compact way
‫to do it like this.
‫This is a screenshot from the autonomous vehicle course.
‫And you can see that here when you put your equations in this form, then you can compute all your predicted
‫states in our case from one to four in one go for as long as you have your control inputs from zero
‫to will.
‫In our case, it was from zero to three and four.
‫As long as you have your present state, then you can compute your predicted states in one go.
‫And so we can do the same thing with the oveI, if that's the equation in order to predict your X1 x2.
‫X three and finally X four, and we don't need more because our Horizon period was for.
‫Then you can rewrite these equations in this form here.
‫So if you write out these equations, then you will get the white ones here.
‫It's exactly the same thing, only in a different format.
‫And remember these A's and B's here they are sub matrices.
‫So this is one huge matrix.
‫And inside this huge matrix, you have sub matrices.
‫So this is a sub matrix is a six by six sub matrix, and this B is a six by three sub matrix.
‫That means that this entire thing here, it would be six times four.
‫So that would be twenty four by six.
‫And this huge matrix here, it would be twenty four by twelve, so twenty four rows and twelve columns
‫because once sub matrix has six rows and three columns and here you have six rows and six columns and
‫the number of columns does not expand.
‫However the number of rows does expand.
‫So twenty four rows by six columns.
‫And one final thing.
‫In our case you cannot have a predicted state that is larger than except for you cannot have X of five
‫because remember then after X of four, you will already have a new outer loop.
‫So the feedback lionization controller will give you a new target to chase.