Scenario optimization: waiting for first evaluation

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
Kostas Risvas
Posts: 10
Joined: Thu Oct 03, 2019 10:24 pm

Scenario optimization: waiting for first evaluation

Post by Kostas Risvas » Wed May 27, 2020 3:56 am

Greetings,

We currently try to optimize a SCONE scenario that tries to simulate the movement of the end point of the upper extremity. The scenario evaluation runs even though the resulted motion is not the desired one, but when trying to optimize the SCONE scenario the optimization process doesn't start and keeps waiting for the first evaluation. We tried different models (e.g even the simple arm26 model of OpenSim distribution) but without any success.

Any feedback and possible solutions would be really appreciated. Thanks in advance.

Best regards,
Konstantinos Risvas,
University of Patras

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

Re: Scenario optimization: waiting for first evaluation

Post by Thomas Geijtenbeek » Fri May 29, 2020 9:05 am

Have you tried evaluating the scenario? You can do this through Scenario -> Evaluate scenario or by pressing Ctrl + E. This will run the simulation once so that you can see what happens.

It might be the case that your simulation takes very long, in which case you might want to adjust the max_duration parameter. This also happens when the simulation is very stiff and is forced to take incredibly small integration timesteps.

Let me know if this helps!

User avatar
Kostas Risvas
Posts: 10
Joined: Thu Oct 03, 2019 10:24 pm

Re: Scenario optimization: waiting for first evaluation

Post by Kostas Risvas » Sat May 30, 2020 3:44 pm

I managed to overcome this issue by setting the parameter "Perform optimization using external process" to 0, under the Tools/Preferences/User Interface tab.

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

Re: Scenario optimization: waiting for first evaluation

Post by Thomas Geijtenbeek » Tue Jun 02, 2020 12:04 am

Great that you managed to find a workaround! Are you using Linux or Windows? I would love to be able to reproduce this issue so I can fix it.

User avatar
Kostas Risvas
Posts: 10
Joined: Thu Oct 03, 2019 10:24 pm

Re: Scenario optimization: waiting for first evaluation

Post by Kostas Risvas » Tue Jun 02, 2020 1:31 am

I am on Windows 10

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

Re: Scenario optimization: waiting for first evaluation

Post by Thomas Geijtenbeek » Fri Jun 05, 2020 6:01 am

Thanks! Do you have this issue of freezing only with your specific .scone scenario, or also with the tutorials?

If it's specific to your scenario, I would greatly appreciate it if you could send me the files privately, so I can look into the issue.

User avatar
Kohei Kaminishi
Posts: 5
Joined: Wed Apr 06, 2016 8:11 am

Re: Scenario optimization: waiting for first evaluation

Post by Kohei Kaminishi » Wed Jul 21, 2021 9:30 am

Hello,

I faced a similar problem with this. And I still have not been able to solve this. Please let me share the information with you.

I tried to combine the arm26 model with the existing 9dof18muscle model and perform an optimization. However, I have failed to do so.

1. I ran the optimization of Tutorial 3a (max duration = 3). This worked properly.

2. I changed the musculoskeletal model in Tutorial 3a to the "gait9dof18musc_Thelen_20170320.osim" model by Ong et al. and ran the optimization. This also worked properly.
https://simtk.org/projects/pfdeficitsgait

3. I changed the musculoskeletal model in Tutorial 3a to a combination of the "gait9dof18musc_Thelen_20170320.osim" model and the arm26 model. "Evaluate scenario" worked properly. However, when I ran the optimization, SCONE froze.
After that, I set "Perform optimization using external process" to 0 and ran the optimization again. SCONE did not freeze. The optimization terminated with Gen 0 and the following message was obtained.

I have not been able to figure out why the error message that does not appear during evaluation appears during optimization.
Any information would greatly help.

Sincerely,
Kohei Kaminishi

Code: Select all

