﻿1
00:00:00,480 --> 00:00:01,240
‫Welcome back.

2
00:00:01,800 --> 00:00:05,340
‫So we had our non-linear states based equations.

3
00:00:06,400 --> 00:00:12,560
‫These ones here, and we managed to put them in this form.

4
00:00:13,450 --> 00:00:19,370
‫Now this state's basic wagin form here was created for linear systems.

5
00:00:20,020 --> 00:00:21,290
‫It makes sense, right?

6
00:00:21,880 --> 00:00:32,640
‫You have matrices here and then you also have vectors here like this and vectors and matrices.

7
00:00:32,680 --> 00:00:34,890
‫They are all part of linear algebra.

8
00:00:35,650 --> 00:00:45,070
‫So normally you use this form for linear systems, either for LTI systems where your ABCDE matrices

9
00:00:45,070 --> 00:00:53,050
‫are completely constant or for LTV systems where these matrices directly depend on time.

10
00:00:53,920 --> 00:00:59,530
‫So this format here is a linear states based equation format.

11
00:01:00,400 --> 00:01:08,860
‫However, what we did in the previous video, we took our nonlinear equations, the ones that we have

12
00:01:08,860 --> 00:01:18,700
‫here, these are nonlinear equations and we managed to reformulate them in such a way that now the state's

13
00:01:18,700 --> 00:01:22,140
‫basic equations appear to be linear.

14
00:01:22,390 --> 00:01:30,040
‫They are not linear, but they appear to be linear because you have the A, B, C and D matrices and

15
00:01:30,040 --> 00:01:32,820
‫separate state and input vectors.

16
00:01:33,550 --> 00:01:39,330
‫So because of that, the system appears to be linear, but in reality they are not.

17
00:01:40,000 --> 00:01:45,770
‫You have simply packed all the nonlinearities into the A matrix.

18
00:01:46,600 --> 00:01:50,200
‫In other words, the equations are exactly the same.

19
00:01:50,990 --> 00:01:55,860
‫You haven't made any approximations, you haven't made any linear ization.

20
00:01:56,530 --> 00:01:58,570
‫The system is exactly the same.

21
00:01:59,290 --> 00:02:07,200
‫You simply rearranged the equations by moving all the nonlinearities inside the Matrix.

22
00:02:08,050 --> 00:02:17,860
‫You're using a standard linear state based equation format on a nonlinear system by keeping all these

23
00:02:17,860 --> 00:02:21,460
‫nonlinearities hidden inside the Matrix.

24
00:02:22,500 --> 00:02:31,290
‫And there is a reason why you do it, the nonlinearities that you have inside The Matrix or FYE, that

25
00:02:31,590 --> 00:02:38,350
‫seat on that and Omega, these variables are measured in real time.

26
00:02:39,300 --> 00:02:47,230
‫That means that they have to get updated every zero point one second.

27
00:02:48,210 --> 00:02:59,400
‫That means that in every inner cycle you have a different five dot, Seeta, Dot and Omega and therefore

28
00:02:59,430 --> 00:03:04,820
‫you have a different a matrix every zero point one second you have a different a matrix.

29
00:03:05,610 --> 00:03:13,050
‫But then again, the NPC algorithm that you learned in the previous course doesn't care about it.

30
00:03:13,770 --> 00:03:21,120
‫For the NPC, every inner loop iteration, every zero point one second is a bright new day.

31
00:03:22,130 --> 00:03:32,840
‫Let's say that at sample time, K, your non constant variables in the Matrix are five, that equals

32
00:03:33,260 --> 00:03:43,300
‫Phi Dot at K Theta, that equals Theta Dot at K and Omega equals Omega at K.

33
00:03:44,120 --> 00:03:48,800
‫And so all these variables will go into the A matrix.

34
00:03:49,610 --> 00:03:57,050
‫And for this particular a zero point, one second inter-group interval, the a matrix is constant.

35
00:03:58,010 --> 00:04:09,170
‫So in this particular loop at K, the NPC treats the system as an LTI system because all the matrices

36
00:04:09,170 --> 00:04:21,260
‫are constant, because Phi K, Seeta, Sub K and Omega Sub K are real time value set K.

37
00:04:22,200 --> 00:04:29,670
‫You get them from a plant or you measure them with sensors, but they are real time values that go into

38
00:04:29,670 --> 00:04:30,720
‫this, a matrix.

39
00:04:31,800 --> 00:04:34,050
‫Then zero point one seconds later.

40
00:04:35,060 --> 00:04:42,690
‫You get your new fi dot theater dot and Omega at Cape plus one.

41
00:04:43,640 --> 00:04:52,100
‫So now this fire, that variable in this matrix will equal to find that at K plus one, which is a different

42
00:04:52,100 --> 00:04:54,560
‫value from five dot at K.

43
00:04:55,310 --> 00:05:05,900
‫The same thing here, theater that becomes Seeta Dot and K plus one and Omega will become Omega at Cape

44
00:05:06,080 --> 00:05:07,640
‫plus one as well.

45
00:05:08,490 --> 00:05:15,740
‫Again, these are concrete numeric values that will enter the Matrix.

