Pendulum - a third way

Looking back at part I of this idea, I don't think I did a very good job. Let me summarize the key things I wanted to say:

  • Normally, there are two ways of modeling the motion of an object:
  • Calculating the forces on the object and using the momentum principle or Newton's second law (which are the same thing). I called this the Newtonian way. The problem with this method is forces that constrain the motion (like the normal force). These forces have a variable magnitude to make the object stay on a particular surface.
  • Defining some variables that describe the system as it is constrained. Then finding the kinetic and potential energy in these variables and using Lagrange's equations. I called this the Lagrangian way. The trouble with this method is that if there are dissipative forces (like friction) things get weird.

Either one of the above ways essentially gets you the same equation of motion. For a pendulum, here is the setup:

i-ec305bf829488b92c75ee5a3f760a55a-2009-12-06_untitled_7.jpg

And here is the equation of motion:

i-f7f8ff30d8d95186a0d84c1a844ec015-2009-12-06_la_te_xi_t_1_4.jpg

Note: this is not your normal text-book pendulum equation. In the simple form, it is assumed that the angle is small. With this approximation, it could be written as:

i-becf262509655500f23ea4f325b75963-2009-12-06_la_te_xi_t_1_5.jpg

Textbooks like it this way because now it looks like the equation for a simple harmonic oscillator. However, for the rest of this post, I am going to use the better version of the equation of motion. Ok, one last point. How do I know that equation is good to use? Simple - it agrees with experimental evidence. So, for the rest of this post, I am going to use that equation of motion as though it were a real pendulum.

Another method

If you think about the pendulum, what makes it tricky? It is not gravity, that is simple. The tension in the string is the problem because it is one of these forces that changes to make the mass stay in the path it stays in. How does the string know exactly how much force to exert on the mass? Think about it. What if the string pulled too much on the mass. If this happened, the radial acceleration would be greater than needed to move in a circle of radius R.

How does the string do that? Is it magic? Does it have a super computer in it? Clearly, not. I think the simplest answer is that the string is like a spring. The greater you pull on it, the more it stretches. When it stretches, it acts like a spring. Springs are awesome. I can model springs. What if I model a mass on a spring with a really high spring constant? That is what I am going to do in vpython. Here is a picture.

i-24d6cea0a875bd47117c16daac81f25d-2009-12-06_vpython.jpg

It turns out that I don't want to do this in vpython. The problem is that vpython doesn't make pretty graphs. Instead, I will use python and use the matplotlib module to make graphs. Here is the game plan for the numerical model:

Calculate the forces on the mass - the gravitational force and the force due to the "spring-string". I could write this as:

i-2ec58004be0f3309d53a8b3a3cfec5a6-2009-12-06_la_te_xi_t_1_15.jpg

  • g vector is the gravitational field
  • r is a vector from the pivot point to the mass
  • R is the length of the "string" or the unstretched length of the spring
  • k is the spring constant of the string

Next, I can use the net force to find the change in momentum of the mass:

i-ef98b5433c92743f4a201b3db0f80f13-2009-12-06_la_te_xi_t_1_16.jpg

And the position (new position) can be determined by:

i-29f737adbc2f4b7ad03c261e24ec2c2b-2009-12-06_la_te_xi_t_1_17.jpg

After this, update the time and keep repeating everything. Of course, this is the basic idea behind a numerical calculation. I usually write pretty messy code, but if you want it, you can have it.

spring_pend_et.py

How well does it do? Here is a plot of the y-position of the spring mass. In this first plot, I intentionally set the spring constant sort of small. In this plot, I set the following:

  • mass = 0.1 kg
  • k = 500 N/m
  • dt = 0.01 seconds

i-8aa1e7cb157e4d397cbaa9275c13429e-2009-12-06_image_1png.jpg

Kind of shaky - this can be fixed. I will increase the spring constant to 5000 N/m and decrease the time interval (dt) to 0.001 seconds. This produces:

i-d04b2e1e0e2b1336fd74f09248100dbc-2009-12-06_image_123png.jpg

How well does this compare to the equation of motion? Here is a plot of the numerical solution of the original equation of motion (from the Lagrangian way) and a plot of the motion of the spring-pendulum. In order to see these two functions, I off-set the values of one of the plots.

i-993d8ab7cfeff5b01474cc36fcbb20f6-2009-12-06_untitled_8.jpg

There is actually a difference between these two plots. If I remove the off-set and zoom in, it looks like this:

i-a1aa10ba31f5ffb49838d2de9132179a-2009-12-06_zoominpng.jpg

I could get rid of these squiggles by increasing the spring constant and/or decreasing the time interval.

So, I claim this works. Does it work well? That is debatable. In order to get good results, the time interval must be pretty small. As computers get faster, this is less of a big deal. Actually, treating stuff as springs is how many of the computer games model physic-y stuff. For them (game programmers), the world is a spring.

More like this

Say, is the equation up there in polar coordinate? I haven't seen a pendulum equation whose variable is an angle while learning it.
Also, what happens if you don't small angle approximate in the usual way? Does it become unsolveable?

@IBY,

This is a good question. Good enough that I will try to make a post just to answer it in more detail. Hope you don't mind waiting a couple of days?