Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2017 Feb 1.
Published in final edited form as: IEEE Trans Biomed Eng. 2015 Jul 13;63(2):269–277. doi: 10.1109/TBME.2015.2455510

An Open-Source Toolbox for Surrogate Modeling of Joint Contact Mechanics

Ilan Eskinazi 1, Benjamin J Fregly 2,
PMCID: PMC4896840  NIHMSID: NIHMS754218  PMID: 26186761

Abstract

Goal

Incorporation of elastic joint contact models into simulations of human movement could facilitate studying the interactions between muscles, ligaments, and bones. Unfortunately, elastic joint contact models are often too expensive computationally to be used within iterative simulation frameworks. This limitation can be overcome by using fast and accurate surrogate contact models that fit or interpolate input-output data sampled from existing elastic contact models. However, construction of surrogate contact models remains an arduous task. The aim of this paper is to introduce an open-source program called Surrogate Contact Modeling Toolbox (SCMT) that facilitates surrogate contact model creation, evaluation, and use.

Methods

SCMT interacts with the third party software FEBio to perform elastic contact analyses of finite element models and uses Matlab to train neural networks that fit the input-output contact data. SCMT features sample point generation for multiple domains, automated sampling, sample point filtering, and surrogate model training and testing.

Results

An overview of the software is presented along with two example applications. The first example demonstrates creation of surrogate contact models of artificial tibiofemoral and patellofemoral joints and evaluates their computational speed and accuracy, while the second demonstrates the use of surrogate contact models in a forward dynamic simulation of an open-chain leg extension-flexion motion.

Conclusion

SCMT facilitates the creation of computationally fast and accurate surrogate contact models. Additionally, it serves as a bridge between FEBio and OpenSim musculoskeletal modeling software.

Significance

Researchers may now create and deploy surrogate models of elastic joint contact with minimal effort.

Index Terms: Biomechanics, joint contact, musculoskeletal modeling, surrogate modeling, toolbox

I. Introduction

Biomechanics researchers model and simulate joint mechanics to gain insight into a variety of clinical problems such as the onset and progression of degenerative joint disease [1], [2], tissue loading and overloading [3], [4], muscle force estimation [5], [6], and implant design performance [7], [8]. Musculoskeletal simulations on the human- and limb-scale tend to use idealized joint models to approximate the net effect of contact and ligaments on the musculoskeletal model’s kinematics. Examples include: revolute joints that model the knee [9]–[12], hinge-matrix formulations that allow rolling and sliding [13], and spherical joints that model the hip [9], [11], [12]. A parallel mechanism is a more complex type of joint model that can accommodate ligaments and multiple contact regions. Parallel mechanisms have been used to model the knee [14] and ankle [15] and to calculate ligament and knee contact forces [16]. Moreover, these mechanisms may also model ligament deformations by means of constraints [17]. While idealized joint models and parallel mechanisms are computationally fast and easy to implement, both suffer from two important limitations. The first is that the joint model may be unable to capture some variables of interest. For example, a knee modeled as a pin joint could not be used to explore the effect of transecting a ligament. The second limitation is that simplifications could result in non-physiological simulation results. For example, modeling the knee as a planar mechanism with isometric ligaments may imply that the ligaments can exert compressive as well as tensile forces.

The disadvantages of simplified joint models necessitate consideration of more realistic joint models that include ligaments and surface-surface interactions (i.e., between cartilage surfaces or implant components). These interactions can be simulated using deformable contact models that output a set of contact loads given the relative position and orientation of the contacting bodies. Use of explicit contact models in simulations presents several advantages: 1) Ligament and contact forces can be calculated, 2) No assumptions are made regarding a joint’s axis of rotation, 3) More inverse dynamics loads can be balanced during muscle force optimizations, resulting in a tighter solution space, 4) Consequences of injury, surgery, or rehabilitation on ligaments and contact surfaces can be predicted, and 5) The influence of articular geometry on joint kinematics can be taken into account. Despite these advantages, deformable contact models are rarely incorporated into iterative simulation frameworks due to their high computational cost [18].

Recent research efforts have overcome the computational cost issue by mapping computationally “slow” deformable contact models into computationally “fast” meta-models or surrogate models [6], [19], [20]. Although these models can replace original “slow” contact models within simulations, researchers often lack the resources and expertise to develop their own surrogate contact models. To our knowledge, there is no software framework currently available that can streamline the entire surrogate contact model creation, evaluation, and deployment process. This situation poses a major barrier to the use of realistic subject-specific joint contact models in multi-body simulations of human movement. Due to the lack of a software framework for surrogate contact modeling, researchers have applied general surrogate modeling packages to the contact problem. Halloran et al. [20] used a lazy learning toolbox for Matlab [21], [22] to build and use surrogate contact models, while Lin et al. used the DACE Kriging toolbox for Matlab [23] to develop a surrogate contact modeling approach [19]. An assortment of other tools such as the SUMO Toolbox [24] and Matlab’s Neural Network Toolbox can also be used for surrogate modeling. However, none of these programs facilitate the workflow needed to create surrogate contact models from beginning to end.

We have developed a freely available open-source program called Surrogate Contact Modeling Toolbox (SCMT) to facilitate the development, deployment, and sharing of surrogate contact models by the research community. SCMT interfaces with the third party finite element analysis software FEBio [25] which performs “slow” quasi-static analyses of elastic contact models. SCMT also interfaces with Matlab’s Neural Network Toolbox™ and Matlab Coder™ to train and deploy neural networks. FEBio was chosen because it is well-suited for solving biomechanical contact problems, is open-source, and is free for non-commercial use. Matlab’s toolboxes were chosen mainly for their neural network training algorithms and ability to export trained neural networks as dynamic-link libraries (DLLs). We have also developed a plugin for OpenSim [26] musculoskeletal modeling software that allows users to incorporate surrogate contact models created with SCMT into musculoskeletal models without having to write any code.

