Talk:Animate a pendulum

Revision as of 17:16, 7 August 2009 by rosettacode>Kevin Reid (reply)

It's moderately tricky to make this work perfectly, especially for large amplitudes. The issue is that there is no neat analytic solution of the equation of motion (not without getting into fairly hairy maths). Since this is to demonstrate simulation and not mathematical prowess, I suggest hacking it. (I have some code that simultaneously plots a phase diagram when running the simulation, which is very nice but detracts from the basic requirements of the task so I omitted it.) —Donal Fellows 15:42, 7 August 2009 (UTC)

Assuming you're referring to the introduction to my example: Sure. I just figured a description of the principle would be useful, to help understand without studying any particular example's code details (such as your refined approximation, and my "k" constant). Feel free to edit that info into the general task description. (Another way to do the pendulum might be to simulate position/velocity vectors and the pendulum arm as a constraint on distance from the center; this might be done if you have a general physics engine handy.)
By the way, I think it would be good to have an explanation of the principle of the approximation procedure used in the Tcl example. --Kevin Reid 17:16, 7 August 2009 (UTC)
Return to "Animate a pendulum" page.