Page 1 of 1

Scenario optimization: waiting for first evaluation

Posted: Wed May 27, 2020 3:56 am
by konris87
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

Re: Scenario optimization: waiting for first evaluation

Posted: Fri May 29, 2020 9:05 am
by tgeijten
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!

Re: Scenario optimization: waiting for first evaluation

Posted: Sat May 30, 2020 3:44 pm
by konris87
I managed to overcome this issue by setting the parameter "Perform optimization using external process" to 0, under the Tools/Preferences/User Interface tab.

Re: Scenario optimization: waiting for first evaluation

Posted: Tue Jun 02, 2020 12:04 am
by tgeijten
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.

Re: Scenario optimization: waiting for first evaluation

Posted: Tue Jun 02, 2020 1:31 am
by konris87
I am on Windows 10

Re: Scenario optimization: waiting for first evaluation

Posted: Fri Jun 05, 2020 6:01 am
by tgeijten
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.

Re: Scenario optimization: waiting for first evaluation

Posted: Wed Jul 21, 2021 9:30 am
by kmns
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.)
 ]

Re: Scenario optimization: waiting for first evaluation

Posted: Mon Jul 26, 2021 1:41 am
by tgeijten
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.

Re: Scenario optimization: waiting for first evaluation

Posted: Tue Jul 27, 2021 8:47 pm
by kmns
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.

Re: Scenario optimization: waiting for first evaluation

Posted: Wed Jul 28, 2021 5:42 am
by tgeijten
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.