it might of of interest to browse the D:EasyJavaSimulationEJS_4.1_090312EJS_4.1workspacesourceusersmurciafemphysicsmechanicsSimplePendulum.xml

i think it has useful tips for modeling pendulum.

Description: Pendulum

A simple pendulum is a physical abstraction that considers a point mass m that oscillates in a vertical plane at the end of a rod of length L and negligible mass.

If we consider the force exerted by gravity on the mass as constant, g, the motion of a simple pendulum can be modeled by a second order ordinary differential equation.

The equation includes a friction force, with b as friction coefficient, and a time-dependent external torque of the form A*sin(F*t), which drives the motion. Typically, the pendulum starts oscillating at time t=0, from a given angle with zero initial angular velocity.

Evolution equation:

d(theta)/dt = omega

d(omega)/dt =-g/L * Math.sin(theta) + (-b*omega+torque(t))/(m*L*L)

Custom:

public double torque (double time) {

return amplitude*Math.sin(frequency*time);

}

I would delete the torque part if you want a simple pendulum with no external torque.

Evolution equation:

d(theta)/dt = omega

d(omega)/dt =-g/L * Math.sin(theta)

I also journeyed on learning with e-trails of my learning

http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=818.0may my XML help you too.