﻿1
00:00:00,720 --> 00:00:01,590
‫Welcome back.

2
00:00:02,220 --> 00:00:06,120
‫So let's now review how we apply constraints to our car.

3
00:00:06,630 --> 00:00:09,900
‫First of all, we took a very easy case.

4
00:00:10,530 --> 00:00:19,980
‫We imagined that our horizon period equal to and that our cost function j only depended on Delta Delta

5
00:00:19,980 --> 00:00:22,050
‫zero and Delta Delta One.

6
00:00:22,620 --> 00:00:26,820
‫So J was a function of Delta Delta Zero and Delta Delta One.

7
00:00:27,390 --> 00:00:29,760
‫We had a two dimensional domain.

8
00:00:30,390 --> 00:00:33,510
‫In other words, two independent variables.

9
00:00:34,230 --> 00:00:36,690
‫Delta Delta zero and Delta Delta One.

10
00:00:37,290 --> 00:00:41,580
‫And then the third dimension was for the cost function J.

11
00:00:42,180 --> 00:00:49,650
‫Since our cost function was quadratic, just like in this course, we had a simple 3D parabola there.

12
00:00:50,250 --> 00:00:56,250
‫We depicted that 3D parabola on a 2D plane with contour lines.

13
00:00:56,940 --> 00:01:04,110
‫If we forget about constraints, then the minimum point of the cost function would be the lowest points

14
00:01:04,620 --> 00:01:07,770
‫of that parabola or on a 2D plane.

15
00:01:08,310 --> 00:01:10,620
‫It would be the center of the circle.

16
00:01:11,370 --> 00:01:20,160
‫And then you would find the corresponding Delta Delta zero and Delta Delta One for that minimum point.

17
00:01:20,760 --> 00:01:30,210
‫That would be the solution of your unconstrained NPC, which in that particular case would be zero and

18
00:01:30,210 --> 00:01:30,630
‫zero.

19
00:01:31,230 --> 00:01:42,630
‫So Delta You Global equals zero and zero because Delta Delta zero equals zero and Delta Delta One equals

20
00:01:43,170 --> 00:01:43,650
‫zero.

21
00:01:44,280 --> 00:01:49,440
‫So that was unconstrained optimization or unconstrained minimization.

22
00:01:50,010 --> 00:01:55,170
‫But then we said that, OK, what if we impose certain conditions?

23
00:01:55,800 --> 00:02:03,060
‫What if we say that Delta Delta Zero must be greater than or equal to zero point zero five?

24
00:02:03,060 --> 00:02:10,140
‫Radiance and Delta Delta One must be greater than, or equal to 0.07 radiance.

25
00:02:10,830 --> 00:02:15,510
‫Our goal was still to minimize our cost function, J.

26
00:02:16,140 --> 00:02:21,630
‫But we had to find the smallest j possible that would respect these conditions as well.

27
00:02:22,230 --> 00:02:31,350
‫And so we divided this two dimensional domain into several areas based on those constraints.

28
00:02:31,950 --> 00:02:38,400
‫For example, the orange area here, it satisfied the first constraint here.

29
00:02:38,400 --> 00:02:45,360
‫Delta Delta zero is greater than 0.05 radiance, but it violated the second constraint.

30
00:02:45,990 --> 00:02:48,030
‫It's below Delta.

31
00:02:48,030 --> 00:02:51,930
‫Delta One equals zero point zero seven radiance.

32
00:02:52,590 --> 00:02:55,320
‫The purple area was vice versa.

33
00:02:55,920 --> 00:03:00,210
‫The second condition was OK, but the first condition was not OK.

34
00:03:00,810 --> 00:03:02,120
‫Then the red area.

35
00:03:02,790 --> 00:03:10,860
‫It violated both constraints and only the green area was feasible because it respected both constraints.

36
00:03:11,520 --> 00:03:19,950
‫And so this original G men that we found earlier, it was no longer valid because it would be in the

37
00:03:19,950 --> 00:03:22,920
‫region that violated both constraints.

38
00:03:23,520 --> 00:03:32,190
‫We had to find a new J Min, a new smallest value for the cost function that would be somewhere in the

39
00:03:32,190 --> 00:03:33,390
‫green region here.

40
00:03:33,960 --> 00:03:39,630
‫We found that in the green area, J was smallest in this corner here.

41
00:03:40,200 --> 00:03:42,070
‫We called that point J.

42
00:03:42,090 --> 00:03:42,450
‫Min.

43
00:03:42,870 --> 00:03:46,320
‫Superscript C C stands for constraints.

44
00:03:46,980 --> 00:03:55,710
‫Essentially, if you're dealing with a perfect 3D parabola, then has a circular contour lines from

45
00:03:55,710 --> 00:04:03,750
‫the top view, then a good way to know that this is the point here that gives you the smallest value

46
00:04:03,750 --> 00:04:04,380
‫for your cost.

47
00:04:04,380 --> 00:04:12,610
‫Function in the green region is by going to the place where you have your S'mores J without the constraints.

48
00:04:13,260 --> 00:04:19,140
‫And then you draw a straight line from that point till the green region.

49
00:04:19,770 --> 00:04:23,670
‫And since in this corner, this line is the shortest.

50
00:04:24,360 --> 00:04:32,700
‫That's why we concluded that that's the place where your cost function took the smallest value in the

51
00:04:32,700 --> 00:04:33,600
‫green region.

52
00:04:34,230 --> 00:04:42,240
‫Obviously, your G means superscript C is greater than your G men when you don't take your constraints

53
00:04:42,240 --> 00:04:43,050
‫into account.

54
00:04:43,620 --> 00:04:50,490
‫So in general, J means C is greater than or equal to G men.

55
00:04:51,150 --> 00:04:53,560
‫And in this case, it's definitely greater.

56
00:04:54,180 --> 00:04:59,760
‫But at least the solution that you have now, which is this.

57
00:04:59,890 --> 00:05:00,580
‫On here.

58
00:05:01,270 --> 00:05:08,260
‫So your Delta Delta zero is zero point zero five in Delta, Delta One is zero point zero seven.

59
00:05:08,950 --> 00:05:16,150
‫This solution minimizes your cost function and honors your constraints at the same time.

60
00:05:16,720 --> 00:05:20,830
‫So that's the main idea behind constrained optimization.

61
00:05:21,430 --> 00:05:28,300
‫We wanted to minimize our cost function, but at the same time we had additional conditions, we had

62
00:05:28,300 --> 00:05:32,770
‫constraints and we had to make sure that we respect those constraints.

