﻿1
00:00:00,730 --> 00:00:11,290
‫But, OK, you know that the solution that gives you your minimum cost function is zero and zero based

2
00:00:11,290 --> 00:00:18,280
‫on the matrices and vectors that you have here, a double bar and small have transposed.

3
00:00:18,880 --> 00:00:21,580
‫But we haven't considered the constraints yet.

4
00:00:22,120 --> 00:00:24,670
‫Let's see if this solution.

5
00:00:24,700 --> 00:00:34,090
‫Zero and zero, if it also satisfies all your constraints so you have your G Matrix and H Vector transposed,

6
00:00:34,720 --> 00:00:42,210
‫the general form for the linear inequality constraints is G times, don't you?

7
00:00:42,220 --> 00:00:46,870
‫Global less than or equal to and the H vector?

8
00:00:47,470 --> 00:00:50,350
‫And so this is my G matrix.

9
00:00:51,040 --> 00:00:52,630
‫This is my Delta Global.

10
00:00:53,260 --> 00:00:54,880
‫And this is my h vector.

11
00:00:55,510 --> 00:01:01,330
‫If I multiply g by Delta, you global, then I will have all that.

12
00:01:01,930 --> 00:01:05,530
‫So this is my system of inequality equations.

13
00:01:06,190 --> 00:01:08,020
‫So I have four equations.

14
00:01:08,650 --> 00:01:19,420
‫And since my solution was there was a Delta zero equals zero radiance and Delta a zero equals zero meters

15
00:01:19,420 --> 00:01:20,440
‫per second squared.

16
00:01:21,160 --> 00:01:25,630
‫These equations, they will become these ones here.

17
00:01:26,170 --> 00:01:32,020
‫So on the left side, everything will become zero because my delta a zero is zero.

18
00:01:32,020 --> 00:01:33,450
‫Delta Delta zero zero.

19
00:01:33,940 --> 00:01:35,860
‫And the same thing here and here.

20
00:01:36,460 --> 00:01:39,550
‫So let's see if these statements are true.

21
00:01:40,150 --> 00:01:42,130
‫You can see that the final one is true.

22
00:01:42,760 --> 00:01:47,380
‫Zero is less than or equal to zero point zero eight o four.

23
00:01:47,980 --> 00:01:49,480
‫Also, this one is true.

24
00:01:50,140 --> 00:01:53,830
‫Also, this one is true, but this one is false.

25
00:01:54,310 --> 00:02:00,820
‫It says that zero is less than or equal to minus zero point zero zero three.

26
00:02:01,390 --> 00:02:02,320
‫But that's wrong.

27
00:02:03,020 --> 00:02:10,960
‫Zero is not less than minus zero point zero zero three zero is greater than minus zero point zero zero

28
00:02:10,960 --> 00:02:11,470
‫three.

29
00:02:12,070 --> 00:02:14,760
‫So this solution here, Delta U.

30
00:02:14,770 --> 00:02:16,810
‫Global, equals zero zero.

31
00:02:17,440 --> 00:02:22,470
‫It does not satisfy all the constraints this constraint here.

32
00:02:23,110 --> 00:02:33,700
‫It's not satisfied, but OK, can we find another combination of Delta Delta Zero and Delta A0 that

33
00:02:33,700 --> 00:02:36,790
‫satisfies all these four constraints?

34
00:02:37,480 --> 00:02:37,910
‫OK.

35
00:02:37,930 --> 00:02:42,550
‫Your G would be, of course, bigger than its global minimum.

36
00:02:42,830 --> 00:02:43,540
‫J Min.

37
00:02:44,140 --> 00:02:50,620
‫So you're jamming with the constraints would be greater than G min without the constraints.

38
00:02:51,280 --> 00:02:52,150
‫But that's OK.

39
00:02:52,720 --> 00:02:56,080
‫Well, let's look at this first equation.

40
00:02:56,620 --> 00:03:09,010
‫You have minus zero point zero two times Delta zero less than or equal to minus zero point zero zero

41
00:03:09,070 --> 00:03:09,610
‫three.

42
00:03:10,210 --> 00:03:20,770
‫If we solve this inequality equation, then you will have Delta a zero greater than or equal to minus

43
00:03:20,770 --> 00:03:26,170
‫zero point zero zero three, divided by minus 0.02.

44
00:03:26,800 --> 00:03:34,450
‫The reason why the sine changed its direction is because I divided this side by a negative number,

45
00:03:35,050 --> 00:03:39,490
‫and I divided this side by a negative number, the same number, actually.

46
00:03:40,090 --> 00:03:45,070
‫And if I do that, then this sine it changes its direction.

47
00:03:45,520 --> 00:03:48,520
‫That's why this sine points to the right now.

48
00:03:49,090 --> 00:03:58,780
‫And so you will get 0.15 so your delta a zero is greater than or equal to 0.15.

49
00:03:59,410 --> 00:04:12,430
‫That means that in order to make this statement true, your Delta A0 can only range from 0.15 to + infinity.

