Sharp peaks for GRF prediction in Tutorial

I am working on GRF prediction of people with abnormal gait from kinematic data. Using the algorithm for GRF prediction together with the MoCap framework, I realized that the calculated vertical GRFs look rather sharp and uneven than smooth compared to the ones measured from the force plates.

I thought it was due to the fact that I am not using healthy gait data. But it seems that the same problem occurs in the provided Plug-in-gait_Simple demo using the GRF prediction (see attached pictures).

If I am right, the algorithm for GRF prediction in AMS is derived from Fluit et al. method. However having a look at their paper, they do not seem to have these sharp peaks in the predicted vertical GRF (see attached screenshot).
I tried using a 3rd order criterion (instead of the 2nd one provided in the scripts) as did Fluit et al. but it does not seem to change anything.
Am I missing something here? Is this normal? Should a post-processing-step be added? What do you suggest to alleviate this fault?

Thank you in advance for your answer.
Best regards,



Hi @julie

I see what you mean and it does not seem ideal.
You should stick with the second order criteria since the solver is more stable with that.

To alleviate some of the sharp kinks you can play around with the settings of the GRF prediction class.
There are control parameters to adjust the trigger volume in which the foot is deemed in contact with the ground, and there are also controls for the velocity threshold at which contact can be made.
These should allow you to get a smoother curve.
Here is a great wiki post on the underlying contact class of the GRF tool and how to modify it.

The AMMR Plug-in model have not been optimized to create the smoothest curve, you could probably improve it if needed. Since the actual force plate data exist for that trial you can align the onset and offset of contact with that data, although it is tedious.
If you come up with something that you think is more realistic you are very welcome to show it to us and make a pull request to the AMMR with the change!

How much you need to adjust and fine polish it in your model depends on your research question.

I am unaware of the GRF prediction settings used by Fluit and it seems that their curves are normalized and aggregated which probably makes it hard to determine how much of this was present in their models.

Best regards,
AnyBody Technology

Thank you very much for the fast answer @Bjorn !
Actually I think I found where the problem comes from and I do not think it can be solved by playing with height and velocity conditions for contact detection.
If you have a look at the attached picture, it appears that discontinuities occur when switching from single to double stance phases and vice versa.

Actually, Fluit et al. implemented a smoothed strength function for the force actuators to prevent discontinuities in the estimated GRFs during the transitions from being completely determined (single stance) to being under-determined (double stance) and vice versa (see attached picture from their paper). However in the FootPlateConditionalContact (of GRF Tools), the strength of the normal force component seems constant. Please let me know if you agree we that point.

In case you do agree and that this turns out to be the reason for the observed discontinuities in the predicted GRFs, do you know if such a smoothed strength function for contact elements has already been implemented ?


Discontinuities observed in the demo:

Smoothed strength function of Fluit et al.:

Hi @julie

The GRF tool does utilize a smoothed strength function for switching on/off at contact.
It is quite deeply nested in the classes but you can find the code for it in the AMMR/Tools/GRFPrediction/ContactSurfaceDistanceAndVelocityDepLinPush.any file.
It actually have a number of different smoothing function profiles that you can switch to.
The default is a linear function, but there is also a square wave, bspline and cosine option.

We noticed a error in some of the logics for the bspline option so here is a fixed version of the file if you would like to use that option:
ContactSurfaceDistanceAndVelocityDepLinPush.any (24.2 KB)
You can just exchange your current file with this version, and it will also be part of the next release.

The code structure should allow you to try the others, tweak them or add your own versions of a smoothing function.

We appreciate your time to ask these questions since it helped fix a bug!

Best regards,

Dear @Bjorn ,
I am glad my question helped solving a bug. However I realized that the smoothing of actuators' strength might not be the solution for the observed discontinuities.
Indeed, since the discontinuities remained whatever the smoothing type and smoothing parameters, I thought it may not be the cause of these sharp peaks. Also, to confirm this thought, I plotted the strength profiles of the actuators together with the GRF prediction and it doesn't look like it matches the discontinuities (see Figure below).

GRFs prediction and strength profiles of force actuators:

Then, what I did (always using the Plug-in-gait simple demo) is:

  • Extracting the vertical measured GRFs from force plate data for both legs of the demo
  • Extracting the vertical predicted GRFs from the GRF prediction algorithm for both legs of the demo
  • Extracting the vertical predicted GRFs from the GRF prediction algorithm when having actuators only on the left side. I know that it's wrong to completely exclude any force from the right leg because it implies that the whole weight is held up by the left one even in what should be double stance phases, but I really just wanted to understand what happens in single limb support.

Then I plotted all this data together with vertical dashed gray lines at toe-off and heel-strike times (see attached figure).

