Hello.(adsbygoogle = window.adsbygoogle || []).push({});

This is not a Physics homework problem, but rather a Programming project. I am asked to model a pendulum using the Java Swing class for graphics, but I'm having a few problems understanding the Physics behind it, and would appreciate a few answers and some guidance.

Doing the research, I found some energy equations (K = 1/2*m*v^2; U = mgh), but I don't think they'll be too useful in my calculations.

I then found the following equations:

Omega (W) = SQRT(g/L), where

Omega is the angular frequency,

g is the acceleration due to gravity, and

L is the length of pendulum the string.

Theta (Angular Frequency) = Theta_MAX * cos(Omega * dt + Phi), where

Theta is the angular distance moved in the given time period dt,

Theta_MAX is the maximum angle for the pendulum, and

Phi is the phase shift.

I think I want to use theThetaequation for program, but I'm not sure how.

Here are my initial assumptions for my model:

* Bob starts from rest at an angle of 20 degrees (0.349 radians)

* g = 10 m/s^2

* L = 100 m

* dt = 0.1 sec (time increment for displaying the location of the bob at different intervals)

Here are my calculations:

Omega = SQRT(g/L) = SQRT(10/100) = 0.32 rad/s (approximately 18.33 degrees per second)

Now here's where I thinkmy calculations are incorrectwhen I try to find Theta, the angular displacement in each 0.1 second time increment. This angle will be used to draw the pendulum string (using the Java drawLine method).

Theta = Theta_Max * cos(Omega * dt + Phi)

Theta = 0.349 * cos(0.32 * 0.1 + 0.349) = 0.349(??????????)

It seems that in this equation, as the time increment dt approaches to 0, the angular displacement Theta moved in these 0 seconds approaches to 0.349 * cos(Omega * 0 + Phi) = 0.349 * cos(Phi) = 0.349 * cos(0 + 0.349) = 0.328 rad, which does not make sense.

Am I mistaken with the phase shift? Or is the whole equation misplaced or something? I'm fairly sure this is the equation I need to figure out how far the bob has moved in each 0.1 second time increment.

Any information on the matter will be greatly appreciated.

Thank you.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Angle/distance (Theta) moved by a pendulum bob in t seconds.

**Physics Forums | Science Articles, Homework Help, Discussion**