This paper summarizes SCMT’s design, features, and workflow. To demonstrate the full spectrum of SCMT’s functionality, we provide two examples applications. The first demonstrates the creation of multi-domain surrogate contact models for artificial tibiofemoral (TF) and patellofemoral (PF) joints and evaluates their accuracy and computational speed. The second example demonstrates a forward dynamic simulation of an open-chain knee extension-flexion motion where the knee is modeled as a 12 DOF joint possessing deformable TF and PF surrogate contact models, seven ligaments, and four muscles. We hope that making SCMT available to the research community will lead to the widespread use of surrogate contact models in simulations of human motion, ultimately advancing the field of musculoskeletal simulation.

II. Overview

SCMT is a software framework that allows users to generate neural network-based surrogate contact models from finite element models. SCMT includes an application programming interface (API) and a stand-alone graphical user interface (GUI). The main features of SCMT are a Sample Point Generator, a Model Sampler, a Sample Point Filter, an Out-of-Contact Sampler, a Surrogate Model Designer, and a Surrogate Model Tester (Fig. 1). The GUI allows users to interact with SCMT’s core functionality with the aid of tooltips and without having to write code.

Fig. 1.

Fig. 1

The Surrogate Contact Modeling Toolbox (SCMT) is composed of several tools or modules. The Sample Point Generator creates sample points which may cluster around reference trajectories. The Model Sampler performs multiple static analyses by calling FEBio. The Sample Point Filter removes unwanted sample points. The Out-of-Contact Sampler creates sample points corresponding to either fully out-of-contact or partly out-of-contact configurations. The Surrogate Model Designer defines the structure of the surrogate model and the neural network training criteria. The Surrogate Model Tester calculates the surrogate model errors.

SCMT is written in C++ with the GUI designed in Qt Creator (Digia Plc, Valimotie 21, 00380 Helsinki). The source code and compiled executable are freely available (https://simtk.org/home/scmt). The software is designed for use in Microsoft Windows operating systems. Third party tools are used extensively throughout the code. Among these tools are the Boost serialization library to read and write XML files and binary files [27], Hammersley libraries for creating low-discrepancy sequences of sample points [28], and the OpenMP API for multithreading [29]. SCMT interfaces with FEBio and Matlab via command line execution using the Windows Shell API. A user guide is available online and the code is heavily commented to allow users with C++ knowledge to explore the algorithms and to make changes to the code if desired.

The GUI provides a variety of tools for surrogate model creation that may be used either independently or as part of a structured workflow. The first tool is a Sample Point Generator that allows users to specify multiple domains of input space and the number of sample points desired in each domain. The second tool is a Model Sampler that interfaces with FEBio by parsing files and executing command line calls in a multithreaded fashion. The third tool is a Sample Point Filter that eliminates sample points containing values that exceed user-defined limits. The fourth tool is an Out-of-Contact Sampler which creates sample points that are in either fully out-of-contact or partly out-of-contact configurations. The fifth tool is a Surrogate Model Designer that specifies the inputs to and outputs of each artificial neural network (ANN) and the overall surrogate model. The Surrogate Model Designer also writes the training and testing data to disk and can launch a Matlab routine that generates and compiles the ANNs. The sixth tool is a Surrogate Model Tester that calculates root-mean-squared (RMS) errors and maximum absolute errors for the surrogate model outputs in multiple domains of input space. The seventh tool is a set of Utilities that simplify tasks regarding joining sets of sample points and converting sample point data into different formats. Together, these tools allow users to generate surrogate contact models easily and efficiently.

We also produced an OpenSim plugin to support surrogate contact models created with SCMT. The plugin allows OpenSim users to incorporate their surrogate contact models into OpenSim models as “Force” components. With this plugin, SCMT effectively provides a bridge between FEBio and OpenSim, two simulation tools widely used in the biomechanics community.

III. SCMT Workflow

The following section describes the recommended workflow to create surrogate contact models with SCMT (Fig. 2). All of these steps are illustrated in detail in two example applications presented in the next section. A more detailed description is available in the SCMT user guide (https://simtk.org/home/scmt).

Fig. 2.

Fig. 2

Diagram describing the steps required to generate and test surrogate contact models using SCMT. The letters in parenthesis correspond to the steps described in the workflow section.

A. Setting Up the FEBio Model

The FEBio model must contain one or two fixed rigid bodies and a single moving rigid body. The fixed bodies should have fixed constraints on all degrees of freedom while the moving body should have a combination of prescribed load constraints and prescribed kinematic constraints. Meshes with deformable material models should be attached to the rigid bodies. SCMT captures the reaction forces and torques on the fixed rigid bodies and the pose of the moving rigid body at the end of each static analysis.

Each static analysis requires two FEBio analysis steps. The first step is configured to apply large loads while the prescribed kinematic constraints are being met. The second step keeps the kinematics from the end of the first analysis step while trying to meet prescribed load constraints on the moving body. Step by step instructions on how to configure the FEBio model for use with SCMT are provided in the user guide.

B. Setting Up Reference Trajectories

SCMT generates sample point inputs that cluster around user-defined reference trajectories. These trajectories are six-dimensional (6-D) representations of pose and/or load measures in the six spatial directions. For example, a point in a trajectory could be described as (forcex, forcey,translationz, rotationx, torquey, torquez). The simplest trajectory is composed of two points that define a 6-D “bounding box” encompassing the desired input space. The bounding box approach yields a domain of large span and low sample point density. To improve sample point density, the user may specify a more detailed trajectory and SCMT will create multiple small subdomains around it. This approach mitigates the curse of dimensionality and allows for regions of high accuracy in the surrogate models.

C. Defining Domains and Generating Sample Point Inputs

Before generating sample points, the user defines the domains to be sampled using the Sample Point Generator. To create a domain, the user first loads a reference trajectory. Then the user gives a name to the domain and defines several settings (number of sample points per domain, Hammersely sequence details, etc.). The user should keep in mind that surrogate model accuracy decreases with domain size and increases with number of sample points. Finally, once the Sample Point Generator settings are defined, sample points populated with inputs may be created.

D. Sampling FEBio Model to Obtain Outputs

Once the FEBio model is configured and the sample point inputs are generated, the user performs multiple contact simulations in FEBio with the Model Sampler. The user loads the sample points previously generated and specifies the name of the FEBio file, the FEBio executable to be used, the number of concurrent threads, and the settings required for parsing the FEBio file. The FEBio model is then sampled via repeated static analyses and the progress is monitored in the console window. Alternatively, the user could utilize a contact simulation program other than FEBio by manipulating the sample point inputs and outputs directly with the SCMT API.

E. Filtering Sample Points

Once sampling has been completed, the user inspects how many sample points converged with the Sample Point Filter. The user then removes unwanted sample points from the data set. This step is necessary because the static analyses sometimes result in sample points with unrealistic poses or loads.

F. Generating Out-of-Contact Points

SCMT includes a tool for creating sample points in out-of-contact (OOC) configurations. There are two types of OOC situations. The first occurs when there is no contact happening between the fixed and moving bodies. In this case, the moving body can simply be translated in a specified direction tx, ty, or tz relative to a previously sampled configuration to achieve a specific amount of liftoff (Fig. 3). Sample points corresponding to intermediate liftoff values are also created. The sample points generated are called “fully OOC points” and require no simulations since all contact loads are known to be zero.

Fig. 3.

Fig. 3

Description of fully out-of-contact sample point generation. a) A pre-existing sample point configuration; b) The moving body is translated along a selected direction by specifying a maximum liftoff value and all contact loads corresponding to the translated configuration are set to zero. Intermediate translations yield intermediate poses.

