Implement O(N) Method
Idea
Roy Featherstone, Abhi Jain, and others developed recursive methods of forming
the right hand side of the differential equations for complex multibody systems
that have an evaluation time of O(N) instead of O(N^3). This project would be
dedicated to implementing a symbolic O(N) method to compliment the
LagrangesMethod and KanesMethod classes. This would give a significant
speed boost in numerical evaluation for systems with bodies greater than 20 or
so.
Status
There is no previous work on this topic.
Potential Mentors
Jason Moore
Involved Software
Python, SymPy, Git
Difficulty
Advanced
Prerequisite Knowledge
This project requires familiarity with multibody dynamics. At the least, one should know how to form the equations of motion of complex systems with one method. The ideal candidate will have experience forming the equations of motion with the aforementioned Featherstone or Jain methods.
Apply To
SymPy, PSF
Efficient Equation of Motion Generation with Python
Idea
Currently we have basic equation of motion generation with automated Kane's and Lagrange's methods. These methods work well but can take many minutes to complete for hard problems. The algorithms that derive these equations of motion can be improved in both speed of computation and the resulting simplification of the equations of motion. This project would involve cleaning up the code base, profiling to find the slow functions, and digging into the SymPy codebase for trigonometric simpification and other relevant function calls to speed up the EoM generation. These modification will help speed up both the entire SymPy codebase and the Mechanics package.
Status
There is some previous work on this topic in the form of small performance enhancement pull requests. There is also a SymPy benchmarking project that should be utilize to track performance with respect to commits.
Potential Mentors
Jason Moore, Jim Crist
Involved Software
Python, SymPy, Git
Difficulty
Beginner
Prerequisite Knowledge
There are no prequisites to this project.
Apply To
SymPy, PSF
Efficient EoM Generation with C++
Idea
Recently, a C++ implementation of the SymPy core has matured (SymEngine). Use of this library could significantly increase the speed of derivation of the equations of motion of complex multibody systems. This project would be dedicated to ensuring SymEngine worked with all operations typically used in the sympy.physics.vector and sympy.physics.mechanics packages. Work is needed to add in core data types and algorthims in SymEngine to mimic the equivalent in SymPy and work will need to be done to provide seemless wrappers for optional use in SymPy. Large benchmark multibody problems would be developed in Python to test the speed.
Status
There has been some work on this in the SymEngine project. There are some benchmarks that test matrix differentiation speed and the like. Please ask on the mailing list about the previous work.
Potential Mentors
Jason Moore, Ondřej Čertík
Involved Software
C++, SymEngine, SymPy, Python, CMake, Git, Cython
Difficulty
Intermediate
Prerequisite Knowledge
There are no prequisites to this project.
Apply To
SymPy, PSF
Generalize the Equation of Motion Generation Classes
Idea
We need to create an abstract base class for equations of motion methods (LagrangesMethod, KanesMethod) so that new methods are easy to add. This project would focus on the generalization and creating at least one new method class for example NewtonEulersMethod or HamiltonsMethod. This abstract base class would support a standard interface to access the system's states, constants, exogenous inputs, mass matrix, right hand side, etc.
Status
There has been no work on this project yet.
Potential Mentors
Jason Moore
Involved Software
Python, SymPy, PyDy, Git
Difficulty
Intermediate
Prerequisite Knowledge
This project requires basic understanding of dynamical systems and at least understanding of one method of generating the equations of motion for a multi-body system.
Apply To
SymPy, PSF
Efficient Code Generation
Idea
SymPy Mechanics can derive the symbolic equations of motion of complex mutlibody systems. These continuous differential equations can be solved to find the state trajectories through time, among other things. But in only the simplest systems can these differential equations be integrated symbolically. In general, one must integrate the differential equations numerically using various integration routines. For example, SciPy provides functionality for integrating ordinary differential equations and differential algebraic equations as do many other software packages. A classic approach to problems such as these is to automatically generate code that can be integrated using robust numerical routines. We'd like to develop code output classes to interface with KanesMethod and LagrangesMethod classes that utilize SymPy code generation package. Generated code should be able to be directly run and/or compiled and run to perform a numerical integration of the equations of motion and produce time history of states. Besides developing the code generation classes for the KanesMethod and LagrangesMethod results, we'd like to spend some time improving the general code generation portions of SymPy and the common subexpression elimination routines. We'd also like to look into utilizing or learning from other code bases that generate effcient code, such as Theano, numba, parakeet, etc. This paper http://jnaiam.org/new/uploads/files/16985fffb53018456cf3506db1c5e42b.pdf could help improve ODE code generation.
Status
PyDy has an ODE code generation module that supports three backends and basic
support for a fourth. There is also a System class that connects the *Methods
classes to the code generation classes. It would be ideal if much of this code
was integrated with SymPy's code generation package. There is an effort under
way by Aaron Muerer to improve SymPy's code generation abilities and this
project should work closely with that.
Potential Mentors
Jason Moore, Jim Crist
Involved Software
Python, SymPy, PyDy, Git, C, Fortran, Octave
Difficulty
Intermediate
Prerequisite Knowledge
This project requires basic understanding of dynamical systems and at least understanding of one method of generating the equations of motion for a multi-body system.
Apply To
SymPy, PSF
Flexible Body Support
Idea
SymPy Mechanics currently only deals with rigid bodies. It is possible to extend the code base to include the functionality for deriving the equations of motion of systems that include flexible bodies. Flexible bodies can be described by both spatial and time varying partial differential equations. One approach that would integrate well with the KanesMethod class is described in "Dynamics of an Arbitrary Flexible Body in Large Rotation and Translation" by Arun K. Banerjee and John M. Dickenst, but there are many other algorithms that could be introduced. This project would lie primarily in SymPy by extending the classes in mechanics to handle the spatial variables and including the automatic derivation of the flexible equations of motion.
Status
No explicit work has been done on this but the sympy.vector package has
support for vector fields that could be a starting point.
Potential Mentors
Jason Moore
Involved Software
Python, SymPy, Git
Difficulty
Advanced
Prerequisite Knowledge
This project requires understanding of flexible body systems.
Apply To
SymPy, PSF
PyDy Website Overhaul and Automated Example Gallery
Idea
The goal of this project will be to redevelop the PyDy website to be attractive and functional with an automated system of displaying example PyDy problems in a gallery with 3D visualizations, source code, and graphics.
The team will need to evaluate other similar galleries and websites from other projects and develop a concept for the new web design. They will also need to learn about how the examples work, develop a standard for example submissions, and a tool that extracts the examples and generates proper HTML/CSS/Javascript for the website.
The expected outcome is an improved website experience for users interested in PyDy that gives users easy access to our example problems without installing and running the software.
Matplotlib, Bokeh, yt, etc are good examples of galleries. There is also a Sphinx extension that will help with this:
https://github.com/sphinx-gallery/sphinx-gallery
Drake's gallery gives an idea of what we'd like: http://drake002.csail.mit.edu/drake/gallery.html
Status
We currently have a small set of example problems that are difficult to see in action. Our website links to the source code for these examples and some Jupyter notebooks, but we'd like to have an automatically generated gallery that displays the input and output of the examples in a on the website. The visitors of the website should be able to interact with the visualizations and see the code that generated them.
Potential Mentors
Jason Moore
Involved Software
Python, SymPy, Git
Difficulty
Advanced
Prerequisite Knowledge
How to run PyDy examples and basic web development skills.
Apply To
PSF
PyDy Simulation GUI Improvements
Idea
The goal of this project will be to add significant improvements and features to the PyDy visualization web app.
PyDy is an open source Python based software package that allows a user to develop mathematical models that predict the motion of complex multibody systems such as robots, musculoskeletal systems, and spacecraft. First, the user develops a symbolic set of ordinary differential or differential algebraic equations using tools in the SymPy Mechanics package. This model is used to generate low level code for the evaluation of the equations which are used to simulate the system forward in time. The results of the simulation are then displayed as 3D graphics in an interactive web browser based GUI that leverages the Jupyter widget functionality and WebGL through the three.js library.
The team will need to learn about the current software design and evaluate the web app user interface for improvements. In particular, we are looking to add a robust Javascript testing suite, leverage the pythreejs library as a new backend (see PR#297), come of up with a responsive and mobile supported UI, and add features, such as the ability to import CAD models into the visualizer. The development workflow for SymPy/PyDy will need to be followed for submitting patches.
The expected outcome is a significantly improved and tested UI that works well in all modern browsers and the latest Jupyter versions.
Some specific ideas:
- ability to visualize vectors with arrows
- deformable objects like linear and torsional springs would really be nice
- the cameras and lights should translate and orient with time and the user should be able to switch among the different cameras
- show the labels of bodies
- display rotational arrows for the coordinates
- display graphs of the generalized coordinates, speeds, and other outputs as a function of time in the GUI
- simulate at real time wrt to the intergration time and allow for speeding up and slowing down the display rate
- rotating and translating the shapes wrt to their attached ref frame and point in the gui would make it easier to get all the shapes placed properly
- add more basic shapes
- ability to add backgrounds, e.g. like a road for a vehicle to ride on
- ability to export the visualization so that we can include it in a web page (e.g. our future example gallery on pydy.org)
- ability to include functions as inputs to the specified coordinates in the gui, for example set a force to be 5 * sin(0.9 * t)
- save/load simulations
Status
We currently have a working GUI but there are a number of outstanding bugs and feature requests. There is a work in progress pull request that implements integration with pythreejs.
Potential Mentors
Jason Moore
Involved Software
Python, SymPy, Git, Javascript, HTML, CSS, PyThreeJS
Difficulty
Beginner
Prerequisite Knowledge
How to run PyDy examples and basic web development skills.
Apply To
PSF
Realtime Simulation
Idea
We can currently visualize a system after it has been simulated. Ideally we'd have a real time simulation such that the parameters and forces can be changed at each time step. We'd like an interactive simulation environment. This would likely make use of the IPython server/client messaging protocol to actively update the Javascript WebGL visualizations.
Status
There has been no work on this project.
Potential Mentors
Jason Moore
Involved Software
Python, SymPy, Git, Javascript
Difficulty
Intermediate
Prerequisite Knowledge
How to run PyDy examples and basic web development skills. An understanding of numerical integration is needed.
Apply To
PSF
Interactive Generation of a System
Idea
Develop GUI based tool for creating multi-body models. This would include a 2D and/or 3D drag-n-drop workspace where you can add in basic bodies, add kinematic constraints, and apply forces. This interactive work would generate SymPy Mechanics code on the fly and thus the equations of motion. The visualization can be animated in the same interactive workspace. The commerical product Working Model has features similar to this.
Status
Sahil developed the start of some modules to build up basic systems in SymPy Mechanics during GSoC 2015. These modules are the first step to getting this project working. There has also been work in the Mubosym project that allows one to construct systems in this fashion. This work needs to be integrated and completed before the development of the GUI.
Potential Mentors
Jason Moore
Involved Software
Python, SymPy, Git, Javascript
Difficulty
Advanced
Prerequisite Knowledge
Understanding of building multibody systems and web development.
Apply To
SymPy, PSF
High Level System Specification for Kinematic Chains
Idea
Develop a higher level specification language that abstracts out the underlying system generation. This is similar to the "Interactive Generation of a System" project above, but takes a text based approach to it. Many systems can be modelled as a series interconnected links with varying types of joints (robots, humans, etc...). Instead of manually creating these system using the current api, a higher level markup would be desired. This could take a few different forms:
- Abstract out various types of joints (pin, ball, universal, prismatic, etc...), implementing classes for each. A nice api for building up a system from these would need to be designed and created. This design would also mesh nicely with our visualization system, as each joint/link could be matched easily with a corresponding element of the visualization. As such, the user could potentially freed from having to manually create the visualization setup later.
- Use a table of Denavit-Hartenberg parameters. These are commonly used in robotics or the design of spatial mechanisms. As there are many conventions for DH parameters, an option to choose which convention would need to be provided.
- Use exponential coordinates, and express the system as a series of twists. This is the approach taken in Murray, Li, Sastry, and can result in a more compact representation for forward kinematics. These have the added benefit of not having multiple conventions (unlike DH parameters).
Status
There is some work on this in Sahil's 2015 GSoC work. See the wiki and his pull requests.
Potential Mentors
Jason Moore, Jim Crist
Involved Software
Python, SymPy, Git
Difficulty
Advanced
Prerequisite Knowledge
Understanding of building multibody systems.
Apply To
SymPy, PSF