Okay, so far, we've had lots of summations, some over constraints, some over generalized coordinates. This slide now is simply a way to write all of this in a more compact matrix notation. Some people call it a vector form, but as you know, this is not really a vector. This is really a matrix. It's a N by one of coordinates. It's not something that satisfies vector math because this could be angles in there and we know angles are not vectors. If it's position coordinates, they may represent a vector, but with attitude, that's not true. So really, you see both in textbooks, I wanted to write it out that way, but really it's the matrix form of this. So it avoids having summations because you now use linear algebra to write all this as a system of equations in a nice compact way. And some people like that. So that means instead of doing the q.q.I, and qi, we just have Q and q and C is the non conservative generalized forces. But you would have, and a number of them for a number of generalized coordinates. And this is an N by N transposed becomes an N by M. And the number of Lagrange multiplier is the number of constraints that you have, which was M. So this all works out. And again, the rows of a become now transposed. So the columns of a transpose become the rows of a times lambda. That's just the same as that summation we had where we carefully summed over the column because now it became the road by transposing it, right? So that's equivalent, it's just more compact and how we can write it. And then the profit and constraints are written this way Aq.+B. Everything that's linear dependent on rates goes into the A. And everything else goes into the B and that's it right there. And constraints don't allow for quadratic rates, for example, as a constraint. Just linear rate dependencies. So the rest of it, we talked about the partial velocity. So when you have to get kinetic energy of particles or points in space, you do your time explicit time dependency. Which might appear plus the partial of our with respect to the generalized coordinates times the generalized coordinate rates. And these partials were you're generalized your part, sorry, you're partial velocities. And as we argued earlier, these actually form if this goes away, this forms a basis vector set. So all your rates times these partial velocities will form your actual velocity. So it's like a base vector set for the velocity space. Some way to think of it. Now, more generally, if you want to write the kinetic energy of a system of particles and your particle positions can have time explicit components. And the classic, m over 2 extort squared coordinate quadratic coordinates. If you carry out this dot product, you have something that doesn't depend on coordinates, something that depends on coordinate rates. And you square this. So you're going to have this stuff squared, this stuff squared plus this times this. So you're going to have turns in kinetic energy that do not contain generalized coordinate rates, terms and energy that will contain linear, generalized coordinate rates. And the classic turns and energy that have generalized coordinate rates squared, right? That's always what you have. So this is really the most general way we can write kinetic energy. This is your classic and you will see people right to T2, T1 and T0 terms. This is what they're talking about in these analytical mechanics books. So this one is your classic mass over to velocity squared. And you've seen even with oilers equations, we can, you know, the kinetic energy of a rigid body. We can put it in that form. Your generalized mass tensor would become a inertia tensor all of a sudden and then you have omega. But omega we can relate directly to your pitch roll rate or kryptonite rates. So it all drops into the same quadratic form. But if there's a, you're moving on a conveyor belt or in the homework problem, you're talking about that loop, right? That was spinning at a fixed prescribed rate that will introduce a time, explicit component to your velocity. And you may end up then with a linear termine que dots and a term that doesn't depend on cue dots at all. This is important because then we've seen like ranches equations if this is the most general way I can write my kinetic energy quadratic linear and rate independent energy components. I then have to take partial derivatives of this with respect to q dots. Well, guess what the T node will not contribute right? Because there is no q dots in there. So that partial of T with respect to Q dot is going to go to zero and its time derivative 000. But there's also a partial derivative of T with respect to Q, and Q could be in here. So this term T0 could contribute to that partial T partial q part that we have. The linear and quadratic clearly will contribute to the partial T partial q dot term of Lagrange equation. So you can write this out another way to look at if you have system of particles of mass there because these things form based vectors. The system mass matrix then is simply going to be M times the outer product of all these based vectors. We've seen this a little bit already with the SCMGs. The inertia of the wheel was inertia about the spin axis times Gs, Gs transposed the space vectors outer products I gave you the contributions. This is just something like that. Just written in a much more general way. So these partial velocities you can see they keep appearing lots of places and have some insights and meaning. But you can do that and that would be that M. So this M can depend on states. You see that in that that multi link problem that you can solve for right? There all of a sudden that system mass matrix that you produce with Lagrange and dynamics does depend on the angles, data on the multi link system. So that's an example of this. Now if you go through this, take the partial of both T two, T one and T0, in respect to q dot the T 01 drops out. But I'm left with the other two and I still have to take a DDT of that partial minus the partial of T all three TS, T2 T1, T0. And if I have a non conservative forces the V function with respect to Q you do that and that M matrix which appeared in the T two. This depends on q, so partial of the T two with respect to Q will have non zero terms. This is an end by one times and end by end times and end by one. And you're doing a partial now with respect to states, which gives you this higher order tensor. Some of you have seen these things, the Christofle operator, it basically. You end up with A column and each column is this is an end by one. The partial of an n by n with respect to a scalar is still an n by n times and n by one. So the answer is a one x 1 but I have to do it for all the degrees of freedom. And so this gives me a column and n by one in the end that matches it all. But that's so these kinds of operations is called the Christofle operator that you will find, I think you've seen that before in your multi body stuff that you've done. So that's where it appears and then the rest of them are just the classic partials of the energies with respect to q. There's no special form there and in the end of course these are constraints. So this is why I'm showing you how you can rewrite, you will find these equations of motion. Often written this way, this is the most general way for any finite degree of freedom equations of motion. If somebody asks you in the premium exam, solving this equation, you know find equations of motion, you could be smartass if you want to. I don't recommend it and just write these equations. Say this works for everything. So whatever the system is this must be, it must have something of this form because if I'm in that exam then I'm going okay, be more specific, [LAUGH]. This is not going to, they'll make me chuckle, but that's it and then I want to see some real algebra that shows me what are them. But there are papers done 50, 10 for example, we use these equations this way when we talked about rate based control. And we can show that with all of this and you make this kinetic energy and you plug in t dot what you get was Q. Whatever torque was act or whatever generalized force and I didn't call it that at the time, but that's what it was. Times your omega times those rates had to be, that was it. That was the generalized power equation. As long as you can find some torque that will guarantee these rates will always go to zero or be negative definite. You can come up with feedback controls and very general systems improve robustness. So that rate based feedback control we did in 50, 10. This kind of connects to that slide that I said, well trust me for now this is equations. But you can see it's very compact. All this stuff we've just grouped together into a G term. So we kind of cheated and said all, there's lots of stuff just call it G. But then on the right-hand side, generalized forces constraint forces subject to your algebraic Sofyan constraints that you have right? We have to solve them as DA, differential algebraic equations. And the G I just put explicitly, so there's a time explicit one. There's these partials that m gets complicated. That's what you want to have symbolic manipulators for to keep track of all those terms, Josh? >> Just to make energy. >> I actually did use the Lagrange in implicitly here because you see a V as well appear, I just didn't call it L. I just had T earlier, there was T2, T1, T0. I never explicitly said that I just use the T version. I actually used this Lagrange in which is T minus V. And so here, I'm just getting the T. And then here all of a sudden you see partials of E appearing because I'm starting out with the Lagrange inversion of it, not the kinetic energy version of it, yep, it's just an extra term. And that term goes into, you can see here the partials of all of that and it goes into this G function, it's all embedded here. And so we're left with the non conservative generalized forces plus the constraint forces that have to be acting on the system. So, you saw for the Lagrange multipliers.