Setting IntegratorMaximumStepSize

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
shakiba rafiee
Posts: 6
Joined: Thu Mar 26, 2015 2:19 pm

Setting IntegratorMaximumStepSize

Post by shakiba rafiee » Mon Mar 15, 2021 12:44 pm

Hi all,

I wanted to see how I can have more control over the integration step of the forward simulation in the python interface. I am working on this reflex-based OpenSim model that was published for the NeurIPS 2019 Learn to Move - Walk Challenge.

https://github.com/stanfordnmbl/osim-rl ... roller1.py

For this project, I need to have more control over the accuracy of the integration. I was thinking to start with setting both the integrator accuracy as well as the maximum step size. I was able to change the accuracy of the integrator; however, when I use the "setIntegratorMaximumStepSize" command, it gives me the following error.

object has no attribute 'setIntegratorMaximumStepSize'

I was hoping someone here could help me with this.

Thanks in advance,
Shakiba Rafiee

Tags:

User avatar
Carmichael Ong
Posts: 401
Joined: Fri Feb 24, 2012 11:50 am

Re: Setting IntegratorMaximumStepSize

Post by Carmichael Ong » Mon Mar 29, 2021 2:28 pm

Not all integrators support `setIntegratorMaximumStepSize`, so it's likely the integrator used for osim-rl by default doesn't have it. My guess is that the integrator is a variable step integrator, so it will try to take as large of steps as possible while being controlled by the tolerance (which is a nice featuer to keep a simulation as quick as possible).

You can see the comments in the OpenSim doxygen and Simbody doxygen pages about this issue:
https://simtk.org/api_docs/opensim/api_ ... 38604ceaf5
https://simbody.github.io/3.5.0/classSi ... 688e6430ba

User avatar
shakiba rafiee
Posts: 6
Joined: Thu Mar 26, 2015 2:19 pm

Re: Setting IntegratorMaximumStepSize

Post by shakiba rafiee » Mon Apr 19, 2021 1:34 pm

Hi Carmicheal,

Thank you for the reply.

You are correct. I think the default integrator that the opensim_rl use, does not support "setIntegratorMaximumStepSize". I have been trying to use fixed-step size for the integrator with little success.

I am a little confused on the process here. It turns out that the manager class I end up using has very few functions. The one that makes sense seems to be manager.setDTArray().

Are there any examples for this function implemented in python that I can take a look at?

POST REPLY