{"id":16927815,"url":"https://github.com/moorepants/learn-multibody-dynamics","last_synced_at":"2025-10-25T14:31:06.895Z","repository":{"id":37828236,"uuid":"383764685","full_name":"moorepants/learn-multibody-dynamics","owner":"moorepants","description":"Interactive computational book on multibody dynamics","archived":false,"fork":false,"pushed_at":"2024-08-12T10:07:10.000Z","size":129170,"stargazers_count":121,"open_issues_count":52,"forks_count":28,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-14T20:35:19.395Z","etag":null,"topics":["dynamics","engineering","mechanics","multibody"],"latest_commit_sha":null,"homepage":"https://moorepants.github.io/learn-multibody-dynamics/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moorepants.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"license.rst","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-07T10:48:11.000Z","updated_at":"2024-10-02T21:12:48.000Z","dependencies_parsed_at":"2024-03-04T21:47:46.495Z","dependency_job_id":"32b932ea-9c07-4d78-a691-aa08bcd293e4","html_url":"https://github.com/moorepants/learn-multibody-dynamics","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moorepants%2Flearn-multibody-dynamics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moorepants%2Flearn-multibody-dynamics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moorepants%2Flearn-multibody-dynamics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moorepants%2Flearn-multibody-dynamics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moorepants","download_url":"https://codeload.github.com/moorepants/learn-multibody-dynamics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238161514,"owners_count":19426669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dynamics","engineering","mechanics","multibody"],"created_at":"2024-10-13T20:35:12.123Z","updated_at":"2025-10-25T14:31:06.889Z","avatar_url":"https://github.com/moorepants.png","language":"Python","readme":"======\nREADME\n======\n\nThis repository contains the source for the interactive textbook `Learn\nMultibody Dynamics \u003chttps://moorepants.github.io/learn-multibody-dynamics/\u003e`_.\n\nAuthors and Contributors\n========================\n\nAuthor: Jason K. Moore\n\nCo-Authors: Wouter Wolfslag\n\nContributors: Peter Stahlecker, Jan Heinen, @tamoora, Christopher Dembia, Arthur Ryman\n\nLicense\n=======\n\nThe contents of this repository are licensed under the CC-BY 4.0 license. See\n``license.rst`` for more information.\n\nDesign\n======\n\nThe design of the book has these general goals:\n\n- use computational thinking to teach multibody dynamics\n- the book is online and interactive (run/modify code, interact with figures)\n- don't just teach the math and expect the students to figure out the\n  computation on their own, the computations should be first class and could\n  even go as far as replacing the math as the teach mechanism\n- computational difficulties should not be hidden and should be taught\n- after completing the book, you should be able to create a physics engine if\n  you desired\n- most lessons should be motivated by a real problem statement, instead of\n  teaching the concepts with little connection to reality or strictly from a\n  mathematical sense\n- allow collaborative contributions\n\nBuilding the Website\n====================\n\nSetup the code and environment\n------------------------------\n\nClone the repository::\n\n   git clone https://github.com/moorepants/learn-multibody-dynamics.git\n   cd learn-multibody-dynamics\n\nInstall miniconda_ or a similar tool (e.g. Anaconda_) and create a conda\nenvironment for the book::\n\n   conda env create -f multibody-book-env.yml\n\n.. _miniconda: https://docs.conda.io/en/latest/miniconda.html\n.. _Anaconda: https://www.anaconda.com/products/individual\n\nActivate the conda environment::\n\n   conda activate multibody-book\n\nBuild and view the website\n--------------------------\n\nTo build the website run::\n\n   make html\n\nWhen complete, the website is then viewable in your browser::\n\n   \u003cyourbrowser\u003e _build/html/index.html\n\nYou can also run sphinx-autobuild (updates while while you edit) with::\n\n   make autobuild\n\nWorking with a remote git branch\n--------------------------------\n\nIf you want to build one of the branches (for example a pull request), you'll\nneed to fetch and checkout the branch. First fetch down all the branches::\n\n   git fetch origin\n\nThen checkout the branch (this command is only need the first time you check it\nout)::\n\n   git checkout -b branch-name origin/branch-name\n\nThe branch name is listed on the pull request just under the title \"...wants to\nmerge X commits into master from branch-name.\" Or you can find all branches\nhere: https://github.com/moorepants/learn-multibody-dynamics/branches\n\nNow run::\n\n   make clean\n   make html\n\nThe ``make clean`` makes sure you don't keep any remnants from prior builds\naround before building the new branch.\n\nAfter you have a new branch setup you can switch between the master branch and\nany branch name with just::\n\n   git checkout master\n   git checkout branch-name\n\nIf the master branch or any other branch has been updated on github you can\npull down the latest changes with::\n\n   git checkout branch-name\n   git pull origin branch-name\n\nEditing Guide\n=============\n\nrestructuredtext\n----------------\n\nThe text is written in reStructuredText and processed with Sphinx. The `Sphinx\nreStructuredText documentation page\n\u003chttps://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html\u003e`_ is a\ngood starting point to learn the syntax.\n\nreStructuredText doesn't enforce a specific heading order, but this should be\nfollowed for this text:\n\n.. code:: rst\n\n   =======\n   Chapter\n   =======\n\n   Section\n   =======\n\n   Subsection\n   ----------\n\n   Subsubsection\n   ^^^^^^^^^^^^^\n\nAutoreferencing is enabled so the above sections can be referenced with:\n\n.. code:: rst\n\n   :ref:`Chapter`\n   :ref:`Section`\n   :ref:`Subsection`\n   :ref:`Subsubsection`\n\nFor equations and figures, they need to be manually labeled for numbered\nreferencing. Use these patterns:\n\n.. code:: rst\n\n   .. math::\n      :label: eq-my-equation-name\n   :math:numref:`eq-my-equation-name`\n\n   .. _fig-my-figure-name:\n   :numref:`fig-my-figure-name`\n\nWhen citing Kane \u0026 Levinson 1985 or other books include the page number:\n\n.. code:: rst\n\n   ([Kane1985_], pg. 23)\n\nCross-referencing API documentation in various libraries:\n\n.. code:: rst\n\n   :external:py:meth:`~sympy.physics.vector.frame.ReferenceFrame.ang_acc_in`\n   :external:py:class:`~sympy.physics.vector.frame.ReferenceFrame`\n   :external:py:func:`~sympy.physics.vector.functions.cross`\n\nExercises look like this:\n\n.. code:: rst\n\n   .. admonition:: Exercise\n\n      What is 1 + 1?\n\n   .. admonition:: Solution\n      :class: dropdown\n\n      The answer is 2.\n\nIndentation:\n\n- Python: 4 spaces\n- RestructuredText: 3 spaces\n- LaTeX: 2 spaces\n\n.. code:: rst\n\n   .. math::\n\n      \\begin{bmatrix}\n        a \u0026 b\n      \\end{bmatrix}\n\n   .. juputer-execute::\n\n      def f(a):\n          return a\n\njupyer-sphinx\n-------------\n\nWe use jupyter-sphinx to transform each page with code cells into a Jupyter\nNotebook and Python script. Any page that includes ``.. jupyter-execute::``\ndirectives will be processed in this way. The documentation for jupyter-sphinx\nis here:\n\nhttps://jupyter-sphinx.readthedocs.io\n\nEach page that has executable code should include these download links at the\ntop of the page. If the filename is ``page.rst`` then include:\n\n.. code:: rst\n\n   .. note::\n\n      You can download this example as a Python script:\n      :jupyter-download-script:`page` or Jupyter Notebook:\n      :jupyter-download-notebook:`page`.\n\nXournal++\n---------\n\nI draw the figures, one per page, in Xournal++. The I export as -\u003e svg -\u003e\nchoose None for background and \"current page\" to get a single exported svg.\n\nThe SVG figures should be cropped to the bounding box of the drawn elements.\nOne can do so using Inkscape with these button presses: File -\u003e Document\nProperties -\u003e Resize Page to Content. With Inkscape \u003e 1.0 this command will\ncrop the figure:\n\n.. code:: bash\n\n   inkscape --export-type=svg --export-area-drawing ./my-figure.svg\n\nLive rebuilding with sphinx-autobuild\n-------------------------------------\n\n`Sphinx autobuild`_ is a pretty good way to get almost instaneous rendered HTML\nversions of the reStructuredText file. You can open a window with your text\neditor and a window with your broswer side-by-side for almost instant feedback\non the formatting and Jupyter code execution.\n\n.. _Sphinx autobuild: https://github.com/executablebooks/sphinx-autobuild\n\n.. code:: bash\n\n   sphinx-autobuild -b html . _build/html/\n\nThis is also encoded in the Makefile:\n\n.. code:: bash\n\n   make autobuild\n\nIf errors occur in jupyter-sphinx cells while editing this will always cause\nthe entire book to be rebuilt, i.e. it wipes the sphinx cache. If you set an\nenvironment variable ``CHAPTER`` to the name of chapter's filename (without the\n``.rst`` extension) only the chapter you are working on will be built. For\nexample:\n\n.. code:: bash\n\n   CHAPTER=configuration make autobuild\n\nwill only build the ``configuration.rst`` chapter.\n\nExecute code cells in IPython while writing\n-------------------------------------------\n\ntmux\n^^^^\n\nhttps://tmuxcheatsheet.com/\n\nhttps://medium.com/hackernoon/a-gentle-introduction-to-tmux-8d784c404340\n\n::\n\n   tmux new\n   \u003cCtrl\u003e+b %  # side by side panes\n   \u003cCtrl\u003e+\u003carrow key\u003e  # jump between panes\n\nvim-slime\n^^^^^^^^^\n\nhttps://github.com/jpalardy/vim-slime\n\ncreate a vim slime config file for rst\n\n::\n\n   \u003cCtrl\u003e+cc  # execute line(s) in ipython pane\n\nPrepare Offline Version\n=======================\n\nCreated a directory for MathJax v2::\n\n   mkdir -p _static/js/\n   cd _static/js/\n   wget https://github.com/mathjax/MathJax/archive/refs/tags/2.7.9.zip\n   unzip 2.7.9.zip\n   mv MathJax-2.7.9/ MathJax/\n   rm 2.7.9.zip\n\nDownload this JavaScript file also::\n\n   wget https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@^1.0.1/dist/embed-amd.js\n   cd ../..\n\nIn ``conf.py`` change these two lines::\n\n   todo_include_todos = False\n\n   mathjax_path = \"js/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML\"\n\nNow, build the HTML version::\n\n   make clean\n   make html\n\nMake sure ``embed-amd.js`` loads from the local source with::\n\n   sed -i \"s,https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@^1.0.1/dist,_static/js,g\" _build/html/*.html\n\nRemove links to external resources (slows loading on offline computers)::\n\n   sed -i 's,\u003clink href=\"https://fonts.gstatic.com/\" rel=\"preconnect\" crossorigin\u003e,,g' _build/html/*.html\n   sed -i 's^\u003clink href=\"https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700\u0026display=fallback\" rel=\"stylesheet\"\u003e^^g' _build/html/*.html\n   sed -i 's,\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js\"\u003e\u003c/script\u003e,,g' _build/html/*.html\n\nNow build the PDF version::\n\n   make latexpdf\n\nCreate a folder to zip up the book::\n\n   mkdir -p misc/book/\n\nCopy over the files::\n\n   cp -r _build/html/* misc/book/\n   cp _build/latex/learnmultibodydynamics.pdf misc/\n\nZip the book::\n\n   cd misc/\n   zip -r me41056-book-20XX.zip book/ learnmultibodydynamics.pdf\n\nThis version should work offline (except for externally loaded videos and\nimages).\n\nContent Resources\n=================\n\nHere are links to various resources that use SymPy for dynamics that could be\nincorporated into this repository, as is or as inspiration:\n\n- UC Davis MAE223 notebooks: https://moorepants.github.io/mae223/schedule.html\n- PyDy tutorial: https://github.com/pydy/pydy-tutorial-human-standing\n- PyDy documentation examples: https://pydy.readthedocs.io/en/latest/index.html#examples\n- PyDy source examples: https://github.com/pydy/pydy/tree/master/examples\n- SymPy Mechanics documentation: https://docs.sympy.org/dev/modules/physics/mechanics/index.html\n- Resonance notebooks: https://moorepants.github.io/resonance/\n- Yeadon example: https://nbviewer.jupyter.org/github/chrisdembia/yeadon/blob/v1.2.1/examples/bicyclerider/bicycle_example.ipynb\n- Problems from EME 134: https://moorepants.github.io/eme134/labs.html\n- TU Delft MAE41055 2021 homework notebooks\n- Oliver's solutions to the TUD advanced dynamics course examples: https://github.com/pydy/pydy/pull/137\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoorepants%2Flearn-multibody-dynamics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoorepants%2Flearn-multibody-dynamics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoorepants%2Flearn-multibody-dynamics/lists"}