So as you can see:

  • It looks that the prediction when a single or both legs are included match in single stance (which makes sense as a single leg bears the whole BW).
  • Also, discontinuities (sharp peaks in vertical GRFs prediction) always happen at either toe-off or heel-strike.
  • Finally, it actually looks that during the double stance phase the predicted and measured GRFs match quite well, but that it is in the single stance phase that the prediction is significantly greater.

My guess is then that the discontinuity might actually be due to this constant overshoot in the single stance phase. So the problem is not in undetermined conditions (double limb support), but it rather seems to be in the single limb support phase.

Please let me know what you think and what your guess is about this superiority in magnitude of the predicted against measured GRF in single limb support phases. Maybe I am missing something obvious here.
Note that I just changed the smoothing strength function from linear to cosine, I ran the Parameters identification and ran the analysis. I would like to get this demo working to be sure I can use this method with other data. I'd also like the demo outcome to be (at least qualitatively) consistent with Fluit et al. and Skals et al. papers from which the method and the smoothing function are respectively derived since it was never mentioned anything about these peaks and superiority of GRF magnitudes in single stance for predicted data.

Thank you very much for your time in helping me to solve that.


Hi Julie,

Since you are seeing an overestimation of the force during single support, I think it indicates that the mass of the subject may be not correct in the model and ball-park estimates from the graphs seems to be that the mass in the model is ~5-7 kg heavier than the subject really was. Could you double check that?

Best regards

Dear @julie , Dear @msan00 ,

First I think Plug-in-gait_Simple demo/SubjectSpecificData.any/BodyMass should be changed to 66 minus 6-7 kg ( Original: 66kg) because original residual Fy result is always higher than ZERO by about 60-70N ....
The Pelvis Residual Force value must be checked(Fig01):

-> The about 100N vertical residual force still remains on around HeelTouch / ToeOff phase.

I also think the difference with sharp peak between measured and predicted is not only because the problem of foot contact timing or foot CoP distribution but because of the problem including whole body motion(maybe Body mass center motion) .

Following is the rough check of measured Force Plate and its residual Fy using #1's modified mass case (Fig02) .
If you cancel the residual force just by adding residual Fy to the measured Ground reaction force you will see that the value(Of course This is different from measured data) is almost same as GRF predicted.

I am not sure but if we could reduce the residual Fy to Zero in the GRF measured analysis by adjusting the body motion [kinematics] ( or adjusting body mass distribution ) , the sharp peak in the GRF prediction may be reduced with the same motion and mass distribution.

Thank you,
Best regards, LAOZI

Dear @msan00 and @laozilaozi ,
First thank you very much for your interest in this problem.
I checked for the mass and reducing it indeed creates a better match in single stance phase. What I did here is changing the BW from 66 to 60kg (but in the demo file it is not written anywhere what was the true BW of the subject). Then I ran the parameter identification, loaded the parameters, ran the analysis and extracted the vertical GRFs predicted with the new weight. Here is the result:

Trying with data from a subject of known mass, I did not have this offset in single stance. So the anthropometrics of the demo should be adjusted.

Another thing that seems incoherent is the mass of the subject. Indeed, in the anthropometrics it is set to 66kg, but after parameters identification and scaling, then it appears to be above 67kg in BodyModel folder. I also noted that for other data. As @laozilaozi suggested, this may affect mass repartition for the model and the derived kinematics and kinetics.

As you can see, we still have the overshoot at heel strike and toe off. Thank you @laozilaozi for the tip about the residuals here. I understand your suggestion about improving marker tracking and body mass distribution to reduce the residuals. However, I see some obstacles for that:

  • First, the final goal of this algorithm to predict GRFs would be to use it without needing force plates (and so without measured data for which we could optimize the residuals of the model)
  • Second, I do not see exactly how to improve those parameters for the demo since I did not find any information about the subject data was taken from.
  • Thirdly, I ran this GRF measurements and predictions for different trials of diverse subjects and this problem is redundant for all the files. Maybe this suggest changes to be done in the core of model scaling technique ? In which case what better technique do you suggest?

It seems it is tricky to identify where the problem comes from, so thank you very much for your suggestions.



Just a small reminder to say that I am still open to any kind of suggestions regarding the problem mentioned above for GRF prediction discrepancies for the Plug-in-gait demo (cf my last post).

Best regards,


Hi Julie,

So sorry about the very slow response.

About the mass of the subject, then I am not sure what has happend here but it does seem like the mass of the model does not match the subject's real match. Maybe someone at ABT has more insights here?

About the sharo kinks then it is expected that they will occur as Newtons laws fully specific the ground reaction force during single support and that is no longer the case during double support where the muscle recruitment will determine the results.

I did look back at some of our other results and they also present some kinks during these transitions. I think the reasons for why these are not clear in the Figures of the validation papers is because it gets drowned out in the averaging (and standard deviations).

Best regards

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.