# a pendulum problem

This topic is 5375 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I'm having trouble trying to come up with a rotation matrix that transforms a pendulum at a particulur time. So let's say I want to animate a clock pendulum located at the origin with the pendulum weight hanging down vertically (-Y axis) in the XY plane. The pendulum swings through k radians from end to end, this takes m seconds. The pendulum is at one extreme at k/2 radians at time t = 0. One swing of the pendulum is defined by the function sin(a), where -pi/2 <= a <= pi/2 Now the problem is what is the rotation matrix that would give the the transformation of the pendulum at any given time t, to animate the oscillating pendulum. Can anyone help me out? [Edited by - LordG on October 17, 2004 4:11:49 PM]

##### Share on other sites
Actually solving a real (not mathematical) pendulum problem leads to a differential equation, the solution of which cannot be expressed as an elementary function. So there is no exact function of time giving angle. Only approximations are possible, and thus the exact matrix also cannot exist.
So you just can't exactly convert time to angle.

(the story is different about a mathematical pendulum, since there we assume that sin(a) = a, for small amplitudes, and the equation becomes solvable (the one tought in school))

##### Share on other sites
Assuming you don't want a mathematically correct pendulum you could use a function similar to pi/2*cos(2*t*pi/m) to produce the angle. That will at least get it to swing back and forth.

##### Share on other sites
No, I don't really care if the pendulum is mathematically correct.

Thanks LilBudyWizer, I think that equation you gave is what I needed.

[Edited by - LordG on October 17, 2004 9:53:32 PM]

##### Share on other sites
For small angles, e.g., the pendulum swing back and forth maybe +/- 5 degrees, the sin/cos formulas are pretty darned close to reality. This is provable based on linearization of the governing equations of motion.

##### Share on other sites
[cos(theta) -sin(theta) 0 0
sin(theta) cos(theta) 0 0
0 0 1 0
0 0 0 1]

where theta = pi/2*cos(2*t*pi/m)

is this a valid 4x4 matrix for the original poster's problem?

• 21
• 16
• 9
• 17
• 13