Skip to content

Commit 097e998

Browse files
committed
2 parents b4b875c + b64ba36 commit 097e998

File tree

6 files changed

+80
-38
lines changed

6 files changed

+80
-38
lines changed

.github/workflows/draft-pdf.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Draft PDF
2+
on: [push]
3+
4+
jobs:
5+
paper:
6+
runs-on: ubuntu-latest
7+
name: Paper Draft
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v4
11+
- name: Build draft PDF
12+
uses: openjournals/openjournals-draft-action@master
13+
with:
14+
journal: joss
15+
# This should be the path to the paper within your repo.
16+
paper-path: paper.md
17+
- name: Upload
18+
uses: actions/upload-artifact@v4
19+
with:
20+
name: paper
21+
# This is the output path where Pandoc will write the compiled
22+
# PDF. Note, this should be the same directory as the input
23+
# paper.md
24+
path: paper.pdf

.github/workflows/main.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Doxygen Action
66
# events but only for the master branch
77
on:
88
push:
9-
branches: [ master ]
9+
branches: [ main ]
1010

1111

1212

@@ -26,14 +26,34 @@ jobs:
2626
uses: mattnotmitt/[email protected]
2727
with:
2828
# Path to Doxyfile
29-
doxyfile-path: "./docs/Doxygen/Doxyfile" # default is ./Doxyfile
29+
doxyfile-path: "./Doxyfile" # default is ./Doxyfile
3030
# Working directory
3131
working-directory: "./docs/Doxygen" # default is .
3232

33-
- name: Deploy
34-
uses: peaceiris/actions-gh-pages@v3
33+
- name: Upload static files as artifact
34+
id: deployment
35+
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
3536
with:
36-
github_token: ${{ secrets.GITHUB_TOKEN }}
37-
# Default Doxyfile build documentation to html directory.
38-
# Change the directory if changes in Doxyfile
39-
publish_dir: ./docs/Doxygen/html
37+
path: ./docs/Doxygen/Doxygen_HTML
38+
39+
# Deployment job
40+
deploy:
41+
# Add a dependency to the build job
42+
needs: build
43+
44+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
45+
permissions:
46+
pages: write # to deploy to Pages
47+
id-token: write # to verify the deployment originates from an appropriate source
48+
49+
# Deploy to the github-pages environment
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
54+
# Specify runner + deployment step
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Instruction to start using the toolbox
1+
Instruction to start using the BioMAC-Sim-Toolbox. Extended documentation can be found here: https://mad-lab-fau.github.io/BioMAC-Sim-Toolbox/
22

33
1. Make sure that you have compiler installed. For instructions, see here: https://nl.mathworks.com/matlabcentral/answers/311290-faq-how-do-i-install-the-mingw-compiler
44
2. Install IPOPT. For example, you can install it by installing the following version through the Add-On Explorer in MATLAB: https://github.com/ebertolazzi/mexIPOPT. To do so, go to the "Apps" tab, click "Get More Apps" in top left to open the Add-On Explorer, then search for "IPOPT" and click "Add" on the top right.
@@ -8,4 +8,4 @@ Instruction to start using the toolbox
88

99
If you are using a newer Apple Silicon Mac, please take a look at the following to get mexIPOPT running: https://github.com/ebertolazzi/mexIPOPT/issues/24
1010

11-
If you would like to compile on different systems on the same machine, you need to manually delete the .o files after building the model files to ensure that you can build on the other system.
11+
If you would like to compile on different systems on the same machine, you need to manually delete the .o files after building the model files to ensure that you can build on the other system.

docs/Doxygen/pages/mainpage.dox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*/
1111

12-
/** @mainpage Welcome to the documentation of the biomechanical simulation toolbox.
12+
/** @mainpage Welcome to the documentation of the biomechanical motion analasys and creation (BioMAC) simulation toolbox.
1313
* @image html running.png
1414
This toolbox was created by researchers from the <a href="https://www.mad.tf.fau.de/">Machine Learning and Data Analytics</a> Lab and the <a href="https://www.asm.tf.fau.de/en/startseite/research/biomac/">Biomechanical Motion Analysis and Creation Group</a> at Friedrich-Alexander-Universit&auml;t Erlangen-N&uuml;rnberg in Erlangen, Germany and by researchers from the former Parker-Hannifin Laboratory for Human Motion and Control at Cleveland State University, Cleveland, Ohio, USA.
1515
*/

