A Weighted Least Squares Method For Inverse Dynamic Analysis
A Weighted Least Squares Method For Inverse Dynamic Analysis
Engineering
To cite this article: Antonie J. van den Bogert & Anne Su (2008) A weighted least squares method
for inverse dynamic analysis, Computer Methods in Biomechanics and Biomedical Engineering,
11:1, 3-9, DOI: 10.1080/10255840701550865
Internal forces in the human body can be estimated from measured movements and external forces
using inverse dynamic analysis. Here we present a general method of analysis which makes optimal use
of all available data, and allows the use of inverse dynamic analysis in cases where external force data is
incomplete. The method was evaluated for the analysis of running on a partially instrumented treadmill.
It was found that results correlate well with those of a conventional analysis where all external forces
are known.
Keywords: Inverse dynamics; Gait analysis; Multibody dynamics; Ground reaction force
was implemented as a general software tool that allows where M is a mass matrix, tu is a vector of unknown forces
arbitrary 3D or 2D models to be defined using markers on and moments, tk is a vector of known forces and moments,
the subject and generates and solves the kinematic and and c are the gravitational, centrifugal and Coriolis effects.
dynamic equations automatically. The method can A and B are coefficient matrices. After using spline
produce an optimal solution for any inverse dynamics smoothing (Woltring 1986) to obtain first and second
problem as long as the number of unknown load variables derivatives of q(t), the only remaining unknowns are tu. In
does not exceed the number of DOF. The utility of the order to avoid inconsistency in frequency content between
method will be demonstrated on an analysis of running the force and motion measurements, force measurements
with incomplete ground reaction force (GRF) data. tk are smoothed with the same spline filter (van den Bogert
and de Koning 1996, Bisseling and Hof 2006). If, as is
typically the case in whole body models, the number of
2. General methodology unknown forces and moments in tu is less than the number
of equations (number of DOF) N, the system of equations
2.1 Kinematic analysis is overdetermined and a linear least squares method can be
used. Unlike in the kinematic analysis, weighting is
First, a skeleton model is defined with N DOF and
required because here the N equations may have different
generalized coordinates q ¼ (q1 . . . qN)T. Assuming known
error levels, scaling relationships, or units of measure-
joint axes, the position r ¼ (x, y, z)Tand orientation R of each
ment. We first rewrite (3) as:
body segment can be computed using forward kinematics as
functions of q. If a marker i is placed at a known position p in A·t u ¼ b þ e ð4Þ
the segment’s reference frame, the global coordinates ri of
the marker are therefore a known function of q: where
r i ¼ rðqÞ þ RðqÞ · p i ; f i ðqÞ ð1Þ
b ¼ BðqÞ·t k þ cðq; qÞ
_ 2 M·q€ ð5Þ
If M markers are placed on the skeleton and their global 3D
coordinates are measured, the optimal (least squares) and e is a vector of residual errors. The weighed least
estimate for the skeleton pose q can be obtained by squares solution is:
minimizing
t u ¼ arg min ðA·t u 2 bÞT WðA·t u 2 bÞ ; ð6Þ
tu
X
M
2
FðqÞ ¼ kr i 2 f i ðqÞk ð2Þ
i¼1
where the weighting matrix W is the inverse of the
covariance matrix of the error vector e.
Note that in 3Ds, the right hand side is a sum of 3M squares. In order to find the covariance matrix, we consider that
A unique minimum exists if 3M $ N and 3m £ N the the noise in q(t) is small, while the error in first and second
Jacobian matrix J ¼ ›f/›q is non-singular. This method is derivatives can be substantial even after optimal
commonly referred to as global optimization (Lu and smoothing (Woltring 1985). We therefore assume that
O’Connor 1999), where global refers to the fact that the the matrix A does not contribute to e, and we only consider
entire skeleton is modeled, rather than isolated bones as in the error in b which is the result of the propagation of
conventional rigid body motion analysis (Challis 1995). If an measuring errors in tk, q, q, _ and q. € There are strong
appropriate skeleton model and marker set is used, global correlations between the elements of b, because of the
optimization requires fewer markers and produces more coefficient matrices and because of the whole body
robust results than conventional rigid body methods (Lu and kinematic solution in which each marker coordinate
O’Connor 1999, Roux et al. 2002). contributes to each generalized coordinate. We can,
In our implementation (Mocap Solver 6.19, Motion therefore, not assume that the covariance matrix is
Analysis Corp., Santa Rosa, CA), equation (2) is minimized diagonal. An analytical derivation would be intractable, so
using the LMDIF code for nonlinear least squares problems we use Monte Carlo simulation to estimate the covariance
(Moré et al. 1980) which is available from MINPACK at matrix from errors in raw data. The raw data are the
http://www.netlib.org. We also have obtained good results marker coordinates ri and the force measurements on
with the Levenberg – Marquardt solver in Numerical which tk depends. We assume normally distributed errors
Recipes (Press et al. 1992) which is faster but somewhat sr (mm) in each marker coordinate, and normally
less robust in situations where J is near-singular. distributed errors st (N or Nm) in measured force and
moment variables. We take one typical recording of the
motion of interest, perturb each sample of raw data with
2.2 Dynamic analysis
normally distributed random numbers with standard
After adding mass properties to the skeleton model, its deviations sr and st , and propagate the data through the
equations of motion can be derived as: kinematic analysis, spline smoothing, and finally through
equation (5). This is done a number of times on the same
M·q€ ¼ AðqÞ·t u þ BðqÞ·t k þ cðq; qÞ;
_ ð3Þ motion data to obtain a large number of perturbed vectors
Inverse dynamic analysis 5
b from which the covariance matrix COV is then paradigm but this does not allow full 6-component GRF
estimated as: (3D force and moment) to be recorded, which is required
for conventional recursive inverse dynamic analysis
Nf XNp
1 X when starting at the feet. A relatively inexpensive option
COV ij ¼ ðbikl 2 bik Þ bjkl 2 bjk ð7Þ is an instrumented treadmill with a force platform under
N p N f k¼1 l¼1
the belt (GaitWay, Kistler, Amherst NY). This
where bik is the unperturbed ith element of b in sample k, instrumentation only measures three of the 6 external
and bikl is the kth perturbation of this variable. Nf is the load variables: vertical force and center of pressure.
number of frames (samples), and Np is the number of There is, however, currently no method for inverse
perturbations applied to each frame. We use Np ¼ 50. dynamic analysis that can use such partial instrumenta-
Once the covariance matrix is known, we compute its tion. This inverse dynamic problem, however, fits nicely
square root S using Cholesky factorization, such that into the least squares framework presented above. With
S·S T ¼ COV. Equation (6) is now equivalent to: an N-DOF linked segment model in 3Ds, there will be
N 2 6 unknown internal loads, 3 unknown external
t u ¼ arg minS 21 ðA·t u 2 bÞk; ð8Þ loads, and n equations of motion. The number of
tu equations (n) exceeds the number of unknowns (n 2 3).
We will demonstrate the utility of the least squares
Equation (7) was solved using the DGGGLM General
method on this problem.
Linear Regression solver which is available from the
LAPACK library at http://www.netlib.org. DGGGLM is
based on QR decomposition of the matrices A and S
3.2 Instrumentation and protocol
(Golub and Van Loan 1989).
Twenty-eight reflective markers were placed on a 44
year old male subject (figure 1). Markers were tracked
2.3 Equations of motion
with six Falcon cameras (Motion Analysis Corp., Santa
There are many ways to derive equations of motion in Rosa, CA) and EVa 5.2 software at 240 frames per
the form (3). We used the SD/Fast software (PTC, second. GRF data were collected with an AMTI force
Needham, MA) to generate the equations of motion. plate (OR6-5 #4048, Advanced Mechanical Technology
SD/Fast produces a triangular mass matrix which is Inc., Watertown, MA) at 1000 samples per second. Data
advantageous for forward dynamics but has no particular were collected during standing, followed by 23 trials of
advantage here because the mass matrix is never running at the subject’s preferred speed. The subject was
inverted. We obtain the mass matrix M using the instructed to vary running style between trials, in order
SD/Fast function SDMASSMAT. SD/Fast also has a to test the ability of the inverse dynamic analysis to
function SDFRCMAT which computes the right hand detect these variations.
side of (3) for given kinematic state ðq; qÞ
_ and applied
forces. The latter function was used to obtain first the
_ by setting all forces to zero, and
column vector cðq; qÞ,
then to obtain the columns of matrices A and B by
successively applying a unit force in each component of
tu or tk, while keeping all other components zero. A new
M, A, B and c is thus computed in each sample of the
movement. A more general symbolic manipulation
method, such as Autolev (Online Dynamics, Sunnyvale,
CA), would be able to extract A, B and c directly which
would be more efficient.
3. Example of application
3.3 Data processing time histories of these variables during one typical trial,
using all three solution methods. The ability of methods
From the marker coordinates during standing, a twelve-
(2) and (3) to detect differences between trials was
segment skeleton model (figure 1) was generated with 29
assessed by determining peak joint moments from each
DOF: six for trunk position and orientation, three for a
trial over the first 60 frames (250 ms) after heelstrike. Each
spherical joint between pelvis and trunk, three for each
of the methods (2) and (3) was compared to the “gold
spherical joint at hip and shoulder, one for each hinge joint
standard” result of method (1) and the differences between
at elbow and knee and two for the rotations in each ankle
methods were quantified by the Pearson product-moment
(van den Bogert et al. 1994). Positions and orientations of
correlation coefficient
joint axes were based on existing methods (Isman and
Inman 1969, Bell et al. 1990, Vaughan et al. 1992). P P P
n xi yi 2 xi yi
Segment mass properties were computed from total body r ¼ qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
P P 2 ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
ffi q P P 2ffi ð9Þ
mass and segment lengths using the methods of de Leva n x2i 2 xi n y2i 2 yi
(1996). Equations of motion were generated using
SD/Fast as described in section 2.1. Data from the and mean relative error
running trials were processed using the methods presented
1 Xxi 2 yi
in sections 2.1 –2.3. Specifically, the spline smoothing of MRE ¼ y ð10Þ
q(t) and tk(t) was performed using a quintic spline filter n i
Figure 2. Three dimensional joint moments at hip and knee during a representative running trial, obtained with each of the three inverse dynamics
methods. Frame rate is 240 Hz and frame 1 represents heel strike.
method (Kuo 1998), it is no longer required that the model function call to the SD/Fast function SDREAC, after the
is jointed to the ground. This, however, necessitated the actuating loads have been solved. In addition to the ability
use of a weighting matrix in solving the least squares to utilize redundant measurements, the least squares
problem. We derived this weighting matrix via Monte method has the additional advantage over conventional
Carlo simulation of error propagation from estimated methods that it is not limited to tree-structured multibody
errors in raw measurements (marker trajectories and systems.
external forces). The method as presented here solves There are also some limitations and disadvantages of
unknown actuator forces, joint moments and any unknown this method. If certain regions of the multibody system
GRFs. Conventional recursive methods (Winter 1979) also have higher errors in model or measurements, it may be
solve the non-actuating reaction loads at each joint, which better not to use a whole body least squares method, but
are useful in estimations of joint contact forces (van den (if complete external force data are available) use a
Bogert 1994). In order to enable such applications of our recursive method which models only the region of interest.
methods, not demonstrated in this paper, we obtain the full For example, the inverse dynamic analysis of the lower
6-component reaction loads at each joint by a single extremity during gait is more reliable when the upper body
8 A. J. van den Bogert and A. Su
Figure 3. Peak joint moments (in Nm) in all 23 trials, compared Figure 4. Peak joint moments in all 23 trials, compared between the
between the NOGRF method (no GRF data used) and the FULLGRF FzMxy method (partial instrumentation) and the FULLGRF method,
method, where full GRF data is available. Maximum moments were used where full GRF data is available.
for hip extensor and both internal rotator moments. Minimum moments
were used for knee flexor and both adductor moments.
and 0.1 Nm. However, the FzMxy analysis was sensitive
to sr. Trial and error tuning showed that sr ¼ 50 mm
is not included in the model, because motion of visceral produced good results, though no attempt was made to
mass can not be measured reliably. However, if no full fully optimize this parameter. The value of 50 mm may
GRF data is available, such a partial body model is not an seem large, as it is much larger than typical measuring
option. errors in motion capture systems, but it does reflect the
The hip and knee joint moments during running fact that many aspects of upper body motion, where most
(figure 2) were consistent with other studies that used full mass resides, were not modeled: spine and neck motion,
force plate instrumentation (Winter 1983, Ferber et al. scapulo-thoracic translation, wrist motion, and especially
2003). Our results demonstrate that nearly the same results the motion of internal organs which can not be measured
can be obtained with an instrumented treadmill in which reliably.
only the vertical force and centre of pressure are measured
(figure 4), except perhaps the extensor moment at the hip. Table 1. Error measures for joint moments obtained with no force
Large errors were seen in the internal rotation moments measurement (NOGRF) or partial force measurement (FzMxMy). Each
result was compared to a “gold standard” where complete GRF data was
during the swing phase (figure 2), when the true loads are used (FULLGRF). Mean relative errors (MRE) and correlation
zero, but the unmeasured GRF were given significantly coefficients (r) were computed using equations (9) and (10).
non-zero estimates by the NOGRF and FzMxy methods.
This problem could be avoided by considering these FzMxMy NOGRF
unmeasured variables to be known, and equal to zero, Joint moment MRE (%) r MRE (%) r
whenever the measured vertical GRF (Fz) is zero.
Hip extensor 13.5 0.379 11.4 0.263
In order to obtain good results with the LSID method, Hip adductor 9.4 0.827 16.9 0.735
the measurement error estimates sr and st, required for Hip rotator 9.4 0.645 12.4 0.653
the covariance matrix, may need to be tuned carefully. Knee flexor 4.4 0.942 12.8 0.663
Knee adductor 11.7 0.946 58.4 0.002
In this application, the FULLGRF results were robust and Knee rotator 47.3 0.887 49.6 0.526
not sensitive to our choice of sr ¼ 1 mm and st ¼ 0.1 N
Inverse dynamic analysis 9
We have demonstrated the utility of the LSID method R.W. Bisseling and A.L. Hof, “Handling of impact forces in inverse
for analysis of running on a partially instrumented dynamics”, J. Biomech., 39, pp. 2438– 2444, 2006.
A.J. Van der Bogert, G.D. Smith and B.M. Nigg, “In vivo determination
treadmill. This can be applied clinically to assist and of the anatomical axes of the ankle joint complex: an optimization
evaluate gait retraining therapies with the goal of approach”, J. Biomech., 27, pp. 1477–1488, 1994.
preventing overuse injuries in runners. Many such injuries J.H. Challis, “An examination of procedures for determining body
segment attitude and position from noisy biomechanical data”, Med.
are thought to be related to abnormal three dimensional Eng. Phys., 17, pp. 83–90, 1995.
joint moments (Ferber et al. 2003). The partially P. de Leva, “Adjustments to Zatsiorsky-Seluyanov’s segment inertia
instrumented analysis (FzMxMy) has the capability of parameters”, J. Biomech., 29, pp. 1223–1230, 1996.
detecting changes in joint moments caused by changes in M.P. de Looze, I. Kingma, J.B.J. Bussmann and H.M. Toussaint,
“Validation of a dynamic linked segment model to calculate joint
running technique. moments in lifting”, Clin. Biomech., 7, pp. 161–169, 1992.
When analysing walking gait with similar methods, we R. Ferber, I.M. Davis and D.S. Williams, III, “Gender differences
obtained good results during single stance, but the double in lower extremity mechanics during running”, Clin. Biomech., 18,
pp. 350–357, 2003.
stance phase presents a problem, even if the feet are on G.S. Fleisig, J.R. Andrews, C.J. Dillman and R.F. Escamilla, “Kinetics of
separate force platforms that can measure vertical force baseball pitching with implications about injury mechanisms”, Am.
and center of pressure. Although the number of unknowns J. Sports Med., 23, pp. 233– 239, 1995.
(N-6 joint moments, plus 6 external force/moment G.H. Golub and C.F. Van Loan, Matrix Computations, Baltimore: Johns
Hopkins University Press, 1989.
variables) is, in this case, exactly equal to the number of R.E. Isman and V.T. Inman, “Anthropometric studies of the human foot
equations N, the matrix A is singular and no unique and ankle”, Bull. Prosthet. Res., 11, pp. 97 –129, 1969.
solution exists. This can be understood by considering that A.D. Kuo, “A least-squares estimation approach to improving the
precision of inverse dynamics computations”, J. Biomech. Eng., 120,
the resultant horizontal GRF can be estimated from pp. 148–159, 1998.
horizontal acceleration of the center of mass of the entire T.W. Lu and J.J. O’Connor, “Bone position estimation from skin marker
body, but the data contains no information on how this co-ordinates using global optimisation with joint constraints”,
resultant force is distributed between the two feet. J. Biomech., 32, pp. 129– 134, 1999.
J. Moré, B. Garbow and K. Killstrom, “User Guide for MINPACK-1”,
Minimal effort solutions can then be considered as an Argonne National Laboratories Report ANL-80-74, Argonne, Illinois
alternative (Vaughan et al. 1982). An application where 1980.
the LSID method may be especially useful is the spine, W.H. Press, S.A. Teukolsky, W.T. Vetterling and B.P. Flannery,
Numerical Recipes in Fortran, 2nd ed., Cambridge: Chapter 15
where it will produce an optimal merging of the top –down
Cambridge University Press, 1992.
and bottom – up methods which are currently the only E. Roux, S. Bouilland, A.P. Godillon-Maquinghen and D Bouttens,
available options (de Looze et al. 1992). “Evaluation of the global optimisation method within the upper limb
kinematics analysis”, J. Biomech., 35, pp. 1279–1283, 2002.
A.J. van den Bogert, “Analysis and simulation of mechanical loads on the
human musculoskeletal system, a methodological overview”, Exerc.
Acknowledgements Sport Sci. Rev., 22, pp. 23– 51, 1994.
A.J. van den Bogert and J.J. de Koning, “On optimal filtering for
This work was funded in part by grant 1R43HD36645 inverse dynamic analysis”, Proceedings, 9th Biennial Conference of
the Canadian Society of Biomechanics, Vancouver, BC 1996,
from the US National Institutes of Health to David pp. 214–215.
Hoadley of Foster– Miller Corporation. The software C.L. Vaughan, J.G. Hay and J.G. Andrews, “Closed loop problems in
module for kinematic analysis was developed by the first biomechanics. Part II-an optimization approach”, J. Biomech., 15,
pp. 201–210, 1982.
author as a paid consultant for Motion Analysis C.L. Vaughan, B.L. Davis and J.C. O’Connor, Dynamics of Human Gait,
Corporation. We are grateful to Dr Elizabeth Hardin Champaign, IL: Human Kinetics, 1992.
who collected the data and Dr Arthur D. Kuo (University D.A. Winter, Biomechanics of Human Movement, New York: Wiley,
of Michigan) for valuable input throughout the project. 1979.
D.A. Winter, “Moments of force and mechanical power in jogging”,
J. Biomech., 16, pp. 91– 97, 1983.
H.J. Woltring, “On optimal smoothing and derivative estimation
References from noisy displacement data in biomechanics”, Hum. Mov. Sci., 4,
pp. 229–245, 1985.
A.L. Bell, D.R. Pedersen and R.A. Brand, “A comparison of the accuracy H.J. Woltring, “A FORTRAN package for generalized, cross-validatory
of several hip center location prediction methods”, J. Biomech., 23, spline smoothing and differentiation”, Adv. Eng. Softw., 8,
pp. 617–621, 1990. pp. 104–113, 1986.