This example, we're going to go back. This is a familiar one. You may have solved this dynamical system before with Newtonian mechanics. Pretty simple. We'll have a spring force, it's not just a linear spring, it has a cubic stiffness to it as well. I just wanted to show this one, so what is the potential function of a cubic stiffness and we want to get these equations of motion. We're going to first do Newton's equations then we're going to solve the other forms that we go through. With Newton's equations, F equals ma. I need a, the acceleration, so if this is our er, you take two derivatives, like you can hopefully just do in your sleep now. You got that and there's a constraint. There is a motor that makes this move at a big Omega rate. My Theta dot is equal to big Omega which is equal to a constant. Whatever the particle is doing, that motor is strong enough to just override that. I stuck your VACMG circle, I'm assuming I can get the gimbal rates that I want regardless of what happens inside with the wheel speeds you had some good servo controls. That's exactly what's happening here. Very equivalent to VACMGs. This is our constraint. Is this in a pfaffian form or is this in a holonomic form? Abby, what do you think? This constraint, how it's written. Pfaffian or holonomic? Pfaffian. You don't sound certain. What's unclear? You're right. It is a pfaffian form. What makes it a pfaffian? [inaudible]. No, you're thinking rheonomic and scleranomic. That's where we had holonomic constraints that either were or weren't time-dependent. What was the key thing that makes this a pfaffian form Paul? Let's say it has got rates. Has rates in it. Holonomic constraints only have states. This distance must be constant. This length, the height of the floor must be a constant, only has states and then pfaffian forms allows you to have linear dependencies on rates because it's Theta dot. You can integrate this. This is again integrable and you could say that Theta is equal to initial Theta plus big Omega times time and you can have an explicit answer in a holonomic form. That's one where time appears in it explicitly but I'm going to use the pfaffian form because that's what I need later on. But now when I have my acceleration to go from here to here, I'm simply applying this constraint that the Theta double dot, well, Theta dots is constant so there is no Theta double dot that goes to zero. Theta dot just becomes big Omega, so my r double-dot here is my constraint compliant version of my acceleration. I applied that constraint. That's what you do with Newtonian stuff. Then I've got my forces well, free body diagram. You're going to have the radial spring force that's here plus the wall is pushing on it. I'm ignoring gravity, you would have gravity pushing up on this thing as well but then n just becomes mg. It completely decouples, so I've simplified the algebra just for this example. Let me go into gravity part. This could be floating in space, this would still work then. This is the force and now we do F equals ma. You set them equal. In this case I get my differential equations readily in this simple example right here and this other force I had to introduce and I didn't know what it was, it's just going to be the e Theta component. If you looked at the falling rod problem, the other ones we would have to back solve system of equations for these unknowns and then get differential equations as a result of that. Here is a simple enough system where the math just happens to work out to be decoupled and one gives me my equation and one gives me the constraint force. Well, that's the wall force that has to act on it. That's the Newtonian approach. Let's do Lagrange's equations. Again, I'm doing it in a minimal coordinate set first. The only degree of freedom I have is r. Theta is dictated through this constraint. You have to be moving at a constant rate. Theta is not a degree of freedom. So when I get my r dot, I simply have to replace Theta dot with big Omega and that's my inertial velocity I will have that is constrain compliant. The only generalized coordinate I need is r in this case. Then given this, your mass over 2, velocity squared and I'll let you adopt this. These are at least orthogonal so this will give you this result, and this force is a conservative force for the spring. The linear spring is k_1 over 2r squared. The cubic spring is simply going to be k_2 over 4 times r^4. You should always be able to go backwards. If you have this potential function, what's the gradient of this with respect to little r and you get 4 times r cubed and 4 times 1 over 4 cancels, and it's the negative gradient that gives you the force which gives you minus k_2 r cubed. If you think you're right or you're not sure if this is a four or a two just quickly take the gradient of it and you will find that you get back the original force. Now we have the linear and the cubic conservative force written as a potential function. I do my Lagrangian, so this minus all this is here and now we'll look at the wall force, the wall force I can just look at my wall force dotted with admissible variations because I have a one degree of freedom system. The only things I can vary are in Theta. That's always going to be in the e_r direction regardless of where e_r points. The del r you would have is del r e_r dotted with this. This becomes zero which means the wall force is a non-working term and I don't have to include it which should make sense because this is the force that enforces this holonomic or pfaffian constraints and these don't do work. You do just this is equal to zero. There is no big Q in this particular case and outcomes with the math this differential equation again, same as when we had the Newtonian approach. Now let's try it as a redundant set of coordinates subject to this constraint. What do you have to do? Well, we write our kinetic energy but you note I don't say that Theta dot is equal to big Omega, I'm just treating Theta and r as independent coordinates right now, two generalized coordinates and they have to satisfy a certain constraint. The Lagrangian that you're going to have is T minus V. The V is the same as before so that's still there. The constraint, this is a pfaffian form, so it was A times your generalized coordinate rates Q_1 dot, Q_2 dot which in this case is x dot and Theta dot. Well, there is no x dot in my pfaffian form so that one is just going to be zero, the sensitivity and there's Theta dot, so it's partial it's just going to be one and there is a term that goes into the B and that was the minus big Omega that you'd have. That's the pfaffian form. When we solve this, we're now going to have Lagrange multipliers times the sensitivities and it's per J, so per column. This is not per row. The coordinates one through little n act on the columns here and you multiply this out. It was A times Q dot as a set. If you do that, we have one constraint, so there's one multiplier and the first one is this with respect to r equal to Lambda times 0 from here and the second one is the Lagrange operator on the Theta coordinate equal to here that would be this column 1, so Lambda times 1 which leads to these two sets of differential equations which are still coupled and we have a Lagrange multiplier. What you do now is you solve these subject to this algebraic. This is a differential algebraic form. Now you plug in Theta dot is equal to a constant, that means Theta double dot vanishes. Theta dot becomes big Omega. The law here again, it's such a simple system. The Lagrange multiplier trivially is given this way and it didn't appear in my differential equation, so the first line still just gave me my differential equations. Solving this DAs became somewhat trivial. It's not always this trivial. Sometimes you have to back substitute and do more math. But this gives you a little bit of an idea that we can deal with constraint coordinates on constraints Lagrangians and how this all falls together. Any questions on this one? Yes Anthony. We have something simple like this, you have the Lagrangian multiplier [inaudible], is it really even worth solving for, do you really even need it? In this case you don't have to get the equations of motion. If you do want to know what it is for other stuff because that's really, you know the Lagrange multiplier actually tells you what that force is going to be. Maybe you do want to know what the wall force is. I'm not going to break it, I can only apply so much force there before I might have breakage. You could go back and solve for that if you need it. Generally I would say for now on hallmarks on the problems give me both, give me everything to solve the full thing. But in real life you rarely will deal with such simple systems because if you do why are you doing a constraint Lagrangian formulation, this is like a 2, 3 liner with Newtonian mechanics or Eulerian mechanics. For the cases where you do use Lagrangians you don't get this simple decoupling. [inaudible]. Exactly, otherwise this sledgehammer trying to drive in a little bitty nail. Good.