Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The topics covered in this section include:

Table of Contents
You can also find more information in the /wiki/spaces/OpenSim/pages/53084243.

Overview

An OpenSim model represents the neuromuscular and musculoskeletal dynamics of a human or animal that is of interest to study within a computer simulation. The OpenSim model is made up of components corresponding to parts of the physical system that combine to generate or describe movement. These parts are: reference frames, bodies, joints, constraints, forces, contact geometry, markers and controllers

In OpenSim, a model's skeletal system is represented by rigid bodies interconnected by joints. Joints define how a body two bodies (e.g., bone segment), termed parent and child bodies, can move with respect to its parent body. In OpenSim, each body has a parent and is connected to its parent via a joint. one another. Constraints can also be applied to limit the motion of bodies. 

...

An OpenSim Model File (arm26.osim).  The file below was opened in the XML editor Notepad++, which provides the color syntax highlighting.  The sections have been collapsed to highlight the model components.  Clicking on the + icon to the left of a section would expand it, displaying the relevant tags for that section.

 


Info

Use the OpenSim GUI's XML Browser, under Help to find the XML mark-up for any OpenSim model component described below.

...

Code Block
languagexml
titleExample XML Code from Model Arm26 to Represent a Body
<Body name="r_humerus">
	<attached_geometry>...</attached_geometry>
	<WrapObjectSet>...</WrapObjectSet>
	<mass>1.8645719999999999</mass>
	<mass_center>0 -0.18049599999999999 0</mass_center>
	<inertia>0.01481 0.0045510000000000004 0.013193 0 0 0</inertia>
</Body>

Every model comes with a Ground body, which exists as a property of a Model, not in the BodySet.

Geometry

In version 4.0, OpenSim supports more types/shapes than in previous versions. You don't have to specify a mesh file to use most analytical shapes (Brick, Sphere, Cylinder, Cone, Ellipsoid). In addition you can specify Mesh to indicate geometry read from a mesh file. You can use .vtp, .stl, or .obj files to visualize geometry. All these types are kinds of Geometry. Check the units of your model and the units of the exported geometry (e.g., from Solidworks) if you are experiencing size/display issues. 

...

A body is a moving reference frame (Bo) in which its center-of-mass and inertia are defined, and the location of a joint frame (B) fixed to the body can be specified. Similarly, the joint frame (P) in the parent body frame (Po) can also be specified. Flexibility in specifying the joint is achieved by permitting joint frames that are not coincident with the body frame. In 4.0, this flexibility was enhanced via the introduction of the Frame class hierarchy. There are three main types of Frames: Ground (each model starts with a ground frame), Body, and PhysicalOffsetFrame. All three of these frames are called PhysicalFrames because they either are a rigid body or are fixed to a rigid body. In OpenSim 4.0, a joint connects two PhysicalFrames (parent and child). One can use PhysicalOffsetFrames to specify a constant transform between a joint frame and the body frame.

As an example, the body r_humerus contains the joint r_shoulder. The figure below shows an example from Arm26 defining the r_shoulder joint. Note the key tags, such as <socket_parent_frame>, <socket_child_frame>, <Coordinate>, <translation>, and <orientation>. Note the use of an intermediate PhysicalOffsetFrame for the joint's parent frame.

...

OpenSim currently supports three types of built-in constraints: PointConstraint, WeldConstraint, and CoordinateCouplerConstraint. A point constraint fixes a point defined with respect to two bodies (i.e., no relative translations). A weld constraint fixes the relative location and orientation of two bodies (i.e., no translations or rotations). A coordinate coupler relates the generalized coordinate of a given joint (the dependent coordinate) to any other coordinates in the model (independent coordinates). The user must supply a function that returns a dependent value based on independent values. The following example implements coordinate coupler constraint for the motion of the patella as a function of the knee ankle angle and also welds the foot to ground.

...

Code Block
languagexml
titleSample of linear and torque actuators in a model’s ForceSet
<!--Apply a force at a point in the direction specified in the body frame -->
<PointActuator name="FY_residual">
 <!--Name of Body to which this actuator is applied.-->
 <body> pelvis </body>
 <!--Location of application point; in body frame unless point_is_global=true-->
 <point> 0 0 0</point>
 <!--Interpret point in Ground frame if true; otherwise, body frame.-->
 <point_is_global> false </point_is_global>
 <!--Force application direction; in body frame unless force_is_global=true.-->
 <direction> 1 0 0</direction>
 <!--Interpret direction in Ground frame if true; otherwise, body frame.-->
 <force_is_global> true </force_is_global>
 <!--The maximum force produced by this actuator when fully activated.-->
 <optimal_force> 8.0 </optimal_force>
</PointActuator>
  
 <!--Apply an equal and opposite torque on two bodies about the axis defined in the the first body -->
<TorqueActuator name="MZ_residual">
 <optimal_force> 1000.0 </optimal_force>
 <bodyA> ground </bodyA>
 <axis> 0.000 0.000 -1.000 </axis>
 <bodyB> pelvis </bodyB>
</TorqueActuator >
 
<!--Apply a generalized force along (force) or about (torque) the axis of a generalized coordinate. Positive force increases the coordinate -->
<CoordinateActuator name="knee_reserve">
 <optimal_force> 300.0 </optimal_force>
 <coordinate> knee_angle_r </coordinate>
</CoordinateActuator>

...


The Muscle Actuator

There are several muscle models in OpenSim. All muscles include a set of muscle points where the muscle is connected to bones (bodies) and provide utilities for calculating muscle-actuator lengths and velocities. Internally muscle models may differ in the number and types of parameters. Muscles typically include muscle activation and contraction dynamics and their own states (for example activation and muscle fiber length). The control values are typically bounded excitations (ranging from 0 to 1) which lead to a change in activation and then force. Below is an example of a muscle model, as described by Thelen (2003), from an OpenSim model. 

...