where
L is
the length,
m is the mass of the bob,
g
is the local gravitational constant (
g= 9.8
m/s
2) and
theta
is the angle through which it swings. This
equation is similar to the mass-on-a-spring
in one dimension, if we consider theta to be
analogous to x in that case. The usual way
this is solved is by assuming that
theta <<
1, so sin(
theta) ~
theta.
In that case the equation is formally
identical to the mass-on-a-spring.
We will use the Runge-Kutta method to solve
for the motion in the general case,
where theta is
not small--that is, where
one cannot use the small-angle approximation
to simplify the differential equation.
In that case one must use the full form of
the differential equation above, with terms
cast into the General Form discussed in
class and in chapter 9 of the text.
In this case, the variables can be
identified with the text's standard form as
follows:
Here
equation (1) defines the formal relation
between the angular frequency omega and
the angular variable theta, and equation
(2) is the recast form of Newton's Law
in this case. In the form given by
L&P these two equations look like
In this case the functions that will need to
be embedded in your parent program, and then
passes as arguments to
FRK2( ) are
fairly simple:
//the dx/dt function only requires returning the velocity--no action
double f_x (double t, double x, double v)
{
return (v);
}
// Here is the actual force law
double f_v( double t, double x, double v)
{
double retval, g, L;
g = 0.0; // insert actual value for g
L = 0.0; // insert actual pendulum length here
return( retval = -g/L*sin(x));
}
Lab Assignment for Report:
- Summarize your prior exercises
where they are relevant to set the
context for the following work.
- Using your harmonic oscillator
program as the template, create a new
program to analyze the motion of a large-amplitude
pendulum for about 10 periods
or so, for a starting amplitude of 2.9
radians.
- Plot the results in a manner
similar to the harmonic oscillator,
including the total energy. Check
energy conservation for both the Euler
and RK2 methods.
Compare the results to the solution
for small-amplitude oscillations (eg.,
sinusoidal behavior).
- Plot the period of the oscillation
as a function of the starting
amplitude, from 38 degrees up to 178
degrees, in 20 degree steps (you can
just measure the period from your
graph using the cursor function of you
wish). What is the physical cause of
this behavior? (You can describe it in
qualitative terms).
7. Extra credit (15%) : Velocity
dependent drag force
Add a drag
force to either your mass-on-a-spring
harmonic oscillator or the simple pendulum
above, of the form
Fd = -b v
where b
is the drag coefficient (units of
kg/s). Choose a value of b
for your input parameters which damps
the oscillations down to 1/e of their
original value within about 5 periods.
Check that you conserve energy for b=0.
Check also that you can reproduce the
critically damped and overdamped cases
for some values of b.
Show some plots of the behavior.
Hint: since your equation for dv/dt
now has a dependence on v, you will
need to use the full Runge-Kutta
terms, including the v-dependent terms
shown above. You may want to
separate your RK calculations into
function calls to simplify the
program.