From d1013cb40ec8182cd057870315b2717cda287009 Mon Sep 17 00:00:00 2001 From: jtheinen Date: Thu, 10 Aug 2023 18:35:50 +0200 Subject: [PATCH 01/15] Complete layout, added all missing elements --- docs/FAQ.rst | 8 ++++ docs/conf.py | 3 ++ docs/contribute.rst | 18 ++++++++ docs/gettingstarted/Background.rst | 58 ++++++++++++++++++++++++ docs/gettingstarted/Installation.rst | 68 ++++++++++++++++++++++++++++ docs/gettingstarted/Quickstart.rst | 6 +++ docs/gettingstarted/index.rst | 11 +++++ docs/index.rst | 3 ++ docs/references.bib | 28 ++++++++++++ 9 files changed, 203 insertions(+) create mode 100644 docs/FAQ.rst create mode 100644 docs/contribute.rst create mode 100644 docs/gettingstarted/Background.rst create mode 100644 docs/gettingstarted/Installation.rst create mode 100644 docs/gettingstarted/Quickstart.rst create mode 100644 docs/gettingstarted/index.rst create mode 100644 docs/references.bib diff --git a/docs/FAQ.rst b/docs/FAQ.rst new file mode 100644 index 0000000..9832e2a --- /dev/null +++ b/docs/FAQ.rst @@ -0,0 +1,8 @@ +=== +FAQ +=== + +Why is my code giving errors? +----------------------------- + +First make sure you have filled in every bound and guess where necessary. It might be usefull to look at the dimensions of all attributes to check whether you missed a bound or guess. \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 0736b83..5e4524d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -27,6 +27,7 @@ "sphinx.ext.autosummary", "sphinx.ext.mathjax", "sphinx.ext.viewcode", + "sphinxcontrib.bibtex", ] templates_path = ["_templates"] @@ -45,6 +46,7 @@ "python": ("http://docs.python.org/3", None), } +bibtex_bibfiles = ["references.bib"] # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output @@ -56,3 +58,4 @@ } html_static_path = ["_static"] + diff --git a/docs/contribute.rst b/docs/contribute.rst new file mode 100644 index 0000000..fab2de3 --- /dev/null +++ b/docs/contribute.rst @@ -0,0 +1,18 @@ +========== +Contribute +========== + +Pycollo is currently under development. Major code refactors, including significant API changes, are likely. As such contributions may not be readily accepted at this time. If you are keen to contribute, please contact the authors by email or file an issue on the issue tracker detailing how you would like to get involved. + +Issue Tracker: https://github.com/brocksam/pycollo/issues + +Source Code: https://github.com/brocksam/pycollo + +License +------- + +This project is licensed under the terms of the MIT license. + +Authors +------- +Sam Brockie - sambrockie@icloud.com \ No newline at end of file diff --git a/docs/gettingstarted/Background.rst b/docs/gettingstarted/Background.rst new file mode 100644 index 0000000..c2c7f5f --- /dev/null +++ b/docs/gettingstarted/Background.rst @@ -0,0 +1,58 @@ +What is Pycollo? +================ + +In optimization there are shooting methods and simultaneous methods. A shooting method uses a simulation to enforce the system dynamics, while the collocation method enforces the dynamics at given points along the trajectory. Shooting methods are more prone to find a global solution, but are computationally heavy. Collocation methods tend to converge better and faster but are prone to find local minima. Direct methods are generally best for problems where dynamics and control must be computed to a similar accuracy, and the structure of the control trajectory is not known a priori :cite:p:`kelly_introduction_2017`. + +Pycollo is a direct orthogonal collocation transcription tool for Python :cite:p:`brockie_predictive_2021`. The dynamics and constraints are enforced over a discretization. The discretization exists of N collocation points. The collocation points are either mesh points or polynomial points, but all collocation points are enforced to the constraints and dynamics. After transcription the problem is passed to the solver IPOPT (Interior Point OPTimizer). When the found IPOPT solution does not meet the error-tolerance set in PyCollo, the discretization is refined and a new itera- tion is solved in IPOPT. Mesh points, polynomial points, mesh sections and mesh refinement are explained in figure 5. The polynomials are of the Legendre-Gauss-Lobatto (LGL) nature. More information on the mesh can be found in appendix A. The integration scheme is an implicit Runge-Kutta Kth method :cite:p:`brockie_predictive_2021`. This high order method will have a high accuracy with the disadvantage that all states and constraints need to be differentiable. + +It is highly advised to read :cite:p:`kelly_introduction_2017` if you are new to direct collocation. + + +Multiphase direct collocation +----------------------------- +Some optimal control problems face discontinuities or changes in dynamics. Boolean operations can work in lower order optimization schemes, but with higher order schemes such as pycollo, every formulation needs to be differentiated. Differentiating of boolean operations is impossible or can lead to numerical instabillities (such as a sigmoid function). To still have the benefits of a higher order scheme and handle discontinuities one can use multiple continious phases. Each phase represents a distinct segment of the problem with its own set of dynamics, constraints, and control inputs. The main idea behind this scheme is to discretize each phase individually and then link the phases together by ensuring continuity of states and control inputs at phase boundaries. Between the phase boundaries discontinuities can be handeled such as impact, friction or change of dynamics. This approach allows you to tackle complex problems with changing dynamics or control strategies over different time intervals. + +Pycollo will help you with the following steps: + +1. Discretization within Each Phase: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Within each phase, you discretize the continuous-time dynamics using collocation points. Collocation points are time instances within the phase where you will approximate the system dynamics using constraints. These points are often chosen based on established techniques like Gaussian quadrature. + +2. State and Control Parameterization: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +For each phase, parameterize the state and control trajectories using LGL polynomial approximations. + +3. Dynamics and Constraint Approximation: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +At each collocation point within a phase, you approximate the system dynamics and constraints using discrete equations. This involves approximating the differential equations that describe the system's behavior and ensuring that path constraints and boundary conditions are met at these points. + +4. Endpoint Constraints: +^^^^^^^^^^^^^^^^^^^^^^^^ + +To ensure smooth transitions between phases, you enforce continuity constraints at the boundaries between phases. This involves linking the state and control variables from the final collocation point of one phase to the initial collocation point of the next phase. + +5. Objective Function Discretization: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Discretize the objective function over each phase by approximating integrals as summations over the collocation points. This allows you to express the objective function in terms of the endpoint variables. + +6. Formulating the Optimization Problem: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +With the discretized dynamics, constraints, and objective function in place for each phase, Pycollo formulates the complete optimization problem as a NLP. This program aims to find the optimal values of the discrete state and control variables across all phases, while satisfying the dynamics, constraints, and continuity conditions. + +7. Solving the Optimization Problem: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Pycollo uses IPOPT to solve the NLP + +8. Using a PH method to ensure tolerances are met: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Pycollo adjusts the amount of collocation points (P) and size of the mesh sections (H), to ensure all tolerances are met. Whenever a state shows non linear behaviour the amount of collocation points in that section will increase to decrease errors. + +In summary, a multiphase direct collocation scheme breaks down a complex optimal control problem into manageable phases, discretizes the dynamics and constraints within each phase, ensures continuity between phases, and solves the resulting optimization problem to find the optimal control strategy across multiple segments. This approach is particularly useful for problems where the system behavior and control strategies change over different time intervals. + +.. bibliography:: \ No newline at end of file diff --git a/docs/gettingstarted/Installation.rst b/docs/gettingstarted/Installation.rst new file mode 100644 index 0000000..898bf91 --- /dev/null +++ b/docs/gettingstarted/Installation.rst @@ -0,0 +1,68 @@ +========================== +Pycollo Installation Guide +========================== + +Prerequisites +============= + +Before you begin, ensure you have the following prerequisites installed: + +- Python (>= 3.7) + +Step 1: Create a Virtual Environment +------------------------------------ + +It is recommended to install Pycollo in a virtual environment to manage dependencies. + +1. Open a terminal or command prompt. + +2. Create a new virtual environment: + + .. code-block:: bash + + python -m venv pycollo-env + +3. Activate the virtual environment: + + - On Windows: + + .. code-block:: bash + + .\pycollo-env\Scripts\activate + + - On macOS and Linux: + + .. code-block:: bash + + source pycollo-env/bin/activate + +Step 2: Install Pycollo +------------------------ +To install with conda-forge enter the following command at a command prompt + +.. code-block:: bash + + conda install -c conda-forge pycollo + +To install using conda, enter the following command at a command prompt: + +.. code-block:: bash + + conda install pycollo + +To install using pip, enter the following command at a command prompt: + +.. code-block:: bash + + pip install pycollo + + +Pycollo and its dependencies will be downloaded and installed. + +.. note:: + + If you no longer need the virtual environment, you can deactivate it by running the command: + + .. code-block:: bash + + deactivate \ No newline at end of file diff --git a/docs/gettingstarted/Quickstart.rst b/docs/gettingstarted/Quickstart.rst new file mode 100644 index 0000000..cba3c00 --- /dev/null +++ b/docs/gettingstarted/Quickstart.rst @@ -0,0 +1,6 @@ +========== +Quickstart +========== + +This project is currently a work in progress, this documetnation gives three examples which walks you through the main functions of Pycollo. Some working examples can be found in the examples directory for more complex applications. + diff --git a/docs/gettingstarted/index.rst b/docs/gettingstarted/index.rst new file mode 100644 index 0000000..56ff5b1 --- /dev/null +++ b/docs/gettingstarted/index.rst @@ -0,0 +1,11 @@ +Getting Started +=============== + +.. toctree:: + :maxdepth: 2 + :titlesonly: + + Background + Installation + Quickstart + diff --git a/docs/index.rst b/docs/index.rst index 8732541..c11d90f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,4 +7,7 @@ Pycollo: an Open-Source Package for Multi Phase Direct Collocation. :maxdepth: 2 :titlesonly: + gettingstarted/index + contribute + FAQ api_reference diff --git a/docs/references.bib b/docs/references.bib new file mode 100644 index 0000000..f7d923c --- /dev/null +++ b/docs/references.bib @@ -0,0 +1,28 @@ + +@article{kelly_introduction_2017, + title = {An {Introduction} to {Trajectory} {Optimization}: {How} to {Do} {Your} {Own} {Direct} {Collocation}}, + volume = {59}, + issn = {0036-1445}, + shorttitle = {An {Introduction} to {Trajectory} {Optimization}}, + url = {https://epubs.siam.org/doi/10.1137/16M1062569}, + doi = {10.1137/16M1062569}, + abstract = {This paper is an introductory tutorial for numerical trajectory optimization with a focus on direct collocation methods. These methods are relatively simple to understand and effectively solve a wide variety of trajectory optimization problems. Throughout the paper we illustrate each new set of concepts by working through a sequence of four example problems. We start by using trapezoidal collocation to solve a simple one-dimensional toy problem and work up to using Hermite--Simpson collocation to compute the optimal gait for a bipedal walking robot. Along the way, we cover basic debugging strategies and guidelines for posing well-behaved optimization problems. The paper concludes with a short overview of other methods for trajectory optimization. We also provide an electronic supplement that contains well-documented MATLAB code for all examples and methods presented. Our primary goal is to provide the reader with the resources necessary to understand and successfully implement their own direct collocation methods. (An erratum is attached.)}, + number = {4}, + urldate = {2022-03-15}, + journal = {SIAM Review}, + author = {Kelly, Matthew}, + month = jan, + year = {2017}, + note = {Publisher: Society for Industrial and Applied Mathematics}, + keywords = {34, 37, 49, 90, 97, direct collocation, direct transcription, optimal control, robotics, trajectory optimization, tutorial}, + pages = {849--904}, + file = {Full Text PDF:/Users/j.t.heinen/Zotero/storage/IVJN38S3/Kelly - 2017 - An Introduction to Trajectory Optimization How t.pdf:application/pdf}, +} + +@misc{brockie_predictive_2021, + title = {Predictive {Simulation} of {Musculoskeletal} {Models} {Using} {Direct} {Collocation}}, + language = {en}, + author = {Brockie, Samuel George}, + year = {2021}, + file = {Brockie - Predictive Simulation of Musculoskeletal Models Us.pdf:/Users/j.t.heinen/Zotero/storage/GAHGMDT8/Brockie - Predictive Simulation of Musculoskeletal Models Us.pdf:application/pdf}, +} From bb1ebe9c3d653155e5ec6d3ac443738edc5bb1ac Mon Sep 17 00:00:00 2001 From: jtheinen Date: Thu, 10 Aug 2023 18:37:38 +0200 Subject: [PATCH 02/15] minor edit background --- docs/gettingstarted/Background.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/gettingstarted/Background.rst b/docs/gettingstarted/Background.rst index c2c7f5f..0a42ede 100644 --- a/docs/gettingstarted/Background.rst +++ b/docs/gettingstarted/Background.rst @@ -1,6 +1,9 @@ +================ What is Pycollo? ================ +Pycollo, a combination of Python and collocation, is a Python package for solving multiphase optimal control problems using direct orthogonal collocation. + In optimization there are shooting methods and simultaneous methods. A shooting method uses a simulation to enforce the system dynamics, while the collocation method enforces the dynamics at given points along the trajectory. Shooting methods are more prone to find a global solution, but are computationally heavy. Collocation methods tend to converge better and faster but are prone to find local minima. Direct methods are generally best for problems where dynamics and control must be computed to a similar accuracy, and the structure of the control trajectory is not known a priori :cite:p:`kelly_introduction_2017`. Pycollo is a direct orthogonal collocation transcription tool for Python :cite:p:`brockie_predictive_2021`. The dynamics and constraints are enforced over a discretization. The discretization exists of N collocation points. The collocation points are either mesh points or polynomial points, but all collocation points are enforced to the constraints and dynamics. After transcription the problem is passed to the solver IPOPT (Interior Point OPTimizer). When the found IPOPT solution does not meet the error-tolerance set in PyCollo, the discretization is refined and a new itera- tion is solved in IPOPT. Mesh points, polynomial points, mesh sections and mesh refinement are explained in figure 5. The polynomials are of the Legendre-Gauss-Lobatto (LGL) nature. More information on the mesh can be found in appendix A. The integration scheme is an implicit Runge-Kutta Kth method :cite:p:`brockie_predictive_2021`. This high order method will have a high accuracy with the disadvantage that all states and constraints need to be differentiable. From 2373883144c3e4de2e276ad14bc3b4cd932e860f Mon Sep 17 00:00:00 2001 From: Sam Brockie Date: Tue, 29 Aug 2023 16:03:33 +0200 Subject: [PATCH 03/15] Reword FAQ answer --- docs/FAQ.rst | 13 +++++++++---- docs/index.rst | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/FAQ.rst b/docs/FAQ.rst index 9832e2a..a1d98da 100644 --- a/docs/FAQ.rst +++ b/docs/FAQ.rst @@ -1,8 +1,13 @@ -=== -FAQ -=== +========================== +Frequently Asked Questions +========================== Why is my code giving errors? ----------------------------- -First make sure you have filled in every bound and guess where necessary. It might be usefull to look at the dimensions of all attributes to check whether you missed a bound or guess. \ No newline at end of file +Pycollo's error checking for bounds and guesses can give opaque error messages +or even fail. Make sure that you have provided bounds and a guess for every +variable and constraint where necessary. It can be helpful to look at the +dimensions of all attributes and compare this to the bounds and guesses that you +have supplied to ensure that these are equal. If they are not then you are +probably missing some bounds or a guess. diff --git a/docs/index.rst b/docs/index.rst index c11d90f..8e6757d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,5 +9,5 @@ Pycollo: an Open-Source Package for Multi Phase Direct Collocation. gettingstarted/index contribute - FAQ + fag api_reference From 30e0a9b38bf3a167a34faa38004197486dc132ba Mon Sep 17 00:00:00 2001 From: Sam Brockie Date: Tue, 29 Aug 2023 16:07:12 +0200 Subject: [PATCH 04/15] Add sphinxcontrib-bibtex>=2.6.1 --- docs/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/requirements.txt b/docs/requirements.txt index 6d41039..8233a23 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,3 @@ furo>=2023.5.20 sphinx>=6.1.3 +sphinxcontrib-bibtex>=2.6.1 From 59726282d8414df72ec8d8ef60f3fde0e4590d3b Mon Sep 17 00:00:00 2001 From: Sam Brockie Date: Tue, 29 Aug 2023 16:08:03 +0200 Subject: [PATCH 05/15] Fix typo --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 8e6757d..966774a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,5 +9,5 @@ Pycollo: an Open-Source Package for Multi Phase Direct Collocation. gettingstarted/index contribute - fag + faq api_reference From 2f09f9b48886a9d7db0b7f937a478a1d8de19f81 Mon Sep 17 00:00:00 2001 From: Sam Brockie Date: Tue, 29 Aug 2023 16:12:30 +0200 Subject: [PATCH 06/15] Update Python versions to 3.11 --- .github/workflows/deploy.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d1c2af0..284df38 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Install dependencies run: python -m pip install --upgrade -r requirements.txt -r docs/requirements.txt - name: Install Pycollo diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d84d572..7225afd 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Install dependencies run: python -m pip install --upgrade -r requirements.txt -r docs/requirements.txt - name: Install Pycollo diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4941d54..4112f65 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Install dependencies run: python -m pip install --upgrade ruff - name: Lint with Ruff diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 91195bd..f56e575 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9aa9b5b..876c95c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.8', '3.9', '3.10'] + python-version: ['3.8', '3.9', '3.10', '3.11'] defaults: run: shell: bash -l {0} From e2337daa8a21aa15d8c5303761ef4c1419e9bb4f Mon Sep 17 00:00:00 2001 From: Sam Brockie Date: Tue, 29 Aug 2023 16:13:38 +0200 Subject: [PATCH 07/15] Rename to contributing --- docs/{contribute.rst => contributing.rst} | 8 ++++---- docs/index.rst | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) rename docs/{contribute.rst => contributing.rst} (87%) diff --git a/docs/contribute.rst b/docs/contributing.rst similarity index 87% rename from docs/contribute.rst rename to docs/contributing.rst index fab2de3..e93eb6c 100644 --- a/docs/contribute.rst +++ b/docs/contributing.rst @@ -1,6 +1,6 @@ -========== -Contribute -========== +============ +Contributing +============ Pycollo is currently under development. Major code refactors, including significant API changes, are likely. As such contributions may not be readily accepted at this time. If you are keen to contribute, please contact the authors by email or file an issue on the issue tracker detailing how you would like to get involved. @@ -15,4 +15,4 @@ This project is licensed under the terms of the MIT license. Authors ------- -Sam Brockie - sambrockie@icloud.com \ No newline at end of file +Sam Brockie - sambrockie@icloud.com diff --git a/docs/index.rst b/docs/index.rst index 966774a..a3c79af 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,6 +8,6 @@ Pycollo: an Open-Source Package for Multi Phase Direct Collocation. :titlesonly: gettingstarted/index - contribute + contributing faq api_reference From 118ff7140ccab010ee7927f10f76345d0ac2c5d9 Mon Sep 17 00:00:00 2001 From: Sam Brockie Date: Tue, 29 Aug 2023 16:16:24 +0200 Subject: [PATCH 08/15] Add acknowledgements section --- README.rst | 10 ++++++++-- docs/contributing.rst | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 6a7573c..0c73d95 100644 --- a/README.rst +++ b/README.rst @@ -27,8 +27,8 @@ To install using pip, enter the following command at a command prompt: For more information, refer to the `installation documentation `_. -Contribute -========== +Contributing +============ Pycollo is currently under development. Major code refactors, including significant API changes, are likely. As such contributions may not be readily accepted at this time. If you are keen to contribute, please contact the authors by email or file an issue on the issue tracker detailing how you would like to get involved. @@ -45,6 +45,12 @@ Authors - Sam Brockie - sgb39@cam.ac.uk + +Acknowledgements +================ + +A special thanks is owed to Jan Heinen, Jason K. Moore, and the Chan Zuckerberg Initiative for their fantastic contributions to the Pycollo documentation. + Citation ======== diff --git a/docs/contributing.rst b/docs/contributing.rst index e93eb6c..04222ea 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -15,4 +15,10 @@ This project is licensed under the terms of the MIT license. Authors ------- + Sam Brockie - sambrockie@icloud.com + +Acknowledgements +---------------- + +Special thanks to Jan Heinen, Jason K. Moore, and the Chan Zuckerberg Initiative for their fantastic contributions to the Pycollo documentation. From 8ced0161b323b5c2b39d034bf1e257f4149406b5 Mon Sep 17 00:00:00 2001 From: Sam Brockie Date: Tue, 29 Aug 2023 16:18:40 +0200 Subject: [PATCH 09/15] Rewrite package summary on docs homepage --- docs/index.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index a3c79af..55ee6a1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,7 +1,8 @@ -===================== -Pycollo Documentation -===================== -Pycollo: an Open-Source Package for Multi Phase Direct Collocation. +======= +Pycollo +======= + +General-purpose optimal control, trajectory optimisation and parameter optimisation using direct collocation. .. toctree:: :maxdepth: 2 From 3b6a0679cc0d14bcdece126cd65ce448c5b35671 Mon Sep 17 00:00:00 2001 From: Sam Brockie Date: Tue, 29 Aug 2023 16:19:07 +0200 Subject: [PATCH 10/15] Rename files and folders --- .../Background.rst => getting_started/background.rst} | 0 docs/{gettingstarted => getting_started}/index.rst | 6 +++--- .../Installation.rst => getting_started/installation.rst} | 0 .../Quickstart.rst => getting_started/quickstart.rst} | 0 docs/index.rst | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename docs/{gettingstarted/Background.rst => getting_started/background.rst} (100%) rename docs/{gettingstarted => getting_started}/index.rst (63%) rename docs/{gettingstarted/Installation.rst => getting_started/installation.rst} (100%) rename docs/{gettingstarted/Quickstart.rst => getting_started/quickstart.rst} (100%) diff --git a/docs/gettingstarted/Background.rst b/docs/getting_started/background.rst similarity index 100% rename from docs/gettingstarted/Background.rst rename to docs/getting_started/background.rst diff --git a/docs/gettingstarted/index.rst b/docs/getting_started/index.rst similarity index 63% rename from docs/gettingstarted/index.rst rename to docs/getting_started/index.rst index 56ff5b1..818aa9d 100644 --- a/docs/gettingstarted/index.rst +++ b/docs/getting_started/index.rst @@ -5,7 +5,7 @@ Getting Started :maxdepth: 2 :titlesonly: - Background - Installation - Quickstart + background + installation + quickstart diff --git a/docs/gettingstarted/Installation.rst b/docs/getting_started/installation.rst similarity index 100% rename from docs/gettingstarted/Installation.rst rename to docs/getting_started/installation.rst diff --git a/docs/gettingstarted/Quickstart.rst b/docs/getting_started/quickstart.rst similarity index 100% rename from docs/gettingstarted/Quickstart.rst rename to docs/getting_started/quickstart.rst diff --git a/docs/index.rst b/docs/index.rst index 55ee6a1..098963e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,7 +8,7 @@ General-purpose optimal control, trajectory optimisation and parameter optimisat :maxdepth: 2 :titlesonly: - gettingstarted/index + getting_started/index contributing faq api_reference From be09b7b7964f620991a07741e00f65946e17855d Mon Sep 17 00:00:00 2001 From: Sam Brockie Date: Tue, 29 Aug 2023 16:31:10 +0200 Subject: [PATCH 11/15] Update minimum supported version to Python 3.8 --- docs/getting_started/installation.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/getting_started/installation.rst b/docs/getting_started/installation.rst index 898bf91..6e322ff 100644 --- a/docs/getting_started/installation.rst +++ b/docs/getting_started/installation.rst @@ -7,7 +7,7 @@ Prerequisites Before you begin, ensure you have the following prerequisites installed: -- Python (>= 3.7) +- Python (>= 3.8) Step 1: Create a Virtual Environment ------------------------------------ @@ -37,7 +37,8 @@ It is recommended to install Pycollo in a virtual environment to manage dependen source pycollo-env/bin/activate Step 2: Install Pycollo ------------------------- +----------------------- + To install with conda-forge enter the following command at a command prompt .. code-block:: bash @@ -65,4 +66,4 @@ Pycollo and its dependencies will be downloaded and installed. .. code-block:: bash - deactivate \ No newline at end of file + deactivate From 3c542a57877a76cb5a4a894bd816e3b66c4f009a Mon Sep 17 00:00:00 2001 From: Sam Brockie Date: Tue, 29 Aug 2023 16:45:20 +0200 Subject: [PATCH 12/15] Remove file fields --- docs/references.bib | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/references.bib b/docs/references.bib index f7d923c..aa78fc9 100644 --- a/docs/references.bib +++ b/docs/references.bib @@ -16,7 +16,6 @@ @article{kelly_introduction_2017 note = {Publisher: Society for Industrial and Applied Mathematics}, keywords = {34, 37, 49, 90, 97, direct collocation, direct transcription, optimal control, robotics, trajectory optimization, tutorial}, pages = {849--904}, - file = {Full Text PDF:/Users/j.t.heinen/Zotero/storage/IVJN38S3/Kelly - 2017 - An Introduction to Trajectory Optimization How t.pdf:application/pdf}, } @misc{brockie_predictive_2021, @@ -24,5 +23,4 @@ @misc{brockie_predictive_2021 language = {en}, author = {Brockie, Samuel George}, year = {2021}, - file = {Brockie - Predictive Simulation of Musculoskeletal Models Us.pdf:/Users/j.t.heinen/Zotero/storage/GAHGMDT8/Brockie - Predictive Simulation of Musculoskeletal Models Us.pdf:application/pdf}, } From 5610398b9b423b0937b2991b0ce565b24154b075 Mon Sep 17 00:00:00 2001 From: Sam Brockie Date: Tue, 29 Aug 2023 16:45:43 +0200 Subject: [PATCH 13/15] Remove quickstart --- docs/getting_started/index.rst | 2 -- docs/getting_started/quickstart.rst | 6 ------ 2 files changed, 8 deletions(-) delete mode 100644 docs/getting_started/quickstart.rst diff --git a/docs/getting_started/index.rst b/docs/getting_started/index.rst index 818aa9d..8a4946b 100644 --- a/docs/getting_started/index.rst +++ b/docs/getting_started/index.rst @@ -7,5 +7,3 @@ Getting Started background installation - quickstart - diff --git a/docs/getting_started/quickstart.rst b/docs/getting_started/quickstart.rst deleted file mode 100644 index cba3c00..0000000 --- a/docs/getting_started/quickstart.rst +++ /dev/null @@ -1,6 +0,0 @@ -========== -Quickstart -========== - -This project is currently a work in progress, this documetnation gives three examples which walks you through the main functions of Pycollo. Some working examples can be found in the examples directory for more complex applications. - From 1aa63d6884268addc01f94649e6016886e79a6c7 Mon Sep 17 00:00:00 2001 From: Sam Brockie Date: Tue, 29 Aug 2023 16:49:09 +0200 Subject: [PATCH 14/15] Reformat paragraph to single line --- docs/FAQ.rst | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/FAQ.rst b/docs/FAQ.rst index a1d98da..2c1d561 100644 --- a/docs/FAQ.rst +++ b/docs/FAQ.rst @@ -5,9 +5,4 @@ Frequently Asked Questions Why is my code giving errors? ----------------------------- -Pycollo's error checking for bounds and guesses can give opaque error messages -or even fail. Make sure that you have provided bounds and a guess for every -variable and constraint where necessary. It can be helpful to look at the -dimensions of all attributes and compare this to the bounds and guesses that you -have supplied to ensure that these are equal. If they are not then you are -probably missing some bounds or a guess. +Pycollo's error checking for bounds and guesses can give opaque error messages or even fail. Make sure that you have provided bounds and a guess for every variable and constraint where necessary. It can be helpful to look at the dimensions of all attributes and compare this to the bounds and guesses that you have supplied to ensure that these are equal. If they are not then you are probably missing some bounds or a guess. From dfd6082aff6ae74baaf69ae38f20fc3ce66682b5 Mon Sep 17 00:00:00 2001 From: Sam Brockie Date: Tue, 29 Aug 2023 16:50:46 +0200 Subject: [PATCH 15/15] Rename file to lowercase --- docs/{FAQ.rst => faq.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{FAQ.rst => faq.rst} (100%) diff --git a/docs/FAQ.rst b/docs/faq.rst similarity index 100% rename from docs/FAQ.rst rename to docs/faq.rst