Skip to content

Commit 25e00ce

Browse files
JacobAdamsenJacob Hilmar Adamsenmelund
authored
Tutorial updates for Finite Element interfacing and other small tutorial updates (#26)
* Tutorial snippet updates * Tutorial images and text changes * Tutorial snippets in Getting started * Tutorial snippets in Modeling the human body * Created whole folders for snippet files * Update tests * Used cmd.exe to create lib in ci test * Merge commit '118df158da292f4b7f185ff8d0172692779da1e9' * Updates to tutorial Modeling the Human Body. New folder structure * Final updates to the first 4 tutorials. * Update file paths in lesson1.md * rename1 * rename2 * Tutorial updates - file structure, images and more * Update file path in lesson2.md * Different updates to the first few tutorials * Text and general structure updates to the first few tutorials * Updates of code snippets, images and other stuff in A Study of Studies * Mainly changes to Parameter Studies and Optimization Tutorial. Many files created due to Code Snippets. * Setup of making Python optimization tutorial in Jupyter notebook and changes to the tutorial * Small extra update to Python Optimization Tutorial * Final changes in Python optimization tutorial - made download files an more * One small extra update to Python optimization Study * Update instructions for installing python * Fixed download link * Fix download link * Add exclusion pattern for Jupyter Notebook execution in conf.py * Updates to Finite element analysis interfacing tutorials (Not finished work yet) * Minor changes to other tutorials and all changes to FEM interfacing lesson 1 tutorial (which is not finished yet) * Updates for FE interfacing tutorial to use FEBio * Small grammar changes to Getting Started and A Study of Studies tutorials * Fixed mistakes with insertion of notes in tutorials * Update build workflow to checkout ammr4-beta branch instead of master --------- Signed-off-by: Morten Enemark Lund <melund@gmail.com> Co-authored-by: Jacob Hilmar Adamsen <jha@anybodytech.com> Co-authored-by: Morten Enemark Lund <mel@anybodytech.com> Co-authored-by: Morten Enemark Lund <melund@gmail.com>
1 parent a59f1eb commit 25e00ce

50 files changed

Lines changed: 82110 additions & 729 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,20 @@ jobs:
7373
repository: anybody/ammr
7474
ref: master
7575
path: ammr
76-
76+
- uses: actions/checkout@v4
77+
name: Checkout AMMR4
78+
with:
79+
repository: anybody/ammr4-beta
80+
ref: ammr4-beta
81+
path: ammr4
82+
83+
84+
7785
- name: Link AMMR
7886
shell: cmd
7987
run: |
8088
echo #include "%GITHUB_WORKSPACE%/ammr/libdef.any" > libdef.any
81-
89+
echo #include "%GITHUB_WORKSPACE%/ammr4/libdef.any" > libdef-ammr4.any
8290
8391
- uses: prefix-dev/setup-pixi@v0.8.1
8492
with:

A_Getting_started/intro.md

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,61 +3,64 @@
33

44
# Getting Started Tutorial
55

6-
:::{note}
7-
The AnyBody software comes with an inbuilt model repository - The AnyBody Managed Model Repository (AMMR). This tutorial starts with unpacking a local version of the AMMR. You can skip to {doc}`lesson 1 <lesson1>` if you have already done this.
6+
:::{note} The AnyBody software comes with an inbuilt model repository - The
7+
AnyBody Managed Model Repository (AMMR). This tutorial starts with unpacking a
8+
local version of the AMMR. You can skip to {doc}`lesson 1 <lesson1>` if you have
9+
already done this.
810
:::
911

10-
1112
## Goals for this tutorial
1213

13-
This tutorial takes the top-down approach and aims to accomplish the following:
14+
This tutorial takes a top-down approach and aims to accomplish the following:
1415

1516
1. Create a new standing model using the Human Standing template model
16-
2. Learn how to load & change the posture of the human model, and use the model view window
17-
3. Run an inverse dynamics analysis and review the results.
17+
2. Learn how to load & change the posture of the human model, and use
18+
the model view window
19+
3. Run an inverse dynamics analysis and review the results
1820

19-
This entire tutorial relies heavily on using the AnyBody Managed Model Respository (AMMR).
21+
This tutorial relies heavily on using the AnyBody Managed Model Repository (AMMR).
2022
Follow the steps below to unpack a local version of the AMMR.
2123

2224
# Setup the AMMR
2325

24-
25-
Before you continue you must unpack the entire repository and save it on
26-
your hard disk. To get a copy of the AMMR press the Demo tab in the
27-
AnyBody assistant dialog box.
26+
Before you continue, you must unpack the entire repository and save it on your
27+
hard disk. To get a copy of the AMMR, press the Demo tab in the AnyBody
28+
assistant dialog box.
2829

2930
![...](_static/intro/image1.png)
3031

31-
Following the instructions in the Demo tab will install a copy of the AMMR in your documents folder by
32-
default. It is good practice to create a second local copy of the AMMR
33-
so that you do not overwrite the original AMMR folder by accident.
32+
Following the instructions in the Demo tab will install a copy of the AMMR in
33+
your documents folder by default. It is good practice to create a second local
34+
copy of the AMMR so that you do not overwrite the original AMMR folder by
35+
accident.
3436

3537
# AMMR structure
3638

3739
Open a file manager and navigate to the directory where you unpacked the
38-
repository. You should see a folder structure that includes the
39-
following subfolders:
40+
repository. You should see a folder structure that includes the following
41+
subfolders:
4042

41-
- **Application** includes demo simulations of activities such as cycling, lifting
42-
a box or propelling a wheelchair.
43-
- **Body** contains models of body parts and collections of body parts such as the lumbar spine model, leg models etc.
44-
which are used by the applications.
43+
- **Application**: Includes demo simulations of activities such as cycling,
44+
lifting a box, or propelling a wheelchair.
45+
- **Body**: Contains models of body parts and collections of body parts such as
46+
the lumbar spine model, leg models, etc., which are used by the applications.
4547

4648
A closer inspection of the Application branch reveals that it has four subfolders:
4749

48-
- The **Beta** folder contains models that are unfinished, but may still be useful.
49-
- The **Examples** folder contains many models of various activities of daily living, and it is likely that you
50-
will find a model that is similar to your own end goal.
51-
- The **MocapExamples** folder contains models utilizing the AnyMoCap framework. If you have your own motion capture data this is a good place to start,
52-
whether you want to analyze multi trial/subject MoCap data or a single subject wearing an inertial MoCap suit.
53-
- The **Validation** folder contains models that have been used for validation purposes, typically by comparison of the model predictions
54-
with experimental measurements.
55-
50+
- The **Beta** folder contains models that are unfinished but may still be useful.
51+
- The **Examples** folder contains many models of various activities of daily
52+
living, and it is likely that you will find a model that is similar to your
53+
own end goal.
54+
- The **MocapExamples** folder contains models utilizing the AnyMoCap framework.
55+
If you have your own motion capture data, this is a good place to start,
56+
whether you want to analyze multi-trial/subject MoCap data or a single subject
57+
wearing an inertial MoCap suit.
58+
- The **Validation** folder contains models that have been used for validation
59+
purposes, typically by comparison of the model predictions with experimental
60+
measurements.
5661

5762
:::{admonition} **Continue**
5863
:class: seealso
5964

6065
With that knowledge, you are all set to go, and you can proceed with
61-
{doc}`Lesson 1: Creating the standing model <lesson1>` using
62-
template.
63-
:::
66+
{doc}`Lesson 1: Creating the standing model <lesson1>` using the template. :::

A_Getting_started/lesson1.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,30 @@
33

44
# Lesson 1: Creating a Standing Model
55

6-
The standing model can be found in the AMMR folder under
7-
Applications/Examples. The main file is called StandingModel.Main.any.
6+
The standing model can be found in the AMMR folder under Applications/Examples.
7+
The main file is called StandingModel.Main.any.
88

9-
**While this file can be opened with the "File->Open" menu in AnyBody, do not do this! This tutorial will teach you an easier way
10-
to use the Standing Model as a starting template.**
9+
**While this file can be opened with the "File->Open" menu in AnyBody, do not do
10+
this! This tutorial will teach you an easier way to use the Standing Model as a
11+
starting template.**
1112

1213
Key (modifiable) features of the standing model are:
1314

1415
- Both feet are always connected to the ground.
1516
- The posture is defined by the joint angles for all major joints except the ankles.
16-
- The model automatically balances itself by maintaining its center of mass vertically above the ankle joints.
17-
E.g., if the arms move forward, the entire body moves backwards to maintain the balance.
18-
- External forces can be applied to predefined nodes on the model. Muscle forces may change, to resist these forces and maintain balance.
17+
- The model automatically balances itself by maintaining its center of mass
18+
vertically above the ankle joints. For example, if the arms move forward, the
19+
entire body moves backward to maintain balance.
20+
- External forces can be applied to predefined nodes on the model. Muscle forces
21+
may change to resist these forces and maintain balance.
1922

2023
(model-templates)=
2124

2225
## Model templates
2326

24-
To create a new standing model using the template model in the AMMR, click the "Create New from template" button ![Model_button](_static/lesson1/image_1.png) in the toolbar:
27+
To create a new standing model using the template model in the AMMR, click the
28+
"Create New from template" button ![Model_button](_static/lesson1/image_1.png)
29+
in the toolbar:
2530

2631
```{image} _static/lesson1/image_2.png
2732
:alt: Toolbar
@@ -66,11 +71,13 @@ to AMMR repository you want to use.
6671

6772
To see the 3D graphical representation of the model you need to load.
6873

69-
**Load/reload is a frequent operation and has been assigned to function
70-
key F7. You may also load your model by clicking** ![Load](_static/lesson1/image_6.png) **in the toolbar.**
74+
**Load/reload is a frequent operation and has been assigned to function key F7.
75+
You may also load your model by clicking** ![Load](_static/lesson1/image_6.png)
76+
**in the toolbar.**
7177

72-
This action will load whatever file is chosen in the text editor. If a file is already loaded, the
73-
above action will simply reload the file until you give another file loading priority by right-clicking its tab and select “Load Model”.
78+
This action will load whatever file is chosen in the text editor. If a file is
79+
already loaded, the above action will simply reload the file until you give
80+
another file loading priority by right-clicking its tab and select “Load Model”.
7481

7582
```{image} _static/lesson1/image_7.png
7683
:alt: Load Model
@@ -80,19 +87,19 @@ above action will simply reload the file until you give another file loading pri
8087

8188
## The model view
8289

83-
When loading is completed, the Model View window opens and shows the
84-
standing model: (You can open it manually from View -> Model Views).
90+
When loading is completed, the Model View window opens and shows the standing
91+
model: (You can open it manually from View -> Model Views).
8592

8693
```{image} _static/lesson1/image_5.png
8794
:alt: Model view
8895
:class: bg-primary
8996
:align: center
9097
```
9198

92-
The icons in the toolbar at the top of the Model View window allow you
93-
to modify the image: zoom, pan, rotate, etc. They should be mostly
94-
self-explanatory. Now is a good time to play a bit around with them and
95-
to familiarize yourself with the options.
99+
The icons in the toolbar at the top of the Model View window allow you to modify
100+
the image: zoom, pan, rotate, etc. They should be mostly self-explanatory. Now
101+
is a good time to play a bit around with them and to familiarize yourself with
102+
the options.
96103

97104
In practical use it is often necessary to change quickly between these
98105
functions, so keyboard shortcuts have been provided:

A_Getting_started/lesson2.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Scroll down to the line that says `#include "Model\Mannequin.any"`.
2020
:end-before: //# END SNIPPET 1
2121
```
2222

23-
**This line means that your model will include the content of the "Mannequin.any" file located in the Model folder,
24-
within the main file.**
23+
**This line means that your model will include the content of the
24+
"Mannequin.any" file located in the Model folder, within the main file.**
2525

2626
Double-clicking the file name in the editor window after loading
2727
your model opens the mannequin file in a new tab. Then you see the
@@ -34,9 +34,11 @@ of the lines):
3434
:end-before: //# END SNIPPET 1
3535
```
3636

37-
**The section between each pair of braces creates a Folder, with all variables defined within forming the folder contents.**
37+
**The section between each pair of braces creates a Folder, with all variables
38+
defined within forming the folder contents.**
3839

39-
Once the loading process is complete, you can see this folder structure being replicated in "Model tree" on the left of your screen. All contents of this file
40+
Once the loading process is complete, you can see this folder structure being
41+
replicated in "Model tree" on the left of your screen. All contents of this file
4042
can be seen by expanding the "Mannequin" folder icon in the tree.
4143

4244
```{image} _static/lesson2/image1.png
@@ -45,38 +47,44 @@ can be seen by expanding the "Mannequin" folder icon in the tree.
4547
:align: center
4648
```
4749

48-
There are sub-folders for postural joint angles (in degrees) and angular velocities (in degrees/second),
49-
for the right and left halves of the body.
50+
There are sub-folders for postural joint angles (in degrees) and angular
51+
velocities (in degrees/second), for the right and left halves of the body.
5052

51-
Changing any of the joint angles and reloading the model, will change the model's posture at load time. To start with, ensure that the contents of the `Right`
52-
and `Left` sub-folders are as follows.
53+
Changing any of the joint angles and reloading the model, will change the
54+
model's posture at load time. To start with, ensure that the contents of the
55+
`Right` and `Left` sub-folders are as follows.
5356

5457
```{literalinclude} Snippets/lesson2/MyStandingHuman-3/Model/Mannequin.any
5558
:language: AnyScriptDoc
5659
:start-after: //# BEGIN SNIPPET 1
5760
:end-before: //# END SNIPPET 1
5861
```
5962

60-
If you scroll down, you'll see that the contents of `Left` folder are set to be equal
61-
to those from the `Right` folder, in order to create a symmetric posture.
63+
If you scroll down, you'll see that the contents of `Left` folder are set to be
64+
equal to those from the `Right` folder, in order to create a symmetric posture.
6265

63-
**This is an important feature of the AnyScript language. Instead of numbers, you can create references to other variables or write
64-
mathematical expressions wherever necessary.**
66+
**This is an important feature of the AnyScript language. Instead of numbers,
67+
you can create references to other variables or write mathematical expressions
68+
wherever necessary.**
6569

66-
To create a non-symmetric posture, you would have to replace some of the expressions in the `Left` folder with numbers of your choice.
70+
To create a non-symmetric posture, you would have to replace some of the
71+
expressions in the `Left` folder with numbers of your choice.
6772

68-
Scrolling further below, you will find the `PosturVel folder`. This is organized exactly like Posture, but the numbers here specify
69-
joint angular velocities in degrees per second. For now, please leave all the values in this folder as zero.
73+
Scrolling further below, you will find the `PosturVel folder`. This is organized
74+
exactly like Posture, but the numbers here specify joint angular velocities in
75+
degrees per second. For now, please leave all the values in this folder as zero.
7076

7177
(running-analysis)=
7278

7379
## Running a simulation analysis
7480

7581
Simulation based analyses in AnyBody are termed "Studies".
7682

77-
**Step 1**: Click on the operations drop-down menu at the top (see figure). Select “Main.RunApplication”
83+
**Step 1**: Click on the operations drop-down menu at the top (see figure).
84+
Select “Main.RunApplication”
7885

79-
"RunApplication" is a readymade package of some pre-processing steps and the "InverseDynamics" analysis. Other drop-down operations include:
86+
"RunApplication" is a readymade package of some pre-processing steps and the
87+
"InverseDynamics" analysis. Other drop-down operations include:
8088

8189
- **Kinematics**: Runs Kinematic analysis
8290
- **InverseDynamics**: Runs Inverse dynamic analysis
@@ -92,7 +100,8 @@ useful for testing and debugging.
92100
:align: center
93101
```
94102

95-
**Step 2**: Click the "Execute" button on the Execute toolbar. This toolbar is next to the drop-down menu, and contains three buttons:
103+
**Step 2**: Click the "Execute" button on the Execute toolbar. This toolbar is
104+
next to the drop-down menu, and contains three buttons:
96105

97106
- **Run operation**: Starts or pauses the chosen operation. Shortcut
98107
F5.

0 commit comments

Comments
 (0)