‫But remember, x tilde global equals C double bar times, Delta, you global.
‫Plus a double circle Flex Times X to the zero.
‫That means that y global star, it equals C till the star.
‫Global Times.
‫X still the global or it equals C to the star.
‫Global Times C Double Bar.
‫Times.
‫Delta you global.
‫Plus C till Death Star.
‫Global Times.
‫A Double Circle Flex Times.
‫It's still the zero.
‫Remember that your C double bar and a double circle flex.
‫These are these matrices here, c double bar and a double circle flex.
‫And so what we have done here?
‫We did the exact same thing in the previous car course.
‫You see why global star equals and then all this.
‫We took this c till the global star.
‫We multiplied it by this vector here.
‫That means that this red matrix it got distributed among these two terms here.
‫This is your C double bar matrix.
‫This is your a double circle flex from the previous car course.
‫And then when you performed this multiplication, then you can see how these C2, the star matrices,
‫how they were distributed inside these matrices here.
‫And as you can see in the previous car course, we used the non simplified LP approach.
‫That's why your C double bar and a double serve conflicts matrices are a bit different there.
‫We had to do it that way because our horizon period in that course was considerably longer than in this
‫course.
‫And now, since our y star global vector contains the predicted U2 Q3 and you values one, two, three
‫and four time steps into the future, what I can do now I can reformulate my constraints like that y
‫global star, minimum y global star and y global star maximum.
‫So this vector here, it simply contains all the minimal values that I can have here in this vector.
‫And then this vector here, it contains all the maximum values that I can have here and both for minimum
‫and maximum values.
‫U2 zero, U2 one, U2 two and U2 three.
‫They would be the same.
‫Then you three zero U2.
‫You want U3 two and you three three.
‫They would have the same maximum and minimum value as well.
‫And finally, you for zero, you for one, you for two and you for three.
‫They will also have the same maximum and minimum of values.
‫But now what I can do, I can still have my y global star minimum here, and then I can still have my
‫y global star maximum here.
‫But now, instead of this one here, I'm going to replace it with this one here.
‫So I'm going to have C to the star.
‫Global Times C Double Bar Times, Delta U Global Plus C to the Star Global Times A Double Circle Flex
‫Times X2 still the zero next.
‫I can take this second term here and I can put it on this side and on that side.
‫And so I will have y global star minimum minus C till the Global Star Times, a double circle flex times
‫till the zero, then all that is less than or equal to then I have here C till the star Global Times
‫C Double Bar Times, Delta U Global, which is this one here.
‫And then that is less than or equal to Y Global Max star and then minus C to the Star Global.
‫A double circle flex and X tilde zero.
‫And now it becomes interesting.
‫Now I only have a term here that has Delta Global in it.
‫What I can do now.
‫I can separate them like this.
‫So first of all, we take this one.
‫Then we take this one here.
‫This will be our second part.
‫So I will have see to the star.
‫Global Times.
‫See Double Bar.
‫Times.
‫Delta, you global.
‫And that's less than or equal to why Star Global Max minus.
‫And then this term here.
‫And then the second part here, it will be like this again.
‫See till this star.
‫Global Times.
‫See Double Bar.
‫Times Delta.
‫You Global.
‫It's greater than or equal to.
‫And then you have all this that you have over here.
‫But now remember all our inequality signs.
‫They had to point to the left.
‫So that means that I have to multiply this side by minus one.
‫And this side by minus one.
‫And if I do that, then this sign will become like this.
‫In other words, I can simply write that I have a minus sign here.
‫Then the inequality sign is like this.
‫Then I'm going to put a minus sign here and here.
‫I will have a plus sign.
‫And now you can just formulate them like this.
‫I have this matrix here.
‫Times Delta, you global less than or equal to why global star max.
‫And then all this and then minus y global star men.
‫And then plus all this.
‫And there you have it.
‫You have your matrix and you have your h vector.
‫And now all we have to do is to give this g matrix and each vector to the solver.
‫Together with your cost function information, so don't you global that considers the constraints it
‫equals?
‫Solve underscore kewpie h double bar small if transposed g and then H transposed and then in addition,
‫you will have your solver equals c accept.
‫And that's it.
‫That's how you find the solution that minimizes your cost function and respects your constraints.
‫At the same time, from the solvers point of view, you constrained your delta use.
‫But in reality, you know that our journey started with Omegas.
‫You first had a minimum and maximum omega.
‫That's what we started with, with minimum and maximum Omegas.
‫Then from there, we went to minimum and maximum use.
‫And once we had that, we were able to go from here till this form here.
‫So that was the journey.
‫And now I would like to talk about a problem that you face for sure.
‫It can happen many times that when you work with constraints, then there simply are no solutions that
‫minimize the cost function and respect all the constraints at the same time to give you good intuition
‫about this problem.
‫In the previous car course, I had a very good example for that.
‫I will show it to you here as well.
‫So if you have already covered the previous car course and I mean the second concourse, then you can
‫skip the next two videos.
‫But if not, then feel free to watch them here.
‫So let's forget about the drone during two videos, and let's focus on this car example.
‫Even though this problem can occur with any system.
‫You can do it by hand.
‫I'm going to give you a Matrix H double bar.
‫It looks like this.
‫Then I'm going to give you a small f transposed that looks like this.
‫Then I'm going to give you a g matrix that looks like this.
‫And then I'm going to give you the H Vector transposed that looks like this.
‫So you have two questions.
‫Question number one, do you have a solution?
‫Delta you global that minimizes your cost function, j, and respects all your constraints.
‫So that's the first question.
‫And Question two is why.
‫Whatever answer you have for your question one.
‫Why is it like that?
‫So give it some thought.
‫Try doing it by yourself first.
‫Don't watch the next video right away.
‫And then when you have thought about it, then I'll see you in the next video.
‫Thank you very much.