Skip to content

Autolev SymPy PyDy Parser

S.Y. Lee edited this page Mar 4, 2019 · 1 revision

Autolev and MotionGenesis

The last version of Autolev that was released was 4.1 (I think). This is what most researchers are probably still using. Paul Mitiguy has released a new software called MotionGenesis which has very similar syntax (essentially Autolev 5.0 with significant API changes). I've never met a researcher that is using MotionGenesis, but there may be some. We should target Autolev 4.1 code as there are a fair number of models that can be converted.

Learning About Kane's Method

Autolev only has automated equations of motion generation using Kane's method. Kane's two books on the subject are available for free via Cornell's library:

Materials for Jason's class on the subject are here:

http://github.io/moorepants/mae223

There is an old print book called "Dynamics Online" that is a guidebook for using Autolev. Jason will figure out how to get you a copy.

"DynamicsOnline: Theory and Implementation with AUTOLEV" Thomas R. Kane and David A. Levinson 2000

Paul Mitiguy's materials. Paul has a newer textbook that goes with MotionGenesis which he uses in his Stanford classes. If you can get a copy, it could be useful, but I think it is geared primarily towards undergraduate dynamics and does not have much if anything from Kane's method.

Here is an tutorial from Autolev 4.1:

http://www2.mae.ufl.edu/~fregly/PDFs/autolev_tutorial.pdf

Example Autolev Scripts

Simple Examples

  • The examples directory in the PyDy repository has many basic models that could be created in Autolev.
  • Anything from any advanced dynamics textbooks can be used to create examples.
  • Models from this dynamics benchmarking website can be created in both software. The nice thing is that numerical results aare available form 3rd party software that we can also compare to. https://www.iftomm-multibody.org/benchmark

Bicycle Example

This code generates the non-linear Whipple/Carvallo model which is a very good example that utlizes many of the core features of Autolev and SymPy Mechanics. This should be the primary target for reproduction for the summer. If the parser can handle this model it can handle the vast majority of Autolev code.

SymPy Bicycle Example

http://docs.sympy.org/latest/modules/physics/mechanics/examples/bicycle_example.html

This used to be able to generate the correct linear results, but has been broken for a while since we stopped testing it. There issues in the SymPy repo regarding this. But the non-linear equations may likely be correct. We just need to evaluate them against this benchmark:

http://rspa.royalsocietypublishing.org/content/463/2084/1983.e-letters

PyDy Bicycle Example

https://github.com/pydy/pydy/pull/122

This model also implements the bicycle and has all of the code to benchmark it against the above paper. There must be a small error in the SymPy/PyDy code though, as two or three values do not match. But this could be used to help benchmark the SymPy bicycle example. Or this can be fixed.

Autolev Bicycle - Jason

This is a working bicycle model in Autolev:

https://github.com/moorepants/dissertation/tree/master/src/eom

The benchmark works against two papers' results. We can use this as the primary Autolev example.

Autolev Bicycle - Luke

Github user hazelnusse has sympy produced bike model too, but I'm having trouble finding it in his public repos. Will look more.

Human Lower Boday Gait Example

Ton van den Bogert provided Jason with a 9 degree of freedom human lower body model (torso, upper legs, lower legs, feet) written in Autolev. Jason has already created a SymPy mechanics model that produces the same results for the joint torque driven system.

Repository: https://github.com/csu-hmc/gait2d

Human Arm Example

Ton van den Bogert provided Jason with an 11 degree of freedom human arm model. We can likely get permission to include it in SymPy's repository. I'll send this via email.

Benchmarking

Each Autolev script produces some fundamental symbolic, partially symbolic, or numerical result. For short symbolic results we can compare symbolics with something like simplify(autolev_expr - sympy_expr), for anything longer than a few lines of code we should evaluate the expressions numerically with identical random inputs and perform floating point comparisons between the Autolev and SymPy results, and for purely numerical results the same.

We may not be able to run old Autolev code anymore without a license. I may be able to get it running but it will have limited memory.

Copyright Issues

We need to be careful about adding any copyrighted Autolev code to the SymPy repository.

  • Autolev source code: ask author's for permission to license it with SymPy's license.
  • Code generated by Autolev (C, Fortran, Matlab): It isn't super clear who owns the copyright to generated code. We need to look into this.
  • When using an example from Autolev's books, documention, etc it would be preferable if we read the problem statement and found the solution using Autoleve on our own, so that we are not copying the code exactly from the Autolev materials.
Clone this wiki locally
You can’t perform that action at this time.