PyOMD2
OMD2 is a multibody dynamics tool for modeling spatial mechanical system.
OMD2 has been embedded into Python to take advantage of the vast number of free Python tools. All the examples use
VPython. VPython is not necessary to run PyOMD2. PyOMD2 just crunches the numbers and has no visualization tools.
Although not used in the examples,
Matplotlib
compliments PyOMD2 very well.
To try out PyOMD2 go to the download page and get PyOMD2 Download (sorry it is only available for windows right now).
In the zipped folder you will find the examples:- ball.py: A ball falling on the ground.
- pendulum.py: A pendulum.
- slidercrank.py: A slider crank mechanism.
- ujointpendulum.py: A pendulum with a u-joint rather than a revolute.
Everything you need, nothing you don't
PyOMD2 allows the user to create bodies, joints and forces. The user can define the bodies to have any mass and inertia desired.
The choice of joints is fairly comprehensive. Those of you who have studied the topic of multi-body dynamics would likely agree that the real pain is in
the joints, PyOMD2 takes care of that for you. The beauty of PyOMD2 is that the user can define their own forces in python. PForceSphereCntct.py
is a great template in the module for learning how to build forces. After every integration or time step the user can modify the force to apply different
force and torque vectors to a body. So, for example, if you wanted to build a more sophisticated contact force you can keep track of the positions of a body, turn
on the contact forces when they come into contact and turn them off when there is no contact. Or if you want to build a control scheme, monitor the state, or body
position you are interested in and apply your own laws.
Notes On Documentation
More documentation is on the way, for now the examples and the code can be used to learn how to construct a model.
PyOMD2 vs PyOMD
There is another tool on this website that can perform similar tasks: PyOMD. PyOMD and PyOMD2 can both be used to simulate mechanical systems, but both suffer from different limitations at this point. PyOMD can not handle closed loop systems. For example, in a slider crank mechanism the ground is connected via a joint (kinematic constraint) to the piston which is connected to the slider which is connected to the ground. That is a closed loop. A pendulum, on the other hand, is a open loop. The ground is connected to the bob. The bob is not directly or indirectly connected to the ground in any other way. For long open loops PyOMD should be faster. There is also a difference in how the models are built. I think most would find PyOMD2 more intuitive. Eventually I intend to bring the two together, but for now they are completely separate.
Acknowledgement:
I built PyOMD2 by carefully following methodology laid out in the following text:
Computer-Aided Analysis of Mechanical Systems
by: Parvis E. Nikravesh
ISBN: 0-13-164220-0 025
I have read (well maybe not cover to cover) numerous books on the topic and this is the best I've seen. It covers enough of the theory to demonstrate how everything works, and enough practical derivations so those of us with meager mathematical skills do not arrive at dead ends.
Just a small side note: PyOMD (as apposed to PyOMD2) use Kane's method which is not covered in this book.