Skip to content

Latest commit

 

History

History
140 lines (102 loc) · 5.69 KB

README.rst

File metadata and controls

140 lines (102 loc) · 5.69 KB

Introduction

This is the material for a tutorial on rigid body dynamics with scientific Python tools. It will first be given as "Simulation and Control of Biomechanical Systems with Python" at the Midwest American Society of Biomechanics Regional meeting on March 4th, 2014 in Akron, Ohio and then a slightly modified version will be given as "Dynamics and Control with Python" at PYCON on April 9th, 2014 in Montreal.

Register for the MASB tutorial here (only 35 seats):

http://www.uakron.edu/engineering/BME/ASB2014/asb-2014-program-.dot

Register for the PYCON tutorial here:

https://us.pycon.org/2014/

We will cover these main topics:

  • Symbolic derivation of equations of motion for rigid body systems.
  • Numerical simulation of the system.
  • 2D and 3D visualization of the motion of the system.
  • Basic feedback control for stabilization.

The attendees will exposed to various functionality of these Python tools:

License

All materials herein are licensed under Create Commons Attribution 4.0.

Example Problem

The tutorial will work through the PyDy workflow in small steps. At the end the students should have a working 3 link 2D inverted pendulum model of a human that can be used for balancing studies. The free body diagram of the model is shown below:

notebooks/figures/human_balance_diagram.png

Installation

To run these notebooks the SciPy Stack is required. To obtain the needed packages, we are recommending users install the Anaconda Scientific Python Distribution which contains most of the necessary software and eases cross platform installation.

First, download and install Anaconda for your operating system.

Then in an Anaconda terminal (Anaconda CMD prompt on Windows) upgrade to SymPy 0.7.5 by typing and executing:

pip install --upgrade sympy

Then install PyDy with:

pip install pydy

Note on Web Browser Compatibility If you want to see the 3D visualizations you must have a WebGL compliant browser. Visit http://get.webgl.org/ to see if you current browseris up-to-date. If not visit http://caniuse.com/webgl to choose a suitable browser. If not, you will need to upgrade or install another browser. Note that Chrome seems to be the only full proof browser for Webgl, but we've had success with the latest Firefox and IE 11.

Advanced SciPy Stack Installation

There are many methods to installing the SciPy Stack. If you know what you are doing then feel free to install relatively recent versions of NumPy (>= 1.6), SciPy (>= 0.9), matplotlib (>= 0.10), and IPython (>=0.13) however you like. Keep in mind that the tutorial wil be expected to work with the versions provided in Anaconda 1.9, SymPy 0.7.5, and PyDy 0.1.0. You can find various instructions for installing the SciPy stack on the SciPy website.

Use

Download and extract the tutorial materials from:

https://github.com/PythonDynamics/pydy-tutorial-pycon-2014/archive/master.zip

Open a terminal window in the notebooks directory and type:

ipython notebook

Your browser should open and you see a list of all the notebooks and can click to open them and execute.

Notebooks

These are the notebooks for the tutorial.