SwingPendulum theta acceleration

7 views
Skip to first unread message

Clement

unread,
May 26, 2014, 10:03:53 PM5/26/14
to github...@googlegroups.com
Hi all,
I am currently implementing a python version of the swing pendulum for my own work and noticed that there seems to be an issue with the SwingPendulum.java simulation.

From what I can tell, it is using euler's method to step the physics and includes an adjustable timestep. It seems that the timestep is not multiplying all the forces the way it should and will therefore cause the dynamics to change as the timestep is changed (more so than just the gain or loss of approximation accuracy) . It appears to me that the impulse thetaAcceleration at line 61 should be:

double thetaAcceleration = Stepsize * (-velocity + Mass * G * Length * Math.sin(theta) + torque);

Otherwise the gravity and torque of the system would effectively get stronger as timesteps get smaller. In order to fix this issue and not affect most existing code, you could increase the default mass and max/min torque to keep the dynamics unchanged when using the default timestep (e.g. new_default_mass = default_mass / default_timestep). This would be the best solution in my opinion.

Let me know if I made a mistake in my reasoning,
Clement

Thomas Degris-Dard

unread,
May 27, 2014, 5:27:09 AM5/27/14
to github...@googlegroups.com
Hello Clement,

I think you are right. Actually, the goal of the SwingPendulum.java
simulation was to reproduce the problem defined in Doya (2000). What
we can do is to rename the class SwingPendulum to SwingPendulumDoya
and implement your version in SwingPendulum. What do you think?

Thomas


--

---
You received this message because you are subscribed to the Google Groups "RLPark" group.
To unsubscribe from this group and stop receiving emails from it, send an email to githubrlpark...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages