# How do I calculate a upward-pulling force on a swinging pendulum?

I'm trying to implement a simple pendulum using a 2d physics system that can model rigid bodies with gravity. The problem is that I don't know how to calculate the upward-pulling force of the rope, as in this image: I've only found equations for calculating velocity of the pendulum, as shown on wikipedia, but the problem is that I can't change the velocity directly, as I need to be applying a force. The problem is probably just the magnitude of the force vector. Since in the idle position the upward force is equal to negative gravity, I thought I could simply take something like $cos(\theta) \cdot v \cdot G$ where $v$ is the pendulum vector and G is gravity magnitude, but that doesn't work in my simulation.

• Can you define your "pendulum vector"? – Sanya Jul 18 '16 at 23:26
• @Sanya the direction from the pendulum upwards the rope. Basically it's the direction of the force the rope applies to keep it up (in the first image "mysterious rope force") – Jakub Arnold Jul 18 '16 at 23:28
• then I would check your implementation (and maybe ... is your mass unity?); otherwise your idea is correct in my opinion. – Sanya Jul 18 '16 at 23:34
• You can implement a solution by fixing the length of the pendulum. In that case the only force you would need to consider is gravity. Also, that's pretty much how things work in nature, and your solution would be a good simulation. You could figure out what the tension force is (both $x$ and $y$ components) but in order to do that you would have to solve Newton's equations for a complete solution. Your computer program would then be more of an animation than a simulation. The simulation is more interesting, and allows changes that might be impossible to solve analytically. – garyp Jul 18 '16 at 23:46
• @garyp I can't really change the way I approach the problem, given that I have a fixed library I need to use, and to do that I basically do have to animate by applying a force in each time step. – Jakub Arnold Jul 18 '16 at 23:53

The rope pulls just enough that the pendulum doesn't fall to the ground, but follows an arc.

The following picture shows you how work out the force for the static case (no motion of the pendulum):

However, you need to take account of the fact that the pendulum is moving in an arc. When something moves in an arc, you need an additional force $F=\frac{mv^2}{r}$ to provide the centripetal force needed.

Combine these two forces, to obtain the total "mysterious force". Can you figure it out from here?

• I thought I understood until you said to combine the forces. Isn't the one I need the centripetal force? – Jakub Arnold Jul 19 '16 at 0:12
• You also need to counter gravity... – Floris Jul 19 '16 at 0:13
• If I take $-F_g$ + $\frac{mv^2}{r}$, wouldn't the ball just end up sitting in its place in the beginning, since the initial velocity would be zero, so there's no centripetal force? – Jakub Arnold Jul 19 '16 at 0:24

A properly drawn free-body diagram will have a tension force vector acting along the line of the rope, toward the pivot point and a gravity vector acting straight down. If you establish a coordinate system which is instantaneously parallel and perpendicular to the rope, you then will decompose the gravity vector into two components ( $mg$ times trig functions of the angular position, $\theta$). Usually, $\theta$ is measured with respect to the vertical.

The vector sum of the components parallel to the rope must equal $m\frac{v^2}{l}$ where $l$ is the length of the pendulum. $$F_{tension}-mg\cdot\text{trig_function}(\theta)=m\frac{v^2}{l}$$ The gravity component perpendicular to the rope must be $ml\alpha$ where $\alpha$ is the instantaneous angular acceleration, $\alpha= \dfrac{d^2\theta}{dt^2}$.