Giter Site home page Giter Site logo

tommyteavee / opensim-moco Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opensim-org/opensim-moco

0.0 0.0 0.0 17 MB

Solve optimal control problems for musculoskeletal models using OpenSim and direct collocation.

Home Page: https://simtk.org/projects/opensim-moco

License: Apache License 2.0

CMake 3.42% C++ 84.01% Python 3.37% PowerShell 0.02% HTML 0.07% C 3.25% Objective-C 0.01% MATLAB 3.73% Java 0.11% Shell 0.50% Dockerfile 0.13% TeX 0.46% CSS 0.92%

opensim-moco's Introduction

OpenSim Moco

Build Status with GitHub Actions Appveyor Travis

OpenSim Moco is a toolkit for solving optimal control problems involving musculoskeletal systems using the direct collocation method. Moco solves the following broad categories of problems:

  1. Solve for the muscle activity that produces an observed motion.
  2. Solve for the muscle activity that approximately tracks an observed motion.
  3. Solve for a new motion that optimizes user-defined costs.
  4. Solve for muscle properties that yield a good match between simulated and measured muscle activity.

Building Moco

Moco depends on the following software:

  1. OpenSim: Platform for simulating musculoskeletal systems.
    1. Simbody: Multibody dynamics.
  2. CasADi: Algorithmic differentiation and interface to nonlinear solvers.
  3. Tropter: C++ library for solving general optimal control problems with direct collocation. Currently, Tropter's source code is part of Moco. 2. Eigen: C++ matrix library. 3. ColPack: Used to efficiently 4. ADOL-C: Automatic differentiation.
  4. Ipopt: Nonlinear program solver.

Build the dependencies by building the CMake project in the dependencies folder.

Windows

On Windows, you can run the build_on_windows.ps1 PowerShell script to obtain Moco's dependencies and to build Moco. This script assumes you have installed Microsoft Visual Studio 2019 (with C++ support) and CMake 3.2 or greater. You can alternatively use Microsoft Visual Studio 2015 or Microsoft Visual Studio 2017.

Mac

Install the following:

  • gfortran
  • pkgconfig
  • autoreconf
  • aclocal
  • glibtoolize
  • wget
  • cmake
  • doxygen (optional)

You can install these with Homebrew:

brew install cmake pkgconfig gcc autoconf libtool automake wget doxygen

Nagivate to the directory where you placed the opensim-moco source code.

ex: cd ~/opensim-moco

Run build_on_mac from the terminal.

ex ./build_on_mac.sh

Ubuntu

sudo apt install git wget build-essential libtool autoconf cmake pkg-config gfortran liblapack-dev

Use the CMake project in the dependencies directory to install remaining dependencies.

Design goals

  1. Allow biomechanists to solve certain classes of optimal control problems with ease and without writing any code.

    1. Solving for muscle activity from a known motion should be faster than using OpenSim Computed Muscle Control.

    2. Users should be able to solve for mass properties that minimize residual forces.

    3. Advanced users can construct optimal control problems programmatically in C++.

  2. Advanced users can create plugins to create custom cost terms and constraints.

  3. Allow biomechanists to customize an optimal control problem.

    1. Choose an objective functional (sum of squared muscle activation, metabolic cost, joint loads, coordinate tracking, marker tracking).

    2. Choose constraints (activation within range of electromyography).

  4. The software and its source code are made freely available in a way that allows for commercial use (permissive licensing).

  5. Users do not need to manually specify derivatives (gradient, Jacobian, Hessian) for their optimal control problems.

  6. For advanced users, there should be utilities to easily debug issues with problem formulation (which variables are hitting their constraints?) and to improve performance (visualize sparsity pattern).

  7. The software should fully exploit all cores available on a user's computer, but should provide the option to only use 1 thread (if the user is solving multiple problems in parallel).

  8. Users can construct a Moco problem in MATLAB and Python.

  9. The software is easy to build from source.

  10. The software runs on Windows, macOS, and Linux (Ubuntu).

opensim-moco's People

Contributors

antoinefalisse avatar carmichaelong avatar chrisdembia avatar nickbianco avatar noahggordon avatar psbiomech avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.