The second situation occurs when one pair of potentially interacting contact surfaces (or contact pair) is OOC yet a second contact pair is still in contact. These sample points are called “partly OOC points.” Because these points share similar translations and rotations to sample points that are fully in contact, it was convenient to borrow some inputs from these sample points to be used as initial configurations. SCMT implements the following method to sample a partly OOC point: A partly OOC sample point Sooc is created using values from an existing sample point S where both contact interfaces were in contact. Three rotations corresponding to S are prescribed to Sooc as inputs. Two translations from S are prescribed to Sooc as well as one contact force in the remaining spatial direction. Next, a user-specified rotation rx, ry, or rz of Sooc is offset to tilt the moving body. When Sooc is processed with the Model Sampler, the resulting configuration will be partly OOC (Fig. 4) and could be added to the database of sample points to be fitted with a surrogate model.

Fig. 4.

Fig. 4

Description of partly out-of-contact sample point generation. a) A pre-existing sample point configuration. The user-specified lever arm is the estimated distance between the two contact patches. b) The moving body is prescribed to rotate to a specified angle. c) A force is applied in a compressive direction yielding a single contact patch and the approximate pre-defined maximum liftoff. Intermediate rotations yield intermediate poses.

G. Designing and Creating Surrogate Model

Once all sample points have been collected, the user proceeds to define the structure of the surrogate model with the Surrogate Model Designer. SCMT creates surrogate models composed of sequential blocks or computational stages. Each stage corresponds to an artificial neural network with multiple inputs and a single output, where the outputs of earlier blocks can be used as inputs to the ones that follow. Using the Surrogate Model Designer, the user specifies the inputs and outputs of the surrogate model and its stages. The Surrogate Model Designer is also used to write sample points to file in the proper format for Matlab to read.

After specifying model stages, the user defines the neural network architectures and stopping criteria. Each neural network architecture is defined in terms of number of hidden layers and number of neurons per layer. The stopping criteria options are the following: 1) exceeding maximum allotted time for training of each ANN, 2) meeting goal root-mean-square error for training set, and 3) exceeding maximum number of consecutive epochs with increasing validation error. Criterion 1 sets a limit of maximum computation time, Criterion 2 stops the training process when an ANN is considered “accurate enough,” and Criterion 3 avoids overfitting the training data set. The training process for each ANN is terminated as soon as any of these criteria is met. Other configuration options can be selected including whether or not training should be parallelized and the percentage of training sample points to be used for cross-validation in Criterion 3. Once all options are specified, the user launches the training process from the GUI. A Matlab console window in automation mode will show the ANN training progress. Upon finishing, all ANNs are saved to disk as Matlab workspace files, as Matlab functions, and as compiled DLLs. The XML file containing all surrogate model settings together with the DLLs comprise the complete surrogate model.

H. Testing Surrogate Contact Model

