Biomech-Sim-Toolbox 1
Toolbox for movement simulation and analysis
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Model Class Reference

The abstract class describes the basics for a musculoskeletal model. More...

Inheritance diagram for Model:
handle Gait2d_osim Gait2dc Gait3d Gait2dc_Exo

Public Member Functions

function extractControl (in obj, in type, in controlname)
 Function to obtain index of contol with a specific type (and name)
 
function extractState (in obj, in type, in statename)
 Function to obtain index of state with a specific type (and name)
 
function getCoP (in obj, in grf)
 Function to calculate the center of pressure.
 
virtual getDynamics (in obj, in x, in xdot, in u)
 Abstract function to compute implicit differential equation for the model.
 
function getErate_bhargava (in obj, in F_ce, in stim, in act, in l_ce, in v_ce, in t_stim)
 Model function to calculate the energy rate of a single time step using Bhargava et al.
 
function getErate_Houdijk (in obj, in F_ce, in act, in l_ce, in v_ce)
 Model function to calculate the energy rate of a single time.
 
function getErate_Lichtwark (in obj, in F_ce, in act, in l_ce, in v_ce, in t_stim)
 Model function to calculate the energy rate of a single time step using a continuous version of Lichtwark & Wilson's model.
 
function getErate_margaria (in obj, in F_ce, in v_ce)
 Model function to calculate the energy rate of a single time step using Margaria's model.
 
function getErate_Minetti (in obj, in act, in v_ce)
 Model function to calculate the energy rate of a single time.
 
function getErate_uchida (in obj, in F_ce, in stim, in act, in l_ce, in v_ce)
 Model function to calculate the energy rate of a single time.
 
function getErate_Umberger (in obj, in F_ce, in stim, in act, in l_ce, in v_ce)
 Model function to calculate the energy rate of a single time step with Umberger et al.
 
function getEratec_bhargava (in obj, in F_ce, in stim, in act, in l_ce, in v_ce, in dFdx, in dFdxdot, in epsilon)
 Model function to calculate the energy rate of a single time step using a continuous version of Bhargava et al.
 
function getEratec_Houdijk (in obj, in F_ce, in act, in l_ce, in v_ce, in dFdx, in dFdxdot, in epsilon)
 Model function to calculate the energy rate of a single time step using a continuous version of Houdijk et al.
 
function getEratec_Lichtwark (in obj, in F_ce, in act, in l_ce, in v_ce, in dFdx, in dFdxdot, in epsilon)
 Model function to calculate the energy rate of a single time step using a continuous version of Lichtwark & Wilson's model.
 
function getEratec_margaria (in obj, in F_ce, in v_ce, in dFdx, in dFdxdot, in epsilon)
 Model function to calculate the energy rate of a single time step using a continuous version of Margaria's model.
 
function getEratec_Minetti (in obj, in act, in v_ce)
 Model function to calculate the energy rate of a single time step using Minetti's model.
 
function getEratec_umberger (in obj, in F_ce, in stim, in act, in l_ce, in v_ce, in dFdx, in dFdxdot, in epsilon)
 Model function to calculate the energy rate of a single time step with the continuous version of Umberger et al.
 
virtual getGRF (in obj, in x)
 Abstract function returning the ground reaction forces for the system in state x.
 
virtual getJointmoments (in obj, in x, in u)
 Abstract function returns joint moments, for the system in state x.
 
function getMetabolicRate_pernode (in obj, in x, in xdot, in u, in t_stim, in name, in getCont, in epsilon, in exponent)
 Model function to calculate metabolic cost of a movement.
 
virtual getMuscleCEforces (in obj, in x, in xdot)
 Abstract function returning muscle forces of CE for the system in state x.
 
virtual getMuscleCEpower (in obj, in x, in xdot)
 Abstract function returns power generated by muscle contractile elements, for the system in state x.
 
virtual getMuscleforces (in obj, in x)
 Abstract function returning muscle forces for the system in state x.
 
function setbodymass (in obj, in bodymass)
 Function to set body mass, does not influence the.
 
function setMuscles (in obj, in muscles)
 Function to set the muscles table.
 
function setSegmentMass (in obj, in segmentName, in segmentMass)
 Function to set segment mass.
 
function setSegments (in obj, in segmentTable)
 Function to set segment Table.
 
