‫Welcome back.
‫So let's now review how we apply constraints to our car.
‫First of all, we took a very easy case.
‫We imagined that our horizon period equal to and that our cost function j only depended on Delta Delta
‫zero and Delta Delta One.
‫So J was a function of Delta Delta Zero and Delta Delta One.
‫We had a two dimensional domain.
‫In other words, two independent variables.
‫Delta Delta zero and Delta Delta One.
‫And then the third dimension was for the cost function J.
‫Since our cost function was quadratic, just like in this course, we had a simple 3D parabola there.
‫We depicted that 3D parabola on a 2D plane with contour lines.
‫If we forget about constraints, then the minimum point of the cost function would be the lowest points
‫of that parabola or on a 2D plane.
‫It would be the center of the circle.
‫And then you would find the corresponding Delta Delta zero and Delta Delta One for that minimum point.
‫That would be the solution of your unconstrained NPC, which in that particular case would be zero and
‫zero.
‫So Delta You Global equals zero and zero because Delta Delta zero equals zero and Delta Delta One equals
‫zero.
‫So that was unconstrained optimization or unconstrained minimization.
‫But then we said that, OK, what if we impose certain conditions?
‫What if we say that Delta Delta Zero must be greater than or equal to zero point zero five?
‫Radiance and Delta Delta One must be greater than, or equal to 0.07 radiance.
‫Our goal was still to minimize our cost function, J.
‫But we had to find the smallest j possible that would respect these conditions as well.
‫And so we divided this two dimensional domain into several areas based on those constraints.
‫For example, the orange area here, it satisfied the first constraint here.
‫Delta Delta zero is greater than 0.05 radiance, but it violated the second constraint.
‫It's below Delta.
‫Delta One equals zero point zero seven radiance.
‫The purple area was vice versa.
‫The second condition was OK, but the first condition was not OK.
‫Then the red area.
‫It violated both constraints and only the green area was feasible because it respected both constraints.
‫And so this original G men that we found earlier, it was no longer valid because it would be in the
‫region that violated both constraints.
‫We had to find a new J Min, a new smallest value for the cost function that would be somewhere in the
‫green region here.
‫We found that in the green area, J was smallest in this corner here.
‫We called that point J.
‫Min.
‫Superscript C C stands for constraints.
‫Essentially, if you're dealing with a perfect 3D parabola, then has a circular contour lines from
‫the top view, then a good way to know that this is the point here that gives you the smallest value
‫for your cost.
‫Function in the green region is by going to the place where you have your S'mores J without the constraints.
‫And then you draw a straight line from that point till the green region.
‫And since in this corner, this line is the shortest.
‫That's why we concluded that that's the place where your cost function took the smallest value in the
‫green region.
‫Obviously, your G means superscript C is greater than your G men when you don't take your constraints
‫into account.
‫So in general, J means C is greater than or equal to G men.
‫And in this case, it's definitely greater.
‫But at least the solution that you have now, which is this.
‫On here.
‫So your Delta Delta zero is zero point zero five in Delta, Delta One is zero point zero seven.
‫This solution minimizes your cost function and honors your constraints at the same time.
‫So that's the main idea behind constrained optimization.
‫We wanted to minimize our cost function, but at the same time we had additional conditions, we had
‫constraints and we had to make sure that we respect those constraints.