iandanforth / pymuscle

A motor unit based model of skeletal muscle and fatigue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Benchmarking

iandanforth opened this issue · comments

  • Other muscle sim libraries?

None that do exactly what we need. The fatigable muscle model by Yong and the Motor Unit Stack by Lin come close. Thelen 2003 and Millard 2012 also provide useful reference models. Most recently Kim 2015, 2018 provide very detailed models of everything from motorneuron to muscle fiber force output.

  • What methods do they have?

No great insights here.

  • How do they break down subtasks?

Both Motor Unit Stack and PyMus break down the chain of events as you would expect. First the motor neuron train is calculated, then the fiber trains.

Summary Notes

Spike Trains

Both the Motor Unit Stack and PyMUS simulate all the way down to the electrical properties of motorneurons and generation of spike trains. PyMUS is extremely detailed and comes with a visualization gui / toolkit.

Types of muscle simulations

Constant torque, damped springs, hill-type

Hill Type Muscles

Other libraries (OpenSim for example) use Hill type muscle models. This model has a muscle-tendon complex with three components: a contractile element, a parallel element, and a series element.

To calculate forces in a realistic manner this is paired with functions which map the current length of these elements to the force that could be produced. Functions describing the force generated by a muscle as its length varies are called the active length curve (AL) for the contractile element and the passive length curve (PL) for the parallel element.

"The bell-shaped F-L relationship represents the optimal length at which the peak force is produced as the muscle length increases under isometric (constant-length) conditions." (Kim, 2018)

"The F-V relationship represents the velocity dependency of force degradation during the shortening of muscle length and force potentiation during the lengthening of muscle length under isokinetic (constant-velocity) conditions." (Kim, 2018)

The parameters used to characterize each muscle are

  • maximum isometric force
  • optimal muscle fiber length
  • tendon slack length
  • maximum contraction velocity
  • pennation angle.

During a forward dynamic simulation, the muscle force is calculated using two states:

  • the activation value
  • the muscle fiber length

OpenSim Provides (two muscle force models)

There is also a plugin for a muscle model that includes fatigue

Searches

Google

muscle simulation library
muscle modeling software

Github

'motor unit'
'muscle'

Tools

3d4 Complete Anatomy

URLs

https://ca-application.3d4medical.com/store

Notes

Cool 3D anatomy atlas with animations.

Ziva Dynamics

URLs

https://zivadynamics.com/

Notes

Animation software for muscles

Libraries

Motor Unit Stack (Randall Lin)

See comment below

PyMUS

See comment below

OpenSim

See comment below

OpenCMISS

See comment below

LifeMod

URLs

http://www.lifemodeler.com/products/lifemod/

Notes

Looks like an older commercial product that hasn't been updated since 2010

OpenWorm muscle

URLs

https://github.com/openworm/muscle_model

Notes

Seems to be an electrical model primarily.

Other Fuglevand derivatives

https://github.com/anagamori/Motor-Unit-Model-Fuglevand

Library - Motor Unit Stack (Randall Lin)

URLs

https://github.com/rllin/motor_unit_stack

Notes

Last Updated: 2016-05-19
Stars: 0

Summary

This library is composed of three separate models. One for input neurons, another for motor neurons and a third for muscle fibers. It is grounded in both Morris Lecar and Hodgkin Huxley models of spiking neurons. The muscle fibers also have spike like properties where they approach their peak twitch force exponentially and then decay.

To calculate the output of the whole model over a given period of time several spike trains are calculated in series. First the input neuron spike trains are calculated for the entire duration of the run, then this is fed into the motor neurons which calculate their entire spike train. This train is then passed to the set of muscle fibers which create their own spike/force trains. Forces are ultimately calculated as the sum of forces generated by all of the muscle fibers.

Model Composition

One motor unit with one entity per layer. The layers include:
1) a Morris Lecar 2 compartmental cortical neuron that
can be influenced by an external electric field
2) a passive Hodgkin Huxley single compartmental neuron representing an alpha motor neuron that can receive synaptic current input
3) a muscle unit that twitches for every spike event of the alpha motor neuron and can perform twitch summation

  • He has a MuscleFiber class
    • MuscleFiber takes a neuron instance in the constructor
    • It defines some intrinsics about the fiber
      • peak_twitch_force
      • tau_rise
      • tau_decay
  • He has a MotorUnit class (but uses this interchangeably with 'muscle')
    • Takes number of fibers and creates a fiber for each
    • He uses a clipped normal distribution for peak twitch forces, tau rises and tau decays

Everything seems to rely on EventTrace

"generates a trace composed of differences of two exponentials per spike event from the input trace. Can be used for both synapses and twitch summations"

peak: max value reached per isolated event
tau_rise: time to peak
tau_decay: time to decay
trace: time series
dt: delta t

NOTE: Interesting numpy method zeros_like

EventTrace.event() seems have have the most dense math. (no comments)

It looks like it returns an array for a single event that is appended to the full event trace.

Stack.py has a method generate_linear_spectrum_motor_units which would be interesting to compare with the distribution from Potvin.

Other

OpenSim

URLs

https://simtk-confluence.stanford.edu/display/OpenSim/Welcome+to+OpenSim

