<center><applet code="pendulumSystem.class" width=500 height=350 codebase="/java/Pendulum/"><param name="Reset" value="Reset"><param name="Pause" value="Pause"><param name="Show" value="Show"><param name="Resume" value="Resume"><param name="" value=""></applet></center>
You are welcomed to check out
Force analysis of a pendulum<hr ALIGN=LEFT WIDTH="100%">
<font size=+1>How to change parameters?</font><ol>Set the initial position
<font color="#0000FF">Click and drag the left mouse button</font>
<ol>The horizontal position of the pendulum will follow the mouse Animation starts when you release the mouse button</ol>
<li>Adjust the length</li>
<font color="#0000FF">dragging the pointer (while > holding down the left button)</font>
<ol><font color="#0000FF">from the support-point </font>(red dot) to a position that sets the length you want.</ol>
Animation starts when you release the mouse button
<li>Change gravity <font color="#FF0000">g</font></li>
<font color="#0000FF">Click near the tip of the red arrow</font>,
<ol>and drag the mouse button to change it (up-down).</ol>
<li>Change the mass of the bob</li>
<font color="#0000FF">Click near the buttom of the black stick,</font>
<ol>and drag the mouse button to change it (up-down).</ol>
</ol>
Information displayed:
<ul>1. red dots: kinetic energy <font color="#0000FF">K = m v*v /2 </font>of the bob 2. blue dots: potential energy <font color="#0000FF">U = m g h</font>of the bob
<font color="#0000FF">Try ro find out the relation between kinetic energy and pontential energy!</font> 3.black dots (pair) represent the peroid T of the pendulum
<ul>move the mouse to the dot :
<ul>will display information for that dot in the textfield</ul>
</ul></ul>
Click
show checkbox to show more information
<ol>blue arrow(1): gravity green arrows(2): components of gravity red arrow
(1): velocity of the bob
<font color="#0000FF">Try to compare velocity and the tangential component of the gravitional force!</font></ol>
<hr WIDTH="100%">The calculation is in real time (use Runge-Kutta 4th order method). The period(T) is calculated when the velocity change direction.
<ul><font color="#0000FF">You can produce a period verses angle ( T - X ) curve on the screen,just started at different positions and wait for a few second.</font></ul>
Therotically, the period of a pendulum

.
Purpose for this applet:
1. The period of the pendulum mostly depends on the length of the pendulum and the gravity (which is normally a constant)
2. The period of the pendulum is independent of the mass.
3. The variation of the pendulum due to initial angle is very small.
The equation of motion for a pendulum is

when the angle is small
math_failure (math_unknown_error): \theta << 1
,

so the above equation become

which imply it is approximately a simple harmonic motion with period

What is the error introduced in the above approximation?
From Tayler's expansion

To get first order approximation, the error is

So the relative error (error in percentage)=

If the angle is 5 degree, which mean

So the relative error is

For angle=5 degree , the relative error is less than

For angle=10 degree , the relative error is less than

For angle=20 degree , the relative error is less than

So the period of the pendulum is almost independent of the initial angle (the error is relatively small unless the angle is much larger than 20 degree- for more than 2% error).
So sad.. still can't find resource code.