Simulation using optimized parameters

SCONE is a software tool for predictive simulations of biomechanical movement. It uses OpenSim for modeling and simulation, and performs optimization using various control strategies, including feed-forward control, proprioceptic feedback control, and bal
POST REPLY
User avatar
Yuichiro Omura
Posts: 44
Joined: Thu Apr 04, 2019 10:03 pm

Simulation using optimized parameters

Post by Yuichiro Omura » Wed Oct 26, 2022 11:29 pm

I'm trying to perform a simulation using optimized parameters in another simulation (I can't divert .par files because the parameters to be optimized for these simulations are different).
For this simulation, after I optimized only an offset of each joint angle, I added the optimized offsets (second columns in .par file) to the initial joint angle values and ran the simulation using the same controller.
I expected to get the same results as the simulation run by double-clicking the .par file in the result folder on SCONE, but I got different results.
I checked that all the values were the same. Is this a related problem with significant digits?
If so, is there anything I can do to get the same simulation results that I get by double-clicking the .par file?
Thank you for your always support.

User avatar
Thomas Geijtenbeek
Posts: 432
Joined: Wed Mar 12, 2014 8:08 am

Re: Simulation using optimized parameters

Post by Thomas Geijtenbeek » Thu Oct 27, 2022 1:13 am

If you only optimize joint offsets in your initial optimization, and add those to the initial pose, then the result should be very similar. There might be some minor differences due to rounding errors, but this should be minimal (although eventually errors will accumulate and the simulation can diverge).

A good way to compare the simulations is to first run the .par, then plot all coordinates in the Analysis Window, and press Tools -> Keep Current Analysis Graphs. This will keep the graphs in the background of the plot. You can then run the new simulation with the new offsets, and compare the coordinates in the graph. Perhaps this will help you spot a difference somewhere.

User avatar
Yuichiro Omura
Posts: 44
Joined: Thu Apr 04, 2019 10:03 pm

Re: Simulation using optimized parameters

Post by Yuichiro Omura » Mon Oct 31, 2022 8:28 am

Thank you for the solution and information.
I have checked and it seems that the divergence was still occurring due to rounding errors.

User avatar
Thomas Geijtenbeek
Posts: 432
Joined: Wed Mar 12, 2014 8:08 am

Re: Simulation using optimized parameters

Post by Thomas Geijtenbeek » Tue Nov 01, 2022 1:22 am

You can also use sconecmd to evaluate an existing .par file, using:

Code: Select all

sconecmd -e <par_file.par>

User avatar
Yuichiro Omura
Posts: 44
Joined: Thu Apr 04, 2019 10:03 pm

Re: Simulation using optimized parameters

Post by Yuichiro Omura » Tue Nov 01, 2022 2:12 am

Thank you for sharing the method! I'll use this command to fix the problem.

POST REPLY