I changed the code to the rolling torus example pretty significantly. Little fixes in how the arrows representing the body fixed unit vectors are now fixed. Additionally, I added some code that calculates the kinetic, potential and total energy of the system, and plots it. The scipy solver seems to do a pretty good (not perfect) job of maintaining constant energy. I think tightening up the error tolerances would improve this, but the simulation is well behaved at this point so I didn’t bother.
Archive for October, 2009
New rolling torus code
Thursday, October 15th, 2009Gyrostat
Friday, October 9th, 2009I just added an example of use for the derivation of the equations of a gyrostat using PyDy. It is located in the examples/gyrostat/ subdirectory.
In case you aren’t familiar, here is the definition of a gyrostat:
A gyrostat is a mechanical system which is comprised of more than one body and yet has the rigid body property that its inertia components are time independent constants.
The reason I became interested in gyrostats is because in modeling the bicycle, the rear frame and the rear wheel can be treated as a gyrostat, and in doing so, the number of parameters that appear in the equations of motion will be reduced by two. The same can be done for the front fork and handlebar assembly and front wheel.
In addition to the Python script that generates the equations, I took the time to do a complete write up of the model in LaTeX and generate a nice pdf of it.