00:01
Ok we have a cart with a spring attached to it that can oscillate back and forth and there's a pendulum attached to the middle of that cart of mass m.
00:14
So we want to write out the lagrangian for this.
00:19
We have to start with the kinetic energy terms.
00:22
So for the mass m.
00:27
So the only, so i've got two generalized coordinates.
00:36
One of them is little x that tells us the position of the cart.
00:45
And it's measured from the equilibrium position of the cart which is a, so that makes it an inertial coordinate.
00:53
So for that the kinetic energy is just going to be half little m times x dot squared.
01:05
So for big m the kinetic energy is somewhat trickier because the theta, the theta generalized coordinate we want to use is not inertial.
01:19
And so we have to relate this to the inertial coordinates.
01:24
So i'm going to use x and y as the positions of the particle down here relative to an inertial frame.
01:43
Because that's what i need to calculate the kinetic energy.
01:47
So x is going to be little x plus l sine theta.
01:59
And then y will be just l cosine theta.
02:11
And so when i take big x dot we get little x dot plus l cos theta theta dot.
02:23
And y dot is l minus l sine theta theta dot.
02:33
Okay.
02:35
So when i calculate the kinetic energy for the bigger mass, mass big m, i get half big m times x dot squared capital x plus capital y dot squared.
02:55
So that's one half of big m and then i get little x dot plus l cos theta theta dot squared plus l squared sine squared theta theta dot squared.
03:16
And i can expand this and so i'm going to end up with little x dot squared plus 2l cos theta theta dot x dot.
03:32
And i get a theta dot squared times cos squared theta.
03:36
So that's just going to be sine squared plus cos sine squared is 1 l squared theta dot squared.
03:43
So there's my kinetic energy.
03:47
Okay.
03:47
Then i have two potential energy terms.
03:52
One is for the spring.
03:54
So i get one half kx squared for the spring.
04:00
And then for the gravity, usually we put u equals zero at the bottom of the swing.
04:12
So u for the gravitational potential, it's above that.
04:22
So it's l minus l cos theta.
04:25
So it's little m, excuse me, big m g times l times one minus cos theta.
04:47
Okay.
04:48
And so my lagrangian is t minus v.
04:53
So we have all those different terms going in there...