# PyElastica 
[![Build_status][badge-travis]][link-travis] [![CI][badge-CI]][link-CI] [![Documentation Status][badge-docs-status]][link-docs-status] [![codecov][badge-codecov]][link-codecov] [![Downloads][badge-pepy-download-count]][link-pepy-download-count] [![Binder][badge-binder]][link-binder]

PyElastica is the python implementation of **Elastica**: an *open-source* project for simulating assemblies of slender, one-dimensional structures using Cosserat Rod theory.

[![gallery](https://github.com/skim0119/elastica-python/blob/assets_logo/assets/alpha_gallery.gif)][link-project-website]

Visit [cosseratrods.org][link-project-website] for more information and learn about Elastica and Cosserat rod theory.

## Installation 
[![PyPI version][badge-pypi]][link-pypi]

PyElastica is compatible with Python 3.6 - 3.8. The easiest way to install PyElastica is with PIP. 

~~~bash
$ pip install pyelastica 
~~~

## Documentation
[![Documentation Status][badge-docs-status]][link-docs-status]

Documentation of PyElastica is available [here][link-docs-website]

## Tutorials
[![Binder][badge-binder-tutorial]][link-binder]

We have created several Jupyter notebooks and Python scripts to help users get started with PyElastica. The Jupyter notebooks are available on Binder, allowing you to try out some of the tutorials without having to install PyElastica.

We have also included an example script for visualizing PyElastica simulations using POVray. This script is located in the examples folder ([`examples/visualization`](examples/visualization)).

## Contribution

If you would like to participate, please read our [contribution guideline](CONTRIBUTING.md)

PyElastica is developed by the [Gazzola Lab][link-lab-website] at the University of Illinois at Urbana-Champaign.

## List of publications and submissions

- [ Control-oriented modeling of bend propagation in an octopus arm](https://arxiv.org/abs/2110.07211) (UIUC, 2021)
- [A physics-informed, vision-based method to reconstruct all deformation modes in slender bodies](https://arxiv.org/abs/2109.08372) (UIUC, 2021) (In Review: IEEE RA-L 2022) [code](https://github.com/GazzolaLab/BR2-vision-based-smoothing)
- [Optimal control of a soft CyberOctopus arm](https://ieeexplore.ieee.org/document/9483284) (UIUC, 2021) (ACC 2021)
- [Elastica: A compliant mechanics environment for soft robotic control](https://ieeexplore.ieee.org/document/9369003) (UIUC, 2021) (IEEE RA-L 2021)
- [Controlling a CyberOctopus soft arm with muscle-like actuation](https://arxiv.org/abs/2010.03368) (UIUC, 2020)
- [Energy shaping control of a CyberOctopus soft arm](https://ieeexplore.ieee.org/document/9304408) (UIUC, 2020) (IEEE CDC 2020)

## Citation

We ask that any publications which use Elastica cite the following papers:

Overall and for single rods:  
Gazzola, Dudte, McCormick, Mahadevan, <strong>Forward and inverse problems in the mechanics of soft filaments</strong>, Royal Society Open Science, 2018. doi: [10.1098/rsos.171628](https://doi.org/10.1098/rsos.171628)
```
@article{Gazzola2018,
  title={Forward and inverse problems in the mechanics of soft filaments},
  author={Gazzola, M and Dudte, LH and McCormick, AG and Mahadevan, L},
  journal={Royal Society open science},
  volume={5},
  number={6},
  pages={171628},
  year={2018},
  publisher={The Royal Society Publishing},
  doi = {10.1098/rsos.171628},
  url = {https://doi.org/10.1098/rsos.171628},
}
```

For assemblies of rods:  
Zhang, Chan, Parthasarathy, Gazzola, <strong>Modeling and simulation of complex dynamic musculoskeletal architectures</strong>, Nature Communications, 2019. doi: [10.1038/s41467-019-12759-5](https://doi.org/10.1038/s41467-019-12759-5)
```
@article{Zhang2019,
  title={Modeling and simulation of complex dynamic musculoskeletal architectures},
  author={Zhang, X and Chan, FK and Parthasarathy, T and Gazzola, M},
  journal={Nature Communications},
  volume={10},
  number={1},
  pages={1--12},
  year={2019},
  publisher={Nature Publishing Group},
  doi = {10.1038/s41467-019-12759-5},
  url = {https://doi.org/10.1038/s41467-019-12759-5},
}
```

For control of soft robots:  
Naughton, Sun, Tekinalp, Parthasarathy, Chowdhary and Gazzola, <strong>Elastica: A compliant mechanics environment for soft robotic control</strong>, IEEE Robotics and Automation Letters, 2021. doi: [10.1109/LRA.2021.3063698](https://doi.org/10.1109/LRA.2021.3063698)
```
@article{Naughton2021,
  author={Naughton, N and Sun, J and Tekinalp, A and Parthasarathy, T and Chowdhary, G and Gazzola, M},
  journal={IEEE Robotics and Automation Letters}, 
  title={Elastica: A compliant mechanics environment for soft robotic control}, 
  year={2021},
  volume={},
  number={},
  pages={1-1},
  doi={10.1109/LRA.2021.3063698}
}
```

## Senior Developers ✨
_Names arranged alphabetically_
- Arman Tekinalp
- Chia-Hsien Shih (Cathy)
- Fan Kiat Chan
- Noel Naughton
- [Seung Hyun Kim](https://github.com/skim0119)
- Tejaswin Parthasarathy (Teja)
- Yashraj Bhosale (Yash)

[//]: # (Collection of URLs.)

[link-project-website]: https://cosseratrods.org
[link-lab-website]: http://mattia-lab.com/
[link-docs-website]: https://docs.cosseratrods.org/

[badge-pypi]: https://badge.fury.io/py/pyelastica.svg
[badge-travis]: https://travis-ci.com/GazzolaLab/PyElastica.svg?branch=master
[badge-CI]: https://github.com/GazzolaLab/PyElastica/workflows/CI/badge.svg
[badge-docs-status]: https://readthedocs.org/projects/pyelastica/badge/?version=latest
[badge-binder]: https://mybinder.org/badge_logo.svg
[badge-pepy-download-count]: https://pepy.tech/badge/pyelastica
[badge-codecov]: https://codecov.io/gh/GazzolaLab/PyElastica/branch/master/graph/badge.svg
[link-pypi]: https://badge.fury.io/py/pyelastica
[link-travis]: https://travis-ci.com/github/GazzolaLab/PyElastica
[link-CI]: https://github.com/GazzolaLab/PyElastica/actions
[link-docs-status]: https://docs.cosseratrods.org/en/latest/?badge=latest
[link-pepy-download-count]: https://pepy.tech/project/pyelastica
[link-codecov]: https://codecov.io/gh/GazzolaLab/PyElastica

[badge-binder-tutorial]: https://img.shields.io/badge/Launch-PyElastica%20Tutorials-579ACA.svg?logo=data:image/png;base64, 
[link-binder]: https://mybinder.org/v2/gh/GazzolaLab/PyElastica/master?filepath=examples%2FBinder%2F0_PyElastica_Tutorials_Overview.ipynb
