Constraint Dynamics
Comp259, HW 3
Jeff Feasel
Preliminaries
- The bead has a mass of 1 kg.
- Acceleration due to gravity is 9.8 m/s^2.
- The loop is a circle of radius 1m.
- The bead has zero initial velocity.
- The bead starts near the apex of the loop, perturbed a few degrees
to one side. If it started exactly at the top of the loop with zero
velocity the bead would go nowhere.
- Runga-Kutta 3-step integration is used with a step size of 0.005 sec.
Constraint Force
- The primary force that acts upon the bead is gravity. The force
of gravity is -- obviously -- always applied straight down.
- The constrained force is calculated so as to ensure the curvature of
the bead's path matches the curvature of the loop.
- The constrained force is computed based only on the force of gravity
and the particle's current position and velocity. Other forces are
used to compensate for numerical error, but these are not included in the
computation of the constrained force.
Correction Force
- Truncation error in the integration causes the bead to come off track
slightly at each time step. I compute the distance between the center
of the bead and the point on the loop nearest to the bead's center.
- A force proportional to this distance is applied in a direction towards
the nearest loop point (which is also toward the loop's center).
- The force has a magnitude of 1.0/(time_step_size) * distance from loop.
- This force is not counted in the computation of the constraint
force.
Friction Force
- Friction is applied in a direction opposite to the velocity.
Its magnitude is proportional to the velocity by a factor f, which
I set to 0.0001 for many of my trials.
- This force is not counted in the computation of the constraint
force.
Experimental Results
- The bead starts a few degrees off of the apex of the loop. It
speeds up as it falls and then slows as it climbs back up to the other side,
up to about the same height it started at before falling back down.
- With friction disabled the bead will eventually (after 20 oscillations
or so) go slightly higher than where it started and loop around over the
top rather than falling back down the way it came. This means the integration
process adds a slight amount of energy to the system.
- A very small amount of resistance solves this problem. A friction
coefficient of 0.0001 is the smallest value that will keep the system from
gaining energy. With this very slight friction force, it does not appear
to ever loop around over the top, nor does the bead's maximum height show
an appreciable decline within several minutes of simulation.
- I tried several values for the magnitude of the correction force. This
force is proportional to the distance between the bead's center and the nearest
point on the loop. A constant of 1.0/(time_step_size) seems to be optimal.
- Smaller correction forces cause the bead to gain enough energy to loop
over the top. This can be explained as follows: Numerical error
in the integration causes the bead to gain energy. The correction force
pulls it directly inward, in a direction that's slightly more than
90 degrees to its velocity, therefore reducing the speed slightly.
(If it were less than 90 degrees the speed would be increased, exactly
90 degrees the speed would be unchanged.) Much like the friction force
-- which works completely counter to the velocity -- it serves to
reduce the kinetic energy of the bead which counter-balances the energy added
by the integration.
Source code.