46
00:05:16,460 --> 00:05:24,260
‫You're a matrix will now be different compared to the previous one from zero point one seconds before.

47
00:05:25,100 --> 00:05:25,940
‫But so what?

48
00:05:26,690 --> 00:05:29,170
‫It has concrete values inside it.

49
00:05:29,180 --> 00:05:37,310
‫And so the NPC controller that you're familiar with will take these A.B.C..

50
00:05:37,310 --> 00:05:38,750
‫The Matrix is.

51
00:05:39,780 --> 00:05:49,410
‫This critize them and then compute your use three and you four and then zero point one seconds later

52
00:05:49,650 --> 00:05:59,790
‫at K plus two, you will have a new Firedog Theta Dot and Omega, either your plant or your sensors

53
00:05:59,790 --> 00:06:03,090
‫in your real UELI will update these values.

54
00:06:03,900 --> 00:06:12,240
‫And so your a matrix will get updated automatically and then the NPC controller will use that updated

55
00:06:12,240 --> 00:06:17,820
‫one for computing the new control input values, UTU, U3 and EUFOR.

56
00:06:18,660 --> 00:06:23,820
‫And that will go on every inner loop till the end of the trajectory.

57
00:06:24,630 --> 00:06:27,420
‫Remember, the NPC is just an algorithm.

58
00:06:27,420 --> 00:06:38,010
‫It can I think it just needs constant A, B, C and D matrices matrices with numeric values as their

59
00:06:38,010 --> 00:06:44,340
‫elements, not functions nor independent variables, but concrete numeric values.

60
00:06:45,120 --> 00:06:49,740
‫And it will give you some kind of you to use three and EUFOR in return.

61
00:06:50,640 --> 00:06:57,960
‫And you know what, it turns out that this real time based control where you update the variables in

62
00:06:57,960 --> 00:07:06,930
‫your a matrix as you go in real time, it turns out that it works very well in many cases.

63
00:07:07,230 --> 00:07:10,680
‫And in fact, it is a very popular methodology.

64
00:07:11,370 --> 00:07:18,410
‫My professor at the university once told me that one area where they use it is the aerospace industry,

65
00:07:18,900 --> 00:07:26,130
‫this kind of methodologies being used in controlling airplanes, for example, due to the fact that

66
00:07:26,130 --> 00:07:31,110
‫many systems in the aerospace engineering industry are highly nonlinear.

67
00:07:31,830 --> 00:07:37,020
‫One option would be to use non-linear MPAC techniques for that.

68
00:07:37,890 --> 00:07:46,740
‫However, as I've heard, these techniques require a lot of computational time because non-linear NPC

69
00:07:46,890 --> 00:07:51,330
‫simply requires more time for optimizing the cost function.

70
00:07:52,140 --> 00:07:58,380
‫And that can be problematic when you need your controller to run fast and control the system in real

71
00:07:58,380 --> 00:08:03,160
‫time, especially if the frequency of a controlled loop is high.

72
00:08:03,930 --> 00:08:09,810
‫So you need to compute the new you to use three and you four at a very high rate.

73
00:08:10,710 --> 00:08:19,080
‫So you can either get a faster computer that does computations faster or you can bypass this and use

74
00:08:19,080 --> 00:08:22,680
‫the easiest NPC that you already know.

75
00:08:23,550 --> 00:08:31,350
‫By using the methodology that you have just learned here, you put the nonlinear states based equations

76
00:08:31,890 --> 00:08:40,680
‫in the linear format by keeping the nonlinearities inside the A Matrix elements, meaning that you will

77
00:08:40,680 --> 00:08:44,070
‫have independent variables in the Matrix.

78
00:08:45,000 --> 00:08:54,480
‫But then you give those variables a specific value every zero point one second, and that value comes

79
00:08:54,480 --> 00:09:03,780
‫either from the plant if you're simulating the OV flight or from the sensors of a real USV, if you

80
00:09:03,780 --> 00:09:05,790
‫are doing real flight.

81
00:09:06,790 --> 00:09:15,490
‫And so you update your a matrix every zero point one second based on the data that you get in real time,

82
00:09:16,450 --> 00:09:24,310
‫then you democratize the system and you feed it into your familiar NPC to get your you to use three

83
00:09:24,310 --> 00:09:25,210
‫and you four.

84
00:09:26,190 --> 00:09:34,950
‫To get your three control inputs, this strategy might not give you the best optimum solution, a nonlinear

85
00:09:34,950 --> 00:09:39,230
‫NPC technique might give you more optimal solutions.

86
00:09:39,690 --> 00:09:43,770
‫However, very often this strategy is good enough.

87
00:09:44,550 --> 00:09:52,490
‫But the advantage of this strategy is that it runs faster than non-linear NPC techniques.

88
00:09:53,400 --> 00:10:02,760
‫It arrives to the solutions your you to use three and you for it arrives there faster, making it more

89
00:10:02,760 --> 00:10:04,370
‫practical in real life.

90
00:10:05,070 --> 00:10:06,720
‫And this strategy has a name.

91
00:10:06,930 --> 00:10:11,580
‫It's called a linear parameter.

92
00:10:12,580 --> 00:10:17,440
‫Varying methodology or LPT for short.