The Surrogate Model Tester tool allows users to load a surrogate model and test it against a separate set of sample points not used for training. The Surrogate Model Tester outputs the root-mean-square errors and maximum absolute errors for each of the outputs. The user also has the option to evaluate errors only in specific domains. For example, the user may ask for errors only in the domain corresponding to sample points that are out-of-contact. If the errors are unacceptably large, the user can revise the settings in the previous steps and iterate while keeping all of the sample points previously generated.

IV. Example Applications

The two examples presented in this section illustrate: a) How SCMT can be used to create multi-domain surrogate models of deformable contact for artificial TF and PF joints, and b) How surrogate contact models created with SCMT of artificial TF and PF joints can be used within a forward dynamic simulation of an open-chain knee extension-flexion motion. All files required to run both example applications are provided at (https://simtk.org/home/scmt). The knee was selected for both example applications because it is a highly complex 12 DOF joint typically modeled as a 1 DOF joint in musculoskeletal simulations. Being able to model the knee as a six DOF TF joint coupled with a 6 DOF PF joint within muscle-actuated simulations could facilitate improved estimation of joint contact, ligament, and muscle forces during movement. Moreover, modeling the knee as a 12 DOF joint eliminates assumptions about the knee axis of rotation, patellar kinematics, and how contact forces contribute to the flexion-extension moment. Instrumented implant force data, fluoroscopy data, an OpenSim musculoskeletal model, and implant geometry for these examples were obtained from the First Grand Challenge Competition to Predict in vivo Knee Loads [30].

A. Example 1: Surrogate Model Creation

This example illustrates the creation and testing of surrogate contact models of TF and PF artificial joints to be used in gait simulations.

1) Creating TF and PF finite element models

We created FEBio finite element models of TF and PF joints using geometric models of the implant components. The TF contact model consisted of single element meshes for the medial and lateral fixed rigid bodies representing the tibial tray, a deformable mesh representing the plastic tibial insert with its back surfaces attached to the fixed bodies, and a mesh for the metallic femoral component condyles modeled as rigid. The PF contact model consisted of a single element mesh for the fixed rigid body representing the patella bone, a deformable mesh modeling the plastic patellar button with its back surface attached to the fixed body, and a mesh of the femoral component trochlea modeled as rigid. In both cases, the rigid femoral component served as the moving body to which a combination of kinematic constraints and loads were prescribed. The plastic components made of ultra-high molecular weight polyethylene were modeled as neo-hookean solids with their Young’s modulus estimated using experimental contact force, pressure, and area data collected from a similar implant [31] (see Supplementary Material). The selected Young’s modulus and Poisson’s ratio were 700 MPa and 0.45, respectively, which corresponded to values used in another study [18].

The implant geometries were meshed using TrueGrid® (XYZ Scientific Applications, Inc. Livermore, CA) and consisted of 2,784 and 2,000 hexahedral elements for the tibial insert and patellar button, respectively. These meshes were tested against finer meshes (75,168 elements for tibial insert and 8,000 elements for patellar button) using static analyses, and the discrepancies were below 12 N/250 N mm in reaction forces/torques and below 15 μm/2.5x10−2 deg in poses.

The moving bodies for the TF and PF models were translated to suitable initial configurations where only small penetrations occurred between the contacting surfaces. The centers of rotation of the moving bodies were translated accordingly. The deformable meshes were rigidly attached to the fixed bodies using rigid contact constraints. Sliding contact was defined between the implant contact surfaces. After we configured the constraints, load curves, and analysis settings, the models were ready to be sampled (Fig. 5). This entire configuration procedure was performed within the software package Preview [25] which exported the FEBio models.

Fig. 5.

Fig. 5

a) Finite element model of tibiofemoral joint contact. The femoral component surfaces were modeled as rigid while the tibial insert was modeled as deformable. Two “fake” rigid bodies below the tibial insert were added such that their reaction loads could be captured. b) Finite element model of patellofemoral joint contact. The femoral component surface was modeled as rigid while the patellar button was modeled as deformable. One “fake” rigid body was added under the patellar button to capture the reaction loads.

2) Setting up reference trajectories and defining domains

The surrogate contact models created for this example were intended for use in gait simulations. Therefore, we clustered sample points along reference envelopes representing walking kinematics and loads. For the TF model, we created kinematic and kinetic envelopes for a variety of walking motions using a single cycle of fluoroscopic knee motion data (anterior-posterior translation, medial-lateral translation, internal-external rotation, and flexion-extension rotation) and multiple cycles of instrumented implant load data (inferior-superior force and adduction moment) [30]. Real variability was used to define envelope ranges for the load data and assumed variability was used for the motion data. Domain T1 was built along normal walking trajectories, and domain T2 was built for a series of different walking motions including normal gait, medial thrust gait, walking pole gait, and trunk sway gait. Domain T3 encompassed all trajectories in a bounding box without clustering sample points. Domain T4 consisted of sample points at the contact boundary for both medial and lateral sides. Domain T5 covered the configurations where both condyles were out-of-contact. Domain T6 represented configurations were only one condyle was out-of-contact (see Supplementary Material).

We had no reliable experimental data to help define pose/load trajectories for the patellofemoral model. Therefore, we defined a large bounding box domain named P1 which encompassed estimated kinematics from cadaver studies [32], [33] and estimated loads from simulation studies [6], [34]. We defined another domain named P2 corresponding to points at the contact boundary. Finally, we defined domain P3 as out-of-contact configurations.

3) Sampling and filtering

Sample points were obtained automatically using the Model Sampler. With thirteen parallel threads, our 3.4 GHz PC workstation was able to perform roughly one static analysis per second necessitating about two days of computation per joint. The net number of static analyses performed were 91,263 for the TF joint and 82,126 for the PF joint.