Notes

Features

  • Create and Edit Models
  • Library of pre-created human models
  • Import and visualize marker data, joint kinematics, external forces
  • Kinematic solvers
  • Handles .stl and .obj files
  • Movie and image capture / export
  • Scripting through Matlab
  • API (python scripting available)
    • python 3 is also now supported (through conda)
  • can import SIMM models

Muscle Model

Thelen 2003 Model

Hill-type muscles
Muscles all have multiple segments and insertions
Muscles are listed under 'forces'

Arm extensors

Tricep

- trilat
- trilong
- trimed

Lower insertion is all at the end of the ulna

opensim-tricep

Arm flexors

Bicep

  • Biclong
  • Bicshort
    Brachialis

Computed Muscle Control

"can generate muscle-driven forward simulations of movement"

Seems to be oriented toward seeing what muscles would do in a given motion. aka It will solve inverse kinematics for you, or follow a 'tracking task'

"At user-specified time intervals during a simulation, the CMC tool computes muscle excitation levels that will drive the generalized coordinates (e.g., joint angles) of a dynamic musculoskeletal model towards a desired kinematic trajectory. CMC does this by using a combination of proportional-derivative (PD) control and static optimization (figure below)."

Visualization

Topology Viewer - See the graph of connected bodies and joints
Multiple 3D Views - You can see the same model from multiple angles

File Structure

Model files are stored separately from animation files (.stl vs .obj)
Muscle activation color is stored in .sto files

"The color data muscle be included in an OpenSim storage (.sto) file. The file should have columns with the muscles names of interest, with values (e.g., activations) ranging from 0 to 1. Muscles with a value of zero will appear blue. Muscles with a value of one or great will appear red"

" you must first load a motion. Then you can right click on the motion, select Color Muscles From File... and choose the storage file with muscle color data."

Pros

  • Complete and validated skeletal models of humans

Cons

  • Restrictive License
  • Slow - 14x slower than real time for arm muscles.
  • Primarily targeted at the biomedical community
  • Only the API is open source
  • Seems to be focused on a single model at a time rather than N agents
  • Rotation in viewer is aweful (processes)

Chemoelectromechanical Model using OpenCMISS

URLs

https://www.hindawi.com/journals/cmmm/2013/517287/
http://opencmiss.org/

Notes

OpenCMISS is a very general computational library and visualization library packaged into an SDK. The above article doesn't actually point to implementing code and the OpenCMISS sdk doesn't have any native library implementation of a muscle.

Composed of two libraries:

Iron

Finite Element Analysis
HPC and Distributed Architectures
Has Python APIs
Mozilla Public License v2

Zinc

Visualization of Mathematical Models

Library - PyMUS

URLs

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5904262/
https://github.com/NMSL-DGIST/PyMUS/

Notes

Intended Audience

"Our model motor unit and simulation software may represent efficient tools not only for researchers studying the neural control of force production from a cellular perspective but also for instructors and students in motor physiology classroom settings."

Motivation

"To accurately understand the neural mechanisms controlling muscle contraction and force production, a systematic investigation of the input-output properties of motor units at the system level, including both motoneurons and muscle subunits, is crucial due to the non-linearities inherent in motoneuron and muscle behavior."

Motor Unit Model is composed of three parts

  • motoneuron model

"two-compartment modeling approach that accurately captures the key cell-type-related electrical properties under both passive conditions (somatic input resistance, membrane time constant, and signal attenuation properties between the soma and the dendrites) and active conditions (rheobase current and afterhyperpolarization duration at the soma and plateau behavior at the dendrites)"

two compartments are

  • soma, axonal hillock and initial segment
  • dendrites

this get's very specific into the electrical properties of the motoneuron and its input-output relationship

"In the presence of monoamines, during normal behaviors, motoneurons display bistable behavior in which the firing state transitions from quiescence to regular firing or from low-frequency to high-frequency stable firing following the activation of PICs by a brief excitatory pulse input. This bistability has also been shown to lead to the production of counterclockwise hysteresis in the motoneuron input-output relationship during the slowly ascending and descending current stimulation at the soma"

  • muscle unit model

"reflects the experimentally identified dependencies of muscle activation dynamics on isometric, isokinetic and dynamic variation in muscle length over a full range of stimulation frequencies"

"composed of a contractile element representing the muscle fibers and a serial elastic element representing the tendon"

kim-muscle-unit-model

  • simplified axon model

perfect conduction but introduces delay time.

Pros

  • More complete / detailed model

Cons

  • Designed on/for windows
  • GNU licensed!!
  • Slower than real time
  • not designed as a library (more of an experimental simulation toolbox for detailed responses of motor units)

Models

Potvin 2017

Rajagopal and Yong 2013

Description

Muscle Model
This muscle model differs from the currently available muscles in OpenSim by altering its force generation equation. This model uses the following equation:

yong equation

where

equation key

The new additions to previous models include making the maximum isometric force dependent on fiber composition and adding activation and fatigue factors.

Code

def forceVelocity(velocity):
    """Given velocity return a weight to apply to force"""
    return weight

def muscleForce():

Thelen 2003

Millard 2012