50
00:04:13,000 --> 00:04:25,840
‫So your Delta A0 is included in the set 0.15 and plus infinity if it ranges between 0.15 and plus infinity.

51
00:04:26,290 --> 00:04:27,670
‫Then this statement is true.

52
00:04:28,300 --> 00:04:37,720
‫If my Delta A0 is less than 0.15, then it will make this statement false.

53
00:04:38,410 --> 00:04:39,430
‫You can try it out.

54
00:04:39,970 --> 00:04:48,760
‫Take a random number between 0.15 and + infinity for Delta A0 and then put it here and see if this statement

55
00:04:48,760 --> 00:04:53,620
‫is true and then take a random number that is less than 0.15.

56
00:04:54,280 --> 00:04:57,010
‫Put it here and see if it's true or false.

57
00:04:57,670 --> 00:05:00,200
‫So maybe then I can have a solid.

58
00:05:00,290 --> 00:05:11,730
‫Russian Delta, You Global equals zero for my Delta Delta zero and 0.15 for my Delta A0.

59
00:05:12,360 --> 00:05:17,670
‫Maybe there would be a good solution in that case, my j minimum.

60
00:05:17,670 --> 00:05:26,910
‫With the constraints, it would be 50 times Delta Delta zero squared plus one half Delta A0 squared.

61
00:05:27,540 --> 00:05:30,420
‫The first term would be 50 times zero squared.

62
00:05:30,990 --> 00:05:38,700
‫The second term would be zero point fifteen squared and that would be zero point zero one one two five.

63
00:05:39,240 --> 00:05:47,160
‫So you can see that my g min with the constraints is greater than my German without the constraints

64
00:05:47,730 --> 00:05:50,100
‫because that one was zero.

65
00:05:50,730 --> 00:05:51,840
‫But that's okay, right?

66
00:05:52,440 --> 00:05:59,490
‫I mean, our cost function is slightly bigger than is a global minimum, but we have still minimized

67
00:05:59,490 --> 00:06:02,970
‫it while respecting our constraints, right?

68
00:06:05,080 --> 00:06:06,040
‫Wrong.

69
00:06:06,580 --> 00:06:07,150
‫Yes.

70
00:06:07,510 --> 00:06:09,490
‫We have satisfied this constraint.

71
00:06:10,000 --> 00:06:15,940
‫And also, this one is OK and this one is OK, but what about the fourth constraint?

72
00:06:16,510 --> 00:06:19,510
‫Now this one is not satisfied.

73
00:06:20,080 --> 00:06:28,930
‫In order to satisfy this constraint, your delta A0 must be less than or equal to zero point zero eight

74
00:06:28,930 --> 00:06:29,530
‫04.

75
00:06:30,100 --> 00:06:40,960
‫In other words, Delta A0 can range between minus infinity and zero point zero eight 04.

76
00:06:41,530 --> 00:06:42,520
‫That's what it says.

77
00:06:43,180 --> 00:06:45,070
‫You don't even have to solve this equation.

78
00:06:45,700 --> 00:06:53,320
‫It's already in the solved form, and he tells you that it cannot be greater than zero point zero eight

79
00:06:53,320 --> 00:06:53,860
‫or four.

80
00:06:54,490 --> 00:07:04,000
‫So for the first constraint, your Delta A0 could vary between 0.15 and plus infinity.

81
00:07:04,600 --> 00:07:12,970
‫For the fourth constraint, your Delta A0 could vary from minus infinity to 0.08 or four.

82
00:07:13,540 --> 00:07:21,970
‫So if I draw a number line here, I have minus infinity on one side, plus infinity on another side.

83
00:07:22,600 --> 00:07:30,610
‫This number line is, of course, for Delta A0, and then I'm going to have here zero point zero, eight

84
00:07:30,610 --> 00:07:33,340
‫or four and then 0.15.

85
00:07:33,970 --> 00:07:43,540
‫And so if my Delta A0 goes from 0.15 to plus infinity, then my first constraint is satisfied.

86
00:07:44,170 --> 00:07:52,060
‫And then if I go from zero point zero eight or for to minus infinity, then my fourth constraint is

87
00:07:52,060 --> 00:07:52,960
‫satisfied.

88
00:07:53,470 --> 00:07:55,330
‫And now, can you see the problem?

89
00:07:55,960 --> 00:08:01,030
‫You can clearly see that you can never satisfy both constraints.

90
00:08:01,690 --> 00:08:08,380
‫You either satisfy one constraint if you're in this region or you satisfy the fourth constraint.

91
00:08:08,890 --> 00:08:15,760
‫If you're in this region and if you're in this region, well, then you violate both constraints.

92
00:08:16,420 --> 00:08:26,650
‫If instead of this constraint, I had, for example, Delta A0 less than or equal to zero point eight

93
00:08:26,650 --> 00:08:31,180
‫oh four knots zero point zero eight or four, but zero point eight or four.

94
00:08:31,840 --> 00:08:39,280
‫Then if this is my delta easier no line, then my zero point eight or four, it would be here.

