Skip to content

Ipuch/bioNC

Repository files navigation

This repository contains the source code for the bioNC library, a python package for biomechanics and natural coordinates formalism. Inverse and Forward approach are implemented.

Status

Stars Forks

Release Version License
Build status codecov Black

Last Commit Contributors Merged PRs Open Issues Closed Issues

Table of Contents

-Installation

-A first practical example

-Mathematical backends

-Natural coordinates reminders

Installation

  • from conda:

Conda-version Last-update

    conda install -c conda-forge bionc
  • from source:
    python setup.py install

A first practical example

The easiest way to learn bionc is to dive into it. So let's build our first model. Please note that this tutorial is designed to recreate example which builds a lower limb model (Pelvis, Thigh, Shank, Foot). You can have look to https://github.com/Ipuch/bioNC/blob/main/examples/model_creation/main.py

Inverse kinematics

Mathematical backends

This toolbox support two mathematical backends: numpy and casadi.

Natural coordinates reminders

The $i$-th body in a biomechanism with $N$ bodies has generalized coordinates:

$$Q_i = (u_{i}, r_{p_{i}}, r_{d_{i}}, w_{i}) \in \mathbf{R}^3 \times \mathbf{R}^3 \times \mathbf{R}^3 \times \mathbf{R}^3,$$

represented in natural coordinates.

  • $u$: is the proximal vector in the global coordinate system.
  • $r_p$: the position of the proximal point in the global coordinate system.
  • $r_d$: the position of the distal point in the global coordinate system.
  • $w$: is the distal vector in the global coordinate system.

The biomechanism generalized coordinates:

$$Q = (Q_1, \dots, Q_N).$$

is the concatenation of all body coordinates.

To rigidify the body segments and to articulate them, two types of holonomic constraints are handled in this formalism: rigid-body constraints and joint constraints (also termed as kinematic constraints), denoted $\Phi^r(Q)$ and $\Phi^j(Q)$, respectively, and gathered in a common constraint function $\Phi$:

$$\begin{align} \Phi(Q) = \left( \Phi^r(Q) \quad \Phi^j(Q) \right)^\top \in \mathbf{R}^{6 \times N} \times \mathbf{R}^M. \end{align}$$

How to cite

Pierre Puchaud, Alexandre Naaim, & Anais Chaumeil. (2024). Ipuch/bioNC: CarpentersTogether (0.9.0). Zenodo. https://doi.org/10.5281/zenodo.10822669

@software{pierre_puchaud_2024_10822669,
  author       = {Pierre Puchaud and
                  Alexandre Naaim and
                  Anais Chaumeil},
  title        = {Ipuch/bioNC: CarpentersTogether},
  month        = mar,
  year         = 2024,
  publisher    = {Zenodo},
  version      = {0.9.0},
  doi          = {10.5281/zenodo.10822669},
  url          = {https://doi.org/10.5281/zenodo.10822669}
}

Reference

This work is an implementation mostly inspired by the work of Dr. Raphael Dumas (Senior Researcher at IFSTTAR – University of Lyon) on three-dimensional multi-body modeling of the human musculoskeletal system.