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.