Sample points in domain T1 to T4 were filtered such that the medial and lateral inferior-superior forces were compressive ( Fymed,Fylat<-1N). Sample points in domain P2 were also filtered such that the compressive force was in the expected range ( −20 N < Fx < 0 N ). The effects of filtering on the number of sample points available for training and testing is shown in the Supplementary Material.

4) Designing and training surrogate models

The surrogate models took pose parameters as inputs and loads as outputs. The inputs and outputs to the stages of the TF model are shown in (1)–(7) while the inputs and outputs to the stages of the PF model are shown in (8)–(13). Translations tx, ty, and tz were along the global x, y, and z axes while rotations rx, ry, and rz followed a body-fixed x-y-z Euler sequence. For the TF model the global x-axis pointed posteriorly, the y-axis superiorly, and the z-axis medially. For the PF model the global x-axis pointed posteriorly, the y-axis superiorly, and the z-axis medially. Forces acting on the fixed bodies are denoted as F and torques as T . The TF model outputs medial and lateral superior-inferior forces ( Fymed and Fylat) to describe the medial-lateral load split. The inputs and outputs to each stage were chosen using a previously defined method [35]. For both models, the contact loads that were highly sensitive to pose parameter variations were fit as functions of the pose parameters while the insensitive loads were fit as functions of the pose parameters and the sensitive loads calculated in the earlier stages.

For the TF model, each stage consisted of an ANN with four hidden layers of thirty neurons each. For the PF model, each stage consisted of an ANN with two hidden layers of thirty neurons each. The models were trained using twelve Matlab workers with twenty percent of the training data selected randomly for cross-validation. The stopping criteria for each ANN were set to 6000 s, a training RMS value of 1 N or 1 N mm, and 50 consecutive validation error increments.

  1. Surrogate Model Stages for TF Contact:
    Fymed=f(tx,ty,tz,rx,ry,rz) (1)
    Fylat=f(tx,ty,tz,rx,ry,rz) (2)
    Fx=f(tx,ty,tz,rx,ry,rz,Fymed,Fylat) (3)
    Fz=f(tx,ty,tz,rx,ry,rz,Fymed,Fylat) (4)
    Tx=f(tx,ty,tz,rx,ry,rz,Fymed,Fylat) (5)
    Ty=f(tx,ty,tz,rx,ry,rz,Fymed,Fylat) (6)
    Tz=f(tx,ty,tz,rx,ry,rz,Fymed,Fylat) (7)
  2. Surrogate Model Stages for PF contact:
    Fx=f(tx,ty,tz,rx,ry,rz) (8)
    Fz=f(tx,ty,tz,rx,ry,rz) (9)
    Fy=f(tx,ty,tz,rx,ry,rz,Fx,Fz) (10)
    Tx=f(tx,ty,tz,rx,ry,rz,Fx,Fz) (11)
    Ty=f(tx,ty,tz,rx,ry,rz,Fx,Fz) (12)
    Tz=f(tx,ty,tz,rx,ry,rz,Fx,Fz) (13)

5) Evaluating errors

The models were tested in all domains of inputs space (see Supplementary Material for details). All RMS force/torque errors were below 24 N/621 N mm and 21 N/173 N mm for the TF and PF surrogate models, respectively. The RMS and maximum absolute errors for the TF model were found to be lowest for domain T5 (fully out-of-contact) and highest for domains T2 (all gait) and T6 (partly out-of-contact). The errors for the PF surrogate model were also calculated and were similarly the lowest for domain P3 (fully out-of-contact).

6) Evaluating computational speed

Both surrogate models were subjected to a computational speed test consisting of 10,000 consecutive surrogate model evaluations on a 3.4 GHz computer without parallelization. The average computation time for each TF and PF model evaluation was 88.3 μs and 57.6 μs, respectively.

B. Example 2: Surrogate Model Utilization

We incorporated TF and PF surrogate contact models into the pre-existing patient-specific pelvis and leg OpenSim model to perform a forward dynamic simulation of a seated open chain knee extension-flexion motion. The surrogate TF contact model encompassed a larger domain than the one generated for gait in Example 1, allowing for higher flexion. The surrogate PF contact model was the same one described in Example 1.

1) Creating realistic knee poses

We created realistic static poses where we applied the estimated contact loads that ligaments would impose on the tibial tray and patellar button. We started by removing all muscles from the model, locking the pelvis to ground, locking the ankle DOFs, and locking the hip joint at 90 degrees of flexion to place the model in a “sitting” position. We removed gravity from the model and added two coordinate actuators that applied generalized forces of 100 N on the patellar button and tibial insert to push them into the femoral component as ligaments would. All TF joint DOFs except for the flexion angle were free, while for the PF joint the medial-lateral and anterior-posterior translations were free and all other DOFs were locked. We then performed static analyses at 0 and 80 degrees of knee flexion and recorded the coordinates corresponding to the static poses. We visually compared the resulting static poses to fluoroscopic images to verify that the patellar location and tilt was realistic.

2) Adding and calibrating ligaments at knee poses

