I'm trying to animate an $N$-Pendulum with solid (massless) rods, though I have tried many different ideas but I can't seem to make the animation work. Here are my last few thought processes:
First, at a certain frame, calculate the net force on each node. For a very small change in time, 3 essentially rotates around 2, and 2 around 1. So, the net force must be entirely perpendicular to the previous bar. As such, I can work backwards: first we know the gravity on three, and I know the angle relative to 2, so I now know both the net force and Tension 2 (which must cancel with a component of gravity), then we repeat up the chain.
My goal is to get the net angular acceleration on each node so I can do a double riemann integral (I have angular position and velocity relative to the last node stored for each node).
angv += anga * dt, angx += angv * dt
Then, we have the net force at each node, here's what I've been playing around with. For each rod, calculate the net angular acceleration on both ends and then since the previous node doesn't move (for a small dt), that angular acceleration is equal to the a.a. around the last node and not just the center of mass. I think the error here was that this started swinging with both nodes always in line if you started it perfectly horizontally
Because of the error, I decided to elapse time one at a time instead of on both ends of the rod. I moved a node a little bit, then calculated the angular acceleration on each of the rods to calculate their new angular positions.
I then realized that let's say the previous nodes had a sudden movement, then the net acceleration on that node would be affected, so I calculated the net acceleration on each node then did vector addition for the previous nodes up to the current node and then did the same rod calculation as 1)
I'm not sure what I'm doing wrong: here's my animation so far (for 2 which is my most updated version). It tends to work better with more limited nodes probably meaning that it's the more complicated algorithms messing up, or I'm just bad at coding https://i.stack.imgur.com/pvCoI.jpg