Hello and thanks in advance for your help.(adsbygoogle = window.adsbygoogle || []).push({});

For about a week now, I've been trying to write what should be a simple python program. The idea is first to write a program for a simple harmonic pendulum, then adapt it to a spring pendulum. However, in order to do this, I have to write the simple harmonic pendulum so that it is moved by forces in certain directions.

I have all (or most?) of the mathematics and physics behind it sorted, but I have no idea how to program it in a way that would include the forces acting upon the pendulum to make it work.

The forces (simple harmonic pendulum):

Gravity: g

Perpendicular: -mgsin(theta)

Bottom of the weight: mgcos(theta)

Total (directionless) speed of weight: [tex]v=\sqrt{2gr(cos(\theta_{1})-cos(\theta_{0}))[/tex] (Theta_{1}is the current angle the object is making, Theta_{0}is the starting angle)

And a few others

Would it require a rule that doesn't allow it to go more than the length of the string away from the origin, or is it possible to model it with forces too? (It doesn't really matter though, as the spring pendulum doesn't have this restriction)

With the pendulum as a spring, the only thing I can think of to add would be Hooke's law.

Thanks again, and any help would be appreciated.

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

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

# Visual Python Pendulum

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads for Visual Python Pendulum |
---|

Python for vector files |

Practicing Python and R at the same time |

Python (VPython) Can someone help me with my orbit simulator? |

Using Visual Basic |

Visually Graphic Bugs |

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