95
00:08:39,940 --> 00:08:42,010
‫0.15 would be here.

96
00:08:42,670 --> 00:08:49,690
‫And so for the first constraint, I would go like this for the fourth constraint, I would go like this.

97
00:08:50,380 --> 00:09:00,460
‫Then you can see that in this region, when you're Delta Zero ranges from 0.15 and zero, eight or four,

98
00:09:01,060 --> 00:09:04,090
‫that's where you satisfy both constraints.

99
00:09:04,720 --> 00:09:06,100
‫And then it would be OK.

100
00:09:06,700 --> 00:09:13,900
‫All the constraints with your Delta Delta Zero are already satisfied when you're Delta Delta zero equals

101
00:09:14,020 --> 00:09:14,590
‫zero.

102
00:09:15,220 --> 00:09:24,040
‫And in this case, if you had this constraint for your fourth one, then for as long as your Delta A0

103
00:09:24,700 --> 00:09:32,530
‫is between this interval, then you would also satisfy your first and your fourth constraint.

104
00:09:33,070 --> 00:09:41,860
‫And then you would simply need to find the Delta A0 inside this interval that would minimize your cost

105
00:09:41,860 --> 00:09:42,460
‫function.

106
00:09:42,550 --> 00:09:43,270
‫The most?

107
00:09:44,680 --> 00:09:54,430
‫However, that's not our case, in our case, your Delta A0 is less than or equal to zero point zero,

108
00:09:54,460 --> 00:09:55,330
‫eight or four.

109
00:09:55,900 --> 00:10:02,740
‫And as you can see from the no line, there is simply no way for you to satisfy all the constraints.

110
00:10:03,370 --> 00:10:11,140
‫And that's when the solver will give you an error, or it will simply tell you that you have a value

111
00:10:11,140 --> 00:10:11,650
‫error.

112
00:10:12,250 --> 00:10:16,150
‫Your constraints are inconsistent and you have no solution.

113
00:10:16,840 --> 00:10:25,150
‫Or what I have seen is that in MATLAB, your quattro proc, it will simply give you an empty array.

114
00:10:25,720 --> 00:10:33,760
‫It just means that there are no solutions out there that can minimize your cost function and satisfy

115
00:10:33,760 --> 00:10:34,780
‫all the constraints.

116
00:10:35,410 --> 00:10:43,750
‫So this has been a small numerical example to give you a feel for what it means when the solver tells

117
00:10:43,750 --> 00:10:51,550
‫you that there are no solutions found for your optimization problem, and this problem is something

118
00:10:51,730 --> 00:10:53,980
‫that you will have to deal with a lot.

119
00:10:54,520 --> 00:11:02,890
‫In fact, that's what happened here in trajectory to the solver simply did not find a solution that

120
00:11:02,890 --> 00:11:04,750
‫can satisfy all the constraints.

121
00:11:05,410 --> 00:11:07,750
‫As a result, you see this kind of behavior.

122
00:11:08,170 --> 00:11:09,820
‫Everything just goes to zero.

123
00:11:10,450 --> 00:11:21,700
‫Your CI X and Y values also your body frame ex dot your body frame y dot your side, dot your net longitudinal

124
00:11:21,700 --> 00:11:27,340
‫acceleration, your lateral acceleration and your angular acceleration.

125
00:11:27,970 --> 00:11:30,040
‫So what can caused this problem?

126
00:11:30,640 --> 00:11:39,490
‫Well, in Trajectory two, it was caused by this big jump in your longitudinal velocity reference values,

127
00:11:40,120 --> 00:11:43,300
‫but it can also happen if you don't have that discontinuity.

128
00:11:43,930 --> 00:11:53,290
‫It can happen if, for example, your NPC weights are tuned in a bad way or you ask the car to do unrealistic

129
00:11:53,290 --> 00:11:59,620
‫things, maybe in your trajectory your turns are too sharp.

130
00:12:00,310 --> 00:12:07,930
‫Maybe you want to perform your turn at very high speeds, or maybe you have both of these problems,

131
00:12:08,620 --> 00:12:11,240
‫maybe your constraints.

132
00:12:11,860 --> 00:12:14,320
‫Maybe they are too strict.

133
00:12:14,860 --> 00:12:22,240
‫If you only allow your steering wheel angle to turn one degree to the left and one degree to the right,

134
00:12:22,930 --> 00:12:26,050
‫then that could be a problem in those cases.

135
00:12:26,710 --> 00:12:35,710
‫Try adjusting your NPC weights or try to loosen up your constraints as much as possible or make your

136
00:12:35,710 --> 00:12:40,990
‫trajectory smoother and make sure that you turn at realistic speeds.

137
00:12:41,710 --> 00:12:45,340
‫Try to avoid sharp turns, etc. In.

138
00:12:45,440 --> 00:12:53,380
‫Of course, the controller works best for smooth trajectories without terms that are too sharp.

139
00:12:54,040 --> 00:12:54,880
‫Thank you very much.

