[CSC 415] Pounds' Pendulum Particulars
Andrew J. Pounds
pounds at theochem.mercer.edu
Sat Jan 22 10:01:50 EST 2011
I know that some of you are working on your pendulum this weekend. I
was asked to provide some particulars to help guide you in your coding.
1. You need one window with a pendulum that looks like a thin
swinging beam. This will be a 2D representation of a pendulum
(nothing fancy -- think of a long rectangle moving around a point
at one end). The pendulum should move "physically" -- meaning
that as it approaches the top of the window it is moving slower
and has its maximum velocity when it swings through the bottom of
the window. Your window should be large enough to show the full
motion of the pendulum so if you give it enough initial velocity,
and it swings all the way around, you can see it. I encourage you
to start with the undamped case so you can carefully observe what
is going on. We will talk about input parameters this week.
2. Your pendulum should move roughly at the same speed on any
computer platform and graphics card (we will have to talk more
about this in class -- you bascally will need to write "self
tuning" graphics code). Before you work on the tuning code, try
to write your pendulum code so that the relative computer platform
speed of the motion depends only on the step size "h" in the
Runge-Kutta calculations.
3. In a second window please show the
* pendulum length
* pendulum "bob" mass
* initial velocity
* an indicator showing if the motion is damped or undamped
* if damped, the damping coefficient (or coefficient of
friction). This can be combined with the damping indicator
above.
* the period of the pendulum (more about that later)
* the instantaneous velocity in radians/sec
4. You will need a third window in which you graph the phase space
plot for the system as the pendulum motion is propagated. We will
talk about this more in class this coming week.
5. As with projects in the past, I prefer that you make segemented
source files with a single makefile to build the project. If you
intend to run your code on multiple platforms, then please include
the appropriate information in the makefile to determine the type
of platform on which you are building. Use this information to
call the appropriate sections of your makefile.
6. Once you are done, I need everything tarred and gzipped and
e-mailed to me.
Here are some question you might want to ask yourself.
1. On what variable(s) does the pendulum's motion depend?
2. If you run the pendulum undamped, is there some point at which it
will cease to work properly?
3. Can you give your pendulum the correct initial velocity to make it
"hang" at the top?
4. Does the period of the pendulum change as a function of time?
5. Is there a relationship between the period of the pendulum and the
Runge-Kutta stepsize "h"
--
Andrew J. Pounds, Ph.D. (pounds at theochem.mercer.edu)
Associate Professor of Chemistry and Computer Science
Mercer University, Macon, GA 31207 (478) 301-5627
More information about the csc415
mailing list