A big bottle neck is reading the states table from the manager, i.e. the line
Code: Select all
sTable = manager.getStatesTable()
Another is the osimTableToStruct method, with sTable above as an argument.
For example, to run a 30s simulation, it takes the forward dynamics 7 s to run, while manager.getStatesTable() takes 9 s (all settings default for the integrator except minimum step size = 0.001), and the osimTableToStruct method takes 15 s.
For a 60s simulation, it takes the forward dynamics 14 s, getStatesTable 40 s and osimTableToStruct 29 s.
I'm wondering if there is an alternative to getStatesTable and osimTableToStruct? Or is there a way to speed up those processes themselves?
I don't need all the data this is spitting out, and would be fine extracting the states at every 10 time steps. Is there a way to do that, and will it speed things up?