paper.bib

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ @article{koelewijn:2022
100100
publisher={IEEE}
101101
}
102102

103+
@article{Geyer:2010,
104+
title={A muscle-reflex model that encodes principles of legged mechanics produces human walking dynamics and muscle activities},
105+
author={Geyer, Hartmut and Herr, Hugh},
106+
journal={IEEE Transactions on neural systems and rehabilitation engineering},
107+
volume={18},
108+
number={3},
109+
pages={263--273},
110+
year={2010},
111+
publisher={IEEE}
112+
}
113+
103114
@article{Wachter:2006,
104115
title={On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming},
105116
author={W{\"a}chter, A and Biegler, LT},

paper.md

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'BioMAC-Sim-Toolbox: A MATLAB toolbox for human movement simulation and analysis'
2+
title: 'BioMAC-Sim-Toolbox: A MATLAB toolbox for biomechanical motion analysis and creation through simulation'
33
tags:
44
- MATLAB
55
- Biomechanics
@@ -54,14 +54,14 @@ forward shooting can be used to investigate neural control of gait.
5454
Movements of humans and other animals are extremely versatile, while our efficiency is unmatched by human-made
5555
machines without having accurate or efficient controllers. Therefore, a better understanding of human movement can have a large impact for persons with movement disabilities, sports performance optimization, and design of human-made devices. Movement simulations are a key tool for creating this understanding.
5656
On the one hand, we can use so-called predictive simulations [@ackermann:2010; @falisse:2019;@koelewijn:2018] to investigate unseen movements by replicating the optimization in the central nervous system [@zarrugh:1974] in a computer optimization.
57-
On the other hand, we can use so-called reconstructive simulations to estimate variables that cannot or were not measured directly by minimizing a data tracking error [@dorschky:2019a;@nitschke:2023;@nitschke:2024]. Such wide-spread measurements and their biomechanical analysis are vital to be able to
57+
On the other hand, we can use so-called reconstructive simulations to estimate variables that cannot or were not measured directly by minimizing a data tracking error [@dorscky:2019a;@nitschke:2023;@nitschke:2024]. Such wide-spread measurements and their biomechanical analysis are vital to be able to
5858
reach this understanding of human movement.
5959

6060
Here, we present `BioMAC-Sim-Toolbox`, a MATLAB toolbox that can be used to create simulations of human movement
6161
and analyse human movements. The main functionality of the toolbox is that it solves trajectory optimization problems, or optimal control problems, for human musculoskeletal dynamics models. These dynamics models combine multibody
6262
dynamics to model the movements of the skeleton with muscle dynamics models to model the dynamics of muscular
6363
contraction and activation. In the trajectory optimization problem, the muscle stimulations are found that minimize an objective. This objective generally includes terms to minimize muscular effort and to minimize a tracking error
64-
with respect to measured movement data [@koelewijn:2016;@dorschky:2019a;@dorschky:2019b;@koelewijn:2022;@nitschke:2023;@nitschke:2024], but different other objectives have been implemented as well, such as
64+
with respect to measured movement data [@koelewijn:2016;@dorscky:2019a;@dorschky:2019b;@koelewijn:2022;@nitschke:2023;@nitschke:2024], but different other objectives have been implemented as well, such as
6565
minimization of metabolic energy expenditure [@koelewijn:2018]. The optimization problem can be described mathematically as follows:
6666

6767
$$ \underset{\mathbf{x}(0),\mathbf{u}(t), v, T} {\text{minimize}} \quad J(\mathbf{x}, \mathbf{u}) = \sum_{j=1}^{N_W} W_{j} \int_{t=0}^T c_{j}(x(t),u(t)) \mathrm{d} t + c_f(x(T),u(T)) $$
@@ -80,9 +80,9 @@ For walking and running, we include a periodicity constraint to the full gait cy
8080

8181
$$ \mathbf{x}(T) = \mathbf{x}(0) + v T \mathbf{x}_{hor} \quad \text{(periodicity)} $$
8282

83-
So far, we have created the problem class "Collocation", which creates a trajectory optimization problem using
83+
So far, we have created the problem class 'Collocation', which creates a trajectory optimization problem using
8484
direct collocation [@betts:2010]. In direct collocation, the numerical integration of the differential equations that represent
85-
the dynamics are solved as equality constraints during the optimization. To do so, collocation nodes, or time nodes
85+
the dynamics are solved as equality constraints during the optimization. To do so, collocation nodes, or time nodes,
8686
need to be predefined, and the integration method should be selected. We have currently implemented a backward Euler and
8787
a midpoint Euler integration method. Backward Euler has shown to be most stable and has been used for publications. A
8888
direct collocation approach creates a large-scale nonlinear optimization problem, for which the derivatives of the
@@ -100,48 +100,35 @@ $$ \mathbf{x}(N+1) = \mathbf{x}(0) + v T \mathbf{x}_{hor} \quad \text{(periodici
100100

101101
for $N$ collocation points $i$.
102102

103-
Problems can be solved using the solvers that are implemented in the class "solver". So far, we have implemented IPOPT [@wachter:2006] to solve the resulting optimization problem. This algorithm can solve optimal control problems transcribed with direct collocation in less than 10 minutes for a 2D model [@koelewijn:2016; @koelewijn:2022] and less than one hour for a 3D model [@nitschke:2020]. Different solvers could easily be integrated into this solver class.
103+
Problems can be solved using the solvers that are implemented in the class 'solver'. So far, we have implemented IPOPT [@Wachter:2006] to solve the resulting optimization problem. This algorithm can solve optimal control problems transcribed with direct collocation in less than 10 minutes for a 2D model [@koelewijn:2016; @koelewijn:2022] and less than one hour for a 3D model [@nitschke:2020]. Different solvers could easily be integrated into this solver class.
104104

105-
As most analysis is specific to the problem type, most code for analysis can be found in the respective problem class. For example, metabolic cost requires an integration over time, which is dependent on the problem type that is being used. In addition, general methods, e.g., to calculate a correlation or root mean squared error between two variables, or to write results into an OpenSim file format, can be found in the function "HelperFunctions folder".
105+
As most analysis is specific to the problem type, most code for analysis can be found in the respective problem class. For example, metabolic cost requires an integration over time, which is dependent on the problem type that is being used. In addition, general methods, e.g., to calculate a correlation or root mean squared error between two variables, or to write results into an OpenSim file format, can be found in the function 'HelperFunctions' folder.
106106

107107
We have implemented different human dynamics models. All implemented models are musculoskeletal models, but they can
108108
also be used as skeletal models, such that the input is generated using joint moments instead of muscle stimulations.
109-
We have implemented a 3D model version (gait3d) and two 2D model versions in c, which are compiled as mex functions. The model dynamics can be tested using the test cases coded in the "tests" folder. The 3D model and one 2D model (gait2d_osim) are loaded from OpenSim, but use our own muscle dynamics model, which is described in [@nitschke:2020],
110-
while the other (gait2dc) is used in our own previous work [@koelewijn:2016; @koelewijn:2022; @dorschky:2019a; @dorschky:2019b].
111-
The model parameters are defined in the .osim file for the OpenSim models, and defined in an Excel file for model gait2dc (gait2dc_par.xlsx). The models can be personalized by directly adjusting the parameters in the .osim model or Excel file, such that, for example, OpenSim scaling can be used [@seth:2011]. They can also still be adjusted in MATLAB, for example to investigate virtual participants [@dorschky:2019a][@koelewijn:2022]. The model dynamics are explained further for gait2dc [@koelewijn:2022; @dorschky:2019a; @dorschky:2019b], for gait3d [@nitschke:2020]. The gait2d_osim model has not yet been used in publications. It is based on the gait10dof18musc.osim model, and can be loaded in two ways: the original version, called gait10dof18musc, and a version with the lumbar joint locked, called gait2d_osim.
109+
We have implemented a 3D model version (gait3d) and two 2D model versions in c, which are compiled as mex functions. The model dynamics can be tested using the test cases coded in the 'tests' folder. The 3D model and one 2D model (gait2d_osim) are loaded from OpenSim, but use our own muscle dynamics model, which is described in [@nitschke:2020],
110+
while the other (gait2dc) is used in our own previous work [@koelewijn:2016; @koelewijn:2022; @dorscky:2019a; @dorschky:2019b].
111+
The model parameters are defined in the .osim file for the OpenSim models, and defined in an Excel file for model gait2dc (gait2dc_par.xlsx). The models can be personalized by directly adjusting the parameters in the .osim model or Excel file, such that, for example, OpenSim scaling can be used [@seth:2011]. They can also still be adjusted in MATLAB, for example to investigate virtual participants [@dorscky:2019a; @koelewijn:2022]. The model dynamics are explained further for gait2dc [@koelewijn:2022; @dorscky:2019a; @dorschky:2019b], for gait3d [@nitschke:2020]. The gait2d_osim model has not yet been used in publications. It is based on the gait10dof18musc.osim model, and can be loaded in two ways: the original version, called gait10dof18musc, and a version with the lumbar joint locked, called gait2d_osim.
112112

113113
We have included several examples in the folder 'ExampleScripts' to highlight the applications of the model and help
114114
future users get started with the code. We have added two introduction examples, one for 2D simulations (script2D.m) and one for
115-
3D simulations (script3D), which is based on [@nitschke:2020]. The goal of these introductory examples is to show how the toolbox works, and
115+
3D simulations (script3D), which is based on @nitschke:2020. The goal of these introductory examples is to show how the toolbox works, and
116116
highlight different options in the implementation. We have added an application in the folder 'Treadmill' to show an example use
117117
of the 'gait2d_osim' model, combined with an implementation of a treadmill. Based on previous
118118
publications, we have added three additional applications. The code in the folder 'IMU2D' shows how simulations can be
119119
created that reconstruct inertial sensor movement, and is based on the publications by @dorscky:2019a and @dorschkynitschke:2024.
120120
The code in the folder 'ExoPaper' shows how simulations can be used to make predictions, in this
121-
case of walking with an exoskeleton, based on the paper by @koelewijn:2022. The code in MarkerTracking3D is an
121+
case of walking with an exoskeleton, based on the paper by @koelewijn:2022. The code in 'MarkerTracking3D' is an
122122
example of how simulations can be created by tracking marker and ground reaction force data, based on the publication by
123123
@nitschke:2024.
124124

125125
Currently, the toolbox can be used to solve trajectory optimization problems to solve predictive and reconstructive simulations. We have implemented code to track marker positions, joint angles, translations, ground reaction forces, accelerations, angular velocities, movement duration, and movement speed. We have further implemented objectives to minimize muscular effort, metabolic cost, squared torque, joint accelerations, passive joint moments, ground reaction force impact, and head stability. By combining these different objectives, many different types of simulations can be generated and the movement kinematics and kinetics investigated.
126126

127127
In future, the toolbox can be expanded. New problem classes can be defined, for example for inverse
128-
kinematics and inverse dynamics, or to solve muscle activations and stimulations statically or dynamically. Furthermore, a single shooting approach can be implemented, which would allow for models with discontinuous dynamics or control to be investigated, such as a reflex model [@geyer:2010].
129-
130-
# Figures
131-
132-
Figures can be included like this:
133-
![Caption for example figure.\label{fig:example}](figure.png)
134-
and referenced from text using \autoref{fig:example}.
135-
136-
Figure sizes can be customized by adding an optional second parameter:
137-
![Caption for example figure.](figure.png){ width=20% }
128+
kinematics and inverse dynamics, or to solve muscle activations and stimulations statically or dynamically. Furthermore, a single shooting approach can be implemented, which would allow for models with discontinuous dynamics or control to be investigated, such as a reflex model [@Geyer:2010].
138129

139130
# Acknowledgements
140131

141-
We acknowledge contributions from Marko Ackermann, Dieter Heinrich, Maria Eleni Athanasiadou, Chuyi Wang, Christopher Löffelmann, Linus Hötzel, Utkarsha Shukla, Tobias Luckfiel, Heiko Schlarb. The development of the BioMAC-Sim-Toolbox was supported by adidas AG and by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) through Project-ID442419336, SFB 1483 - EmpkinS and through Project-ID520189992
142-
143-
# TODOS
144-
- Check mu in 2D normal and 3D contact model
145-
- Ask Markus to add about the _osim model
132+
We acknowledge contributions from Marko Ackermann, Dieter Heinrich, Maria Eleni Athanasiadou, Chuyi Wang, Christopher Löffelmann, Linus Hötzel, Utkarsha Shukla, Arne Kuederle, Tobias Luckfiel, Heiko Schlarb. The development of the BioMAC-Sim-Toolbox was supported by adidas AG and by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) through Project-ID442419336, SFB 1483 - EmpkinS and through Project-ID520189992
146133

147134
# References

0 commit comments

Comments
 (0)