SkillAgentSearch skills...

Bioptim

An optimization framework that links CasADi, Ipopt, ACADOS and biorbd for Optimal Control Problem

Install / Use

/learn @pyomeca/Bioptim

README

<p align="center"> <img src="https://github.com/pyomeca/biorbd_design/blob/main/logo_png/bioptim_full.png" alt="logo" /> </p>

Bioptim is an optimal control program (OCP) framework for biomechanics. It is based on the efficient biorbd biomechanics library and benefits from the powerful algorithmic diff provided by CasADi. It interfaces the robust Ipopt and the fast Acados solvers to suit all your needs for solving OCP in biomechanics.

Status

| Type | Status | |---|---| | License | <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-success" alt="License"/></a> | | Continuous integration | Build status | | Code coverage | codecov | | DOI | DOI | | Publication | IEEE Badge |

The current status of bioptim on conda-forge is

| Name | Downloads | Version | Platforms | MyBinder | | --- | --- | --- | --- | --- | | Conda Recipe | Conda Downloads | Conda Version | Conda Platforms | Binder |

Contact

You can join us on Discord Discord or open an Issue on GitHub. We would be thrilled to discuss with you about bioptim and biomechanics/optimal control in general!

Try bioptim

Anyone can play with bioptim with a working (but slightly limited in terms of graphics) MyBinder by clicking the following badge

Binder

As a tour guide that uses this binder, you can watch the bioptim workshop that we gave at the CMBBE conference on September 2021 by following this link: https://youtu.be/z7fhKoW1y60

A GUI is available to run all the current examples. To run it you can use the following command, from the root folder of the project:

conda install -c conda-forge pyqt pyqtgraph
python -m bioptim.examples

Please refer to section Examples for more information on how to run the examples.

Table of Contents

Testing bioptim

<details> <summary><a href="#how-to-install">How to install</a></summary> </details>

Defining our optimal control problems

<details> <summary><a href="#a-first-practical-example">A first practical example</a></summary> </details> <details> <summary><a href="#a-more-in-depth-look-at-the-bioptim-api">A more in depth look at the `bioptim` API</a></summary> </details> <details> <summary><a href="#examples">Examples</a></summary> </details> <details> <summary><a href="#performance">Performance</a></summary> </details> <details> <summary><a href="#troubleshooting">Troubleshooting</a></summary> </details>

Citing

How to install

The preferred way to install for the lay user is using anaconda. Another way, more designed for the core programmers, is from the sources. While it is theoretically possible to use bioptim from Windows, it is highly discouraged since it will require manually compiling all the dependencies. A great alternative for Windows users is Ubuntu on Windows supporting Linux.

Installing from Anaconda (For Windows, Linux, and Mac)

The easiest way to install bioptim is to download the binaries from Anaconda repositories. The project is hosted on the conda-forge channel (https://anaconda.org/conda-forge/bioptim).

After having appropriately installed an anaconda client [my suggestion would be Miniconda (https://conda.io/miniconda.html)] and loaded the desired environment to install bioptim in, just type the following command:

conda install -c conda-forge bioptim

This will download and install all the dependencies and install bioptim. And that is it! You can already enjoy using bioptim!

Installing from the sources (For Linux, Mac, and Windows)

Installing from the sources is as easy as installing from Anaconda, with the difference that you will be required to download and install the dependencies by hand (see the section below).

Dependencies

bioptim relies on several libraries. The most obvious one is the biorbd suite (including indeed biorbd and bioviz), but extra libraries are required. Due to the different dependencies, it would be tedious to show how to install them all here. The user is therefore invited to read the relevant documentation.

Here is a list of all direct dependencies (meaning that some dependencies may require other libraries themselves):
Python | numpy | scipy | [packaging](https://packa

View on GitHub
GitHub Stars118
CategoryDevelopment
Updated27d ago
Forks56

Languages

Python

Security Score

100/100

Audited on Mar 1, 2026

No findings