Large Residual Loads in Static Optimization

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Menthy Denayer
Posts: 2
Joined: Fri Nov 24, 2023 1:58 am

Large Residual Loads in Static Optimization

Post by Menthy Denayer » Thu May 23, 2024 6:23 am

Hello forum!
I have some questions regarding residual forces encountered in static optimization.

Context
I am trying to use OpenSim to predict the knee joint contact forces during walking. For this, I am using the CAMs Knee dataset, which includes kinematic data (optical motion markers) and ground reaction forces. We hope to use the OpenSim simulations as an additional comparison for a new method predicting the same forces.

Materials & Methods
Currently, I am using the standard gait2392 model. However, I have also been trying out the Rajagopal2023, Pelegrinelli2023 & Lerner2015 models.
  1. Using the CAMs Knee data, I scaled the basic model using 66 markers. For this, I extended the standard markers from the gait2392 model with additional markers based on the data documentation. I obtained a total squared error of 7cm, a marker RMS error of 3cm and a maximal error of 7cm.
  2. I then used Inverse Kinematics to track the marker data for one gait cycle.
All data & files can be accessed here.

Problem Description
After inspecting the SO results, it seems the residual actuators are quite high, as shown in the below figure:
ik_so_residualForces.png
ik_so_residualForces.png (34.15 KiB) Viewed 1498 times
ik_so_residualMoments.png
ik_so_residualMoments.png (31 KiB) Viewed 1498 times
I read about the process of improving the static optimization results here. Since the filtering of the kinematics data did not reduce the residuals as much as I hoped, I also tried using the RRA tool. After some playing around with the actuators file (increasing the control limits and limiting the optimal force), I obtained these results:
rra_residualForces.png
rra_residualForces.png (19.01 KiB) Viewed 1498 times
rra_residualMoments.png
rra_residualMoments.png (24.43 KiB) Viewed 1498 times
Although some improvements are certainly possible, the results seem to be below the limits given here, so I considered it to be sufficient for now. However, after applying static optimization again using the RRA-predicted kinematics I obtained these results:
rra_so_residualForces.png
rra_so_residualForces.png (77.88 KiB) Viewed 1498 times
The results are now much more noisy with some extreme values around t = 0.88s. I inspected both the kinematics & GRFs, but I didn't seem to find anything of notice around this time.

Questions
Thus, my questions are the following:
  1. Can I still use the results obtained by applying IK & SO, or are these residuals too large? The reserve actuators do seem fine and below 5% of the computed inverse dynamics results.
  2. I read the paper of Hicks et al. (2015), where a magnitude of 5% of the maximal external force is recommended. However, when I compute this value based on the GRF data, I would expect the residual forces to be below 70 N, which isn't the case for Fx & Fy. For the moments, I've computed a boundary of 13.30 Nm (1% of COM height * max external force), which is a problem for Mx & Mz.
  3. What is going wrong during the RRA step leading to such high noise & residuals?
  4. Finally, I performed Static Optimization, applying a 6Hz lowpass filter to the inverse kinematics result.

My problem seems similar to the following:
  1. Thread 1: however I don't think the GRFs I am using are very noisy (see shared folder).
  2. Thread 2: however without a clear solution.

Tags:

User avatar
Carmichael Ong
Posts: 401
Joined: Fri Feb 24, 2012 11:50 am

Re: Large Residual Loads in Static Optimization

Post by Carmichael Ong » Fri May 24, 2024 4:33 pm

Residuals can represent discrepancies between the kinematic and kinetic data, so while each of those data may look OK, it's important to consider them together. It's a hard problem to diagnose, but here are a couple of ideas to start with:
- At what point in the gait cycle are these spikes? Often they are at initial contact and toe-off as those are the most likely times for there to be discrepancies between kinematic and kinetic data because the force is changing suddenly.
- How did you filter the data (both marker and GRF)? If they are filtered differently, this could cause changes in your marker and GRF data such that they don't align at all time points any more.

Other steps to consider:
- RRA can often take multiple steps. This example/tutorial may be helpful (especially part 2): https://opensimconfluence.atlassian.net ... +and+Swing
- https://addbiomechanics.org/ is a tool that can automate the scaling, IK, and ID steps. You could consider using this tool rather than manually scaling in OpenSim.

User avatar
Menthy Denayer
Posts: 2
Joined: Fri Nov 24, 2023 1:58 am

Re: Large Residual Loads in Static Optimization

Post by Menthy Denayer » Sat May 25, 2024 2:47 am

Thank you for your reply!

- The spikes do seem to be situated around the heel-strike and toe-off regions, although I didn't find any drastic force changes at the exact timepoints in the ground reaction forces.
- I filtered both the raw marker data and ground reaction forces using a 4th order butterworth lowpass filter, with a 6Hz cutoff frequency. The data was captured using different sampling frequencies however (100 Hz for marker data & 2000 Hz for GRFs). When performing SO & RRA, I filtered the IK results again using the built-in lowpass filter from the OpenSim GUI, with fcutt = 6Hz.

- Thank you for these recommendations, I will definitely look into them!

POST REPLY