Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] *Running JMP Two Times in a Row Gives Different Results* #336

Open
bfregly opened this issue Sep 6, 2024 · 4 comments
Open

[BUG] *Running JMP Two Times in a Row Gives Different Results* #336

bfregly opened this issue Sep 6, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@bfregly
Copy link
Contributor

bfregly commented Sep 6, 2024

Describe the bug
JMP runs have become stochastic. I ran two knee-only JMP runs in a row, and the lsqnonlin Resnorm values differ after the first iteration, even though the second run is identical to the first run. Iteration 0 is still the same for both runs though.

To Reproduce
Steps to reproduce the behavior:
Run JointModelPersonalizationTool('JMPRKneeSettingsv3Class.xml') two times in a row and compare the values of Resnorm as lsqnonlin progresses through each optimization. After the first iteration they will be different.

Expected behavior
Repeated identical JMP runs produce different results.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Mac Intel]
  • OpenSim Version: 4.5
  • MATLAB Version: 2023a
  • NMSM Pipeline Version: v1.2

Additional context
The attached zip file has all the file needed to reproduce the issue in about 30 seconds.
JMP Bug.zip

@bfregly bfregly added the bug Something isn't working label Sep 6, 2024
@bfregly
Copy link
Contributor Author

bfregly commented Sep 8, 2024

Rob just tested this issue on a Windows PC and it does not occur on Windows. I just ran OpenSim IK twice in a row from the GUI using only the right thigh and shank markers with weights of 1, and the IK motion files that I got were identical. So the problem appears to be in our code somewhere. Maybe we have an indexing issue somewhere where we are accessing a value off the end of an array?

@cvhammond
Copy link
Member

Rob could test it on one of the Mac test computers as well to see if it's a Mac issue

@RobSalati
Copy link
Contributor

I ran this JMP on one of the lab macs with the same version of matlab and opensim and was not able to reproduce the bug.

@RobSalati
Copy link
Contributor

I ran more tests comparing across operating systems and across matlab versions. I tested the lab mac on matlab 2023a and 2023b, and I tested two separate windows machines, also with 2023a and 2023b.

The mac JMP run converged in 6 iterations with the same cost functions across both matlab versions.

The windows JMP runs converged in 8 iterations with the same cost functions, also across both matlab versions and windows machines.

From a mathworks forum post, this could be due to different rounding methodologies in the operating systems because matlab was compiled differently.

This shows an inconsistency between operating systems which likely cannot be fixed, but does not explain why your machine was getting inconsistent results between runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants