# Finding position of simple pendulum?

1. Oct 3, 2009

### DevonV

I'm trying to write a program to model a simple pendulum, and I'm having some trouble seeing how I would solve for the position w.r.t. time.

I would ultimately like to be able to specify a length of string, acceleration due to gravity, mass (though I know it has no effect on the period) and angle it's pulled back.

Any help would be great, thanks!

PS: I don't think this qualifies as homework because I'm doing it for fun, but I'm very sorry if I'm wrong!

2. Oct 3, 2009

### sleventh

I'm assuming you are using a pendulum with a dampening force such as air resistance. If not you will be able to exclude the resistive force parameters from this adaptation of newtons second law, allowing your pendulum to follow free oscillation. the angle in this case is equal to phi and anything following after the symbol $$\cdot$$ is meant to be the time derivative of that variable.
Force=m(L $$\cdot$$ $$\cdot$$$$\phi$$)=restoring force+resistive force
=-mgsin($$\phi$$)-2m$$\sqrt{g/l}$$(L $$\cdot\phi$$) [note: the rsistive force in this case is a obscure example. you will need to create your own depending on what you would like your program to do.

from here you will integrate solving for your angle as a function of time.
$$\phi$$(t)=(A+Bt)e^(-$$\sqrt{g/l}$$t)

[note: the value $$\sqrt{g/l}$$ is considered your dampening parameter which i defined in this case. if you chose to exclude a dampening force or use a different dampening scenario this will not be similar]

to solve for A and B you need to use the first equation and the previous in combination and also set initial parameters. hope this helped!