virtual showStick (in obj, in x)
 Abstract function to show model as stick figure.
 
virtual simuAccGyro (in obj, in data, in q, in qd, in qdd)
 Abstract function to simulate acceleration and gyroscope signals.
 

Public Attributes

Property CPs
 Table: Contact points.
 
Property dofs
 Table: Degrees of freedom (Range of Dofs should not be changed here.
 
Property drag_coefficient
 Double: Air drag coefficient in N/(m/s)^2 (default: 0.2128)
 
Property gravity
 Double array: Gravity vector in m/(s^2)
 
Constant Property GRFNAMES = {'rightFx', 'rightFy', 'rightFz', 'rightMx', 'rightMy', 'rightMz', 'leftFx', 'leftFy', 'leftFz', 'leftMx', 'leftMy', 'leftMz' }
 Cell array with string: Gives the names for the GRF vector returned by getGRF()
 
Property joints
 Table: Joints.
 
Property mExtraScaleFactor
 Double: Scale factor for extra torques in Nm (default: 100 since we used this in previous simulations.
 
Property muscles
 Table: Muscles.
 
Property torques
 Table: Torque actuators.
 
Property wind_speed
 Double: Wind speed in direction of +X in m/s (default: 0)
 

Protected Member Functions

virtual initMex (in obj)
 Abstract function to initialize model mex file.
 
virtual initModel (in obj, in vargin)
 Abstract function to initialize with default parameters.
 
virtual update_constraints (in obj)
 Abstract function defining the table Model.constraints.
 
virtual update_controls (in obj)
 Abstract function defining the table Model.controls.
 
function update_idxControls (in obj)
 Function defining Model.hidxControls.
 
function update_idxForward (in obj)
 Function defining Model.idxForward.
 
function update_idxForwardAll (in obj)
 Function defining Model.idxForwardAll.
 
function update_idxSideward (in obj)
 Function defining Model.idxSideward.
 
function update_idxSidewardAll (in obj)
 Function defining Model.idxSidewardAll.
 
function update_idxStates (in obj)
 Function defining Model.hidxStates.
 
virtual update_idxSymmetry (in obj)
 Abstract function defining Model.idxSymmetry.
 
function update_idxTorqueDof (in obj)
 Function defining Model.idxTorqueDof.
 
function update_idxUpward (in obj)
 Function defining Model.idxUpward.
 
virtual update_mexParameter (in obj, in src, in evnt)
 Abstract function performed to update the parameter of the mex and the tables.
 
virtual update_states (in obj)
 Abstract function defining the table Model.states.
 

Protected Attributes

Property constraints
 Table: Information on constraints implemented in the mex and here.
 
Property controls
 Table: Information on controls of the model.
 
Property idxForward
 Double array: Indices for forward translation.
 
Property idxForwardAll
 Double array: Indices for forward translation, speed, position of contact points and force at contact points.
 
Property idxSideward
 Double array: Indices for sideward translation.
 
Property idxSidewardAll
 Double array: Indices for sideward translation, speed, position of contact points and force at contact points.
 
Property idxSymmetry
 Struct: Double arrays with indices for symmetry to map right to left.
 
Property idxTorqueDof
 Double array: Indices of dofs of torque actuators.
 
Property idxUpward
 Double array: Indices for upward translation.
 
Property init
 Double: Showing if the mex model is initialized.
 
Property nConstraints
 Double: Number of constraints (height of Model.constraints)
 
Property nControls
 Double: Number of controls (height of Model.controls)
 
Property nCPs
 Double: Number of contact points (height of Model.CPs)
 
Property nDofs
 Double: Number of degree of freedoms (height of Model.dofs)
 
Property nJoints
 Double: Number of joints (height of Model.joints)
 
Property nMus
 Double: Number of muscles (height of Model.muscles)
 
Property nSegments
 Double: Number of segments (height of Model.segments)
 
Property nStates
 Double: Number of states (height of Model.states)
 
Property nTor
 Double: Number of torque actuators (height of Model.torques)
 
Property segments
 Table: Segments (Segment properties should not be changed)
 
Property states
 Table: Information on states of the model.
 

Detailed Description

The abstract class describes the basics for a musculoskeletal model.

Todo:
We should set init = 0 as soon as we are loading an other model. This should be also done for all models which are saved within an other object (e.g. problem.model). Furthermore, we should check init == 1 each time before calling the mex.

Member Function Documentation

◆ extractControl()

function extractControl ( in  obj,
in  type,
in  controlname 
)

Function to obtain index of contol with a specific type (and name)

Parameters
objModel class object
typeString: Type of the control
controlname(optional) String or cell array of strings: Name of the control
Return values
iControlDouble array: Indices in Model.controls matching type (and name)

◆ extractState()

function extractState ( in  obj,
in  type,
in  statename 
)

Function to obtain index of state with a specific type (and name)

Parameters
objModel class object
typeString: Type of the state
statename(optional) String or cell array of strings: Name of the state
Return values
iStateDouble array: Indices in Model.states matching type (and name)

◆ getCoP()

function getCoP ( in  obj,
in  grf 
)

Function to calculate the center of pressure.

It solves the center of pressure (COP) coordinates from: COP x F + Ty = M, where COP is a point in the XZ plane and Ty is the "free moment" on the Y axis. expand the equation:

  1. COPy * Fz - COPz * Fy + 0 = Mx
  2. COPz * Fx - COPx * Fz + Ty = My
  3. COPx * Fy - COPy * Fx + 0 = Mz

Use COPy = 0, to get COPx = Mz / Fy and COPz = -Mx / Fy

For 2D, COPz will be 0.

Parameters
objModel class object
grfDouble vector: Ground contact vector containing Fx, Fy, Fz, Mx, My, Mz (right), and Fx, Fy, Fz, Mx, My, Mz (left) (12)
Return values
CoP_rDouble vector: Center of pressure in x, y and z direction for right foot (3)
CoP_lDouble vector: Center of pressure in x, y and z direction for left foot (3)

◆ getDynamics()

virtual getDynamics ( in  obj,
in  x,
in  xdot,
in  u 
)
virtual

Abstract function to compute implicit differential equation for the model.

Reimplemented in Gait2d_osim, Gait2dc, and Gait3d.

◆ getErate_bhargava()

function getErate_bhargava ( in  obj,
in  F_ce,
in  stim,
in  act,
in  l_ce,
in  v_ce,
in  t_stim 
)

Model function to calculate the energy rate of a single time step using Bhargava et al.

's model

Function to calculate the energy rate at a single time step using a continuous version of Bhargava et al.'s model. Model paper: Bhargava et al., J Biomech, 2004

Inputs are muscle states of the specific muscle that is considered.

Parameters
objModel object
F_ceForce in the contractile element
stimStimulation of the muscle (between 0 and 1)
actActivation level of the muscle (between 0 and 1)
l_ceNormalized length of the contractile element
v_ceNormalized velocity of the contractile element
t_stimDuration of stimulation of muscle

The output of getEratec_bhargava.m is a double which is equal to the energy rate of the time step in W/kg

Return values
EdotThe energy expenditure during the current time step

◆ getErate_Houdijk()

function getErate_Houdijk ( in  obj,
in  F_ce,
in  act,
in  l_ce,
in  v_ce 
)

Model function to calculate the energy rate of a single time.

Function to calculate the energy rate at a single time step using Houdijk et al.'s model. Houdijk et al., J Biomech, 2006. The paper desription is not optimal, see comments

Inputs are muscle parameters of the specific muscle that is considered. Inputs are muscle states of the specific muscle that is considered.

Parameters
objModel object
F_ceForce in the contractile element
actActivation level of the muscle (between 0 and 1)
l_ceNormalized length of the contractile element
v_ceNormalized velocity of the contractile element

The output of getErate_Houdijk.m is a double which is equal to the energy rate of the time step in W/kg

Return values
EdotThe energy expenditure during the current time step
wMuscle work during the current time step

◆ getErate_Lichtwark()

function getErate_Lichtwark ( in  obj,
in  F_ce,
in  act,
in  l_ce,
in  v_ce,
in  t_stim 
)

Model function to calculate the energy rate of a single time step using a continuous version of Lichtwark & Wilson's model.

Function to calculate the energy rate at a single time step using Lichtwark & Wilson's model, described in the supplement of Lichtwark & Wilson, J Biomech, 2007. The exception in gamma (line 68), which is according to Lichtwark & Wilson, J Exp Biol, 2005, because results were better in the 2019 comparison paper

Inputs are muscle parameters of the specific muscle that is considered.

Parameters
objModel object
F_ceForce in the contractile element
actActivation level of the muscle (between 0 and 1)
l_ceNormalized length of the contractile element
v_ceNormalized velocity of the contractile element
t_stimDuration of stimulation of muscle

The output of getErate_Lichtwark.m is a double which is equal to the energy rate of the time step in W/kg

Return values
EdotThe energy expenditure during the current time step

◆ getErate_margaria()

function getErate_margaria ( in  obj,
in  F_ce,
in  v_ce 
)

Model function to calculate the energy rate of a single time step using Margaria's model.

Function to calculate the energy rate at a single time step using Margaria's model: 25 % efficient during shortening, 120% during lengthening. Margaria, Int Z Angew Physiol Einschl Arbeitsphysiol, 1968

Inputs are muscle parameters of the specific muscle that is considered.

Parameters
objModel object
F_ceForce in the contractile element
v_ceNormalized velocity of the contractile element

The output of getErate_margaria.m is a double which is equal to the energy rate of the time step in W/kg

Return values
Edotis the energy expenditure during the current time step

◆ getErate_Minetti()

function getErate_Minetti ( in  obj,
in  act,
in  v_ce 
)

Model function to calculate the energy rate of a single time.

Function to calculate the energy rate at a single time step using Minetti's model. Based on: Minetti & Alexander, J Theor Biol, 1997. Uses muscle-level work instead of torque-level

Inputs are muscle parameters of the specific muscle that is considered.

Parameters
objModel object
actactivation level of the muscle (between 0 and 1)
v_cecurrent velocity of the contractile element

The output of getErate_Minetti is a double which is equal to the energy rate

Return values
Edotis the energy expenditure during the current time step

◆ getErate_uchida()

function getErate_uchida ( in  obj,
in  F_ce,
in  stim,
in  act,
in  l_ce,
in  v_ce 
)

Model function to calculate the energy rate of a single time.

Function to calculate the energy rate at a single time step using Uchida's model: Uchida et al., PLOS ONE, 2016

Inputs are muscle states of the specific muscle that is considered

Parameters
objModel class object
F_ceDouble vector: Muscle force of CE returned by obj.getMuscleCEforces(x) (Model.nMus x 1)
stimDouble vector: Stimulation of muscles = neural excitation u (Model.nMus x 1)
actDouble vector: Activation of muscles a (Model.nMus x 1)
l_ceDouble vector: Length of contractile element of muscles s (Model.nMus x 1)
v_ceDouble vector: Velocity of contractile element of muscles (Model.nMus x 1)

The output of getErate_uchida.m is a double which is equal to the energy rate of the time step in W/kg

Return values
EdotDouble vector: Energy expenditure during one time step (energy rate) in W (Model.nMus x 1)
w_ceDouble vector: Mechanical work rate of contractile element in W/kg (normalized to muscle mass) (Model.nMus x 1)
h_slDouble vector: Heat rate due to shortening and lengthening of muscles in W/kg (normalized to muscle mass) (Model.nMus x 1)
h_amDouble vector: Heat rate from the activation of muscles and its maintenance in W/kg (normalized to muscle mass) (Model.nMus x 1)

◆ getErate_Umberger()

function getErate_Umberger ( in  obj,
in  F_ce,
in  stim,
in  act,
in  l_ce,
in  v_ce 
)

Model function to calculate the energy rate of a single time step with Umberger et al.

's model. Ross Miller's code was also used as a reference.

Function to calculate the energy rate at a single time step using Umberger's model. It uses the 2010 version (no negative work): Umberger, J R Soc Interface, 2010 2003 (original) Version: Umberger et al., "A model of human muscle energy expenditure," Computer methods in biomechanics and biomedical engineering, vol. 6, no. 2, pp. 99–111, 2003.

Inputs are muscle states of the specific muscle that is considered

Parameters
objGait2dc class object
F_ceDouble vector: Muscle force of CE returned by Model.getMuscleCEforces(x) (Model.nMus x 1)
stimDouble vector: Stimulation of muscles = neural excitation u (Model.nMus x 1)
actDouble vector: Activation of muscles a (Model.nMus x 1)
l_ceDouble vector: Length of contractile element of muscles s (Model.nMus x 1)
v_ceDouble vector: Velocity of contractile element of muscles (Model.nMus x 1)

The output of getErate_Umberger.m is a double which is equal to the energy rate of the time step in W/kg

Return values
EdotDouble vector: Energy expenditure during one time step (energy rate) in W (Model.nMus x 1)
w_ceDouble vector: Mechanical work rate of contractile element in W/kg (normalized to muscle mass) (Model.nMus x 1)
h_slDouble vector: Heat rate due to shortening and lengthening of muscles in W/kg (normalized to muscle mass) (Model.nMus x 1)
h_amDouble vector: Heat rate from the activation of muscles and its maintenance in W/kg (normalized to muscle mass) (Model.nMus x 1)

◆ getEratec_bhargava()

function getEratec_bhargava ( in  obj,
in  F_ce,
in  stim,
in  act,
in  l_ce,
in  v_ce,
in  dFdx,
in  dFdxdot,
in  epsilon 
)

Model function to calculate the energy rate of a single time step using a continuous version of Bhargava et al.

's model

Function to calculate the energy rate at a single time step using a continuous version of Bhargava et al.'s model. Line 60, phi, was chosen based on graphs of phi as a function of t_stim, since t_stim cannot be differentiated. Model paper: bhargava et al., J Biomech, 2004

Inputs are muscle states of the specific muscle that is considered.

Parameters
objModel object
F_ceForce in the contractile element
stimStimulation of the muscle (between 0 and 1)
actActivation level of the muscle (between 0 and 1)
l_ceNormalized length of the contractile element
v_ceNormalized velocity of the contractile element
dFdxDerivative of CE forces with respect to the state
dFdxdotDerivative of CE forces with respect to the state derivative
epsilonMeasure of the nonlinearity of the continuous functions

The output of getEratec_bhargava.m is a double which is equal to the energy rate of the time step in W/kg

Return values
EdotThe energy expenditure during the current time step
dEdotThe gradient of Edot with respect to all states and inputs

◆ getEratec_Houdijk()

function getEratec_Houdijk ( in  obj,
in  F_ce,
in  act,
in  l_ce,
in  v_ce,
in  dFdx,
in  dFdxdot,
in  epsilon 
)

Model function to calculate the energy rate of a single time step using a continuous version of Houdijk et al.

's model

Function to calculate the energy rate at a single time step using a continuous version of Houdijk et al.'s model. Houdijk et al., J Biomech, 2006.

Inputs are muscle parameters of the specific muscle that is considered. Inputs are muscle states of the specific muscle that is considered.

Parameters
objModel object
F_ceForce in the contractile element
actActivation level of the muscle (between 0 and 1)
l_ceNormalized length of the contractile element
v_ceNormalized velocity of the contractile element
dFdxDerivative of CE forces with respect to the state
dFdxdotDerivative of CE forces with respect to the state derivative
epsilonMeasure of the nonlinearity of the continuous functions

The output of getEratec_Houdijk.m is a double which is equal to the energy rate of the time step in W/kg

Return values
EdotThe energy expenditure during the current time step
dEdotThe gradient of Edot with respect to all states and inputs%

◆ getEratec_Lichtwark()

function getEratec_Lichtwark ( in  obj,
in  F_ce,
in  act,
in  l_ce,
in  v_ce,
in  dFdx,
in  dFdxdot,
in  epsilon 
)

Model function to calculate the energy rate of a single time step using a continuous version of Lichtwark & Wilson's model.

Function to calculate the energy rate at a single time step using a continuous version of Lichtwark & Wilson's model, described in the supplement of Lichtwark & Wilson, J Biomech, 2007.

Inputs are muscle parameters of the specific muscle that is considered.

Parameters
objModel object
F_ceForce in the contractile element
actActivation level of the muscle (between 0 and 1)
l_ceNormalized length of the contractile element
v_ceNormalized velocity of the contractile element
dFdxDerivative of CE forces with respect to the state
dFdxdotDerivative of CE forces with respect to the state derivative
epsilonMeasure of the nonlinearity of the continuous functions

The output of getEratec_Lichtwark.m is a double which is equal to the energy rate of the time step in W/kg

Return values
EdotThe energy expenditure during the current time step
dEdotThe gradien

◆ getEratec_margaria()

function getEratec_margaria ( in  obj,
in  F_ce,
in  v_ce,
in  dFdx,
in  dFdxdot,
in  epsilon 
)

Model function to calculate the energy rate of a single time step using a continuous version of Margaria's model.

Function to calculate the energy rate at a single time step using a continuous version of Margaria's model: 25 % efficient during shortening, 120% during lengthening. Margaria, Int Z Angew Physiol Einschl Arbeitsphysiol, 1968

Inputs are muscle parameters of the specific muscle that is considered.

Parameters
objModel object
F_ceForce in the contractile element
v_ceNormalized velocity of the contractile element
dFdxDerivative of CE forces with respect to the state
dFdxdotDerivative of CE forces with respect to the state derivative
epsilonMeasure of the nonlinearity of the continuous functions

The output of getEratec_margaria.m is a double which is equal to the energy rate of the time step in W/kg

Return values
Edotis the energy expenditure during the current time step
dEdotis the gradient of Edot with respect to all states and inputs

◆ getEratec_Minetti()

function getEratec_Minetti ( in  obj,
in  act,
in  v_ce 
)

Model function to calculate the energy rate of a single time step using Minetti's model.

No discsontinuities here, so it is the same as the original model.

Function to calculate the energy rate at a single time step using Minetti's model. Based on: Minetti & Alexander, J Theor Biol, 1997. Uses muscle-level work instead of torque-level

Inputs are muscle parameters of the specific muscle that is considered.

Parameters
objModel object
actactivation level of the muscle (between 0 and 1)
v_cecurrent velocity of the contractile element

The output of getEratec_Minetti.m is a double which is equal to the energy rate of the time step in W/kg

Return values
Edotis the energy expenditure during the current time step
dEdotis the gradient of Edot with respect to all states and inputs

◆ getEratec_umberger()

function getEratec_umberger ( in  obj,
in  F_ce,
in  stim,
in  act,
in  l_ce,
in  v_ce,
in  dFdx,
in  dFdxdot,
in  epsilon 
)

Model function to calculate the energy rate of a single time step with the continuous version of Umberger et al.

's model

Function to calculate the energy rate at a single time step using a continuous version of Umberger's model. This one is published in Koelewijn, Dorscky et al., Comp Meth Biomed Biomech Eng, 2016, and uses the 2010 version (no negative work): Umberger, J R Soc Interface, 2010

Inputs are muscle states of the specific muscle that is considered.

Parameters
objModel object
F_ceForce in the contractile element
stimStimulation of the muscle (between 0 and 1)
actActivation level of the muscle (between 0 and 1)
l_ceNormalized length of the contractile element
v_ceNormalized velocity of the contractile element
dFdxDerivative of CE forces with respect to the state
dFdxdotDerivative of CE forces with respect to the state derivative
epsilonMeasure of the nonlinearity of the continuous functions

The output of getEratec_umberger.m is a double which is equal to the energy rate of the time step in W/kg

Return values
EdotThe energy expenditure during the current time step
dEdotThe gradient of Edot with respect to all states and inputs

◆ getGRF()

virtual getGRF ( in  obj,
in  x 
)
virtual

Abstract function returning the ground reaction forces for the system in state x.

Reimplemented in Gait2d_osim, Gait2dc, and Gait3d.

◆ getJointmoments()

virtual getJointmoments ( in  obj,
in  x,
in  u 
)
virtual

Abstract function returns joint moments, for the system in state x.

Reimplemented in Gait2d_osim, Gait2dc, and Gait3d.

◆ getMetabolicRate_pernode()

function getMetabolicRate_pernode ( in  obj,
in  x,
in  xdot,
in  u,
in  t_stim,
in  name,
in  getCont,
in  epsilon,
in  exponent 
)

Model function to calculate metabolic cost of a movement.

Function to calculate the metabolic cost of a movement. Seven different models are currently implemented

Parameters
objModel object
xDouble vector: States of the current node
xdotDouble vector: Derivatives of states
uDouble vector: Controls of the current node
t_stimDouble vector: how long each muscle was already stimulated
name(optional) String: name of the model that is being used. Options are umberger, lichtwark, bhargava, margaria, minetti, houdijk, and uchida
getCont(optional) Boolean: If true, get the continuous version which is needed if we use the output for simulation. (default: 0)
epsilon(optional) double parameter: Measure of nonlinearity of model, which is only used in the continuous model version. Default 0.
exponent(optional) integer: if metabolic cost is the objective, this number allows to minimize the square, cube, or nth-power of metabolic cost. Default is 1
Return values
EdotDouble vector: Energy expenditure during one time step (energy rate) in W (Model.nMus x 1)
dEdotdxDouble vector: Derivative of Edot w.r.t to x (Model.nStates x 1)
dEdotduDouble vector: Derivative of Edot w.r.t to u (Model.nControls x 1)
dEdotdTDouble: Derivative of Edot w.r.t to T

◆ getMuscleCEforces()

virtual getMuscleCEforces ( in  obj,
in  x,
in  xdot 
)
virtual

Abstract function returning muscle forces of CE for the system in state x.

Reimplemented in Gait2d_osim, Gait2dc, and Gait3d.

◆ getMuscleCEpower()

virtual getMuscleCEpower ( in  obj,
in  x,
in  xdot 
)
virtual

Abstract function returns power generated by muscle contractile elements, for the system in state x.

Reimplemented in Gait2d_osim, Gait2dc, and Gait3d.

◆ getMuscleforces()

virtual getMuscleforces ( in  obj,
in  x 
)
virtual

Abstract function returning muscle forces for the system in state x.

Reimplemented in Gait2d_osim, Gait2dc, and Gait3d.

◆ initMex()

virtual initMex ( in  obj)
protectedvirtual

Abstract function to initialize model mex file.

Reimplemented in Gait2d_osim, Gait2dc, and Gait3d.

◆ initModel()

virtual initModel ( in  obj,
in  vargin 
)
protectedvirtual

Abstract function to initialize with default parameters.

Reimplemented in Gait2dc.

◆ setbodymass()

function setbodymass ( in  obj,
in  bodymass 
)

Function to set body mass, does not influence the.

Parameters
objModel class object
segmentTableDouble: bodymass

◆ setMuscles()

function setMuscles ( in  obj,
in  muscles 
)

Function to set the muscles table.

Parameters
objModel class object
segmentTableTable: muscles

◆ setSegmentMass()

function setSegmentMass ( in  obj,
in  segmentName,
in  segmentMass 
)

Function to set segment mass.

Parameters
objModel class object
segmentNameString: Name of the segment
segmentMassDouble: Mass of the segment in kg

◆ setSegments()

function setSegments ( in  obj,
in  segmentTable 
)

Function to set segment Table.

Parameters
objModel class object
segmentTableTable: segmentTable

◆ showStick()

virtual showStick ( in  obj,
in  x 
)
virtual

Abstract function to show model as stick figure.

◆ simuAccGyro()

virtual simuAccGyro ( in  obj,
in  data,
in  q,
in  qd,
in  qdd 
)
virtual

Abstract function to simulate acceleration and gyroscope signals.

◆ update_constraints()

virtual update_constraints ( in  obj)
protectedvirtual

Abstract function defining the table Model.constraints.

Reimplemented in Gait2d_osim, Gait2dc, and Gait3d.

◆ update_controls()

virtual update_controls ( in  obj)
protectedvirtual

Abstract function defining the table Model.controls.

Reimplemented in Gait2d_osim, Gait2dc, and Gait3d.

◆ update_idxControls()

function update_idxControls ( in  obj)
protected

Function defining Model.hidxControls.

Parameters
objModel class object

◆ update_idxForward()

function update_idxForward ( in  obj)
protected

Function defining Model.idxForward.

Provides the indices of state variables that have forward translation. States have to be updated before!

Parameters
objModel class object

◆ update_idxForwardAll()

function update_idxForwardAll ( in  obj)
protected

Function defining Model.idxForwardAll.

Provides the indices of state variables that have forward translation, speed, position of contact points and force at contact points. States and idxForward have to be updated before!

Parameters
objModel class object

◆ update_idxSideward()

function update_idxSideward ( in  obj)
protected

Function defining Model.idxSideward.

Provides the indices of state variables that have sideward translation. States have to be updated before!

Parameters
objModel class object

◆ update_idxSidewardAll()

function update_idxSidewardAll ( in  obj)
protected

Function defining Model.idxSidewardAll.

Provides the indices of state variables that have sideward translation, speed, position of contact points and force at contact points. States and idxSideward have to be updated before!

Parameters
objModel class object

◆ update_idxStates()

function update_idxStates ( in  obj)
protected

Function defining Model.hidxStates.

Parameters
objModel class object

◆ update_idxSymmetry()

virtual update_idxSymmetry ( in  obj)
protectedvirtual

Abstract function defining Model.idxSymmetry.

Reimplemented in Gait2d_osim, Gait2dc, and Gait3d.

◆ update_idxTorqueDof()

function update_idxTorqueDof ( in  obj)
protected

Function defining Model.idxTorqueDof.

Searches for indices of dof which have torque actuators in Model.torques.

Parameters
objModel class object

◆ update_idxUpward()

function update_idxUpward ( in  obj)
protected

Function defining Model.idxUpward.

Provides the indices of state variables that have upward translation. States have to be updated before!

Parameters
objModel class object

◆ update_mexParameter()

virtual update_mexParameter ( in  obj,
in  src,
in  evnt 
)
protectedvirtual

Abstract function performed to update the parameter of the mex and the tables.

Reimplemented in Gait2d_osim, Gait2dc, and Gait3d.

◆ update_states()

virtual update_states ( in  obj)
protectedvirtual

Abstract function defining the table Model.states.

Reimplemented in Gait2d_osim, Gait2dc, and Gait3d.

Member Data Documentation

◆ constraints

Property constraints
protected

Table: Information on constraints implemented in the mex and here.

◆ controls

Property controls
protected

Table: Information on controls of the model.

◆ CPs

Property CPs

Table: Contact points.

◆ dofs

Property dofs

Table: Degrees of freedom (Range of Dofs should not be changed here.

Set the bounds of the Problem instead.)

◆ drag_coefficient

Property drag_coefficient

Double: Air drag coefficient in N/(m/s)^2 (default: 0.2128)

◆ gravity

Property gravity

Double array: Gravity vector in m/(s^2)

◆ GRFNAMES

Constant Property GRFNAMES = {'rightFx', 'rightFy', 'rightFz', 'rightMx', 'rightMy', 'rightMz', 'leftFx', 'leftFy', 'leftFz', 'leftMx', 'leftMy', 'leftMz' }

Cell array with string: Gives the names for the GRF vector returned by getGRF()

◆ idxForward

Property idxForward
protected

Double array: Indices for forward translation.

◆ idxForwardAll

Property idxForwardAll
protected

Double array: Indices for forward translation, speed, position of contact points and force at contact points.

◆ idxSideward

Property idxSideward
protected

Double array: Indices for sideward translation.

◆ idxSidewardAll

Property idxSidewardAll
protected

Double array: Indices for sideward translation, speed, position of contact points and force at contact points.

◆ idxSymmetry

Property idxSymmetry
protected

Struct: Double arrays with indices for symmetry to map right to left.

◆ idxTorqueDof

Property idxTorqueDof
protected

Double array: Indices of dofs of torque actuators.

◆ idxUpward

Property idxUpward
protected

Double array: Indices for upward translation.

◆ init

Property init
protected

Double: Showing if the mex model is initialized.

◆ joints

Property joints

Table: Joints.

◆ mExtraScaleFactor

Property mExtraScaleFactor

Double: Scale factor for extra torques in Nm (default: 100 since we used this in previous simulations.

However, it's probably overwritten in the construction (see Gait3d.m)!)

◆ muscles

Property muscles

Table: Muscles.

◆ nConstraints

Property nConstraints
protected

Double: Number of constraints (height of Model.constraints)

◆ nControls

Property nControls
protected

Double: Number of controls (height of Model.controls)

◆ nCPs

Property nCPs
protected

Double: Number of contact points (height of Model.CPs)

◆ nDofs

Property nDofs
protected

Double: Number of degree of freedoms (height of Model.dofs)

◆ nJoints

Property nJoints
protected

Double: Number of joints (height of Model.joints)

◆ nMus

Property nMus
protected

Double: Number of muscles (height of Model.muscles)

◆ nSegments

Property nSegments
protected

Double: Number of segments (height of Model.segments)

◆ nStates

Property nStates
protected

Double: Number of states (height of Model.states)

◆ nTor

Property nTor
protected

Double: Number of torque actuators (height of Model.torques)

◆ segments

Property segments
protected

Table: Segments (Segment properties should not be changed)

◆ states

Property states
protected

Table: Information on states of the model.

◆ torques

Property torques

Table: Torque actuators.

◆ wind_speed

Property wind_speed

Double: Wind speed in direction of +X in m/s (default: 0)


The documentation for this class was generated from the following file: