# Work Product

## Benchmarking

The first item for my project was to create benchmarking tools to measure the progress of later speed enhancements. I first made my own tool but switched to an existing sympy tool when I learned of its existance. The PR containing my custom tool was then closed. The benchmarks were added in PR #27 listed below. The benchmarks currently run fine and are in a state where additional tests can be added to test more complex variations of `KanesMethod`

and `LagrangesMethod`

's use.

- (Closed) Mechanics Benchmarking PR #11154
- (Merged) Added a test for KanesMethod and LagrangesMethod PR #27
- (Merged) Fixed kane benchmark for different input order PR #29
- (Merged) Pydy models migration PR #11168

## SymbolicSystem

I began the discussion for a base class for the equations of motion generators on a PR in sympy. In this PR we started to narrow down what the final class should accomplish. In trying to figure out the need that the final result would fill though it became apparent that examples of use of the final result would be needed and these examples would be better suited for the Pydy repository, thus a new PR for discussion was created there. In writing out examples the API for a final result came together. It was decided that a class to make the equations of motion generators more uniform (thus easing the addition of new generators) would be better off as a container object for the equations of motion and other important aspects of rigid body dynamic systems. This way the output of the equations of motion generators would be consistent and so code that is written to handle the output of one generator can also handle the output of other generators. The final result was the `SymbolicSystem`

class and is currently merged into the Sympy repository. The PR in the Pydy repository remains open because it contains examples of future uses of `SymbolicSystem`

and thus is not ready to be merged but should not be closed either as the examples could be added after `SymbolicSystem`

and pydy.system.System have been expanded upon.

The `SymbolicSystem`

class is complete as far as the scope of the summer project is concerned but there are still some steps to fully integrate it into a normal workflow. First step would be to get `KanesMethod`

and `LagrangesMethod`

to have a method that produces the `SymbolicSystem`

instance with as much information as the *Method class contains. Once both equations of motion generators have the ability to produce `SymbolicSystem`

objects, the pydy.system.System class needs to be rewritten to accept `SymbolicSystem`

objects instead of `KanesMethod`

objects. These steps would go a long ways in getting the new class introduced into a standard workflow.

- (Open) [WIP] Created a basis on which to discuss EOM class PR #353
- (Closed) [WIP] EOMBase class development PR #11182
- (Merged) Added system.py to physics/mechanics PR #11431

## Featherstone's Method

In working on implementing Featherstone's method in Sympy, it became apparent that a body/joint implementation would be needed. There was some work on this front from a previous Google Summer of Code student, but the work was incomplete and was not merged. I decided to work on finishing his implentation but reduce its scope to two joints (revolute and prismatic). In beginning work on this though I found that his implementation does not quite fit the joint internals I would need and so I ended up rewriting the joint code. This code is written but the test code is incomplete. From the test code that is complete, however, it seems like there are possibly some errors in the code that will need to be fixed. Once the tests are able to run correctly, the joint code will probably need to be cleaned to be made presentable and the docstrings will need to be rewritten to reflect the changes that have been made. The current state of the joint code can be found in the FeatherstonesMethod PR.

In addition to the joint code, Featherstone's Method also required some proceesing fucntions for spatial vectors. Code for this has been written and put in a spatial vector PR. This code is currently awaiting the review process.

Once the joint code is fixed up, the tests finished and is merged along with the spatial vector code, work on finishing Featherstone's method can begin. Currently the FeathsertonesMethod code runs without producing errors. Now what needs to happen is a basic example needs to be done by hand so that test code can be created for the class. Once the test code has been written, FeatherstonesMethod code should be fixed where needed and overall cleaned up. Last the documentation and docstrings should be written to reflect the final result of the equation of motion generator.

- (Closed) [WIP] Featherstones EOM support PR #11331
- (Open) [WIP] FeatherstonesMethod PR #11415
- (Merged) Docstring cleanup of physics/mechanics/body.py PR #11416
- (Merged) Fixed an error in frame.py PR #11504
- (Open) [WIP] Spatial vector functions PR #11520

## List of all PR's

This is a list of all PR's that I have interacted with over the summer and will repeat PR's mentioned above for the different portions of the project.

### Pydy PR's

- (Merged) Examples README typo PR #349
- (Merged) Pendulum example added PR #351
- (Open) [WIP] Created a basis on which to discuss EOM class PR #353
- (Open) Added a depencency on older version of ipywidgets PR #100

### Sympy PR's

- (Closed) Mechanics Benchmarking PR #11154
- (Merged) Pydy models migration PR #11168
- (Merged) Physics documentation PR #11117
- (Closed) [WIP] EOMBase class development PR #11182
- (Merged) Minor fix in KanesMethod's docstring PR #11186
- (Merged) Added support for a bodies attribute to LagrangesMethod PR #11263
- (Closed) [WIP] Featherstones EOM support PR #11331
- (Merged) Docstring cleanup of physics/mechanics/body.py PR #11416
- (Merged) Added system.py to physics/mechanics PR #11431
- (Open) [WIP] FeatherstonesMethod PR #11415
- (Merged) Fixed an error in frame.py PR #11504
- (Open) [WIP] Spatial vector functions PR #11520

### Sympy Benchmarking PR's

- (Merged) Added a test for KanesMethod and LagrangesMethod PR #27
- (Merged) Fixed kane benchmark for different input order PR #29

### PR's Reviewed

- (Open) Fix matrix rank with complicated elements PR #10650
- (Open) Improved the explanation of the 5 equations in the Kane's Method docs PR #11183
- (Closed) Remove documented redundant comments PR #10698
- (Open) Docmentation comments corrections PR #10693
- (Merged) Fix issue #8193 PR #11209
- (Open) Blacklisted pygletplot from doctests when pyglet is installed PR #10856
- (Merged) Fix multiarray import error on appveyor PR #354
- (Merged) Added docstrings to ast.py PR #11333
- (Merged) Speeds up the linear system solve in KanesMethod.rhs() PR #10965
- (Merged) Added docstrings to delta and mid property methods PR #11432
- (Merged) Added top-level docstring for singularities.py PR #11440
- (Merged) Intendation fixes -- sympy/concrete/summations.pyPR #11473
- (Open) Adjustments to Legendre, Jacobi symbols docstrings PR #11474
- (Open) Added docstring to jordan_cell method PR #10356