Difference between revisions of "Matlab Primer"
(→Pendulum on a movable support) |
(→Pendulum on a movable support) |
||
Line 46: | Line 46: | ||
:<math>\ddot\theta + \frac{\ddot x}{\ell} \cos\theta + \frac{g}{\ell} \sin\theta = 0.\, </math> | :<math>\ddot\theta + \frac{\ddot x}{\ell} \cos\theta + \frac{g}{\ell} \sin\theta = 0.\, </math> | ||
− | These equations may look quite complicated, but finding them with Newton's laws would have required carefully identifying all forces, which would have been much harder and more prone to errors. By considering limit cases, the correctness of this system can be verified: For example, <math>\ddot x \to 0</math> should give the equations of motion for a pendulum which is at rest in some [[inertial frame]], while <math>\ddot\theta \to 0</math> should give the equations for a pendulum in a constantly accelerating system, etc | + | These equations may look quite complicated, but finding them with Newton's laws would have required carefully identifying all forces, which would have been much harder and more prone to errors. By considering limit cases, the correctness of this system can be verified: For example, <math>\ddot x \to 0</math> should give the equations of motion for a pendulum which is at rest in some [[inertial frame]], while <math>\ddot\theta \to 0</math> should give the equations for a pendulum in a constantly accelerating system, etc. |
Revision as of 23:17, 2 November 2012
Today's lecture will be on MATLAB and PENDULA (plural of PENDULUM). Your next lab assignment motivated the topic.
My name is Sean Carver; I am a research scientist in Mechanical Engineering. I have been programming in MATLAB for almost 20 years and programming computers for almost 30 years.
Pendulum on a movable support
Consider a pendulum of mass m and length ℓ, which is attached to a support with mass M which can move along a line in the x-direction. Let x be the coordinate along the line of the support, and let us denote the position of the pendulum by the angle θ from the vertical.
The kinetic energy can then be shown to be
and the potential energy of the system is
The Lagrangian is therefore
Now carrying out the differentiations gives for the support coordinate x
therefore:
indicating the presence of a constant of motion. Performing the same procedure for the variable yields:
therefore
These equations may look quite complicated, but finding them with Newton's laws would have required carefully identifying all forces, which would have been much harder and more prone to errors. By considering limit cases, the correctness of this system can be verified: For example, should give the equations of motion for a pendulum which is at rest in some inertial frame, while should give the equations for a pendulum in a constantly accelerating system, etc.