Once we obtained the two static poses, we removed all coordinate actuators from the model and replaced them with ligament models. We modeled each ligament as three nearly parallel non-linear path springs. The following ligaments were added: the patellar ligament, the medial collateral ligament (MCL), the lateral collateral ligament (LCL), the medial patellofemoral ligament (MPFL), and the lateral patellofemoral ligament (LPFL). The MCL included the deep MCL, the proximal superficial MCL, and the distal superficial MCL, each with three bundles. We omitted the anterior cruciate ligament (ACL) since the subject had it removed during knee replacement surgery. We also left out the posterior cruciate ligament (PCL) since it applies loads only in high flexion [36] at angles beyond our simulation. We estimated the stiffness corresponding to the linear portion of the force-length curve of each ligament based on literature values [37], [38], and we visually identified the origin and insertion points of each ligament from anatomy references [39]–[42].

We performed an optimization to select the resting lengths of all ligament bundles in the model. The optimization changed the resting lengths such that the net load in each ligament (i.e., the sum of the three bundle loads) was close to 50 N for both static configurations. The optimization also selected the resting lengths of the patellar ligament bundles such that each one applied 100 N of force for the 80 degree flexion pose.

1) Finding static initial conditions for simulation

After selecting ligament resting lengths, we performed a series of static analyses to prepare the model for simulation. We added ideal path actuators to the model to represent the four quadriceps muscles, re-introduced gravity, and altered wrapping surfaces to increase the knee extensor moment arms. For the first static analysis, we applied constant and equal forces to the four quadriceps muscles with the knee flexion angle (for the TF joint) locked at 80 degrees and the other 11 knee DOFs freed. This analysis balanced the ligament, contact, and muscle forces in all DOFs except for TF flexion. The second static analysis started from the previous static pose but with the knee flexion angle freed. The resulting pose yielded a static configuration where muscle, ligament, and contact forces balanced all 12 degrees of freedom in the knee. We repeated this static analysis multiple times, iterating on quadriceps forces until the static flexion angle was about 80 degrees.

2) Performing forward dynamic simulation

Once the initial static pose and muscle forces for simulation were determined, we added a PD controller to the model to track a desired sinusoidal knee flexion curve and added damper forces to the TF and PF joints to reduce the vibrations introduced by the contact and ligament forces. The controller was modified such that the force in each muscle could never go below 15 N, the value in the initial configuration. Using the OpenSim API in C++, we performed a forward dynamic simulation of a two second open-chain extension-flexion motion using the CPODES implicit integrator with the order limited to 2 and the accuracy set to 5x10−3. The 12 DOF simulation (Fig. 6) finished in 4.7 s of CPU time and calculated the TF and PF contact forces experienced during the motion (Fig. 7).

Fig. 6.

Fig. 6

Snapshots for the first second of the two-second seated knee extension-flexion simulation for an OpenSim model with twelve degrees of freedom (DOF). The model had six DOFs for the tibiofemoral joint and six for the patellofemoral joint. Ligament bundles were added and their resting lengths calibrated. A feedback controller was used to apply the path actuator forces that drove the motion.

Fig. 7.

Fig. 7

Plot of the forces acting during the OpenSim simulation of knee extension and flexion. “Tibia Fymed” and “Tibia Fylat” are the superior-inferior compressive forces acting on the medial and lateral compartment of the tibial insert. “Patella Fx” is the compressive force acting on the patellar button in the direction normal to its back surface. “Actuator” stands for the force in each one of the four path actuators representing the quadriceps femoris muscles. Force oscillations at 0.6 s and 1.5 s are caused by compliant knee ligaments in the leg model.

V. Discussion

This paper presented SCMT, a new program for generating surrogate contact models from elastic finite element models. The program facilitates sampling finite element contact models, fitting ANNs to the collected data, assembling the ANNs into surrogate models, and deploying the surrogate models in OpenSim or any other program with a C++ interface. SCMT is meant to be used for research applications involving the modeling and iterative simulation of musculoskeletal models that incorporate joint contact. The same framework could potentially be used to develop foot-ground or limb-socket surrogate contact models as well.

Two examples showed how surrogate contact models can be created with SCMT and used in forward dynamic simulations. The first example application involving surrogate modeling of the knee demonstrated the toolbox’s ability to create surrogate contact models of both the TF and the PF joints with varying levels of accuracy across different domains of input space. The ability to fit out-of-contact points was also demonstrated. In the second example, the OpenSim simulation showed how surrogate contact models created with SCMT may be incorporated into musculoskeletal models possessing ligaments and controlled by muscle forces. Simulations involving surrogate contact models could be used to investigate how muscle, ligament, and joint contact forces interact to produce the resulting joint kinematics and loads on each of these anatomic structures.

Though SCMT facilitates surrogate contact model creation and use, it still possesses several limitations. First, The ANN-based surrogate models do not provide estimates of prediction variance, so the user has no knowledge of the error in the surrogate model outputs during a simulation. Second, the computing times required for sampling finite element models and for training the ANNs are significant and could range from days to weeks depending on the available computer hardware. Third, SCMT can collect reaction forces and torques at the origins of no more than two fixed rigid bodies. Fourth, the current version of SCMT does not collect or fit pressure or center of pressure data from the finite element simulations, which could be useful additional outputs for some applications. Fifth, contact loads are assumed to be functions of pose with no velocity dependence or permanent deformation, and thus only elastic contact models can be represented.

VI. Conclusion

We have shown that SCMT can produce fast and accurate surrogate contact models of more computationally expensive FE contact models. The software can significantly reduce the time and effort required to create and perform computationally efficient musculoskeletal simulations incorporating deformable joint contact models. Our hope is that SCMT will lead to realistic simulations of joint kinematics, more accurate estimation of muscle and joint contact forces, and predictive simulations of rehabilitation and surgical interventions.

Supplementary Material

Supplementary Material.docx

Acknowledgments

Funding for this study was provided by NIH grant R01EB009351 and the University of Florida.

