Problem with Output Files of Joint Reaction Analysis

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Lukas Connolly
Posts: 4
Joined: Mon Dec 16, 2019 4:06 pm

Problem with Output Files of Joint Reaction Analysis

Post by Lukas Connolly » Thu Mar 12, 2020 8:55 am

Hi all,

I'm currently facing a problem I can't really troubleshoot on my own. I already asked my surrounding OpenSim experts in my lab and nobody could figure out the cause for this problem.

The problem is, that when I run a Joint Reaction Analysis (following Static Optimization), I get different outputs (sometimes "normal" and sometimes completely useless) when I repeat the Analysis with same Setup and Input Files. These outputs as shown below, sometimes contain extremly large numbers, NaNs or are completely fine (not yet validated). I can rerun the analysis quickly and the position of the NaNs or large numbers randomly switch around, so I can not link them to any time step etc. Also this problem occurs for multiple task types, so it does not directly relate to infeasible motions etc. Further the output files and log file do not indicate any problems during Static Optimization.

My current workaround is to check the integrity of the Joint Reaction Analysis output file after running the analysis and rerun the analysis if the output file seems to be corrupted. This works fine as the Analysis only takes a couple seconds and I so far never required more than 4 iterations. But this does not realy solve the problem and is more a hack of sorts.

Further steps I've undertaken to troubleshoot this problem. But none resulted in any difference.
  • Rerun the Analysis with the OpenSim GUI instead of Matlab with the same input file
  • Turn on/off filtering for kinematic data in Joint Reaction Analysis
  • Run Matlab Pipeline Code on two other Windows Machines
  • Run Matlab Pipeline Code on OpenSim 4.0 and OpenSim 4.1
  • Add/remove external forces
On the other hand I also tried rerunning the example from the Webinar on Joint Reaction Analysis and could not reproduce this problem. So I suspect the problem either resides in the model, reserve actuators and/or the core code of OpenSim. But as it sometimes works and the results look trustworthy on first sight I suspect the latter.

Attached I'm adding the XML Setup Files for Static Optimization, Joint Reaction Analysis and for the GRF.

Thank you in advance for looking at my problem and for any feedback from your side.

Best regards,
Lukas

Example Output File Screenshots:

Good Output
Image

Output with NaNs
Image

Output with HUGE numbers
Image
Attachments
HC_101_run_rep_01_SOsetup.xml
(5.61 KiB) Downloaded 7 times
HC_101_run_rep_01_JRsetup.xml
(6.22 KiB) Downloaded 9 times
HC_101_run_rep_01_GRF_Setup.xml
(3.13 KiB) Downloaded 7 times

User avatar
Ayman Habib
Posts: 2248
Joined: Fri Apr 01, 2005 12:24 pm

Re: Problem with Output Files of Joint Reaction Analysis

Post by Ayman Habib » Thu Mar 12, 2020 11:08 am

Hello Lukas,

Thanks for reporting. You mentioned what you tried but didn't clarify if you got the same inconsistent/wrong behavior between runs, would be great to confirm.

While using the API in Matlab or Scripting could be more complicated and require special attention, possibly clearing variables to make sure you start on a clean slate, it should all be transparent if run from the GUI or command line. I would not rely on any results that can't be reproduced robustly, how do you know which one is the correct answer?

If the inconsistent results are reproducible in the GUI or command line, please file a bug and attach all the files and steps needed to reproduce and we'll take a look. Please indicate the version of the software and the operating system in use.

Thank you,
-Ayman

User avatar
Lukas Connolly
Posts: 4
Joined: Mon Dec 16, 2019 4:06 pm

Re: Problem with Output Files of Joint Reaction Analysis

Post by Lukas Connolly » Mon Mar 16, 2020 1:30 am

Hello Ayman,

thanks for your quick response!

Regarding your question about the inconsistency between runs. If I run the same simulation (same input and setup files) multiple times, I almost always get a different result, except for when all numbers look reasonable then the values only vary in the 1% range. On the other hand output files containing nans and large numbers are never the same. So both values and positions of the unwanted numbers are random (as it seems).

This behaviour can be seen in all kind of tasks (gait, run, stairs, sit to stand, lift etc.) and occurs in different subjects and between different repetitions of the same task and subject.

I also tried running this problem via the GUI without any difference. I will now file a bug and upload some files with which this problem should be reproducible. Thank you very much for your assistance and great work!

Best regards,
Lukas

POST REPLY