[ SimTK Exception thrown at AbstractIntegratorRep.cpp:428:
  Integrator step failed at time 0.1 apparently because:
SimTK Exception thrown at AbstractIntegratorRep.cpp:547:
  Error detected by Simbody method AbstractIntegrator::takeOneStep(): Unable to advance time past 0.1.
  (Required condition 't1 > t0' was not met.)
 SimTK Exception thrown at AbstractIntegratorRep.cpp:428:
  Integrator step failed at time 0.101 apparently because:
SimTK Exception thrown at AbstractIntegratorRep.cpp:547:
  Error detected by Simbody method AbstractIntegrator::takeOneStep(): Unable to advance time past 0.101.
  (Required condition 't1 > t0' was not met.)
 SimTK Exception thrown at AbstractIntegratorRep.cpp:428:
  Integrator step failed at time 0.102 apparently because:
SimTK Exception thrown at AbstractIntegratorRep.cpp:547:
  Error detected by Simbody method AbstractIntegrator::takeOneStep(): Unable to advance time past 0.102.
  (Required condition 't1 > t0' was not met.)
 SimTK Exception thrown at AbstractIntegratorRep.cpp:428:
  Integrator step failed at time 0.103 apparently because:
SimTK Exception thrown at AbstractIntegratorRep.cpp:547:
  Error detected by Simbody method AbstractIntegrator::takeOneStep(): Unable to advance time past 0.103.
  (Required condition 't1 > t0' was not met.)
 SimTK Exception thrown at AbstractIntegratorRep.cpp:428:
  Integrator step failed at time 0.105 apparently because:
SimTK Exception thrown at AbstractIntegratorRep.cpp:547:
  Error detected by Simbody method AbstractIntegrator::takeOneStep(): Unable to advance time past 0.105.
  (Required condition 't1 > t0' was not met.)
 SimTK Exception thrown at AbstractIntegratorRep.cpp:428:
  Integrator step failed at time 0.106 apparently because:
SimTK Exception thrown at AbstractIntegratorRep.cpp:547:
  Error detected by Simbody method AbstractIntegrator::takeOneStep(): Unable to advance time past 0.106.
  (Required condition 't1 > t0' was not met.)
 SimTK Exception thrown at AbstractIntegratorRep.cpp:428:
  Integrator step failed at time 0.107 apparently because:
SimTK Exception thrown at AbstractIntegratorRep.cpp:547:
  Error detected by Simbody method AbstractIntegrator::takeOneStep(): Unable to advance time past 0.107.
  (Required condition 't1 > t0' was not met.)
 SimTK Exception thrown at AbstractIntegratorRep.cpp:428:
  Integrator step failed at time 0.118 apparently because:
SimTK Exception thrown at AbstractIntegratorRep.cpp:547:
  Error detected by Simbody method AbstractIntegrator::takeOneStep(): Unable to advance time past 0.118.
  (Required condition 't1 > t0' was not met.)
 ]

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

Re: Scenario optimization: waiting for first evaluation

Post by Thomas Geijtenbeek » Mon Jul 26, 2021 1:41 am

This appears to be an issue with the arm26 model. The error message indicates that OpenSim cannot integrate the model, because the required timestep is too small. This is a result of the simulation being too "stiff", meaning the forces and accelerations change too quickly during the simulation. This is usually the case when high forces are applied to very light objects. It appears the arm26 model has not been adapted for use in forward or predictive simulations.

It is difficult to address this issue, especially since you are able to evaluate it. This means the simulation only becomes too stiff under certain conditions, which are explored only as part of the optimization. Changing the initial control parameters may help discovering where the issue lies.

In general, my advise would be to see if you can get the arm26 model to work in an optimization separately. It may require additional coordinate limit forces to keep the DOFs in range, or adjustment of some of the mass properties. Once the adapted model works properly in separation, it should be much easier to combine it with the lower extremity model.

User avatar
Kohei Kaminishi
Posts: 5
Joined: Wed Apr 06, 2016 8:11 am

Re: Scenario optimization: waiting for first evaluation

Post by Kohei Kaminishi » Tue Jul 27, 2021 8:47 pm

Thank you very much!
I understood it as follows: for the control parameters during Evaluation, the simulation is fine, but for a certain range of control parameters during Optimization, the simulation becomes too "stiff".

I will try to change the initial control parameters and check the behavior of the arm26 model separately.

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

Re: Scenario optimization: waiting for first evaluation

Post by Thomas Geijtenbeek » Wed Jul 28, 2021 5:42 am

That's right -- if you try to do a separate optimization with only the arm model (e.g. a simple reaching optimization), than that should help you find the issue with the model.

An alternative could be to use torque-driven control for the arms, by adding a CoordinateLimitForce to each DOF.

Upper extremity models have not been used a lot in simulations, so this area is relatively unexplored and requires a bit more groundwork.

POST REPLY