Now we're going to venture into Lagrange and Dynamics. There's a lot more we could do with D' Alermbert's, there's tons more, you could do a whole class nothing but Kane's equations, especially rigid bodies and multi digit bodies. But again, this is the intent here is, to kind of give you an introduction to all the fundamentals. So if you have to study up on that, you can grab those books and understand a little bit where you know where everything is coming from. For example, we didn't cover D' Alermbert's with constraints. We did Newtonian with constraints by just adding as constraining forces, you could do similar things there. We are going to do constraints in Lagrangian that has a lot of coral areas, so if you had to, these results could be lifted back. But for the sake of time, I'm just going to do them in Lagrangian. So who's my Lagrangian expert here? Yes, I'm looking at you, you raised your hand a few weeks ago. Right, so if somebody says give me the Lagrangian, what are they talking about, Julian? >> [INAUDIBLE]. >> Yeah, so there's this Lagrangian called t minus L script, L typically t minus V. And if all you have, is a system that had, where all the forces acting on this system are conservative. This Lagrangian covers everything, and it's super mechanical, how you can get the equations of motion. You can just go to Mathematica, give this give energy, give potential, this is the formula and poof outcomes in equation, I mean literally that fast, it's amazing. What if it's not conservative? All right, then we have to deal with generalized forces. So all the stuff you've been learning comes back here again, and so we'll go through the steps, how does this go? This goes back to Lagrangian that original question I was raising, we've talked about generalized coordinates. We've talked about D' Alermbert's, and we'll start from D' Alermbert's, and we're going to derive now Lagrangian Dynamics today. And then next time we'll go more into constrained Lagrangian to forth. So D' Alermbert's principal was, if you have n particles each has inertial position vectors, mass times acceleration is dotted with its partial velocity, had to be equal to the generalized force, for each degree of freedom. Generalist correlate, and then the generalized force we just reviewed earlier was the summation of all the forces on acting on all the particles. Started with the partial of every position vector of every particle with respect to this one generalized coordinates, so this is all the partials with respect to x. All the partials with respect to theta or whatever other coordinates you have in your system, right, we've just gone through that. So we are assuming for now a Minimal Coordinates set an Unconstrained Motion. We're going to first arrived that form, and then we will start to relax this into more and more general versions of Lagrangians, but this way we can focus just on this. So this is nothing but D' Alermbert's principle, which is right here, and I've written out what Q is. And if you remember Kane's equation, they took this and met ma minus f dotted with partials, right was equal to zero, and that was basically a Kane's version of these equations. That's the close cousins, so this stuff is all related. The classic definitions had partials of position with respect to states, but we also discovered this cancelation of dot property, which is kind of cool. That the partial of our Inspector Q is the same thing as partial of our docked with respect to Q dot, so I'm going to add thoughts everywhere. This is a slight modification to D' Alermbert's formulation that we had, nothing too shocking yet. And now the question is how do we go from here, and get something, we want to get the differential equations of motion, but we want to generate it really using energy functions. That's the basic principle, so how do we do that? Energy, well, how's energy defined for system of particles? It's simply mass over two times your inertial velocity squared. This is just written on electoral form m over two, R dot, dotted with R dot, and we have I versions of it because there's I elements because there's n number big n of particles. Just for motivation, this is the energy. Let's look at what happens on the other side, we keep seeing all these partials respect to generalized coordinates. So what happens if we take the partial of the scalar energy with respect to the generalized coordinate Q J. Well, what you're going to have is basic chain rule, but we've done this before with dot products. You could write it out partial of one dot with the other, or partial the second dot with the first. But because the dot product is symmetric, you can reverse the order, and it's likely up in a function when we had the partial of X transpose X, it became two times X times the partial of X. Right, so I'm doing the same trick here. So I'm assuming, you know, the algebra. So from here, taking the partial, you get mass times velocity dotted with the partial of the velocity with the spectrum generalized coordinate. Remember, there's a dot here, there's no dot here, that's important. If you wanted to find the partial with respect to q dot, well then you do the same thing over, but you get the partial velocity with respect to generalized coordinate rate, that's what appears there. This term is not necessarily zero, if you have Cartesian coordinates X, y and z as we did earlier, then the rates are x dot y dot z dot and that's it. There's no X anymore, those partials would vanish, but generally you also found other terms with central accordance there was R times theta, dot in that velocity term. So taking the partial Inspector theta dot still left you with an R, so just be careful. This is the general form, this would not necessarily be zero, but it can in some cases. So, this is more motivation, these things look kind of, there's an extra dot here, but we're getting closer, there's some relationship here. So what happens if we take, there was an extra dot and D' Alermbert's, somehow I need an extra derivative to start to relate this the D' Alermbert's system. So what if we take this partial with respect to the coordinate rates, and take a time derivative of it? Well, then with chain rule, you're going to have masses constant, mass times R double dot that will add a dot, there dotted with the partial velocity. So here it is partial velocity, plus mass times velocity, started with the time derivative of this partial velocity. All right, use it again. It's one of those days now, what else can we throw in? Mass times acceleration, Newtonian mechanics, that's simply going to be all the forces acting on it. And I'm breaking it up, I'm not breaking down nonworking, constant separation, distance holding internal forces because those are also just holla gnomic in the end. So, we would have other forces, and then constraint forces acting on it, and we'll know those will drop away again. But generally you have all the four m times acceleration is the net force on that particle, so that would have all of this in there, dotted with this partial plus all of this stuff. This is still the same. Wait, I'm missing something here. The dots moved. >> [INAUDIBLE]. >> I took I got rid of the cancelation of dot property. So I went back to just the partial position with respect to coordinate. Yeah, that's the form that I needed, thanks. So now what? There's this constraint force, we know that the constraint force dotted with admissible variations is going to have to be zero. Those things have to be orthogonal, we argued that weeks ago, right? And the admissible variations in terms of generalized coordinates, you just do chain rules. And you sum over all the generalized coordinates and take the partial of the position with respect to those coordinates times variation induced coordinates. Right, and this is a minimal coordinates set, so we can do that. And in the end you end up with those, and then that leaves you the summation of this constraint forces dotted with these partial velocities and all of this must vanish because this net thing has to be zero. These variations are arbitrary, this term must vanish. So therefore, this constraint force dotted with this partial velocity and again, you can add dots or subtract dots, it's the same thing, has to vanish. So that's where we can argue the Lagrangian Dynamics if you have, polynomial constraint enforcing, nonworking forces don't have to include them. The normal force that keeps you on the surface, or the radio force that keeps you on a circle, don't have to include them. With the other method, which is cool, that saves you tons of algebra, you just get the equations you look for. So we can get rid of these constraint forces. That leaves us with all the other forces dotted with partial velocity plus mass times, velocity times. Now, here notice I have the partial of R partial Q, and I'm taking the time derivative, taking the partial time derivative are reversible. So I could do the time derivative of R, and then take the partial or take the partial of our and then do the time derivative. So that's what I'm doing here, and you now have the partial of our dot with respect to Q. Now, if you eagle eyed and look over to the left again, you see this term, mass times velocity dotted with the partial of velocity, respect to generalized coordinates, not coordinate rates. That was nothing but the partial of the kinetic energy of the system with respect to that generalized coordinate, so that's cool. So now we can rewrite all of this as being nothing but the partial of kinetic energy with respect to that generalized coordinate. I go, okay, that's nice because we're starting to get looking pretty ugly. Let's be honest, it's like where are you going? This has simplified all this mess, right, into this. On the left-hand side, we have this term and this must be equal to this term. What is this term going to be, forces dotted with partial velocities, generalized forces again, exactly what we saw earlier. Right, so if we go here, we ended up this is generalized force acting on that jade coordinate. And you end up with this version of Lagrangian Dynamics. [COUGH] If you have the kinetic energy of the system, and these are the forces, the working forces on it, which could be conservative or non-conservative. We haven't made that distinction yet, so it could be gravity and spring force. This is just kinetic energy, not the Lagranginian. You would have to include that and figure out what's due to gravity, what is the general s force acting on X, Y, Z and get all that. But the left-hand side, means once you formulate kinetic energy, it's very mechanical. You take the partial with respect to coordinate rates, partial respective coordinates, and this expression you take the time derivative and done, you have your differential equation. This is super easy to put into Mathematica, and it'll just spit out these equations for you. You notice we don't need to solve for nonworking forces, so these normal forces constraint forces, all the other stuff is dropped out, like with D' Alermbert's. We do have to get generalized forces, s compared to Kane's equations, you do have to get that term right, and to get this going. So that's why some still prefer Kane's equations over Lagrangian's, but it's a form you should be familiar with. So good, so this is Lagrangian's equations that we can solve now. Assuming we have minimal coordinate sets, and you notice to get kinetic energy, I still need to do transport theorem, I still need to have kinetic matics, right? You have your positions of the coordinates using some coordinates. So the position of the masses, and you have to have some coordinates for each position vector. And then you have to take the inertial derivative R dot, and you might have rotating frames that you're using. So you still have to do the proper transport theorem. I've seen people work, well, I know it's right, because I got energy, and then the computer took all my partials. So I know the computer did it right., it's like, yeah, but did you get energy right? R dot, right? If not, this will work, and it'll give you plots, but it won't be the correct plots, it won't be the right stuff, so make sure you do get energy right, but hopefully you guys can do that.