Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
52c823a
Tutorial snippet updates
Aug 22, 2024
84cb065
Tutorial images and text changes
Aug 27, 2024
df15765
Tutorial snippets in Getting started
Aug 29, 2024
af6da1a
Tutorial snippets in Modeling the human body
Sep 3, 2024
6bc9a6a
Created whole folders for snippet files
melund Sep 6, 2024
8890a32
Update tests
melund Sep 6, 2024
118df15
Used cmd.exe to create lib in ci test
melund Sep 6, 2024
894e204
Merge commit '118df158da292f4b7f185ff8d0172692779da1e9'
Sep 6, 2024
1ffaf07
Merge branch 'TutorialUpdates2' of https://github.com/AnyBody/tutoria…
Sep 6, 2024
2183a40
Updates to tutorial Modeling the Human Body. New folder structure
Sep 11, 2024
bddb3ca
Final updates to the first 4 tutorials.
Sep 13, 2024
951b153
Update file paths in lesson1.md
Sep 13, 2024
d2dcdd0
rename1
Sep 13, 2024
bae2a0a
rename2
Sep 13, 2024
11e4537
Tutorial updates - file structure, images and more
Sep 16, 2024
fa547b9
Update file path in lesson2.md
Sep 16, 2024
d511125
Different updates to the first few tutorials
Sep 20, 2024
b157b32
Text and general structure updates to the first few tutorials
Sep 25, 2024
46c3ef3
Merge remote-tracking branch 'origin/master' into TutorialUpdates2
Sep 25, 2024
a95c9c3
Updates of code snippets, images and other stuff in A Study of Studies
Sep 27, 2024
e3cb1ac
Mainly changes to Parameter Studies and Optimization Tutorial. Many f…
Oct 23, 2024
fb17e77
Setup of making Python optimization tutorial in Jupyter notebook and …
Nov 1, 2024
7e4ad60
Small extra update to Python Optimization Tutorial
Nov 1, 2024
1d0e9c0
Final changes in Python optimization tutorial - made download files a…
Nov 6, 2024
cfdfd9f
One small extra update to Python optimization Study
Nov 8, 2024
d715a7d
Merge commit '8962d385432ecb6718391abfaa5a3dcc36484014' into Tutorial…
Nov 13, 2024
a8acb4e
Update instructions for installing python
melund Nov 18, 2024
8679e31
Fixed download link
melund Nov 18, 2024
086dec1
Fix download link
melund Nov 18, 2024
6dff453
Add exclusion pattern for Jupyter Notebook execution in conf.py
melund Nov 19, 2024
7547300
Updates to Finite element analysis interfacing tutorials (Not finishe…
Dec 6, 2024
d678f70
Minor changes to other tutorials and all changes to FEM interfacing l…
Dec 6, 2024
4ab48f6
Merge branch 'master' into TutorialUpdates2
melund Dec 16, 2024
a9e63cc
Updates for FE interfacing tutorial to use FEBio
Jan 10, 2025
7f1135c
Small grammar changes to Getting Started and A Study of Studies tutor…
Jan 10, 2025
8b7046f
Merge branch 'TutorialUpdates2' of https://github.com/AnyBody/tutoria…
Jan 10, 2025
eeead2f
Fixed mistakes with insertion of notes in tutorials
Jan 17, 2025
c9ad710
Update build workflow to checkout ammr4-beta branch instead of master
Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,20 @@ jobs:
repository: anybody/ammr
ref: master
path: ammr

- uses: actions/checkout@v4
name: Checkout AMMR4
with:
repository: anybody/ammr4-beta
ref: ammr4-beta
path: ammr4



- name: Link AMMR
shell: cmd
run: |
echo #include "%GITHUB_WORKSPACE%/ammr/libdef.any" > libdef.any

echo #include "%GITHUB_WORKSPACE%/ammr4/libdef.any" > libdef-ammr4.any

- uses: prefix-dev/[email protected]
with:
Expand Down
65 changes: 34 additions & 31 deletions A_Getting_started/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,64 @@

# Getting Started Tutorial

:::{note}
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.
:::{note} 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.
:::


## Goals for this tutorial

This tutorial takes the top-down approach and aims to accomplish the following:
This tutorial takes a top-down approach and aims to accomplish the following:

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

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

# Setup the AMMR


Before you continue you must unpack the entire repository and save it on
your hard disk. To get a copy of the AMMR press the Demo tab in the
AnyBody assistant dialog box.
Before you continue, you must unpack the entire repository and save it on your
hard disk. To get a copy of the AMMR, press the Demo tab in the AnyBody
assistant dialog box.

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

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

# AMMR structure

Open a file manager and navigate to the directory where you unpacked the
repository. You should see a folder structure that includes the
following subfolders:
repository. You should see a folder structure that includes the following
subfolders:

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

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

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

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

:::{admonition} **Continue**
:class: seealso

With that knowledge, you are all set to go, and you can proceed with
{doc}`Lesson 1: Creating the standing model <lesson1>` using
template.
:::
{doc}`Lesson 1: Creating the standing model <lesson1>` using the template. :::
43 changes: 25 additions & 18 deletions A_Getting_started/lesson1.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,30 @@

# Lesson 1: Creating a Standing Model

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

**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
to use the Standing Model as a starting template.**
**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 to use the Standing Model as a
starting template.**

Key (modifiable) features of the standing model are:

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

(model-templates)=

## Model templates

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:
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:

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

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

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

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

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

## The model view

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

```{image} _static/lesson1/image_5.png
:alt: Model view
:class: bg-primary
:align: center
```

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

In practical use it is often necessary to change quickly between these
functions, so keyboard shortcuts have been provided:
Expand Down
45 changes: 27 additions & 18 deletions A_Getting_started/lesson2.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Scroll down to the line that says `#include "Model\Mannequin.any"`.
:end-before: //# END SNIPPET 1
```

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

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

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

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
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
can be seen by expanding the "Mannequin" folder icon in the tree.

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

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

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`
and `Left` sub-folders are as follows.
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` and `Left` sub-folders are as follows.

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

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

**This is an important feature of the AnyScript language. Instead of numbers, you can create references to other variables or write
mathematical expressions wherever necessary.**
**This is an important feature of the AnyScript language. Instead of numbers,
you can create references to other variables or write mathematical expressions
wherever necessary.**

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

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

(running-analysis)=

## Running a simulation analysis

Simulation based analyses in AnyBody are termed "Studies".

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

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

- **Kinematics**: Runs Kinematic analysis
- **InverseDynamics**: Runs Inverse dynamic analysis
Expand All @@ -92,7 +100,8 @@ useful for testing and debugging.
:align: center
```

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

- **Run operation**: Starts or pauses the chosen operation. Shortcut
F5.
Expand Down
Loading
Loading