Contributor Information

Ilan Eskinazi, Department of Mechanical and Aerospace Engineering, University of Florida, Gainesville, FL, USA.

Benjamin J. Fregly, Email: fregly@ufl.edu, Department of Mechanical and Aerospace Engineering, Department of Biomedical Engineering, and Department of Orthopaedics and Rehabilitation (231 MAE-A Building PO Box 116250, University of Florida, Gainesville, FL 32611-6250, phone: +1-352-392-8157, fax: +1-352-392-7303

References

  • 1.Andriacchi TP, et al. Rotational changes at the knee after ACL injury cause cartilage thinning. Clin Orthop Relat Res. 2006 Jan;442:39–44. doi: 10.1097/01.blo.0000197079.26600.09. [DOI] [PubMed] [Google Scholar]
  • 2.Peña E, et al. Computer simulation of damage on distal femoral articular cartilage after meniscectomies. Comput Biol Med. 2008 Jan;38(1):69–81. doi: 10.1016/j.compbiomed.2007.07.003. [DOI] [PubMed] [Google Scholar]
  • 3.Aksahin E, et al. The effects of the sagittal plane malpositioning of the patella and concomitant quadriceps hypotrophy on the patellofemoral joint: a finite element analysis. Knee Surg Sports Traumatol Arthrosc. 2014 Nov; doi: 10.1007/s00167-014-3421-7. [DOI] [PubMed] [Google Scholar]
  • 4.Savoldelli C, et al. Stress distribution in the temporo-mandibular joint discs during jaw closing: a high-resolution three-dimensional finite-element model analysis. Surg Radiol Anat. 2012 Jul;34(5):405–13. doi: 10.1007/s00276-011-0917-4. [DOI] [PubMed] [Google Scholar]
  • 5.Thelen DG, et al. Co-Simulation of Neuromuscular Dynamics and Knee Mechanics during Human Walking. J Biomech Eng. 2014 Jan; doi: 10.1115/1.4026358. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Lin YC, et al. Simultaneous prediction of muscle and contact forces in the knee during gait. J Biomech. 2010 Mar;43(5):945–52. doi: 10.1016/j.jbiomech.2009.10.048. [DOI] [PubMed] [Google Scholar]
  • 7.Zach L, et al. Design, analysis and verification of a knee joint oncological prosthesis finite element model. Comput Biol Med. 2014 Aug;54C:53–60. doi: 10.1016/j.compbiomed.2014.08.021. [DOI] [PubMed] [Google Scholar]
  • 8.Halloran JP, et al. Explicit finite element modeling of total knee replacement mechanics. J Biomech. 2005 Feb;38(2):323–31. doi: 10.1016/j.jbiomech.2004.02.046. [DOI] [PubMed] [Google Scholar]
  • 9.Anderson FC, Pandy MG. Dynamic Optimization of Human Walking. J Biomech Eng. 2001 Oct;123(5):381. doi: 10.1115/1.1392310. [DOI] [PubMed] [Google Scholar]
  • 10.Koehle MJ, Hull ML. The effect of knee model on estimates of muscle and joint forces in recumbent pedaling. J Biomech Eng. 2010 Jan;132(1):011007. doi: 10.1115/1.3148192. [DOI] [PubMed] [Google Scholar]
  • 11.Kim HJ, et al. Evaluation of predicted knee-joint muscle forces during gait using an instrumented knee implant. J Orthop Res. 2009 Oct;27(10):1326–31. doi: 10.1002/jor.20876. [DOI] [PubMed] [Google Scholar]
  • 12.Alkjaer T, et al. Computational modeling of a forward lunge: towards a better understanding of the function of the cruciate ligaments. J Anat. 2012 Dec;221(6):590–7. doi: 10.1111/j.1469-7580.2012.01569.x. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Seth A, et al. Minimal formulation of joint motion for biomechanisms. Nonlinear Dyn. 2010 Oct;62(1):291–303. doi: 10.1007/s11071-010-9717-3. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Di Gregorio R, Parenti-Castelli V. A Spatial Mechanism With Higher Pairs for Modelling the Human Knee Joint. J Biomech Eng. 2003 Apr;125(2):232. doi: 10.1115/1.1559895. [DOI] [PubMed] [Google Scholar]
  • 15.Di Gregorio R, et al. Mathematical models of passive motion at the human ankle joint by equivalent spatial parallel mechanisms. Med Biol Eng Comput. 2007 Mar;45(3):305–313. doi: 10.1007/s11517-007-0160-7. [DOI] [PubMed] [Google Scholar]
  • 16.Moissenet F, et al. A 3D lower limb musculoskeletal model for simultaneous estimation of musculo-tendon, joint contact, ligament and bone forces during gait. J Biomech. 2014 Jan;47(1):50–8. doi: 10.1016/j.jbiomech.2013.10.015. [DOI] [PubMed] [Google Scholar]
  • 17.Gasparutto X, et al. Validation of a multi-body optimization with knee kinematic models including ligament constraints. J Biomech. 2015 Apr;48(6):1141–6. doi: 10.1016/j.jbiomech.2015.01.010. [DOI] [PubMed] [Google Scholar]
  • 18.Halloran JP, et al. Comparison of Deformable and Elastic Foundation Finite Element Simulations for Predicting Knee Replacement Mechanics. J Biomech Eng. 2005 Oct;127(5):813. doi: 10.1115/1.1992522. [DOI] [PubMed] [Google Scholar]
  • 19.Lin YC, et al. Surrogate articular contact models for computationally efficient multibody dynamic simulations. Med Eng Phys. 2010 Jul;32(6):584–94. doi: 10.1016/j.medengphy.2010.02.008. [DOI] [PubMed] [Google Scholar]
  • 20.Halloran JP, et al. Adaptive surrogate modeling for efficient coupling of musculoskeletal control and tissue deformation models. J Biomech Eng. 2009 Jan;131(1):011014. doi: 10.1115/1.3005333. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Atkeson CG, et al. Locally Weighted Learning for Control. 1996. pp. 1–33. [Google Scholar]
  • 22.Birattari M, et al. Lazy Learning Meets the Recursive Least Squares Algorithm. 1997 [Google Scholar]
  • 23.Lophaven S, et al. DACE - A MATLAB Kriging Toolbox. Kongens Lyngby; 2002. [Google Scholar]
  • 24.Gorissen D, Dhaene T. A Surrogate Modeling and Adaptive Sampling Toolbox for Computer Based Design. 2010;11:2051–2055. [Google Scholar]
  • 25.Maas SA, et al. FEBio: finite elements for biomechanics. J Biomech Eng. 2012 Jan;134(1):011005. doi: 10.1115/1.4005694. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Delp SL, et al. OpenSim: open-source software to create and analyze dynamic simulations of movement. IEEE Trans Biomed Eng. 2007 Nov;54(11):1940–50. doi: 10.1109/TBME.2007.901024. [DOI] [PubMed] [Google Scholar]
  • 27. [Accessed: 05-Feb-2015];Boost C++ Libraries. [Online]. Available: http://www.boost.org/
  • 28.Burkardt J. [Accessed: 05-Feb-2015];HAMMERSLEY - The Hammersley Quasirandom Sequence. [Online]. Available: http://people.sc.fsu.edu/~jburkardt/m_src/hammersley/hammersley.html.
  • 29. [Accessed: 05-Feb-2015];The OpenMP API Specification for parallel programming. [Online]. Available: http://openmp.org/wp/
  • 30.Fregly BJ, et al. Grand challenge competition to predict in vivo knee loads. J Orthop Res. 2012 May;30(4):503–13. doi: 10.1002/jor.22023. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31.Fregly BJ, et al. Experimental evaluation of an elastic foundation model to predict contact pressures in knee replacements. J Biomech. 2003 Nov;36(11):1659–1668. doi: 10.1016/s0021-9290(03)00176-3. [DOI] [PubMed] [Google Scholar]
  • 32.Keshmiri A, et al. Do surgical patellar interventions restore patellar kinematics in fixed-bearing, cruciate-retaining total knee arthroplasty?: An in vitro study. J Arthroplasty. 2014 Jul;29(11):2197–2201. doi: 10.1016/j.arth.2014.07.008. [DOI] [PubMed] [Google Scholar]
  • 33.Varadarajan KM, et al. Patellar tendon orientation and patellar tracking in male and female knees. J Orthop Res. 2010 Mar;28(3):322–8. doi: 10.1002/jor.20977. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 34.Chen Z, et al. Prediction of in vivo joint mechanics of an artificial knee implant using rigid multi-body dynamics with elastic contacts. Proc Inst Mech Eng H. 2014 May;228(6):564–575. doi: 10.1177/0954411914537476. [DOI] [PubMed] [Google Scholar]
  • 35.Eskinazi I, Fregly BJ. Surrogate Modeling of Deformable Joint Contact using Artificial Neural Networks. Med Eng Phys. doi: 10.1016/j.medengphy.2015.06.006. in press. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Papannagari R, et al. Function of posterior cruciate ligament bundles during in vivo knee flexion. Am J Sports Med. 2007 Oct;35(9):1507–12. doi: 10.1177/0363546507300061. [DOI] [PubMed] [Google Scholar]
  • 37.Li G, et al. A validated three-dimensional computational model of a human knee joint. J Biomech Eng. 1999 Dec;121(6):657–662. doi: 10.1115/1.2800871. [DOI] [PubMed] [Google Scholar]
  • 38.Kim KE, et al. Tensile properties of the medial patellofemoral ligament: the effect of specimen orientation. J Biomech. 2014 Jan;47(2):592–5. doi: 10.1016/j.jbiomech.2013.11.026. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 39.LaPrade RF, et al. The Posterolateral Attachments of the Knee: A Qualitative and Quantitative Morphologic Analysis of the Fibular Collateral Ligament, Popliteus Tendon, Popliteofibular Ligament, and Lateral Gastrocnemius Tendon. Am J Sport Med. 2003 Nov;31(6):854–860. doi: 10.1177/03635465030310062101. [DOI] [PubMed] [Google Scholar]
  • 40.Merican aM, Amis aa. Anatomy of the lateral retinaculum of the knee. J Bone Joint Surg Br. 2008 Apr;90(4):527–34. doi: 10.1302/0301-620X.90B4.20085. [DOI] [PubMed] [Google Scholar]
  • 41.Nomura E, et al. Anatomical analysis of the medial patellofemoral ligament of the knee, especially the femoral attachment. Knee Surg Sports Traumatol Arthrosc. 2005 Oct;13(7):510–5. doi: 10.1007/s00167-004-0607-4. [DOI] [PubMed] [Google Scholar]
  • 42.Terry GC, LaPrade RF. The Posterolateral Aspect of the Knee: Anatomy and Surgical Approach. Am J Sports Med. 1996 Dec;24(6):732–739. doi: 10.1177/036354659602400606. [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Supplementary Material.docx

RESOURCES