samedi 14 mars 2015

Simple way to numerically integrate constrained dynamics?


Vote count:

0




For example, a simple pendulum (string length = 1) can be described as


mx'' = λ*2x


my'' = -mg + λ*2y


x^2 + y^2 - 1 = 0


where the primes mean derivatives w.r.t time, and λ*2x and λ*2y are the constraint forces coming from the 3rd equation, which is the constraint.


Of course, in this case, it is possible not to use λ by choosing the amplitude θ of the string as the only coordinate. In this case, I consider Python(Scipy)'s odeint would be the simplest free way to integrate the equations.


However, such coordinate reduction is not always easy.


Is there a simple way to integrate constrained ODEs like this (well, without Mathematica/Maple/Matlab)? Neither performance nor accuracy is important to me, I just wont to quickly check the results.


(I'm not sure if this question suits here or the physics forum, but for me, it seems the physics forum is more of theory, but not very much about program and numerical stuffs.)


Your help is very much appreciated!!



asked 21 secs ago

akai

70






Simple way to numerically integrate constrained dynamics?

Aucun commentaire:

Enregistrer un commentaire